|
@@ -4,7 +4,7 @@
|
|
|
<view class="page-bg">
|
|
|
<img class="img" :src="staticUrl+'/img/center-index-bg.png'" alt="">
|
|
|
</view>
|
|
|
- <view class="base-info page-wrap u-flex u-row-between">
|
|
|
+ <view class="base-info page-wrap u-flex u-row-between" v-if="vuex_member_info.name">
|
|
|
<view class="left u-flex">
|
|
|
<u-avatar :src="avatar||staticUrl+'/img/avatar.png'" size="110rpx"></u-avatar>
|
|
|
<view class="info">
|
|
@@ -17,23 +17,32 @@
|
|
|
</view>
|
|
|
<u-icon @click="$u.route('/center/memberinfo',{type:'redirectTo'})" name="setting-fill" color="#333333" size="38rpx"></u-icon>
|
|
|
</view>
|
|
|
+ <view class="base-info page-wrap u-flex u-row-between" @click="goLogin" v-else>
|
|
|
+ <view class="left u-flex">
|
|
|
+ <u-avatar :src="staticUrl+'/img/avatar.png'" size="110rpx"></u-avatar>
|
|
|
+ <view class="info">
|
|
|
+ <view class="name ellipsis-1">立即登录</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <u-icon name="setting-fill" color="#333333" size="38rpx"></u-icon>
|
|
|
+ </view>
|
|
|
<view class="property page-wrap u-flex u-row-between">
|
|
|
- <view class="property-item" @click="$u.route('/center/paycode')">
|
|
|
+ <view class="property-item" @click="checkauth('/center/paycode')">
|
|
|
<view class="up">
|
|
|
<u-icon :name="staticUrl+'/img/paycode.png'" color="#333333" size="42rpx"></u-icon>
|
|
|
</view>
|
|
|
<view class="down">会员码</view>
|
|
|
</view>
|
|
|
- <view class="property-item" @click="$u.route('/center/mybalance')">
|
|
|
- <view class="up">{{memberInfo.balance}}</view>
|
|
|
+ <view class="property-item" @click="checkauth('/center/mybalance')">
|
|
|
+ <view class="up">{{memberInfo.balance||0}}</view>
|
|
|
<view class="down">余额</view>
|
|
|
</view>
|
|
|
- <view class="property-item" @click="$u.route('/credits/creditslist')">
|
|
|
- <view class="up">{{memberInfo.credit}}</view>
|
|
|
+ <view class="property-item" @click="checkauth('/credits/creditslist')">
|
|
|
+ <view class="up">{{memberInfo.credit||0}}</view>
|
|
|
<view class="down">积分</view>
|
|
|
</view>
|
|
|
<view class="property-item">
|
|
|
- <view class="up">{{memberInfo.couponNum}}</view>
|
|
|
+ <view class="up">{{memberInfo.couponNum||0}}</view>
|
|
|
<view class="down">优惠券</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -112,14 +121,17 @@
|
|
|
},
|
|
|
tools:[
|
|
|
// {name:'充值中心',url:'/center/recharge',ico:this.$commonConfig.staticUrl+'/img/tool-chongzhi.png'},
|
|
|
- {name:'地址管理',url:'/center/addrlist',ico:this.$commonConfig.staticUrl+'/img/tool-map.png'},
|
|
|
+ {name:'地址管理',url:'center/addrlist',ico:this.$commonConfig.staticUrl+'/img/tool-map.png',checkauth:true},
|
|
|
{name:'客服电话',phone:'',ico:this.$commonConfig.staticUrl+'/img/tool-phone.png'},
|
|
|
]
|
|
|
}
|
|
|
},
|
|
|
onShow() {
|
|
|
- this.getMemberInfo();
|
|
|
- this.statisticsOrder();
|
|
|
+ if(this.vuex_member_info.name){
|
|
|
+ this.getMemberInfo();
|
|
|
+ this.statisticsOrder();
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
onLoad() {
|
|
|
this.getSystemInfo();
|
|
@@ -157,7 +169,12 @@
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
- uni.$u.route(item.url);
|
|
|
+ if(item.checkauth){
|
|
|
+ this.checkauth(item.url)
|
|
|
+ }else{
|
|
|
+ uni.$u.route(item.url);
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
orderClick(item,index){
|
|
|
console.log('item',item);
|
|
@@ -176,6 +193,36 @@
|
|
|
}).catch(err=>{
|
|
|
console.log('memberInfo',err.data);
|
|
|
})
|
|
|
+ },
|
|
|
+ goLogin(){
|
|
|
+ uni.setStorage({
|
|
|
+ key: 'backUrl',
|
|
|
+ data:'center/center' ,
|
|
|
+ success: function () {
|
|
|
+ uni.$u.route('/pages/login/login')
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ checkauth(pageUrl){
|
|
|
+ if(this.vuex_member_info.name){
|
|
|
+ uni.$u.route(pageUrl)
|
|
|
+ }else{
|
|
|
+ uni.showModal({
|
|
|
+ title: '还未登录',
|
|
|
+ content: '是否前往登录!',
|
|
|
+ success: res => {
|
|
|
+ if (res.confirm) {
|
|
|
+ uni.setStorage({
|
|
|
+ key: 'backUrl',
|
|
|
+ data:pageUrl ,
|
|
|
+ success: function () {
|
|
|
+ uni.$u.route('/pages/login/login')
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|