user-center.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457
  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 v-if="token" class="nickname">{{nickname}}</view>
  9. <view v-else class="nickname">您还未登录</view>
  10. <view>
  11. <text v-show="user_type===3" class="wddz">网店店主</text>
  12. <text v-show="user_type===2" class="zgcj">直供厂家</text>
  13. </view>
  14. </view>
  15. <view class="invite">
  16. <view class="invite-code">邀请码:{{invite_code}}</view>
  17. <view class="invite-progress">
  18. <template v-for="index in 5">
  19. <view v-if="index <= invite_num" class="item active"></view>
  20. <view v-else class="item"></view>
  21. </template>
  22. </view>
  23. <view class="invite-notes">再邀请{{5 - invite_num}}人获得一个月代理会员</view>
  24. <view v-if="vip_expire && Date.parse(vip_expire.replace('-','/')) > new Date()" class="invite-notes">会员到期时间:{{vip_expire | datetimeFilter('YYYY-MM-DD')}}</view>
  25. </view>
  26. </view>
  27. <view class="body">
  28. <view class="money">
  29. <view class="row">
  30. <view class="col">可提现金额(元):<text class="warning">{{$store.state.user.money}}</text></view>
  31. <view class="col"><button class="btn tixian-btn" @tap="goToWithdrew">立即提现</button></view>
  32. </view>
  33. <view v-if="user_type===2" class="row">
  34. <view class="col">保证金(元):<text>0.00</text><text class="tips">(保证金2000元)</text></view>
  35. <view class="col"><button class="btn jiaona-btn" @tap="goToDeposit">立即缴纳</button></view>
  36. </view>
  37. <view v-if="user_type===3" class="row">
  38. <view class="col">不可提现金额:<text>0</text></view>
  39. <!-- <view class="col"><button class="btn jiaona-btn">立即缴纳</button></view> -->
  40. </view>
  41. <view class="row statistics">
  42. <view class="item">
  43. <view class="num">{{total_settled_profit}}</view>
  44. <view>累计收益(元)</view>
  45. </view>
  46. <view class="item">
  47. <view class="num">0</view>
  48. <view>本月到账</view>
  49. </view>
  50. <view class="item">
  51. <view class="num">{{fans_num}}</view>
  52. <view>我的粉丝</view>
  53. </view>
  54. </view>
  55. </view>
  56. <view class="menu agent-menu">
  57. <view class="menu-item">
  58. <navigator url="/pages/user/user-profit" open-type="navigate" hover-class="none">
  59. <view class="icon">
  60. <image class="image" src="../../static/images/user/icon25.png" mode=""></image>
  61. </view>
  62. <view class="name">收益</view>
  63. </navigator>
  64. </view>
  65. <view class="menu-item">
  66. <navigator url="/" open-type="navigate" hover-class="none">
  67. <view class="icon">
  68. <image class="image" src="../../static/images/user/icon26.png" mode=""></image>
  69. </view>
  70. <view class="name">订单</view>
  71. </navigator>
  72. </view>
  73. <view class="menu-item">
  74. <navigator url="/pages/user/invitation-list" open-type="navigate" hover-class="none">
  75. <view class="icon">
  76. <image class="image" src="../../static/images/user/icon27.png" mode=""></image>
  77. </view>
  78. <view class="name">粉丝</view>
  79. </navigator>
  80. </view>
  81. <view class="menu-item">
  82. <navigator url="/pages/user/invite" open-type="navigate" hover-class="none">
  83. <view class="icon">
  84. <image class="image" src="../../static/images/user/icon28.png" mode=""></image>
  85. </view>
  86. <view class="name">邀请</view>
  87. </navigator>
  88. </view>
  89. </view>
  90. <navigator url="/pages/user/agent" open-type="navigate" hover-class="none">
  91. <view class="vip-center">
  92. <view class="text">代理会员中心<text class="sub">(特权独享)</text></view>
  93. </view>
  94. </navigator>
  95. <view class="menu">
  96. <view class="menu-item">
  97. <navigator url="/pages/user/money-log" open-type="navigate" hover-class="none">
  98. <view class="icon">
  99. <image class="image" src="../../static/images/menu/b8.png" mode="scaleToFill"></image>
  100. </view>
  101. <view class="name">账单明细</view>
  102. </navigator>
  103. </view>
  104. <view class="menu-item">
  105. <navigator url="/pages/order/order" open-type="navigate" hover-class="none">
  106. <view class="icon">
  107. <image class="image" src="../../static/images/menu/b7.png" mode=""></image>
  108. </view>
  109. <view class="name">订单管理</view>
  110. </navigator>
  111. </view>
  112. <view v-if="user_type===2">
  113. <navigator url="/pages/product/my-product" open-type="navigate" hover-class="none">
  114. <view class="icon">
  115. <image class="image" src="../../static/images/menu/b2.png" mode=""></image>
  116. </view>
  117. <view class="name">我的商品</view>
  118. </navigator>
  119. </view>
  120. <view v-if="user_type===3">
  121. <navigator url="/pages/user/collection" open-type="navigate" hover-class="none">
  122. <view class="icon">
  123. <image class="image" src="../../static/images/menu/b2.png" mode=""></image>
  124. </view>
  125. <view class="name">我的收藏</view>
  126. </navigator>
  127. </view>
  128. <view>
  129. <navigator url="/pages/user/strategy" open-type="navigate" hover-class="none">
  130. <view class="icon">
  131. <image class="image" src="../../static/images/menu/b1.png" mode=""></image>
  132. </view>
  133. <view class="name">新手攻略</view>
  134. </navigator>
  135. </view>
  136. </view>
  137. <view class="menu">
  138. <view>
  139. <navigator url="/pages/user/problem" open-type="navigate" hover-class="none">
  140. <view class="icon">
  141. <image class="image" src="../../static/images/menu/b3.png" mode=""></image>
  142. </view>
  143. <view class="name">常见问题</view>
  144. </navigator>
  145. </view>
  146. <view>
  147. <navigator url="/pages/user/kefu" open-type="navigate" hover-class="none">
  148. <view class="icon">
  149. <image class="image" src="../../static/images/menu/b4.png" mode=""></image>
  150. </view>
  151. <view class="name">联系客服</view>
  152. </navigator>
  153. </view>
  154. <view>
  155. <navigator url="/pages/user/notice" open-type="navigate" hover-class="none">
  156. <view class="icon">
  157. <image class="image" src="../../static/images/menu/b5.png" mode=""></image>
  158. </view>
  159. <view class="name">官方公告</view>
  160. </navigator>
  161. </view>
  162. <view>
  163. <navigator url="/pages/user/feedback" open-type="navigate" hover-class="none">
  164. <view class="icon">
  165. <image class="image" src="../../static/images/menu/b6.png" mode=""></image>
  166. </view>
  167. <view class="name">意见反馈</view>
  168. </navigator>
  169. </view>
  170. </view>
  171. </view>
  172. </view>
  173. </template>
  174. <script>
  175. import {
  176. mapState
  177. } from 'vuex'
  178. export default {
  179. data() {
  180. return {
  181. balance: '',
  182. deposit: ''
  183. };
  184. },
  185. computed: mapState({
  186. nickname: state => state.user.nickname,
  187. user_type: state => state.user.group_id,
  188. invite_code: state => state.user.invite_code,
  189. invite_num: state => state.user.invite_num,
  190. token: state => state.user.token,
  191. vip_expire: state => state.user.vip_expire,
  192. fans_num: state => state.user.fans_num,
  193. total_settled_profit: state => state.user.total_settled_profit
  194. }),
  195. onTabItemTap(e) {
  196. uni.$emit("refresh_userinfo");
  197. },
  198. onNavigationBarButtonTap(e) {
  199. // console.log(e)
  200. switch (e.index) {
  201. case 0:
  202. uni.navigateTo({
  203. url: '/pages/user/setting'
  204. });
  205. break;
  206. case 1:
  207. uni.navigateTo({
  208. url: '/pages/message/message'
  209. });
  210. break;
  211. default:
  212. break;
  213. }
  214. },
  215. methods: {
  216. goToWithdrew() {
  217. uni.navigateTo({
  218. url: "/pages/user/withdraw"
  219. })
  220. },
  221. goToDeposit() {
  222. uni.navigateTo({
  223. url: '/pages/order/deposit'
  224. });
  225. }
  226. }
  227. }
  228. </script>
  229. <style lang="scss" scoped>
  230. .head {
  231. background: $primary-color;
  232. display: flex;
  233. align-items: center;
  234. padding-bottom: 140upx;
  235. padding-top: 20upx;
  236. }
  237. .portrait {
  238. margin: 0 20upx;
  239. border: 10upx solid rgba(255, 255, 255, 0.5);
  240. border-radius: 128upx;
  241. overflow: hidden;
  242. width: 128upx;
  243. height: 128upx;
  244. .image {
  245. width: 128upx;
  246. height: 128upx;
  247. background: white;
  248. }
  249. }
  250. .nickname {
  251. font-size: 30upx;
  252. color: white;
  253. margin-bottom: 10upx;
  254. }
  255. .wddz,
  256. .zgcj {
  257. font-size: 24upx;
  258. color: white;
  259. border: 2upx solid white;
  260. border-radius: 20upx;
  261. width: 140upx;
  262. height: 36upx;
  263. line-height: 36upx;
  264. text-align: center;
  265. text-indent: 20upx;
  266. display: inline-block;
  267. padding: 0;
  268. background: url(../../static/images/do.png) no-repeat;
  269. background-size: 21upx 21upx;
  270. background-position: 10upx;
  271. }
  272. .invite {
  273. text-align: right;
  274. flex-grow: 1;
  275. margin-right: 20upx;
  276. color: white;
  277. .invite-code {
  278. font-size: 30upx;
  279. }
  280. .invite-notes {
  281. font-size: 24upx;
  282. }
  283. .invite-progress {
  284. .item {
  285. border: 2upx solid white;
  286. display: inline-block;
  287. width: 36upx;
  288. transform: scaleX(0.9);
  289. font-size: 0;
  290. border-radius: 2upx;
  291. &.active {
  292. border-color: yellow;
  293. }
  294. }
  295. &::after {
  296. content: "";
  297. background: url(../../static/images/vip.png) no-repeat;
  298. background-size: 42upx 42upx;
  299. width: 42upx;
  300. height: 42upx;
  301. display: inline-block;
  302. position: relative;
  303. top: 16upx;
  304. }
  305. margin-bottom: 20upx;
  306. }
  307. }
  308. .body {
  309. padding: 20upx;
  310. position: relative;
  311. top: -120upx;
  312. .money {
  313. background: white;
  314. border-radius: 20upx;
  315. padding: 20upx;
  316. font-family: "Roboto", sans-serif;
  317. .row {
  318. color: #333;
  319. display: flex;
  320. align-items: center;
  321. margin-bottom: 20upx;
  322. .warning {
  323. color: $primary-color;
  324. font-weight: bold;
  325. font-family: "Roboto-Bold", sans-serif;
  326. }
  327. .tips {
  328. color: #CCC;
  329. font-size: 24upx;
  330. }
  331. &:last-child {
  332. margin-bottom: 0;
  333. }
  334. & .col:first-child {
  335. flex-grow: 1;
  336. font-size: 28upx;
  337. }
  338. & .col:last-child {
  339. // text-align: right;
  340. font-size: 28upx;
  341. }
  342. }
  343. .btn {
  344. background-color: $primary-color;
  345. color: white;
  346. font-size: 26upx;
  347. padding: 5upx 20upx;
  348. border-radius: 40upx;
  349. line-height: normal;
  350. }
  351. }
  352. }
  353. .vip-center {
  354. background: url(../../static/images/center5.png) no-repeat;
  355. background-size: 710upx 78upx;
  356. color: white;
  357. padding: 0 20upx;
  358. margin-top: 20upx;
  359. height: 78upx;
  360. .text {
  361. margin-left: 50upx;
  362. background-color: #ff5454;
  363. font-weight: bold;
  364. line-height: 60upx;
  365. display: inline-block;
  366. margin-top: 10upx;
  367. .sub {
  368. font-size: 24upx;
  369. }
  370. }
  371. }
  372. .menu {
  373. display: flex;
  374. background: white;
  375. border-radius: 20upx;
  376. padding: 30upx 20upx;
  377. margin-top: 20upx;
  378. justify-content: space-between;
  379. .name {
  380. font-size: 28upx;
  381. margin-top: 10upx;
  382. }
  383. .icon {
  384. text-align: center;
  385. }
  386. .icon .image {
  387. width: 60upx;
  388. height: 60upx;
  389. }
  390. }
  391. .statistics {
  392. border-top: 2upx #EEEEEE solid;
  393. padding-top: 20upx;
  394. text-align: center;
  395. font-size: 28upx;
  396. .item {
  397. flex: 1;
  398. }
  399. .num {
  400. color: #ff5454;
  401. font-weight: bold;
  402. }
  403. }
  404. .agent-menu{
  405. padding: 15upx 0;
  406. .menu-item{
  407. flex: 1;
  408. text-align: center;
  409. .name{
  410. margin-top: 0;
  411. }
  412. }
  413. }
  414. </style>