index-my.vue 8.3 KB

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