|
@ -12,11 +12,8 @@ import { |
|
|
import { ElMessage } from "element-plus"; |
|
|
import { ElMessage } from "element-plus"; |
|
|
import AIchat from "./AIchat.vue"; |
|
|
import AIchat from "./AIchat.vue"; |
|
|
import AIfind from "./AIfind.vue"; |
|
|
import AIfind from "./AIfind.vue"; |
|
|
import AiEmotion from "./AiEmotion.vue"; |
|
|
|
|
|
import deepNine from "./deepNine.vue"; |
|
|
|
|
|
import Feedback from "./Feedback.vue"; |
|
|
import Feedback from "./Feedback.vue"; |
|
|
import Announcement from "./Announcement.vue"; |
|
|
import Announcement from "./Announcement.vue"; |
|
|
|
|
|
|
|
|
import { useAppBridge } from "../assets/js/useAppBridge.js"; |
|
|
import { useAppBridge } from "../assets/js/useAppBridge.js"; |
|
|
import { useDataStore } from "@/store/dataList.js"; |
|
|
import { useDataStore } from "@/store/dataList.js"; |
|
|
import { useChatStore } from "../store/chat"; |
|
|
import { useChatStore } from "../store/chat"; |
|
@ -41,7 +38,7 @@ import sendBtn from "../assets/img/homePage/tail/send.png"; |
|
|
import msgBtn from "../assets/img/homePage/tail/msg.png"; |
|
|
import msgBtn from "../assets/img/homePage/tail/msg.png"; |
|
|
import feedbackBtn from "../assets/img/Feedback/feedbackBtn.png"; |
|
|
import feedbackBtn from "../assets/img/Feedback/feedbackBtn.png"; |
|
|
import back from "../assets/img/Feedback/back.png"; |
|
|
import back from "../assets/img/Feedback/back.png"; |
|
|
|
|
|
|
|
|
|
|
|
import AiEmotion from "./AiEmotion.vue"; |
|
|
import HistoryRecord from "./components/HistoryRecord.vue"; |
|
|
import HistoryRecord from "./components/HistoryRecord.vue"; |
|
|
|
|
|
|
|
|
// import VConsole from "vconsole"; |
|
|
// import VConsole from "vconsole"; |
|
@ -108,10 +105,6 @@ const tabs = computed(() => [ |
|
|
name: "AiEmotion", |
|
|
name: "AiEmotion", |
|
|
label: "AI情绪大模型", |
|
|
label: "AI情绪大模型", |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
|
|
|
name: "deepNine", |
|
|
|
|
|
label: "深度九大模型", |
|
|
|
|
|
}, |
|
|
|
|
|
]); |
|
|
]); |
|
|
|
|
|
|
|
|
// 修改 setActiveTab 方法,添加一个可选参数 forceAIchat |
|
|
// 修改 setActiveTab 方法,添加一个可选参数 forceAIchat |
|
@ -127,9 +120,6 @@ const setActiveTab = (tab, index, forceAIchat = false) => { |
|
|
} else if (tab == "AiEmotion") { |
|
|
} else if (tab == "AiEmotion") { |
|
|
isInputDisabled.value = chatStore.emotionInput; |
|
|
isInputDisabled.value = chatStore.emotionInput; |
|
|
console.log("切换到AiEmotion页面,输入框状态为", isInputDisabled.value); |
|
|
console.log("切换到AiEmotion页面,输入框状态为", isInputDisabled.value); |
|
|
} else if (tab == "deepNine") { |
|
|
|
|
|
isInputDisabled.value = chatStore.deepNineInput; |
|
|
|
|
|
console.log("切换到deepNine页面,输入框状态为", isInputDisabled.value); |
|
|
|
|
|
} else { |
|
|
} else { |
|
|
isInputDisabled.value = false; |
|
|
isInputDisabled.value = false; |
|
|
} |
|
|
} |
|
@ -158,8 +148,6 @@ const activeComponent = computed(() => { |
|
|
return AIfind; |
|
|
return AIfind; |
|
|
} else if (activeTab.value === "AiEmotion") { |
|
|
} else if (activeTab.value === "AiEmotion") { |
|
|
return AiEmotion; // 新增逻辑 |
|
|
return AiEmotion; // 新增逻辑 |
|
|
} else if (activeTab.value === "deepNine") { |
|
|
|
|
|
return deepNine; |
|
|
|
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
@ -248,15 +236,6 @@ watch( |
|
|
} |
|
|
} |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
watch( |
|
|
|
|
|
() => chatStore.deepNineInput, |
|
|
|
|
|
async (newVal) => { |
|
|
|
|
|
if (activeTab.value == "deepNine") { |
|
|
|
|
|
isInputDisabled.value = chatStore.deepNineInput; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
const sendMessage = async () => { |
|
|
const sendMessage = async () => { |
|
|
if ( |
|
|
if ( |
|
|
localStorage.getItem("localToken") == null || |
|
|
localStorage.getItem("localToken") == null || |
|
@ -357,7 +336,6 @@ const tokenRuleDialogVisible = ref(false); |
|
|
const hasShownTokenRule = ref({ |
|
|
const hasShownTokenRule = ref({ |
|
|
AIchat: sessionStorage.getItem("hasShownTokenRule_AIchat") === "true", |
|
|
AIchat: sessionStorage.getItem("hasShownTokenRule_AIchat") === "true", |
|
|
AiEmotion: sessionStorage.getItem("hasShownTokenRule_AiEmotion") === "true", |
|
|
AiEmotion: sessionStorage.getItem("hasShownTokenRule_AiEmotion") === "true", |
|
|
deepNine: sessionStorage.getItem("hasShownTokenRule_deepNine") === "true", |
|
|
|
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
// 关闭Token规则提示框 |
|
|
// 关闭Token规则提示框 |
|
@ -373,16 +351,12 @@ const openTokenRuleDialog = () => { |
|
|
// 定义处理函数,以便正确移除事件监听器 |
|
|
// 定义处理函数,以便正确移除事件监听器 |
|
|
const handleGlobalClick = (event) => { |
|
|
const handleGlobalClick = (event) => { |
|
|
// 检查点击事件是否来自"兑换规则"按钮 |
|
|
// 检查点击事件是否来自"兑换规则"按钮 |
|
|
const changeRuleElement = document.querySelector(".changeRule"); |
|
|
|
|
|
if ( |
|
|
|
|
|
changeRuleElement && |
|
|
|
|
|
(changeRuleElement === event.target || |
|
|
|
|
|
changeRuleElement.contains(event.target)) |
|
|
|
|
|
) { |
|
|
|
|
|
|
|
|
const changeRuleElement = document.querySelector('.changeRule'); |
|
|
|
|
|
if (changeRuleElement && (changeRuleElement === event.target || changeRuleElement.contains(event.target))) { |
|
|
// 如果点击的是"兑换规则"按钮,不关闭提示框 |
|
|
// 如果点击的是"兑换规则"按钮,不关闭提示框 |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (tokenRuleDialogVisible.value) { |
|
|
if (tokenRuleDialogVisible.value) { |
|
|
tokenRuleDialogVisible.value = false; |
|
|
tokenRuleDialogVisible.value = false; |
|
|
} |
|
|
} |
|
@ -443,8 +417,6 @@ const showFeedback = () => { |
|
|
|
|
|
|
|
|
const tabContentAIchat = ref(null); |
|
|
const tabContentAIchat = ref(null); |
|
|
const tabContentAiEmotion = ref(null); |
|
|
const tabContentAiEmotion = ref(null); |
|
|
const tabContentDeepNine = ref(null); |
|
|
|
|
|
|
|
|
|
|
|
const isScrolling = ref(false); //判断用户是否在滚动 |
|
|
const isScrolling = ref(false); //判断用户是否在滚动 |
|
|
|
|
|
|
|
|
// AiEmotion页面高度监听器相关变量 |
|
|
// AiEmotion页面高度监听器相关变量 |
|
@ -461,8 +433,6 @@ const getCurrentScrollContainer = () => { |
|
|
return tabContentAIchat.value; |
|
|
return tabContentAIchat.value; |
|
|
} else if (activeTab.value === "AiEmotion") { |
|
|
} else if (activeTab.value === "AiEmotion") { |
|
|
return tabContentAiEmotion.value; |
|
|
return tabContentAiEmotion.value; |
|
|
} else if (activeTab.value === "deepNine") { |
|
|
|
|
|
return tabContentDeepNine.value; |
|
|
|
|
|
} |
|
|
} |
|
|
return null; |
|
|
return null; |
|
|
}; |
|
|
}; |
|
@ -688,7 +658,7 @@ watch( |
|
|
() => { |
|
|
() => { |
|
|
// console.log('messages变化了') |
|
|
// console.log('messages变化了') |
|
|
// 只有在AIchat页面时才执行自动滚动 |
|
|
// 只有在AIchat页面时才执行自动滚动 |
|
|
if (activeTab.value === "AIchat" || activeTab.value === "deepNine") { |
|
|
|
|
|
|
|
|
if (activeTab.value === "AIchat") { |
|
|
throttledSmoothScrollToBottom(); |
|
|
throttledSmoothScrollToBottom(); |
|
|
} |
|
|
} |
|
|
// setTimeout(throttledSmoothScrollToBottom, 100); |
|
|
// setTimeout(throttledSmoothScrollToBottom, 100); |
|
@ -722,26 +692,16 @@ watch( |
|
|
activeTab, |
|
|
activeTab, |
|
|
async () => { |
|
|
async () => { |
|
|
console.log("activeTab变化了", activeTab.value); |
|
|
console.log("activeTab变化了", activeTab.value); |
|
|
if ( |
|
|
|
|
|
activeTab.value == "AIchat" || |
|
|
|
|
|
activeTab.value == "AiEmotion" || |
|
|
|
|
|
activeTab.value == "deepNine" |
|
|
|
|
|
) { |
|
|
|
|
|
|
|
|
if (activeTab.value == "AIchat" || activeTab.value == "AiEmotion") { |
|
|
if (historyRecordRef.value && historyRecordRef.value.getHistoryList) { |
|
|
if (historyRecordRef.value && historyRecordRef.value.getHistoryList) { |
|
|
let model = |
|
|
|
|
|
activeTab.value == "AIchat" |
|
|
|
|
|
? 1 |
|
|
|
|
|
: activeTab.value == "AiEmotion" |
|
|
|
|
|
? 2 |
|
|
|
|
|
: 3; |
|
|
|
|
|
const result = historyRecordRef.value.getHistoryList({ |
|
|
const result = historyRecordRef.value.getHistoryList({ |
|
|
model: model, |
|
|
|
|
|
|
|
|
model: activeTab.value == "AIchat" ? 1 : 2, |
|
|
token: localStorage.getItem("localToken"), |
|
|
token: localStorage.getItem("localToken"), |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (activeTab.value === "AIchat" || activeTab.value === "deepNine") { |
|
|
|
|
|
|
|
|
if (activeTab.value === "AIchat") { |
|
|
isScrolling.value = false; //回复滚动到底部方法 |
|
|
isScrolling.value = false; //回复滚动到底部方法 |
|
|
// 停止AiEmotion页面的高度监听器 |
|
|
// 停止AiEmotion页面的高度监听器 |
|
|
stopAiEmotionHeightObserver(); |
|
|
stopAiEmotionHeightObserver(); |
|
@ -990,6 +950,12 @@ const throttledJudgeDevice = _.throttle(judgeDevice, 300, { |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
const expandHistory = () => { |
|
|
const expandHistory = () => { |
|
|
|
|
|
// if (activeTab.value == "AIchat" || activeTab.value == "AiEmotion") { |
|
|
|
|
|
// historyRecordRef.value.getHistoryList({ |
|
|
|
|
|
// token: localStorage.getItem("localToken"), |
|
|
|
|
|
// model: activeTab.value == "AIchat" ? 1 : 2, |
|
|
|
|
|
// }); |
|
|
|
|
|
// } |
|
|
if ( |
|
|
if ( |
|
|
historyRecordRef.value && |
|
|
historyRecordRef.value && |
|
|
historyRecordRef.value.isCollapsed !== undefined |
|
|
historyRecordRef.value.isCollapsed !== undefined |
|
@ -1000,8 +966,6 @@ const expandHistory = () => { |
|
|
chatStore.aiChatCall = true; |
|
|
chatStore.aiChatCall = true; |
|
|
} else if (activeTab.value == "AiEmotion") { |
|
|
} else if (activeTab.value == "AiEmotion") { |
|
|
chatStore.aiEmotionCall = true; |
|
|
chatStore.aiEmotionCall = true; |
|
|
} else if (activeTab.value == "deepNine") { |
|
|
|
|
|
chatStore.deepNineCall = true; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
@ -1440,28 +1404,6 @@ onUnmounted(() => { |
|
|
ref="aiEmotionRef" |
|
|
ref="aiEmotionRef" |
|
|
/> |
|
|
/> |
|
|
</div> |
|
|
</div> |
|
|
<!-- deepNine页面的独立滚动容器 --> |
|
|
|
|
|
<div |
|
|
|
|
|
v-show="activeTab === 'deepNine'" |
|
|
|
|
|
class="tab-content" |
|
|
|
|
|
:class="{ |
|
|
|
|
|
pcTabContent: !isMobile, |
|
|
|
|
|
}" |
|
|
|
|
|
ref="tabContentDeepNine" |
|
|
|
|
|
> |
|
|
|
|
|
<component |
|
|
|
|
|
v-if="activeTab === 'deepNine'" |
|
|
|
|
|
:is="activeComponent" |
|
|
|
|
|
:messages="messages" |
|
|
|
|
|
@updateMessage="updateMessage" |
|
|
|
|
|
@sendMessage="sendMessage" |
|
|
|
|
|
@ensureAIchat="ensureAIchat" |
|
|
|
|
|
@enableInput="enableInput" |
|
|
|
|
|
@scrollToBottom="handleDeepNineScrollToBottom" |
|
|
|
|
|
@showCount="showCount" |
|
|
|
|
|
ref="deepNineRef" |
|
|
|
|
|
/> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</el-main> |
|
|
</el-main> |
|
|
<!-- 尾部: 问题输入框 深度思考 多语言 语音播报 --> |
|
|
<!-- 尾部: 问题输入框 深度思考 多语言 语音播报 --> |
|
@ -1618,9 +1560,9 @@ onUnmounted(() => { |
|
|
<div class="changeJwcode">精网号:{{ userInfo.jwcode }}</div> |
|
|
<div class="changeJwcode">精网号:{{ userInfo.jwcode }}</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="changeRule" @click="openTokenRuleDialog"> |
|
|
|
|
|
|
|
|
<div class="changeRule"> |
|
|
兑换规则:{{ changeRule.gold }}金币={{ changeRule.token }}Token |
|
|
兑换规则:{{ changeRule.gold }}金币={{ changeRule.token }}Token |
|
|
<div>点击查看详情</div> |
|
|
|
|
|
|
|
|
<div @click="openTokenRuleDialog">点击查看详情</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="changeLevel"> |
|
|
<div class="changeLevel"> |
|
@ -1678,10 +1620,11 @@ onUnmounted(() => { |
|
|
<div class="changeLevel"> |
|
|
<div class="changeLevel"> |
|
|
<div class="changeLevelTitle"> |
|
|
<div class="changeLevelTitle"> |
|
|
兑换Token |
|
|
兑换Token |
|
|
<div class="changeRule" @click="openTokenRuleDialog"> |
|
|
|
|
|
|
|
|
<div class="changeRule"> |
|
|
(兑换规则:{{ changeRule.gold }}金币={{ changeRule.token }}Token) |
|
|
(兑换规则:{{ changeRule.gold }}金币={{ changeRule.token }}Token) |
|
|
<div>点击查看详情</div> |
|
|
|
|
|
|
|
|
<div @click="openTokenRuleDialog">点击查看详情</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="changeLevelContent"> |
|
|
<div class="changeLevelContent"> |
|
@ -1767,24 +1710,14 @@ onUnmounted(() => { |
|
|
center |
|
|
center |
|
|
> |
|
|
> |
|
|
<div class="changeSuccessDialogTitle"> |
|
|
<div class="changeSuccessDialogTitle"> |
|
|
<img |
|
|
|
|
|
v-if="!isMobile" |
|
|
|
|
|
src="https://d31zlh4on95l9h.cloudfront.net/images/84edd341b2ddec464fc4475254f7a309.png" |
|
|
|
|
|
style="scale: 0.7" |
|
|
|
|
|
alt="token图标" |
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
<img v-if="!isMobile" src="https://d31zlh4on95l9h.cloudfront.net/images/84edd341b2ddec464fc4475254f7a309.png" style="scale: 0.7;" alt="token图标"> |
|
|
兑换成功 |
|
|
兑换成功 |
|
|
</div> |
|
|
</div> |
|
|
<div class="changeSuccessDialogContent"> |
|
|
<div class="changeSuccessDialogContent"> |
|
|
尊敬的用户,恭喜您成功兑换:{{ activeLevel.calculatedPosition }} Token |
|
|
尊敬的用户,恭喜您成功兑换:{{ activeLevel.calculatedPosition }} Token |
|
|
</div> |
|
|
</div> |
|
|
<div class="changeSuccessDialogFooter"> |
|
|
<div class="changeSuccessDialogFooter"> |
|
|
<button |
|
|
|
|
|
class="confirmButton" |
|
|
|
|
|
@click="changeSuccessDialogVisible = false" |
|
|
|
|
|
> |
|
|
|
|
|
确定 |
|
|
|
|
|
</button> |
|
|
|
|
|
|
|
|
<button class="confirmButton" @click="changeSuccessDialogVisible = false">确定</button> |
|
|
</div> |
|
|
</div> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
|
|
|
|
|
@ -2642,17 +2575,17 @@ body { |
|
|
.changeSuccessDialogTitle { |
|
|
.changeSuccessDialogTitle { |
|
|
font-size: 1.7rem; |
|
|
font-size: 1.7rem; |
|
|
font-weight: bold; |
|
|
font-weight: bold; |
|
|
color: #7849de; |
|
|
|
|
|
|
|
|
color: #7849DE; |
|
|
display: flex; |
|
|
display: flex; |
|
|
justify-content: center; |
|
|
justify-content: center; |
|
|
align-items: center; |
|
|
align-items: center; |
|
|
letter-spacing: 10px; |
|
|
letter-spacing: 10px; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.changeSuccessDialogTitle image { |
|
|
|
|
|
|
|
|
.changeSuccessDialogTitle image{ |
|
|
font-size: 1.7rem; |
|
|
font-size: 1.7rem; |
|
|
font-weight: bold; |
|
|
font-weight: bold; |
|
|
color: #7849de; |
|
|
|
|
|
|
|
|
color: #7849DE; |
|
|
display: flex; |
|
|
display: flex; |
|
|
justify-content: center; |
|
|
justify-content: center; |
|
|
align-items: center; |
|
|
align-items: center; |
|
@ -2752,6 +2685,7 @@ body { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@media (max-width: 768px) { |
|
|
@media (max-width: 768px) { |
|
|
|
|
|
|
|
|
.tokenRuleDialog { |
|
|
.tokenRuleDialog { |
|
|
bottom: 20%; |
|
|
bottom: 20%; |
|
|
} |
|
|
} |
|
@ -2945,7 +2879,7 @@ body { |
|
|
|
|
|
|
|
|
<style> |
|
|
<style> |
|
|
.changeSuccessDialog { |
|
|
.changeSuccessDialog { |
|
|
background: linear-gradient(180deg, #80d3f8, #8080ff); |
|
|
|
|
|
|
|
|
background: linear-gradient(180deg, #80D3F8, #8080FF); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.changeSuccessDialogFooter { |
|
|
.changeSuccessDialogFooter { |
|
@ -2955,7 +2889,7 @@ body { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.confirmButton { |
|
|
.confirmButton { |
|
|
background: #8a52df; |
|
|
|
|
|
|
|
|
background: #8A52DF; |
|
|
color: white; |
|
|
color: white; |
|
|
border: none; |
|
|
border: none; |
|
|
border-radius: 5px; |
|
|
border-radius: 5px; |
|
|