From 7abdb24968bcb88f177851a30e41f282b9189a98 Mon Sep 17 00:00:00 2001
From: tj <1378534974@qq.com>
Date: 星期三, 21 五月 2025 19:11:47 +0800
Subject: [PATCH] 初步框架

---
 components/footer/customer-footer.vue |  139 +++++++++++++++++++++++-----------------------
 1 files changed, 70 insertions(+), 69 deletions(-)

diff --git a/components/footer/customer-footer.vue b/components/footer/customer-footer.vue
index bf0bcf6..16688bc 100644
--- a/components/footer/customer-footer.vue
+++ b/components/footer/customer-footer.vue
@@ -1,9 +1,10 @@
 <template>
 	<view class="footer flex customer-footer flex-wrap-normal" style="">
-		<view v-for="(item,index) in tabBar" :key="index" class="footer-item">
-			<view class="item" :class="flg==index?'cur':''" @click="go(index,item)">
+		<view v-for="(item, index) in tabBar" :key="index" class="footer-item">
+			<!-- <view class="item" :class="flg == index ? 'cur' : ''" @click="go(index, item)"> -->
+			<view class="item" :class="currentIndex === index ? 'cur' : ''" @click="go(index, item)">
 
-				<!-- <view v-if="index==0">
+			<!-- <view v-if="index==0">
 					<image src="../../static/images/customer/footer/footer-home-1.png" class="footer-icon"
 						v-if="flg==0"></image>
 					<image src="../../static/images/customer/footer/footer-home-0.png" class="footer-icon"
@@ -30,85 +31,85 @@
 						v-if="flg!=3"></image>
 				</view> -->
 
-				<view>
-					{{item.text}}
-				</view>
-
+			<view>
+				{{ item.text }}
 			</view>
+
 		</view>
+	</view>
 
 
 	</view>
 </template>
 <script>
-	export default {
-		data() {
-			return {
-				tabBar: [{
+export default {
+	data() {
+		return {
+			tabBar: [{
 
-						"text": "首页",
-						"pagePath": '/pages/home/home'
-					},
-					{
-
-						"text": "影视地图",
-						"pagePath": '/sub-pages/film-map/index'
-					},
-					{
-
-						"text": "行程规划",
-						"pagePath": '/sub-pages/customer/shopping/shopping'
-					},
-					{
-						"text": "社区",
-						"pagePath": '/pages/user/supplier-user'
-					},
-					{
-						"text": "我的",
-						"pagePath": '/pages/user/supplier-user'
-					}
-				]
-			}
-		},
-		props: {
-			flg: {
-				type: String,
+				"text": "首页",
+				"pagePath": '/pages/home/home'
 			},
-			bussincess: {
-				type: Boolean,
-				default () {
-					return false
-				}
-			}
-		},
-		created() {},
-		methods: {
+			{
 
-			go(index, item) {
-				debugger;
-
-				uni.navigateTo({
-						url: item.pagePath
-					})
-				
-				// if (index === 1 || index === 2) {
-				// 	//交易大厅和购物车,这2个可以用跳转方式
-				
-
-				// 	uni.navigateTo({
-				// 		url: item.pagePath
-				// 	})
-
-				// } else {
-				// 	uni.reLaunch({
-				// 		url: item.pagePath
-				// 	});
-				// }
-
+				"text": "影视地图",
+				"pagePath": '/sub-pages/film-map/index'
 			},
+			{
+
+				"text": "我的种草",
+				"pagePath": '/sub-pages/customer/shopping/shopping'
+			},
+			{
+				"text": "社区",
+				"pagePath": '/pages/user/supplier-user'
+			},
+			{
+				"text": "我的",
+				"pagePath": '/sub-pages/mine/index'
+			}
+			]
 		}
+	},
+	props: {
+		flg: {
+			type: String,
+		},
+		bussincess: {
+			type: Boolean,
+			default() {
+				return false
+			}
+		}
+	},
+	created() { },
+	computed: {
+		currentPath() {
+			const pages = getCurrentPages();
+			const currentPage = pages[pages.length - 1];
+			return '/' + currentPage.route;
+		},
+		currentIndex() {
+			return this.tabBar.findIndex(item => this.normalizePath(item.pagePath) === this.normalizePath(this.currentPath));
+		}
+	},
+	methods: {
+		normalizePath(path) {
+			return path.replace(/^\/+/, '/');
+		},
+		go(index, item) {
+
+			// uni.navigateTo({
+			// 		url: item.pagePath
+			// 	})
+			uni.reLaunch({
+				url: item.pagePath
+			})
+
+		},
 	}
+}
 </script>
 <style lang="scss">
-	@import "./main.scss";
+@import "./main.scss";
 </style>
\ No newline at end of file

--
Gitblit v1.9.3