Browse Source

新增token规则弹出框;

songjie/feature-20250628160649-上线前优化
宋杰 3 weeks ago
parent
commit
347fef7975
  1. 2
      src/views/DBQBmodel.vue
  2. 2
      src/views/Emotionsmodel.vue
  3. 187
      src/views/homePage.vue

2
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("无权限");

2
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("无权限");

187
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.18Token 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
</div>
</el-dialog>
<!-- Token规则提示框 -->
<div v-if="tokenRuleDialogVisible" class="tokenRuleDialog">
<div class="tokenRuleDialogContent">
<div class="tokenRuleDialogClose" @click="closeTokenRuleDialog">
<el-icon><Close /></el-icon>
</div>
<div class="tokenRuleDialogTitle">Token规则</div>
<div class="tokenRuleSection">
<div class="tokenRuleSectionTitle">Token消耗规则</div>
<div class="tokenRuleItem"> "夺宝奇兵大模型""AI情绪大模型"中提交问题若提交成功内容生成则消耗1Token</div>
<div class="tokenRuleItem"> "夺宝奇兵大模型""AI情绪大模型"中提交问题若提交有误无法生成内容则不会消耗Token</div>
<div class="tokenRuleItem"> 接受同一只股票产品咨询时间只消耗1次Token</div>
<div class="tokenRuleItem"> "夺宝奇兵""AI情绪"中Token是互通的</div>
</div>
<div class="tokenRuleSection">
<div class="tokenRuleSectionTitle">Token兑换规则</div>
<div class="tokenRuleItem"> 点击右上角"获取Token次数"即可进入Token兑换页进行金币兑换Token</div>
<div class="tokenRuleItem"> 金币兑换Token的比例为1金币=1Token一经兑换不予退还</div>
</div>
<div class="tokenRuleNote">
注意报告生成过程中请耐心等待在此期间请勿进行页面刷新操作以免导致报告生成进程中断
</div>
</div>
</div>
</div>
</template>
@ -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;
}
}
</style>

Loading…
Cancel
Save