From 32526e5bddb7b14328b2467cd18783f480b33f3b Mon Sep 17 00:00:00 2001
From: xuxueyang <xuxy@fengyuntec.com>
Date: 星期六, 31 八月 2024 01:51:53 +0800
Subject: [PATCH] update合伙人

---
 components/footer/customer-footer.vue |   42 ++++++++++++++++++++++++++++++------------
 1 files changed, 30 insertions(+), 12 deletions(-)

diff --git a/components/footer/customer-footer.vue b/components/footer/customer-footer.vue
index 1ddd505..0627f98 100644
--- a/components/footer/customer-footer.vue
+++ b/components/footer/customer-footer.vue
@@ -84,19 +84,37 @@
 				if (this.flg == index) {
 					return
 				}
-				if (index===1||index===2) {
-					//交易大厅和购物车,这2个可以用跳转方式
-					uni.navigateTo({
-						url:item.pagePath
-					})
-					
-				}else{
-					uni.redirectTo({
-						url: item.pagePath
-					
-					});
+				if (index === 1 || index === 2) {
+					//交易大厅和购物车,这2个可以用跳转方式
+					if (index === 2) {
+						if (!this.currentInfo.id) {
+							this.$message.showToast('请先登录')
+							return
+						}
+
+					}
+					//判断,如果上上上级别,就是要跳转的,改为返回,避免堆栈太多
+					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.reLaunch({
+						url: item.pagePath
+
+					});
 				}
-				
+
 			},
 		}
 	}

--
Gitblit v1.9.3