Enzo 5 years ago
parent
commit
087af17baf
  1. 16
      pages/center/index.vue
  2. 11
      pages/order/index.vue

16
pages/center/index.vue

@ -100,7 +100,8 @@
id: '', id: '',
tel: '', tel: '',
tags: [] tags: []
}
},
showLogin: true
} }
}, },
computed: { computed: {
@ -122,10 +123,11 @@
} }
}, },
onLoad() { onLoad() {
this.getData();
}, },
onShow(){
onShow(e){
this.verifyUserInfo(); this.verifyUserInfo();
this.getData();
}, },
methods: { methods: {
verifyUserInfo(){ verifyUserInfo(){
@ -135,7 +137,13 @@
// } // }
let userInfo = uni.getStorageSync('userinfo') || {}; let userInfo = uni.getStorageSync('userinfo') || {};
if(!userInfo.id || !userInfo.nickname || !userInfo.avatar){ if(!userInfo.id || !userInfo.nickname || !userInfo.avatar){
this.$url('/pages/login/index?type=userinfo');
if(this.showLogin){
this.showLogin = false;
this.$url('/pages/login/index?type=userinfo');
}else{
this.showLogin = true;
this.$url('/pages/index/index', {type: 'switch'});
}
} }
}, },
getData(){ getData(){

11
pages/order/index.vue

@ -104,7 +104,8 @@
current: 0, // tab current: 0, // tab
pageSize: 10, pageSize: 10,
assetsType: '', // assetsType: '', //
orderType: []
orderType: [],
showLogin: true
} }
}, },
onLoad(e) { onLoad(e) {
@ -124,7 +125,13 @@
verifyUserInfo(){ verifyUserInfo(){
let userInfo = uni.getStorageSync('userinfo') || {}; let userInfo = uni.getStorageSync('userinfo') || {};
if(!userInfo.id || !userInfo.nickname || !userInfo.avatar){ if(!userInfo.id || !userInfo.nickname || !userInfo.avatar){
this.$url('/pages/login/index?type=userinfo');
if(this.showLogin){
this.showLogin = false;
this.$url('/pages/login/index?type=userinfo');
}else{
this.showLogin = true;
this.$url('/pages/index/index', {type: 'switch'});
}
} }
}, },
// tab // tab

Loading…
Cancel
Save