index-my.vue 8.4 KB

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