Enzo 4 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: '',
tel: '',
tags: []
}
},
showLogin: true
}
},
computed: {
@ -122,10 +123,11 @@
}
},
onLoad() {
this.getData();
},
onShow(){
onShow(e){
this.verifyUserInfo();
this.getData();
},
methods: {
verifyUserInfo(){
@ -135,7 +137,13 @@
// }
let userInfo = uni.getStorageSync('userinfo') || {};
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(){

11
pages/order/index.vue

@ -104,7 +104,8 @@
current: 0, // tab
pageSize: 10,
assetsType: '', //
orderType: []
orderType: [],
showLogin: true
}
},
onLoad(e) {
@ -124,7 +125,13 @@
verifyUserInfo(){
let userInfo = uni.getStorageSync('userinfo') || {};
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

Loading…
Cancel
Save