user-center.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. <template>
  2. <view>
  3. <view class="head">
  4. <view class="portrait">
  5. <image class="image" src="../../static/images/login/logo.png" mode="scaleToFill"></image>
  6. </view>
  7. <view>
  8. <view class="nickname">{{nickname}}</view>
  9. <view>
  10. <text v-show="user_type===3" class="wddz">网店店主</text>
  11. <text v-show="user_type===2" class="zgcj">直供厂家</text>
  12. </view>
  13. </view>
  14. <view class="invite">
  15. <view class="invite-code">邀请码:{{invite_code}}</view>
  16. <view class="invite-progress">
  17. <view class="item active"></view>
  18. <view class="item active"></view>
  19. <view class="item active"></view>
  20. <view class="item"></view>
  21. <view class="item"></view>
  22. </view>
  23. <view class="invite-notes">再邀请3人获得代理会员</view>
  24. </view>
  25. </view>
  26. <view class="body">
  27. <view class="money">
  28. <view class="row">
  29. <view class="col">可提现金额(元):<text class="warning">8.86</text></view>
  30. <view class="col"><button class="btn tixian-btn">立即提现</button></view>
  31. </view>
  32. <view class="row">
  33. <view class="col">保证金(元):<text>0.00</text><text class="tips">(保证金2000元)</text></view>
  34. <view class="col"><button class="btn jiaona-btn">立即缴纳</button></view>
  35. </view>
  36. </view>
  37. <view class="vip-center">
  38. <view class="text">代理会员中心<text class="sub">(特权独享)</text></view>
  39. </view>
  40. <view class="menu">
  41. <view class="menu-item">
  42. <view class="icon">
  43. <image class="image" src="../../static/images/menu/b8.png" mode="scaleToFill"></image>
  44. </view>
  45. <view class="name">账单明细</view>
  46. </view>
  47. <view class="menu-item">
  48. <navigator url="/pages/order/order" open-type="navigate" hover-class="none">
  49. <view class="icon">
  50. <image class="image" src="../../static/images/menu/b7.png" mode=""></image>
  51. </view>
  52. <view class="name">订单管理</view>
  53. </navigator>
  54. </view>
  55. <view>
  56. <navigator url="/pages/product/my-product" open-type="navigate" hover-class="none">
  57. <view class="icon">
  58. <image class="image" src="../../static/images/menu/b2.png" mode=""></image>
  59. </view>
  60. <view class="name">我的商品</view>
  61. </navigator>
  62. </view>
  63. <view>
  64. <navigator url="/pages/user/strategy" open-type="navigate" hover-class="none">
  65. <view class="icon">
  66. <image class="image" src="../../static/images/menu/b1.png" mode=""></image>
  67. </view>
  68. <view class="name">新手攻略</view>
  69. </navigator>
  70. </view>
  71. </view>
  72. <view class="menu">
  73. <view>
  74. <navigator url="/pages/user/problem" open-type="navigate" hover-class="none">
  75. <view class="icon">
  76. <image class="image" src="../../static/images/menu/b3.png" mode=""></image>
  77. </view>
  78. <view class="name">常见问题</view>
  79. </navigator>
  80. </view>
  81. <view>
  82. <navigator url="/pages/user/kefu" open-type="navigate" hover-class="none">
  83. <view class="icon">
  84. <image class="image" src="../../static/images/menu/b4.png" mode=""></image>
  85. </view>
  86. <view class="name">联系客服</view>
  87. </navigator>
  88. </view>
  89. <view>
  90. <navigator url="/pages/user/notice" open-type="navigate" hover-class="none">
  91. <view class="icon">
  92. <image class="image" src="../../static/images/menu/b5.png" mode=""></image>
  93. </view>
  94. <view class="name">官方公告</view>
  95. </navigator>
  96. </view>
  97. <view>
  98. <navigator url="/pages/user/feedback" open-type="navigate" hover-class="none">
  99. <view class="icon">
  100. <image class="image" src="../../static/images/menu/b6.png" mode=""></image>
  101. </view>
  102. <view class="name">意见反馈</view>
  103. </navigator>
  104. </view>
  105. </view>
  106. </view>
  107. </view>
  108. </template>
  109. <script>
  110. import {
  111. mapState
  112. } from 'vuex'
  113. export default {
  114. data() {
  115. return {
  116. balance: '',
  117. deposit: ''
  118. };
  119. },
  120. computed: mapState({
  121. nickname: state => state.user.nickname,
  122. user_type: state => state.user.group_id,
  123. invite_code: (state) => {
  124. return 'H' + ('00000000' + state.user.id).slice(-8);
  125. }
  126. }),
  127. onNavigationBarButtonTap(e) {
  128. // console.log(e)
  129. switch (e.index) {
  130. case 0:
  131. uni.navigateTo({
  132. url: '/pages/user/setting'
  133. });
  134. break;
  135. case 1:
  136. uni.navigateTo({
  137. url: '/pages/message/message'
  138. });
  139. break;
  140. default:
  141. break;
  142. }
  143. }
  144. }
  145. </script>
  146. <style lang="scss" scoped>
  147. .head {
  148. background: $primary-color;
  149. display: flex;
  150. align-items: center;
  151. padding-bottom: 140upx;
  152. padding-top: 20upx;
  153. }
  154. .portrait {
  155. margin: 0 20upx;
  156. border: 10upx solid rgba(255, 255, 255, 0.5);
  157. border-radius: 128upx;
  158. overflow: hidden;
  159. width: 128upx;
  160. height: 128upx;
  161. .image {
  162. width: 128upx;
  163. height: 128upx;
  164. background: white;
  165. }
  166. }
  167. .nickname {
  168. font-size: 30upx;
  169. color: white;
  170. margin-bottom: 10upx;
  171. }
  172. .wddz,
  173. .zgcj {
  174. font-size: 24upx;
  175. color: white;
  176. border: 2upx solid white;
  177. border-radius: 20upx;
  178. width: 140upx;
  179. height: 36upx;
  180. line-height: 36upx;
  181. text-align: center;
  182. text-indent: 20upx;
  183. display: inline-block;
  184. padding: 0;
  185. background: url(../../static/images/do.png) no-repeat;
  186. background-size: 21upx 21upx;
  187. background-position: 10upx;
  188. }
  189. .invite {
  190. text-align: right;
  191. flex-grow: 1;
  192. margin-right: 20upx;
  193. color: white;
  194. .invite-code {
  195. font-size: 30upx;
  196. }
  197. .invite-notes {
  198. font-size: 24upx;
  199. }
  200. .invite-progress {
  201. .item {
  202. border: 2upx solid white;
  203. display: inline-block;
  204. width: 36upx;
  205. transform: scaleX(0.9);
  206. font-size: 0;
  207. border-radius: 2upx;
  208. &.active {
  209. border-color: yellow;
  210. }
  211. }
  212. &::after {
  213. content: "";
  214. background: url(../../static/images/vip.png) no-repeat;
  215. background-size: 42upx 42upx;
  216. width: 42upx;
  217. height: 42upx;
  218. display: inline-block;
  219. position: relative;
  220. top: 16upx;
  221. }
  222. margin-bottom: 20upx;
  223. }
  224. }
  225. .body {
  226. padding: 20upx;
  227. position: relative;
  228. top: -120upx;
  229. .money {
  230. background: white;
  231. border-radius: 20upx;
  232. padding: 20upx;
  233. .row {
  234. color: #333;
  235. display: flex;
  236. align-items: center;
  237. margin-bottom: 20upx;
  238. .warning {
  239. color: $primary-color;
  240. font-weight: bold;
  241. }
  242. .tips {
  243. color: #CCC;
  244. font-size: 24upx;
  245. }
  246. &:last-child {
  247. margin-bottom: 0;
  248. }
  249. & .col:first-child {
  250. flex-grow: 1;
  251. font-size: 28upx;
  252. }
  253. & .col:last-child {
  254. text-align: right;
  255. font-size: 28upx;
  256. }
  257. }
  258. .btn {
  259. background-color: $primary-color;
  260. color: white;
  261. font-size: 26upx;
  262. padding: 5upx 20upx;
  263. border-radius: 40upx;
  264. line-height: normal;
  265. }
  266. }
  267. }
  268. .vip-center {
  269. background: url(../../static/images/center5.png) no-repeat;
  270. background-size: 710upx 78upx;
  271. color: white;
  272. padding: 0 20upx;
  273. margin-top: 20upx;
  274. height: 78upx;
  275. .text {
  276. margin-left: 50upx;
  277. background-color: #ff5454;
  278. font-weight: bold;
  279. line-height: 60upx;
  280. display: inline-block;
  281. margin-top: 10upx;
  282. .sub {
  283. font-size: 24upx;
  284. }
  285. }
  286. }
  287. .menu {
  288. display: flex;
  289. background: white;
  290. border-radius: 20upx;
  291. padding: 30upx 20upx;
  292. margin-top: 20upx;
  293. justify-content: space-between;
  294. .name {
  295. font-size: 28upx;
  296. margin-top: 10upx;
  297. }
  298. .icon {
  299. text-align: center;
  300. }
  301. .icon .image {
  302. width: 60upx;
  303. height: 60upx;
  304. }
  305. }
  306. </style>