index-my.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  1. <template>
  2. <view class="index-my">
  3. <custom-nav ref="ltm" :title="title" transparent="transparent" noback="noback"></custom-nav>
  4. <navigator class="login-reg" v-if="!logged" url="../../pages/login-reg/login-reg"></navigator>
  5. <view class="content tabbar">
  6. <view class="area info">
  7. <image class="bg" src="../../static/index/my/my-bg.png" mode=""></image>
  8. <view class="userinfo">
  9. <view class="headpic">
  10. <image v-if="logged" class="head" :src="userinfo.avatar"></image>
  11. <image v-else class="head" src="../../static/index/my/defaultimg.png"></image>
  12. <image v-if="userinfo.store" class="medal" src="../../static/index/my/medal.png"></image>
  13. </view>
  14. <view class="center">
  15. <view class="top">
  16. <text class="username">{{ logged ? userinfo.nickname : '请登录' }}</text>
  17. <text v-if="logged" class="level-name"><text class="cuIcon-crownfill"></text>{{ userinfo.level }}</text>
  18. </view>
  19. <view class="bot" v-if="logged">
  20. <text class="userid">ID:{{ userinfo.uuid || '' }}</text>
  21. </view>
  22. </view>
  23. <navigator class="editinfo" :url="'../../pages/person-card/person-card?id=' + userinfo.id + '&self=1'">
  24. <text>我的名片</text>
  25. <text class="cuIcon-right"></text>
  26. </navigator>
  27. </view>
  28. <view class="numinfo">
  29. <navigator url="../../pages/my-order/my-order?type=0" class="numitem">
  30. <text class="num">{{ userinfo.order_num1 || 0 }}</text>
  31. <text class="numname">待审核</text>
  32. </navigator>
  33. <navigator url="../../pages/my-order/my-order?type=1" class="numitem">
  34. <text class="num">{{ userinfo.order_num2 || 0 }}</text>
  35. <text class="numname">待收货</text>
  36. </navigator>
  37. <navigator url="../../pages/my-order/my-order?type=2" class="numitem">
  38. <text class="num">{{ userinfo.order_num3 || 0 }}</text>
  39. <text class="numname">已完成</text>
  40. </navigator>
  41. </view>
  42. </view>
  43. <!-- <navigator url="../../pages/proxy-updata/proxy-updata" class="card">
  44. <image src="../../static/index/my/user-up.png"></image>
  45. </navigator> -->
  46. <!-- <view class="area active">
  47. <view class="active-item" v-for="(item, index) in activeList" :url="item.url" :key="index" @tap="toActive(index)">
  48. <image :src="item.image"></image>
  49. <text>{{ item.name }}</text>
  50. </view>
  51. </view> -->
  52. <view class="area appfun">
  53. <navigator class="app-item" v-for="(item, index) in appfunList" :url="item.url" :key="index">
  54. <image :src="item.image"></image>
  55. <text class="itemname">{{ item.name }}</text>
  56. <text class="cuIcon-right"></text>
  57. <text v-if="index === 0 && messageNum" class="num">{{ messageNum }}</text>
  58. </navigator>
  59. </view>
  60. <!-- <view class="area systemset">
  61. <navigator class="app-item" url="../../pages/system-set/system-set">
  62. <image src="../../static/index/my/set.png"></image>
  63. <text class="itemname">系统设置</text>
  64. <text class="cuIcon-right"></text>
  65. </navigator> -->
  66. </view>
  67. </view>
  68. </view>
  69. </template>
  70. <script>
  71. import { _API_GetUserStatus, _API_GetUserInfo, _API_ConfireLevel } from '@/apis/user.js'
  72. export default {
  73. data() {
  74. return {
  75. title: '我的',
  76. activeList: [
  77. {
  78. name: '争霸赛',
  79. image: '../../static/index/my/zhengbasai.png'
  80. },
  81. {
  82. name: '线下沙龙',
  83. image: '../../static/index/my/shalong.png'
  84. },
  85. {
  86. name: '密训营',
  87. image: '../../static/index/my/mixun.png'
  88. }
  89. ],
  90. appfunList: [
  91. // {
  92. // name: '消息通知',
  93. // url: '../../pages/notify-msg/notify-msg',
  94. // image: '../../static/index/my/message.png'
  95. // },
  96. {
  97. name: '安全管理',
  98. url: '../../pages/safe-manage/safe-manage',
  99. image: '../../static/index/my/safe.png'
  100. },
  101. {
  102. name: '我的授权',
  103. url: '../../pages/auth-card/auth-card',
  104. image: '../../static/index/my/auth.png'
  105. },
  106. {
  107. name: '如何使用',
  108. url: '../../pages/help-use/help-use',
  109. image: '../../static/index/my/help.png'
  110. }
  111. ]
  112. }
  113. },
  114. computed: {
  115. userinfo() { return this.$store.state.userinfo },
  116. logged() { return this.$store.state.app.token ? true : false },
  117. messageNum() { return this.$store.getters['message/messageNum'] }
  118. },
  119. methods: {
  120. toActive(index) {
  121. if (index === 0) {
  122. // uni.showLoading({ mask: true })
  123. // plus.share.getServices(list => {
  124. // try{
  125. // list.find(e => e.id === 'weixin').launchMiniProgram({ id:'gh_ccc3d7c5cbe0' })
  126. // uni.hideLoading()
  127. // }catch(e){
  128. // uni.toast('唤起争霸赛小程序失败,请手动打开')
  129. // uni.hideLoading()
  130. // }
  131. // }, e => {
  132. // uni.toast('获取分享服务列表失败,请手动打开小程序')
  133. // })
  134. } else {
  135. uni.toast('暂未开放')
  136. }
  137. }
  138. }
  139. }
  140. </script>
  141. <style lang="scss" scoped>
  142. .index-my {
  143. @include page();
  144. border-top: none;
  145. .login-reg {
  146. top: 0;
  147. left: 0;
  148. right: 0;
  149. z-index: 2;
  150. position: absolute;
  151. background: transparent;
  152. bottom: $app-tabbar-height;
  153. }
  154. .content {
  155. .card {
  156. left: 50%;
  157. top: 410rpx;
  158. height: 90rpx;
  159. width: 690rpx;
  160. position: absolute;
  161. transform: translateX(-50%);
  162. image {
  163. width: 100%;
  164. height: 100%;
  165. }
  166. }
  167. .area {
  168. background: #FFFFFF;
  169. &.info {
  170. height: 437rpx;
  171. position: relative;
  172. .bg {
  173. z-index: 0;
  174. width: 100%;
  175. height: 100%;
  176. position: absolute;
  177. }
  178. .userinfo {
  179. top: 158rpx;
  180. width: 100%;
  181. display: flex;
  182. height: 100rpx;
  183. padding: 0 30rpx;
  184. position: absolute;
  185. box-sizing: border-box;
  186. .headpic {
  187. height: 100%;
  188. width: 100rpx;
  189. position: relative;
  190. .head {
  191. width: 100%;
  192. height: 100%;
  193. border-radius: 50%;
  194. }
  195. .medal {
  196. right: -10rpx;
  197. bottom: -20rpx;
  198. width: 50rpx;
  199. height: 60rpx;
  200. position: absolute;
  201. }
  202. }
  203. .center {
  204. @include flex(column);
  205. flex: 1;
  206. height: 100%;
  207. margin: 0 16rpx;
  208. .top, .bot {
  209. flex: 1;
  210. width: 100%;
  211. display: flex;
  212. align-items: center;
  213. .username {
  214. font-size: 32rpx;
  215. margin-right: 16rpx;
  216. max-width: calc(100% - 130rpx);
  217. }
  218. .userid {
  219. color: #666666;
  220. font-size: 24rpx;
  221. margin-right: 26rpx;
  222. }
  223. .realname-img {
  224. width: 34rpx;
  225. height: 26rpx;
  226. margin-right: 10rpx;
  227. }
  228. .realname-text {
  229. color: #666666;
  230. font-size: 24rpx;
  231. &.noreal {
  232. color: $app-base-color;
  233. }
  234. }
  235. }
  236. }
  237. .editinfo {
  238. @include flex();
  239. height: 100%;
  240. width: 150rpx;
  241. font-size: 26rpx;
  242. .cuIcon-right {
  243. margin-left: 6rpx;
  244. }
  245. }
  246. }
  247. .numinfo {
  248. @include flex();
  249. bottom: 0;
  250. width: 100%;
  251. height: 140rpx;
  252. position: absolute;
  253. box-shadow: 0px -1px 5px 0px rgba(126,126,126,0.11);
  254. background: linear-gradient(0deg,rgba(255,255,255,1) 0%, rgba(255,255,255,0.2) 100%);
  255. .numitem {
  256. flex: 1;
  257. height: 100%;
  258. @include flex(column);
  259. .num {
  260. font-size: 36rpx;
  261. color: #7B5533;
  262. margin-top: 12rpx 0 26rpx;
  263. }
  264. .numname {
  265. font-size: 26rpx;
  266. }
  267. }
  268. }
  269. }
  270. &.active {
  271. height: 180rpx;
  272. margin-top: 74rpx;
  273. display: flex;
  274. .active-item {
  275. @include flex(column);
  276. flex: 1;
  277. height: 100%;
  278. image {
  279. width: 88rpx;
  280. height: 88rpx;
  281. margin-top: 24rpx;
  282. }
  283. text {
  284. font-size: 26rpx;
  285. margin-top: 16rpx;
  286. }
  287. }
  288. }
  289. &.appfun, &.systemset {
  290. margin-top: 10rpx;
  291. background: $app-base-bg;
  292. navigator {
  293. position: relative;
  294. image {
  295. width: 38rpx;
  296. height: 38rpx;
  297. }
  298. .itemname {
  299. flex: 1;
  300. margin-left: 16rpx;
  301. }
  302. .num {
  303. @include flex();
  304. top: 50%;
  305. right: 66rpx;
  306. width: 30rpx;
  307. height: 30rpx;
  308. color: #FFFFFF;
  309. font-size: 24rpx;
  310. position: absolute;
  311. border-radius: 50%;
  312. background: #FF0000;
  313. transform: translateY(-50%);
  314. }
  315. }
  316. }
  317. }
  318. }
  319. }
  320. </style>