diff --git a/pages/center/index.vue b/pages/center/index.vue index 4fdbf7d..3bf0cb1 100644 --- a/pages/center/index.vue +++ b/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(){ diff --git a/pages/order/index.vue b/pages/order/index.vue index 18b46d5..869d042 100644 --- a/pages/order/index.vue +++ b/pages/order/index.vue @@ -103,7 +103,8 @@ current: 0, // tab下表 pageSize: 10, assetsType: '', //账户类型 - orderType: [] + orderType: [], + showLogin: true } }, onLoad(e) { @@ -123,7 +124,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