From 347fef79759775ebc8b7f4c8dc9b2ffd9ec79609 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E6=9D=B0?= Date: Tue, 26 Aug 2025 17:35:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9Etoken=E8=A7=84=E5=88=99?= =?UTF-8?q?=E5=BC=B9=E5=87=BA=E6=A1=86=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/DBQBmodel.vue | 2 + src/views/Emotionsmodel.vue | 2 + src/views/homePage.vue | 187 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 191 insertions(+) diff --git a/src/views/DBQBmodel.vue b/src/views/DBQBmodel.vue index 094946d..b61f614 100644 --- a/src/views/DBQBmodel.vue +++ b/src/views/DBQBmodel.vue @@ -71,6 +71,8 @@ const goToHomePage = async () => { // 设置 sessionStorage 控制 homepage.vue 激活 AiEmotion tab sessionStorage.setItem("activeTabAI", "AIchat"); sessionStorage.setItem("activeIndexAI", "0"); + // 设置标记表示从外部页面跳转过来 + sessionStorage.setItem("fromExternalPage", "true"); router.push("/homePage"); } else { console.log("无权限"); diff --git a/src/views/Emotionsmodel.vue b/src/views/Emotionsmodel.vue index 455aa3f..6481735 100644 --- a/src/views/Emotionsmodel.vue +++ b/src/views/Emotionsmodel.vue @@ -108,6 +108,8 @@ const goToAiEmotion = async () => { // 设置 sessionStorage 控制 homepage.vue 激活 AiEmotion tab sessionStorage.setItem("activeTabAI", "AiEmotion"); sessionStorage.setItem("activeIndexAI", "1"); + // 设置标记表示从外部页面跳转过来 + sessionStorage.setItem("fromExternalPage", "true"); router.push("/homePage"); } else { console.log("无权限"); diff --git a/src/views/homePage.vue b/src/views/homePage.vue index 39255a4..aa7cb01 100644 --- a/src/views/homePage.vue +++ b/src/views/homePage.vue @@ -330,6 +330,32 @@ const handleHistorySelect = (stockData) => { // 新增一个变量来控制是否显示公告页面 const isAnnouncementVisible = ref(false); +// Token规则提示框相关 +const tokenRuleDialogVisible = ref(false); +const hasShownTokenRule = ref({ + AIchat: sessionStorage.getItem('hasShownTokenRule_AIchat') === 'true', + AiEmotion: sessionStorage.getItem('hasShownTokenRule_AiEmotion') === 'true' +}); + +// 关闭Token规则提示框 +const closeTokenRuleDialog = () => { + tokenRuleDialogVisible.value = false; +}; + +// 检查是否需要显示Token规则提示框(从其他页面跳转过来时) +const checkTokenRuleOnPageLoad = () => { + const activeTab = sessionStorage.getItem('activeTabAI'); + const fromExternalPage = sessionStorage.getItem('fromExternalPage'); + + if (fromExternalPage === 'true' && activeTab && !hasShownTokenRule.value[activeTab]) { + tokenRuleDialogVisible.value = true; + hasShownTokenRule.value[activeTab] = true; + sessionStorage.setItem(`hasShownTokenRule_${activeTab}`, 'true'); + // 清除标记,避免重复显示 + sessionStorage.removeItem('fromExternalPage'); + } +}; + const showAnnouncement = async () => { console.log("打开公告"); dataStore.isFeedback = true; // 显示用户反馈页面 @@ -1098,6 +1124,9 @@ const goChange = async () => { // 8.18金币兑换Token end onMounted(async () => { + // 检查是否需要显示Token规则提示框 + checkTokenRuleOnPageLoad(); + throttledJudgeDevice(); // 禁用全局触摸滚动 touchmoveHandlerRef = touchmoveHandler; @@ -1159,6 +1188,8 @@ onMounted(async () => { sessionStorage.removeItem("activeLevel"); sessionStorage.setItem("rechargeFlag", "0"); } + + }); onUnmounted(() => { @@ -1637,6 +1668,34 @@ onUnmounted(() => { 尊敬的用户,恭喜您成功兑换:{{ activeLevel.calculatedPosition }} Token + + +
+
+
+ +
+
Token规则
+ +
+
Token消耗规则
+
• 在"夺宝奇兵大模型"、"AI情绪大模型"中提交问题,若提交成功,内容生成,则消耗1Token
+
• 在"夺宝奇兵大模型"、"AI情绪大模型"中提交问题,若提交有误,无法生成内容,则不会消耗Token
+
• 接受同一只股票,产品咨询时间,只消耗1次Token
+
• "夺宝奇兵"和"AI情绪"中Token是互通的
+
+ +
+
Token兑换规则
+
• 点击右上角"获取Token次数",即可进入Token兑换页进行金币兑换Token
+
• 金币兑换Token的比例为:1金币=1Token;一经兑换,不予退还
+
+ +
+ 注意:报告生成过程中,请耐心等待,在此期间请勿进行页面刷新操作,以免导致报告生成进程中断 +
+
+
@@ -2453,6 +2512,132 @@ body { text-align: center; } +/* Token规则提示框样式 - 与DBQBmodel无权限弹出框一致 */ +.tokenRuleDialog { + width: 100%; + display: flex; + justify-content: center; + align-items: center; + position: fixed; + bottom: 15%; + color: white; + z-index: 9999; +} + +.tokenRuleDialogContent { + position: relative; + border-radius: 5px; + border: 1px solid white; + padding: 20px 30px; + background-color: #261176; + display: flex; + flex-direction: column; + justify-content: center; + align-items: flex-start; + max-width: 500px; + width: 70vw; + max-height: 70vh; + overflow-y: auto; + box-sizing: border-box; +} + +.tokenRuleDialogClose { + border-radius: 5px; + border: 1px solid white; + background-color: #8621d9; + padding: 2px; + display: flex; + justify-content: center; + align-items: center; + position: absolute; + top: 0px; + right: 0px; + width: 24px; + height: 24px; + cursor: pointer; + color: white; +} + +.tokenRuleDialogTitle { + color: #fec13e; + font-size: 20px; + font-weight: bold; + text-align: center; + margin-bottom: 20px; + width: 100%; +} + +.tokenRuleSection { + margin-bottom: 15px; + width: 100%; +} + +.tokenRuleSectionTitle { + color: #fec13e; + font-size: 16px; + font-weight: bold; + margin-bottom: 8px; +} + +.tokenRuleItem { + color: white; + font-size: 16px; + line-height: 1.5; + margin-bottom: 6px; +} + +.tokenRuleNote { + background: rgba(134, 33, 217, 0.3); + border: 1px solid #fec13e; + border-radius: 5px; + padding: 12px; + color: white; + font-size: 14px; + line-height: 1.5; + margin-top: 15px; + text-align: center; + word-wrap: break-word; + overflow-wrap: break-word; +} + +@media (max-width: 768px) { + .tokenRuleDialogContent { + width: 90vw; + padding: 15px 20px; + max-height: 80vh; + } + + .tokenRuleDialogTitle { + font-size: 18px; + margin-bottom: 15px; + } + + .tokenRuleSectionTitle { + font-size: 14px; + margin-bottom: 6px; + } + + .tokenRuleItem { + font-size: 14px; + line-height: 1.4; + margin-bottom: 5px; + word-wrap: break-word; + overflow-wrap: break-word; + } + + .tokenRuleNote { + font-size: 12px; + padding: 10px; + margin-top: 12px; + line-height: 1.4; + } + + .tokenRuleDialogClose { + width: 20px; + height: 20px; + } +} + @media (max-width: 768px) { .action-btn { height: 21px; @@ -2580,6 +2765,8 @@ body { .changeSuccessDialogContent { font-size: 1rem; } + + }