微信

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <template>
  2. <div class="mainPage">
  3. <div>
  4. <div class="userTop_view" >
  5. <div class="gradient_bg"></div>
  6. <div class="zIndex_bg"></div>
  7. <div class="userAvatar_Border">
  8. <div class="userAvatar">
  9. <img :src='headimgurl' alt="" width="100%" height="100%">
  10. </div>
  11. </div>
  12. <div class="uesr-info">
  13. <div class="user-name">{{user.Name}}</div>
  14. <div class="mobile" v-if="user.Phone">{{user.Phone}}</div>
  15. <div class="mobile" v-else @click="bindMobile">绑定手机号</div>
  16. </div>
  17. </div>
  18. <div class="vip-privilege flex-h">
  19. <div class="flex-item privilege-item" @click="toCoupons">
  20. <div class="img-box">
  21. <img src="../../../../common/icon/userCenter-icon-1.png" width="100%" height="100%" alt="">
  22. </div>
  23. <span>优惠券</span>
  24. <span>{{Nums.couponnum || 0}}张未使用</span>
  25. </div>
  26. <div class="flex-item privilege-item" @click="toCard">
  27. <div class="img-box">
  28. <img src="../../../../common/icon/userCenter-icon-2.png" width="100%" height="100%" alt="">
  29. </div>
  30. <span>卡券</span>
  31. <span>{{Nums.cardsnum || 0}}张未使用</span>
  32. </div>
  33. <div class="flex-item privilege-item" @click="toVip">
  34. <div class="img-box">
  35. <img src="../../../../common/icon/userCenter-icon-3.png" width="100%" height="100%" alt="">
  36. </div>
  37. <span>VIP卡</span>
  38. <span>¥{{(Nums.account || {}).Amount || 0}} <i class="iconfont icon-jiantou-right" style="font-size: 0.1rem;"></i></span>
  39. </div>
  40. </div>
  41. <div class="userCenter-menu">
  42. <div class="menu-item flex-h" @click="toLessonOrder">
  43. <span>我的课程</span>
  44. <i class="iconfont icon-jiantou-right"></i>
  45. </div>
  46. <div class="menu-item flex-h" @click="toGoodsOrder">
  47. <span>商品订单</span>
  48. <i class="iconfont icon-jiantou-right"></i>
  49. </div>
  50. <div class="menu-item flex-h" @click="toBodyCheck">
  51. <span>体检报告</span>
  52. <i class="iconfont icon-jiantou-right"></i>
  53. </div>
  54. <div class="menu-item flex-h" @click="toLuckdraw">
  55. <span>抽奖记录</span>
  56. <i class="iconfont icon-jiantou-right"></i>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. </template>
  62. <script>
  63. import { mapState, createNamespacedHelpers } from 'vuex'
  64. const { mapActions: actions } = createNamespacedHelpers('userCenter')
  65. export default {
  66. name: '',
  67. data () {
  68. return {
  69. user: {}
  70. }
  71. },
  72. computed: {
  73. ...mapState({
  74. userInfo: x => x.userCenter.userInfo,
  75. org: x => x.app.orgId,
  76. Nums: x => x.userCenter.Nums
  77. })
  78. },
  79. components: {
  80. },
  81. mounted () {
  82. this.getUserInfo({ org: this.org }).then(() => {
  83. this.user = this.userInfo.customer
  84. this.AccountInfo = JSON.parse(this.user.AccountInfo)
  85. this.headimgurl = this.user.Headimgurl
  86. })
  87. this.getNum()
  88. },
  89. methods: {
  90. ...actions(['getUserInfo', 'getNum']),
  91. toLessonOrder () {
  92. this.$router.push({ name: 'lessonOrder' })
  93. },
  94. toVip () {
  95. this.$router.push({ name: 'vip' })
  96. },
  97. toCard () {
  98. this.$router.push({ name: 'card' })
  99. },
  100. toCoupons () {
  101. this.$router.push({ name: 'coupons' })
  102. },
  103. bindMobile () {
  104. this.$router.push({ name: 'bindMobile' })
  105. },
  106. toGoodsOrder () {
  107. this.$router.push({ name: 'orderList' })
  108. },
  109. toBodyCheck () {
  110. window.location.href = `${window.location.origin}/c-v2/bodyCheck.html#/`
  111. },
  112. toLuckdraw () {
  113. // ^参数约定为97
  114. let userid = this.userInfo.customer.CustomerId
  115. let num = Math.floor(Math.random() * 10 + 1) * 100 + Math.floor(Math.random() * 10 + 1) * 10 + Math.floor(Math.random() * 10 + 1)
  116. num = num >= 1000 ? 999 : num
  117. userid = parseInt(`${userid}${num}`) ^ 97
  118. window.location.href = `${window.location.origin}/game/luckdraw/#/lotteryList?from=${userid}`
  119. }
  120. }
  121. }
  122. </script>
  123. <!-- Add "scoped" attribute to limit CSS to this component only -->
  124. <style lang="scss" scoped>
  125. @import 'page.scss';
  126. </style>