From ded34e37fca5e2e05e17693d2524c3d664ebf017 Mon Sep 17 00:00:00 2001 From: xuxueyang <xuxy@fengyuntec.com> Date: 星期三, 14 八月 2024 11:20:18 +0800 Subject: [PATCH] update 搜索历史 --- 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