| | |
| | | <view class="user"> |
| | | <view class="user-left"> |
| | | <view class="user-image"> |
| | | <image :src="userInfo.imgFullUrl" mode="widthFix"></image> |
| | | <image :src="userInfo.imgFullUrl?userInfo.imgFullUrl:'/static/icon/default.png'" mode="widthFix"></image> |
| | | </view> |
| | | <view class="user-name"> |
| | | <button open-type="getPhoneNumber" @getphonenumber="getphonenumber" v-if="!userInfo">获取手机号</button> |
| | |
| | | </view> |
| | | </view> |
| | | <view class="cate"> |
| | | <view class="cate-item"> |
| | | <view class="cate-item" @click="jumpTo(1)"> |
| | | <text>{{objNum ? objNum.cartTypeNum : 0}}</text> |
| | | <text>购物车</text> |
| | | </view> |
| | | <view class="cate-item"> |
| | | <view class="cate-item" @click="jumpTo(2)"> |
| | | <text>{{objNum ? objNum.member.integral : 0}}</text> |
| | | <text>积分</text> |
| | | </view> |
| | | <view class="cate-item"> |
| | | <view class="cate-item" @click="jumpTo(3)"> |
| | | <text>{{objNum ? objNum.couponNum : 0}}</text> |
| | | <text>优惠券</text> |
| | | </view> |
| | | <view class="cate-item"> |
| | | <view class="cate-item" @click="jumpTo(4)"> |
| | | <text>{{objNum ? objNum.collectNum : 0}}</text> |
| | | <text>收藏</text> |
| | | </view> |
| | |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="guanggao"> |
| | | <image src="/static/images/share@2x.png" mode="widthFix"></image> |
| | | <view class="guanggao" @click="jumpShare()"> |
| | | <image src="/static/images/share@2x.png" mode="widthFix"></image> |
| | | </view> |
| | | <view class="gn"> |
| | | <view class="gn-item" @click="jump()"> |
| | |
| | | import { mapState } from 'vuex' |
| | | export default { |
| | | computed: { |
| | | ...mapState(['navHeight', 'statusbarHeight', 'openid', 'userInfo']) |
| | | ...mapState(['navHeight', 'statusbarHeight', 'openid', 'userInfo','recshopid','recuserid']) |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | orderNum: null |
| | | }; |
| | | }, |
| | | onLoad() { |
| | | async onLoad() { |
| | | await this.$onLaunched; |
| | | this.getMyInfo() |
| | | this.ordersStatistics() |
| | | }, |
| | | methods: { |
| | | jumpTo(type) { |
| | | if (type === 1) { |
| | | uni.navigateTo({ |
| | | url: '/pages/shopping-cart/shopping-cart' |
| | | }) |
| | | } else if (type === 2) { |
| | | uni.navigateTo({ |
| | | url: '/pages/my-points/my-points' |
| | | }) |
| | | } else if (type === 3) { |
| | | uni.navigateTo({ |
| | | url: '/pages/coupon/coupon' |
| | | }) |
| | | } else if (type === 4) { |
| | | uni.navigateTo({ |
| | | url: '/pages/my-collection/my-collection' |
| | | }) |
| | | } |
| | | }, |
| | | jump() { |
| | | uni.navigateTo({ |
| | | url: '/pages/login/login' |
| | | }) |
| | | }, |
| | | jumpShare(){ |
| | | uni.navigateTo({ |
| | | url: '/pages/share/share' |
| | | }) |
| | | }, |
| | | // 跳转消息 |
| | |
| | | getphonenumber(e) { |
| | | this.$u.api.wxPhone({ |
| | | code: e.detail.code, |
| | | shopId:this.recshopid, |
| | | recId:this.recuserid, |
| | | openid: this.openid |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | this.$store.commit('setUserInfo', res.data.member) |
| | | this.$store.commit('setToken', res.data.token) |
| | | this.$store.commit('setRecShopId','') |
| | | this.$store.commit('setRecUserId','') |
| | | } |
| | | }) |
| | | }, |