From 9c4c0f7e30e66fe54f1b9cdab665b6e4769dbd27 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期二, 28 四月 2026 21:50:38 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 small-program/pages/index/index.vue |   27 +++++++++++++++++++++++++--
 1 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/small-program/pages/index/index.vue b/small-program/pages/index/index.vue
index 47d0bcb..2b84ae9 100644
--- a/small-program/pages/index/index.vue
+++ b/small-program/pages/index/index.vue
@@ -84,6 +84,7 @@
 			</view>
 			<view class="toast-btn" @click="handleLocation">寮�鍚畾浣�</view>
 		</view>
+		<auth-login v-if="showLogin" @close="showLogin = false"></auth-login>
 		<custom-tabbar></custom-tabbar>
 	</view>
 </template>
@@ -98,7 +99,7 @@
 			CustomTabbar
 		},
 		computed: {
-			...mapState(['navHeight', 'statusbarHeight', 'address', 'latitude', 'cityId', 'longitude']),
+			...mapState(['navHeight', 'statusbarHeight', 'address', 'latitude', 'cityId', 'longitude', 'token']),
 			currentAddress() {
 				return this.address && this.address !== '瀹氫綅涓�' ? this.address : '鑾峰彇瀹氫綅'
 			}
@@ -107,7 +108,9 @@
 			return {
 				bannerList: [],
 				pointList: [],
-				ingOrder: null
+				ingOrder: null,
+				showLogin: false,
+				pendingNavigate: null
 			}
 		},
 		async onLoad() {
@@ -120,6 +123,16 @@
 		onShow() {
 			this.ingOrder =null
 			this.getIngorder()
+		},
+		watch: {
+			token(newToken) {
+				if (newToken && this.pendingNavigate) {
+					const fn = this.pendingNavigate
+					this.pendingNavigate = null
+					this.showLogin = false
+					fn()
+				}
+			}
 		},
 		methods: {
 			jumpBannerDetail(item) {
@@ -149,12 +162,22 @@
 				} 
 			},
 			jumpOrderList(status){
+				if (!this.token) {
+					this.pendingNavigate = () => this.jumpOrderList(status)
+					this.showLogin = true
+					return
+				}
 				uni.setStorageSync("orderStatus",status)
 				uni.switchTab({
 					url: '/pages/itinerary/itinerary'
 				})
 			},
 			jumpxiadan() {
+				if (!this.token) {
+					this.pendingNavigate = () => this.jumpxiadan()
+					this.showLogin = true
+					return
+				}
 				if (!this.cityId) return uni.showToast({
 					title: '褰撳墠鍩庡競鏆傛湭寮�閫�',
 					icon: 'none'

--
Gitblit v1.9.3