From 639c683144c9552face1b7fdf3b01e658858567a Mon Sep 17 00:00:00 2001 From: Gsh <15170702455@163.com> Date: Wed, 24 Dec 2025 23:36:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=85=91=E6=8D=A2?= =?UTF-8?q?=E4=B8=AD=E5=BF=83=E5=81=B6=E5=B0=94=E6=97=A0=E6=B3=95=E6=89=93?= =?UTF-8?q?=E5=BC=80=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/ProductPackage/index.vue | 38 +++++++++++-------- .../components/Header/components/Avatar.vue | 8 +++- Yi.Ai.Vue3/src/stores/modules/user.ts | 2 +- 3 files changed, 30 insertions(+), 18 deletions(-) diff --git a/Yi.Ai.Vue3/src/components/ProductPackage/index.vue b/Yi.Ai.Vue3/src/components/ProductPackage/index.vue index bdb4b060..41cd99d9 100644 --- a/Yi.Ai.Vue3/src/components/ProductPackage/index.vue +++ b/Yi.Ai.Vue3/src/components/ProductPackage/index.vue @@ -398,19 +398,25 @@ function goToActivation() {
-
🎁
-

激活码兑换

-

如果您持有意心AI的会员激活码或Token兑换码,
请点击下方按钮前往控制台进行兑换。

- + 🎁 +
+

+ 激活码兑换 +

+

+ 如果您持有意心AI的会员激活码或Token兑换码,
请点击下方按钮前往控制台进行兑换。 +

+ 前往兑换中心 - +

💡 兑换成功后权益将立即生效

@@ -864,31 +870,31 @@ function goToActivation() { min-height: 400px; background: linear-gradient(to bottom, #fff, #fdfdfd); border-radius: 8px; - + .activation-content { text-align: center; max-width: 400px; - + .guide-icon { font-size: 64px; margin-bottom: 24px; animation: float-icon 3s ease-in-out infinite; } - + .guide-title { font-size: 24px; font-weight: 800; color: #2c3e50; margin-bottom: 16px; } - + .guide-desc { color: #606266; line-height: 1.6; margin-bottom: 32px; font-size: 15px; } - + .redeem-jump-btn { width: 200px; height: 48px; @@ -899,13 +905,13 @@ function goToActivation() { border: none; box-shadow: 0 4px 12px rgba(255, 117, 140, 0.3); transition: all 0.3s; - + &:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(255, 117, 140, 0.4); } } - + .guide-tips { margin-top: 24px; font-size: 13px; diff --git a/Yi.Ai.Vue3/src/layouts/components/Header/components/Avatar.vue b/Yi.Ai.Vue3/src/layouts/components/Header/components/Avatar.vue index 0797e2ae..26675ad5 100644 --- a/Yi.Ai.Vue3/src/layouts/components/Header/components/Avatar.vue +++ b/Yi.Ai.Vue3/src/layouts/components/Header/components/Avatar.vue @@ -86,7 +86,6 @@ const navItems = [ // { name: 'userInfo', label: '用户信息', icon: 'User' }, { name: 'apiKey', label: 'API密钥', icon: 'Key' }, - { name: 'rechargeLog', label: '充值记录', icon: 'Document' }, { name: 'usageStatistics', label: '用量统计', icon: 'Histogram' }, { name: 'premiumService', label: '尊享服务', icon: 'ColdDrink' }, @@ -105,6 +104,10 @@ function handleConfirm(activeNav: string) { // 导航切换 function handleNavChange(nav: string) { activeNav.value = nav; + // 同步更新 store 中的 tab 状态,防止下次通过 store 打开同一 tab 时因值未变而不触发 watch + if (userStore.userCenterActiveTab !== nav) { + userStore.userCenterActiveTab = nav; + } } // 联系售后 @@ -307,6 +310,9 @@ watch(() => guideTourStore.shouldStartUserCenterTour, (shouldStart) => { // ============ 监听 Store 状态,控制用户中心弹窗 (新增) ============ watch(() => userStore.isUserCenterVisible, (val) => { dialogVisible.value = val; + if (val && userStore.userCenterActiveTab) { + activeNav.value = userStore.userCenterActiveTab; + } }); watch(() => userStore.userCenterActiveTab, (val) => { diff --git a/Yi.Ai.Vue3/src/stores/modules/user.ts b/Yi.Ai.Vue3/src/stores/modules/user.ts index 5abd2855..4d587ace 100644 --- a/Yi.Ai.Vue3/src/stores/modules/user.ts +++ b/Yi.Ai.Vue3/src/stores/modules/user.ts @@ -52,8 +52,8 @@ export const useUserStore = defineStore( // 新增:打开用户中心方法 const openUserCenter = (tab: string = 'user') => { - userCenterActiveTab.value = tab; isUserCenterVisible.value = true; + userCenterActiveTab.value = tab; }; // 新增:关闭用户中心方法