From 18d59ca85b2bc9ccac4a90203c3b2486acf3b113 Mon Sep 17 00:00:00 2001 From: xuxueyang <xuxy@fengyuntec.com> Date: 星期四, 12 九月 2024 09:19:55 +0800 Subject: [PATCH] Merge branch 'master-2.0' of http://47.96.225.205:8888/r/hmy_farmer-main into master-2.0 --- components/footer/customer-footer.vue | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/components/footer/customer-footer.vue b/components/footer/customer-footer.vue index 3cc049b..0627f98 100644 --- a/components/footer/customer-footer.vue +++ b/components/footer/customer-footer.vue @@ -93,12 +93,23 @@ } } + //判断,如果上上上级别,就是要跳转的,改为返回,避免堆栈太多 + const pages = getCurrentPages(); + //如果上一层就是购物车,那么就返回,而不是跳转 + // console.log('toShopping',pages) + if (pages && pages.length >= 2) { + if ( ('/' + pages[pages.length - 2].route) === item.pagePath) { + uni.navigateBack() + return + } + } + uni.navigateTo({ url: item.pagePath }) } else { - uni.redirectTo({ + uni.reLaunch({ url: item.pagePath }); -- Gitblit v1.9.3