微信

index.vue 3.6KB

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