From bfa7d3b23e526809b04299d9c2719c3449aba3be Mon Sep 17 00:00:00 2001
From: longz <longzhaoz@qq.com>
Date: 星期二, 28 四月 2026 10:32:42 +0800
Subject: [PATCH] 小程序图片压缩

---
 yuyueMiniProgram/src/layouts/tabbar.vue |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/yuyueMiniProgram/src/layouts/tabbar.vue b/yuyueMiniProgram/src/layouts/tabbar.vue
index f5e0f48..adf3a5b 100644
--- a/yuyueMiniProgram/src/layouts/tabbar.vue
+++ b/yuyueMiniProgram/src/layouts/tabbar.vue
@@ -2,10 +2,19 @@
 const router = useRouter()
 
 const route = useRoute()
+const authStore = useMiniAuthStore()
 
 const { activeTabbar, getTabbarItemValue, setTabbarItemActive, tabbarList } = useTabbar()
 
 function handleTabbarChange({ value }: { value: string }) {
+  if (value === 'mine' && !authStore.isLoggedIn) {
+    authStore.showLoginPrompt('您还未登录,请先登录')
+    setTabbarItemActive('home')
+    if (route.name !== 'home') {
+      router.replaceAll({ name: 'home' })
+    }
+    return
+  }
   setTabbarItemActive(value)
   router.pushTab({ name: value })
 }
@@ -34,6 +43,7 @@
 
 <template>
   <slot />
+  <MiniLoginPrompt />
   <wd-gap safe-area-bottom height="var(--wot-tabbar-height, 50px)" />
   <wd-tabbar
     :model-value="activeTabbar.name" active-color="#0068FF" inactive-color="#1A1A1A" bordered safe-area-inset-bottom fixed custom-class="custom-tabbar-bg"

--
Gitblit v1.7.1