微信

index.vue 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <div class="mainPage">
  3. <div class="loading" v-if="isLoading">
  4. <div @click="bindMobile">请绑定手机号</div>
  5. </div>
  6. <div v-else>
  7. <div class="userTop_view" >
  8. <div class="gradient_bg"></div>
  9. <div class="zIndex_bg"></div>
  10. <div class="userAvatar_Border">
  11. <div class="userAvatar">
  12. <img :src='AccountInfo.headimgurl' alt="" width="100%" height="100%">
  13. </div>
  14. </div>
  15. <div class="uesr-info">
  16. <div class="user-name">{{user.Name}}</div>
  17. <div class="mobile">{{user.Phone}}</div>
  18. </div>
  19. </div>
  20. <div class="vip-privilege flex-h">
  21. <div class="flex-item privilege-item" @click="toCoupons">
  22. <div class="img-box">
  23. <img src="../../../../common/icon/userCenter-icon-1.png" width="100%" height="100%" alt="">
  24. </div>
  25. <span>优惠券</span>
  26. <span>2张未使用</span>
  27. </div>
  28. <div class="flex-item privilege-item" @click="toCard">
  29. <div class="img-box">
  30. <img src="../../../../common/icon/userCenter-icon-2.png" width="100%" height="100%" alt="">
  31. </div>
  32. <span>卡券</span>
  33. <span>2张未使用</span>
  34. </div>
  35. <div class="flex-item privilege-item" @click="toVip">
  36. <div class="img-box">
  37. <img src="../../../../common/icon/userCenter-icon-3.png" width="100%" height="100%" alt="">
  38. </div>
  39. <span>VIP卡</span>
  40. <span>¥200 <i class="iconfont icon-jiantou-right" style="font-size: 0.1rem;"></i></span>
  41. </div>
  42. </div>
  43. <div class="userCenter-menu">
  44. <div class="menu-item flex-h" @click="toLessonOrder">
  45. <span>课程订单</span>
  46. <i class="iconfont icon-jiantou-right"></i>
  47. </div>
  48. <div class="menu-item flex-h" @click="toGoodsOrder">
  49. <span>商品订单</span>
  50. <i class="iconfont icon-jiantou-right"></i>
  51. </div>
  52. <div class="menu-item flex-h">
  53. <span>体检报告</span>
  54. <i class="iconfont icon-jiantou-right"></i>
  55. </div>
  56. </div>
  57. </div>
  58. </div>
  59. </template>
  60. <script>
  61. import { mapState, createNamespacedHelpers } from 'vuex'
  62. const { mapActions: actions } = createNamespacedHelpers('userCenter')
  63. export default {
  64. name: '',
  65. data () {
  66. return {
  67. user: {},
  68. isLoading: true
  69. }
  70. },
  71. computed: {
  72. ...mapState({
  73. userInfo: x => x.userCenter.userInfo,
  74. org: x => x.app.orgId
  75. })
  76. },
  77. components: {
  78. },
  79. mounted () {
  80. this.getUserInfo({ org: this.org }).then(() => {
  81. if (this.userInfo != 406) {
  82. this.user = this.userInfo.customer
  83. this.AccountInfo = JSON.parse(this.user.AccountInfo)
  84. this.headimgurl = this.AccountInfo.headimgurl
  85. this.isLoading = false
  86. }
  87. })
  88. },
  89. methods: {
  90. ...actions(['getUserInfo']),
  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. }
  110. }
  111. </script>
  112. <!-- Add "scoped" attribute to limit CSS to this component only -->
  113. <style lang="scss" scoped>
  114. @import 'page.scss';
  115. </style>