user.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. <template>
  2. <view>
  3. <view :class="'mine' + (skinNotColor ? ' not-color' : '')">
  4. <image src="/static/images/wdbg.png" class="wdbg"
  5. ></image>
  6. <view class="minec">
  7. <image :src="userInfos.avatar ? userInfos.avatar : '/static/images/userimg.png'" mode="aspectFit"
  8. class="user" ></image>
  9. <view class="mines" v-if="isLogin">
  10. <view class="ddflex">{{userInfos.nickName?userInfos.nickName:userInfos.username?userInfos.username:''}}
  11. </view>
  12. <text class="edu" v-if="userInfos.mobile">{{userInfos.mobile}}</text>
  13. </view>
  14. <view class="flex" v-else>
  15. <text class="login-btn" @click="jumpUrl('')">点击登录</text>
  16. </view>
  17. </view>
  18. </view>
  19. <!-- 我的团 管理员,一级帮卖和二级帮卖 -->
  20. <view class="order" style="margin-top: -70rpx;" v-if="isLogin&&(userInfos.storeId||userInfos.merchantId)">
  21. <view class="tits ddflex">
  22. <view class="flex">我的收益</view>
  23. </view>
  24. <view style="background-color:#f2f2f2;margin:0 30rpx 10rpx;height: 1px;"></view>
  25. <view class="money-bar">
  26. <view class="flex-1">
  27. <view class="money-number">{{countMoney?countMoney:0}}</view>
  28. <text class="money-text" style="color: #242323;">我的余额</text>
  29. </view>
  30. <view class="recharge" @click="showPop = true">提现</view>
  31. </view>
  32. <view class="order-bar">
  33. <view class="order-bar-item ">
  34. <text>累计收益</text>
  35. <view>¥{{dataInfo.totalProfit?dataInfo.totalProfit:0}}</view>
  36. </view>
  37. <view class="order-bar-item ">
  38. <text>今日收益</text>
  39. <view>¥{{dataInfo.todayProfit?dataInfo.todayProfit:0}}</view>
  40. </view>
  41. <view class="order-bar-item">
  42. <text>已提现</text>
  43. <view>¥{{dataInfo.totalWithdraw?dataInfo.totalWithdraw:0}}</view>
  44. </view>
  45. </view>
  46. </view>
  47. <view class="yichang-box ddflex" :style="(isLogin&&(userInfos.storeId||userInfos.merchantId))?'':'margin-top: -70rpx;'">
  48. <view class="yichang-item fflex" @click="jumpUrl('warning/abnormalAlarm/abnormalAlarm')">
  49. <view class="yichang-title">异常告警</view>
  50. <view class="yichang-data">{{alarmCount}}<text class="symbol">条</text></view>
  51. <view class="yichang-btn">去查看</view>
  52. <image src="../../static/images/ycjg.png"></image>
  53. </view>
  54. <view class="yichang-item fflex" style="margin-left: 26rpx;" @click="jumpUrl('warning/orderAlarm/orderAlarm')">
  55. <view class="yichang-title">异常处理</view>
  56. <view class="yichang-data">{{exceptionOrderCount}}<text class="symbol">个</text></view>
  57. <view class="yichang-btn">去处理</view>
  58. <image src="../../static/images/yccl.png"></image>
  59. </view>
  60. </view>
  61. <view class="order">
  62. <view class="tits dflex">
  63. <view class="flex">我的服务</view>
  64. </view>
  65. <view class="list2 dflex">
  66. <navigator url="" hover-class="none" class="li" @click="jumpUrlS('/pages/order/order')">
  67. <image src="../../static/pages/images/user_service1.png"></image>
  68. <text>我的订单</text>
  69. </navigator>
  70. <navigator v-if="isLogin&&!userInfos.storeId" url="" hover-class="none" class="li" @click="jumpUrl('pages/myStore/myStore')">
  71. <image src="../../static/pages/images/user_service2.png"></image>
  72. <text>我的商家</text>
  73. </navigator>
  74. <navigator v-if="isLogin&&!userInfos.storeId" url="" hover-class="none" class="li" @click="jumpUrl('pages/myMerchant/myMerchant')">
  75. <image src="../../static/pages/images/user_service3.png"></image>
  76. <text>我的门店</text>
  77. </navigator>
  78. <navigator url="" hover-class="none" class="li" @click="jumpUrl('pages/operationData/operationData')">
  79. <image src="../../static/pages/images/user_service4.png"></image>
  80. <text>运营数据</text>
  81. </navigator>
  82. <navigator v-if="isLogin&&!userInfos.storeId&&!userInfos.merchantId" url="" hover-class="none" class="li" @click="jumpUrl('merchant/order?tabIndex=0')">
  83. <image src="../../static/pages/images/user_service9.png"></image>
  84. <text>商城订单</text>
  85. </navigator>
  86. <navigator v-if="isLogin&&(userInfos.storeId||userInfos.merchantId)" url="" hover-class="none" class="li" @click="jumpUrl('promote/withdrawal/myCard/myCard')">
  87. <image src="../../static/pages/images/user_service10.png"></image>
  88. <text>我的银行卡</text>
  89. </navigator>
  90. <view class="li">
  91. <contact-button img-url="../../static/pages/images/user_service5.png" img-style='width: 74rpx;height: 74rpx;margin: 0 auto 12rpx;' button-text="官方客服" styles="line-height:initial;"></contact-button>
  92. </view>
  93. <navigator url="/pages/about/about" hover-class="none" class="li">
  94. <image src="../../static/pages/images/user_service6.png"></image>
  95. <text>关于我们</text>
  96. </navigator>
  97. <navigator url="/mine/feedback/feedback" hover-class="none" class="li">
  98. <image src="../../static/pages/images/user_service7.png"></image>
  99. <text>建议反馈</text>
  100. </navigator>
  101. <navigator v-if="isLogin" url="" hover-class="none" class="li" @click="logout">
  102. <image src="../../static/pages/images/user_service8.png"></image>
  103. <text>退出登录</text>
  104. </navigator>
  105. </view>
  106. </view>
  107. <view class="ceng" v-show="showPop" @click="showPop=false"></view>
  108. <view :style="showPop?'bottom:0;':''" class="pop">
  109. <view class="pop-title">选择提现方式</view>
  110. <view class="pop-c-item ddflex" @click="jumpUrl('promote/withdrawal/index/index?cardType=1')">
  111. <image src="../../static/pages/images/tx1.png"></image>
  112. <view class="fflex">线上提现</view>
  113. <view class="pop-c-item-r ddflex">
  114. <view>仅限个人账户</view>
  115. <image style="width: 12rpx;height:22rpx;margin-left: 12rpx;" src="../../static/images/n_rico.png"></image>
  116. </view>
  117. </view>
  118. <view class="pop-c-item ddflex" @click="jumpUrl('promote/withdrawal/index/index?cardType=2')">
  119. <image src="../../static/pages/images/tx2.png"></image>
  120. <view class="fflex">线下提现</view>
  121. </view>
  122. <view class="pop-item pop-qx" @click="showPop=false">取消</view>
  123. </view>
  124. <!-- <footer-copyright></footer-copyright> -->
  125. <foot channel="user" :isUpdate="isUpdate"></foot>
  126. </view>
  127. </template>
  128. <script>
  129. // pages/user/user.js
  130. const app = getApp();
  131. const req = require("../../utils/request.js");
  132. const route = require("../../utils/route");
  133. import foot from "../../components/nav-bar/index";
  134. import footerCopyright from "../../components/footer-copyright/footer-copyright";
  135. export default {
  136. data() {
  137. return {
  138. skinNotColor: req.public.skinNotColor,
  139. picUrlss: req.public.picUrls,
  140. bottomBlankHeignt: app.globalData.isIPhoneX ? 68 : 0,
  141. // merchantId: '',
  142. iconSrc: req.public.iconSrc,
  143. isLogin:false,
  144. userInfos: null,
  145. alarmCount:0,
  146. exceptionOrderCount:0,
  147. dataInfo:{},
  148. countMoney:0,
  149. showPop:false,
  150. };
  151. },
  152. components: {
  153. foot,
  154. footerCopyright
  155. },
  156. props: {},
  157. onLoad(options) {
  158. this.userInfos = req.getStorage('userInfo');
  159. if(this.userInfos){
  160. this.isLogin = true
  161. }else{
  162. this.isLogin = false
  163. }
  164. },
  165. onShow: function() {
  166. this.setData({
  167. isUpdate: !this.isUpdate
  168. });
  169. this.userInfos = req.getStorage('userInfo');
  170. if(this.userInfos){
  171. this.isLogin = true
  172. this.getUserInfo()
  173. this.getWarningData()
  174. this.getDataInfo()
  175. }else{
  176. this.isLogin = false
  177. this.userInfos = null
  178. this.alarmCount = 0
  179. this.exceptionOrderCount = 0
  180. }
  181. },
  182. methods: {
  183. jumpUrlS(url){
  184. if (!req.isLogins(true)) return false;
  185. uni.switchTab({
  186. url:url
  187. })
  188. },
  189. jumpUrl(url) {
  190. this.showPop=false
  191. if (!req.isLogins(true)) return false;
  192. app.globalData.navigateTo(url);
  193. },
  194. getUserInfo(){
  195. req.getRequest('/admin/v2/userInfo',{},res=>{
  196. })
  197. },
  198. getWarningData(){
  199. req.getRequest('/admin/v2/alarm/alarmCount',{},res=>{
  200. this.alarmCount = res.alarmCount?res.alarmCount:0
  201. this.exceptionOrderCount = res.exceptionOrderCount?res.exceptionOrderCount:0
  202. })
  203. },
  204. logout(){
  205. uni.showModal({
  206. title:'提示',
  207. content:'确定退出登陆?',
  208. success: (res) => {
  209. if(res.confirm){
  210. req.removeStorage('userInfo')
  211. req.removeStorage('AUTH_TOKEN')
  212. this.userInfos = null
  213. this.isLogin = false
  214. req.isLogins(true)
  215. }
  216. }
  217. })
  218. },
  219. // 获取余额数据
  220. getDataInfo(){
  221. let userId = null
  222. let userType = null
  223. if(req.getStorage('userInfo').merchantId){
  224. userId = req.getStorage('userInfo').merchantId
  225. userType = 2
  226. }
  227. // 商户
  228. if(req.getStorage('userInfo').storeId){
  229. userId = req.getStorage('userInfo').storeId
  230. userType = 1
  231. }
  232. req.getRequest('/admin/v2/my/myStatistic',{},res=>{
  233. this.dataInfo = res
  234. })
  235. req.getRequest('/admin/v2/merchant/balance', {id:userId,type:userType}, res => {
  236. this.countMoney = res?res.balance:0;
  237. });
  238. }
  239. }
  240. };
  241. </script>
  242. <style>
  243. @import "./user.css";
  244. </style>