From d28331e24444990c9792c39afebf878d11199c54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E5=B9=B3=E8=89=BA?= <52643018@qq.com> Date: Tue, 29 Jun 2021 14:17:55 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BC=98=E5=8C=96]=20=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/center/index.vue | 16 ++++++++++++---- pages/order/index.vue | 11 +++++++++-- 2 files changed, 21 insertions(+), 6 deletions(-) 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