user.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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">0.00</view>
  28. <text class="money-text" style="color: #242323;">我的余额</text>
  29. </view>
  30. <view class="recharge">提现</view>
  31. </view>
  32. <view class="order-bar">
  33. <view class="order-bar-item ">
  34. <text>累计收益</text>
  35. <view>¥0.00</view>
  36. </view>
  37. <view class="order-bar-item ">
  38. <text>今日收益</text>
  39. <view>¥0.00</view>
  40. </view>
  41. <view class="order-bar-item">
  42. <text>已提现</text>
  43. <view>¥0.00</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. <view class="li">
  83. <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>
  84. </view>
  85. <navigator url="/pages/about/about" hover-class="none" class="li">
  86. <image src="../../static/pages/images/user_service6.png"></image>
  87. <text>关于我们</text>
  88. </navigator>
  89. <navigator url="/mine/feedback/feedback" hover-class="none" class="li">
  90. <image src="../../static/pages/images/user_service7.png"></image>
  91. <text>建议反馈</text>
  92. </navigator>
  93. <navigator v-if="isLogin" url="" hover-class="none" class="li" @click="logout">
  94. <image src="../../static/pages/images/user_service8.png"></image>
  95. <text>退出登录</text>
  96. </navigator>
  97. </view>
  98. </view>
  99. <!-- <footer-copyright></footer-copyright> -->
  100. <foot channel="user" :isUpdate="isUpdate"></foot>
  101. </view>
  102. </template>
  103. <script>
  104. // pages/user/user.js
  105. const app = getApp();
  106. const req = require("../../utils/request.js");
  107. const route = require("../../utils/route");
  108. import foot from "../../components/nav-bar/index";
  109. import footerCopyright from "../../components/footer-copyright/footer-copyright";
  110. export default {
  111. data() {
  112. return {
  113. skinNotColor: req.public.skinNotColor,
  114. picUrlss: req.public.picUrls,
  115. bottomBlankHeignt: app.globalData.isIPhoneX ? 68 : 0,
  116. // merchantId: '',
  117. iconSrc: req.public.iconSrc,
  118. isLogin:false,
  119. userInfos: null,
  120. alarmCount:0,
  121. exceptionOrderCount:0
  122. };
  123. },
  124. components: {
  125. foot,
  126. footerCopyright
  127. },
  128. props: {},
  129. onLoad(options) {
  130. this.userInfos = req.getStorage('userInfo');
  131. if(this.userInfos){
  132. this.isLogin = true
  133. }else{
  134. this.isLogin = false
  135. }
  136. },
  137. onShow: function() {
  138. this.setData({
  139. isUpdate: !this.isUpdate
  140. });
  141. this.userInfos = req.getStorage('userInfo');
  142. if(this.userInfos){
  143. this.isLogin = true
  144. this.getUserInfo()
  145. this.getWarningData()
  146. }else{
  147. this.isLogin = false
  148. this.userInfos = null
  149. this.alarmCount = 0
  150. this.exceptionOrderCount = 0
  151. }
  152. },
  153. methods: {
  154. jumpUrlS(url){
  155. if (!req.isLogins(true)) return false;
  156. uni.switchTab({
  157. url:url
  158. })
  159. },
  160. jumpUrl(url) {
  161. if (!req.isLogins(true)) return false;
  162. app.globalData.navigateTo(url);
  163. },
  164. getUserInfo(){
  165. req.getRequest('/admin/v2/userInfo',{},res=>{
  166. })
  167. },
  168. getWarningData(){
  169. req.getRequest('/admin/v2/alarm/alarmCount',{},res=>{
  170. this.alarmCount = res.alarmCount?res.alarmCount:0
  171. this.exceptionOrderCount = res.exceptionOrderCount?res.exceptionOrderCount:0
  172. })
  173. },
  174. logout(){
  175. uni.showModal({
  176. title:'提示',
  177. content:'确定退出登陆?',
  178. success: (res) => {
  179. if(res.confirm){
  180. req.removeStorage('userInfo')
  181. req.removeStorage('AUTH_TOKEN')
  182. this.userInfos = null
  183. this.isLogin = false
  184. req.isLogins(true)
  185. }
  186. }
  187. })
  188. }
  189. }
  190. };
  191. </script>
  192. <style>
  193. @import "./user.css";
  194. </style>