From 1046a1052efdc7b05aa91acf9b59c21acb76af75 Mon Sep 17 00:00:00 2001 From: Yer <17633066053@163.com> Date: Thu, 28 Sep 2023 17:22:19 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83?= =?UTF-8?q?=E4=BC=98=E5=8C=96tool=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/tabbar/user/utils/tool.vue | 21 ++++++++++++++++++--- utils/filters.js | 7 +++++-- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/pages/tabbar/user/utils/tool.vue b/pages/tabbar/user/utils/tool.vue index ae7f921..2fcb91e 100644 --- a/pages/tabbar/user/utils/tool.vue +++ b/pages/tabbar/user/utils/tool.vue @@ -123,10 +123,25 @@ export default { }, methods: { + handleNavigate(url) { + uni.navigateTo({ + url, + }); + }, navigateTo(url) { - uni.navigateTo({ - url, - }); + const ignores = [ + '/pages/mine/set/setUp', + '/pages/mine/set/editionIntro', + '/pages/mine/set/feedBack' + ] + if (!ignores.includes(url)) { + if (this.$options.filters.tipsToLogin('normal')) { + this.handleNavigate(url) + } + } + else { + this.handleNavigate(url) + } }, linkMsgDetail(){ diff --git a/utils/filters.js b/utils/filters.js index 0a27eda..5ea4136 100644 --- a/utils/filters.js +++ b/utils/filters.js @@ -376,7 +376,7 @@ export function talkIm (storeId, goodsId, id) { } } -export function tipsToLogin () { +export function tipsToLogin (type) { if (!isLogin("auth")) { uni.showModal({ title: "提示", @@ -388,7 +388,10 @@ export function tipsToLogin () { if (res.confirm) { navigateToLogin(); } else if (res.cancel) { - uni.navigateBack(); + if(type !== 'normal'){ + uni.navigateBack(); + } + } }, });