123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- <template>
- <div class="mainPage">
- <div>
- <div class="userTop_view">
- <div class="gradient_bg"></div>
- <div class="zIndex_bg"></div>
- <div class="userAvatar_Border">
- <div class="userAvatar">
- <img :src="headimgurl" alt width="100%" height="100%">
- </div>
- </div>
- <div class="uesr-info">
- <div class="user-name">{{user.Name}}</div>
- <div class="mobile" v-if="user.Phone">{{user.Phone}}</div>
- <div class="mobile" v-else @click="bindMobile">绑定手机号</div>
- </div>
- </div>
- <div class="vip-privilege flex-h">
- <div class="flex-item privilege-item" @click="toCoupons">
- <div class="img-box">
- <img src="../../../../common/icon/userCenter-icon-1.png" width="100%" height="100%" alt>
- </div>
- <span>优惠券</span>
- <span>{{Nums.couponnum || 0}}张未使用</span>
- </div>
- <div class="flex-item privilege-item" @click="toCard">
- <div class="img-box">
- <img src="../../../../common/icon/userCenter-icon-2.png" width="100%" height="100%" alt>
- </div>
- <span>卡券</span>
- <span>0张未使用</span>
- </div>
- <div class="flex-item privilege-item" @click="toVipDetail">
- <i class="iconfont icon-01" @click.stop="toVip"></i>
- <div class="img-box">
- <img src="../../../../common/icon/userCenter-icon-3.png" width="100%" height="100%" alt>
- </div>
- <span>VIP卡</span>
- <span>
- ¥{{Nums.vipbalance}}
- <i class="iconfont icon-jiantou-right" style="font-size: 0.1rem;"></i>
- </span>
- </div>
- </div>
-
- <div class="userCenter-menu">
- <div class="menu-item flex-h" @click="toLessonOrder">
- <span>我的课程</span>
- <i class="iconfont icon-jiantou-right"></i>
- </div>
- <div class="menu-item flex-h" @click="toGoodsOrder">
- <span>商品订单</span>
- <i class="iconfont icon-jiantou-right"></i>
- </div>
- <div class="menu-item flex-h" @click="toBodyCheck">
- <span>体检报告</span>
- <i class="iconfont icon-jiantou-right"></i>
- </div>
- <div class="menu-item flex-h" @click="toLuckdraw">
- <span>抽奖记录</span>
- <i class="iconfont icon-jiantou-right"></i>
- </div>
- <div class="menu-item flex-h" @click="toActiveList">
- <span>活动记录</span>
- <i class="iconfont icon-jiantou-right"></i>
- </div>
- </div>
- </div>
- </div>
- </template>
-
- <script>
- import { mapState, createNamespacedHelpers } from 'vuex'
- const { mapActions: actions } = createNamespacedHelpers('userCenter')
- export default {
- name: '',
- data () {
- return {
- user: {}
- }
- },
- computed: {
- ...mapState({
- userInfo: x => x.userCenter.userInfo,
- org: x => x.app.orgId,
- Nums: x => x.userCenter.Nums
- })
- },
- components: {
-
- },
- mounted () {
- this.getUserInfo({ org: this.org }).then(() => {
- this.user = this.userInfo.customer
- if (this.user.AccountInfo) {
- this.AccountInfo = JSON.parse(this.user.AccountInfo)
-
-
- }
- this.headimgurl = this.user.Headimgurl
- })
- this.getNum()
- },
- methods: {
- ...actions(['getUserInfo', 'getNum']),
- toLessonOrder () {
- this.$router.push({ name: 'lessonOrder' })
- },
- toVip () {
- this.$router.push({ name: 'vip' })
- },
- toVipDetail () {
- this.$router.push({ name: 'vipDetail' })
- },
- toCard () {
- this.$router.push({ name: 'card' })
- },
- toCoupons () {
- this.$router.push({ name: 'coupons' })
- },
- bindMobile () {
- this.$router.push({ name: 'bindMobile' })
- },
- toGoodsOrder () {
- this.$router.push({ name: 'orderList', query: { from: 'c' } })
- },
- toBodyCheck () {
- var url = window.location.pathname
- window.location.href = url.replace('user.html', 'bodyCheck.html') + '#/'
- },
- toLuckdraw () {
- // ^参数约定为97
- let userid = this.userInfo.customer.CustomerId
- let num = Math.floor(Math.random() * 10 + 1) * 100 + Math.floor(Math.random() * 10 + 1) * 10 + Math.floor(Math.random() * 10 + 1)
- num = num >= 1000 ? 999 : num
- userid = `${userid}${num}`
- window.location.href = `${window.location.origin}/game/luckdraw/#/lotteryList?from=${userid}`
- },
- toActiveList(){
- this.$router.push({ name: 'activeList' })
- }
- }
- }
- </script>
-
- <!-- Add "scoped" attribute to limit CSS to this component only -->
- <style lang="scss" scoped>
- @import 'page.scss';
- </style>
|