user-center.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  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">{{balance}}</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(-6);
  125. }
  126. }),
  127. onLoad() {
  128. this.$http.get({
  129. url: "/user/current",
  130. success: (res) => {
  131. this.balance = res.data.data.money
  132. }
  133. })
  134. },
  135. onNavigationBarButtonTap(e) {
  136. // console.log(e)
  137. switch (e.index) {
  138. case 0:
  139. uni.navigateTo({
  140. url: '/pages/user/setting'
  141. });
  142. break;
  143. case 1:
  144. uni.navigateTo({
  145. url: '/pages/message/message'
  146. });
  147. break;
  148. default:
  149. break;
  150. }
  151. }
  152. }
  153. </script>
  154. <style lang="scss" scoped>
  155. .head {
  156. background: $primary-color;
  157. display: flex;
  158. align-items: center;
  159. padding-bottom: 140upx;
  160. padding-top: 20upx;
  161. }
  162. .portrait {
  163. margin: 0 20upx;
  164. border: 10upx solid rgba(255, 255, 255, 0.5);
  165. border-radius: 128upx;
  166. overflow: hidden;
  167. width: 128upx;
  168. height: 128upx;
  169. .image {
  170. width: 128upx;
  171. height: 128upx;
  172. background: white;
  173. }
  174. }
  175. .nickname {
  176. font-size: 30upx;
  177. color: white;
  178. margin-bottom: 10upx;
  179. }
  180. .wddz,
  181. .zgcj {
  182. font-size: 24upx;
  183. color: white;
  184. border: 2upx solid white;
  185. border-radius: 20upx;
  186. width: 140upx;
  187. height: 36upx;
  188. line-height: 36upx;
  189. text-align: center;
  190. text-indent: 20upx;
  191. display: inline-block;
  192. padding: 0;
  193. background: url(../../static/images/do.png) no-repeat;
  194. background-size: 21upx 21upx;
  195. background-position: 10upx;
  196. }
  197. .invite {
  198. text-align: right;
  199. flex-grow: 1;
  200. margin-right: 20upx;
  201. color: white;
  202. .invite-code {
  203. font-size: 30upx;
  204. }
  205. .invite-notes {
  206. font-size: 24upx;
  207. }
  208. .invite-progress {
  209. .item {
  210. border: 2upx solid white;
  211. display: inline-block;
  212. width: 36upx;
  213. transform: scaleX(0.9);
  214. font-size: 0;
  215. border-radius: 2upx;
  216. &.active {
  217. border-color: yellow;
  218. }
  219. }
  220. &::after {
  221. content: "";
  222. background: url(../../static/images/vip.png) no-repeat;
  223. background-size: 42upx 42upx;
  224. width: 42upx;
  225. height: 42upx;
  226. display: inline-block;
  227. position: relative;
  228. top: 16upx;
  229. }
  230. margin-bottom: 20upx;
  231. }
  232. }
  233. .body {
  234. padding: 20upx;
  235. position: relative;
  236. top: -120upx;
  237. .money {
  238. background: white;
  239. border-radius: 20upx;
  240. padding: 20upx;
  241. .row {
  242. color: #333;
  243. display: flex;
  244. align-items: center;
  245. margin-bottom: 20upx;
  246. .warning {
  247. color: $primary-color;
  248. font-weight: bold;
  249. }
  250. .tips {
  251. color: #CCC;
  252. font-size: 24upx;
  253. }
  254. &:last-child {
  255. margin-bottom: 0;
  256. }
  257. & .col:first-child {
  258. flex-grow: 1;
  259. font-size: 28upx;
  260. }
  261. & .col:last-child {
  262. text-align: right;
  263. font-size: 28upx;
  264. }
  265. }
  266. .btn {
  267. background-color: $primary-color;
  268. color: white;
  269. font-size: 26upx;
  270. padding: 5upx 20upx;
  271. border-radius: 40upx;
  272. line-height: normal;
  273. }
  274. }
  275. }
  276. .vip-center {
  277. background: url(../../static/images/center5.png) no-repeat;
  278. background-size: 710upx 78upx;
  279. color: white;
  280. padding: 0 20upx;
  281. margin-top: 20upx;
  282. height: 78upx;
  283. .text {
  284. margin-left: 50upx;
  285. background-color: #ff5454;
  286. font-weight: bold;
  287. line-height: 60upx;
  288. display: inline-block;
  289. margin-top: 10upx;
  290. .sub {
  291. font-size: 24upx;
  292. }
  293. }
  294. }
  295. .menu {
  296. display: flex;
  297. background: white;
  298. border-radius: 20upx;
  299. padding: 30upx 20upx;
  300. margin-top: 20upx;
  301. justify-content: space-between;
  302. .name {
  303. font-size: 28upx;
  304. margin-top: 10upx;
  305. }
  306. .icon {
  307. text-align: center;
  308. }
  309. .icon .image {
  310. width: 60upx;
  311. height: 60upx;
  312. }
  313. }
  314. </style>