From b2ee282fc7270fab4a51740fe7742dc34b0145e2 Mon Sep 17 00:00:00 2001 From: no99 <17663930442@163.com> Date: Mon, 18 Aug 2025 13:59:54 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=8E=86=E5=8F=B2=E8=AE=B0=E5=BD=95pc?= =?UTF-8?q?=E7=AB=AF=E5=B1=95=E5=BC=80=E9=80=BB=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/components/HistoryRecord.vue | 40 +++++---- src/views/homePage.vue | 157 +++++++++++++++++++++++++++------ 2 files changed, 154 insertions(+), 43 deletions(-) diff --git a/src/views/components/HistoryRecord.vue b/src/views/components/HistoryRecord.vue index bb71497..a2db4b4 100644 --- a/src/views/components/HistoryRecord.vue +++ b/src/views/components/HistoryRecord.vue @@ -405,12 +405,8 @@ const props = defineProps({ type: String, default: "AIchat", // 'AIchat' 或 'AiEmotion' }, - isMobile: { - type: Boolean, - default: false, - }, }); - +const isMobile = ref(null); // Emits const emit = defineEmits([ "selectRecord", @@ -440,7 +436,7 @@ const dialogWidth = ref("500px"); // 对话框动态宽度 // 计算属性:根据移动端状态动态设置对话框宽度 const computedDialogWidth = computed(() => { - if (props.isMobile) { + if (isMobile.value) { return "70%"; // 移动端使用百分比宽度 } return dialogWidth.value; // 桌面端使用固定宽度 @@ -458,6 +454,8 @@ const historyRecords = ref([]); const categoryHistory = ref([]); let chatFirstFlag = true; let emotionTirstFlag = true; + + const getHistoryList = async (params) => { try { const result = await getHistoryListAPI(params); @@ -473,20 +471,17 @@ const getHistoryList = async (params) => { // "emotionTirstFlag", // emotionTirstFlag // ); - const userAgent = navigator.userAgent; - const isMobile = - !/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test( - userAgent - ); if (chatFirstFlag && params.model == 1 && result.data.length != 0) { - if (isMobile) { + if (!isMobile.value) { + chatStore.aiChatCall = true; } chatFirstFlag = false; } if (emotionTirstFlag && params.model == 2 && result.data.length != 0) { - if (isMobile) { + if (!isMobile.value) { + chatStore.aiEmotionCall = true; } emotionTirstFlag = false; @@ -494,13 +489,18 @@ const getHistoryList = async (params) => { // 只在首次加载时根据chatStore状态设置折叠状态,避免搜索后自动弹出历史记录 - if (isMobile) { + if (isMobile.value) { + + console.log("移动设备默认关闭"); isCollapsed.value = true; } else { - if (props.currentType == "AIchat" && chatFirstFlag) { + console.log("pc设备进行判断"); + if (props.currentType == "AIchat") { isCollapsed.value = !chatStore.aiChatCall; - } else if (props.currentType == "AiEmotion" && emotionTirstFlag) { + console.log("夺宝奇兵页面", isCollapsed.value); + } else if (props.currentType == "AiEmotion") { isCollapsed.value = !chatStore.aiEmotionCall; + console.log("情绪大模型页面", isCollapsed.value); } } // 非首次调用时保持当前折叠状态不变 @@ -680,7 +680,7 @@ const selectRecord = async (record) => { }); if (result && result.data) { - if (props.isMobile) { + if (isMobile.value) { // 如果手机,收起历史记录 isCollapsed.value = true; if (props.currentType == "AIchat") { @@ -788,6 +788,12 @@ defineExpose({ // 生命周期 onMounted(() => { + const userAgent = navigator.userAgent; + isMobile.value = + /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test( + userAgent + ); + getHistoryList({ model: props.currentType == "AIchat" ? 1 : 2, token: localStorage.getItem("localToken"), diff --git a/src/views/homePage.vue b/src/views/homePage.vue index ad41d96..e4874ed 100644 --- a/src/views/homePage.vue +++ b/src/views/homePage.vue @@ -214,8 +214,8 @@ watch( watch( () => chatStore.chatInput, async (newVal) => { - if(activeTab.value=='AIchat'){ - isInputDisabled.value=chatStore.chatInput; + if (activeTab.value == "AIchat") { + isInputDisabled.value = chatStore.chatInput; } } ); @@ -223,8 +223,8 @@ watch( watch( () => chatStore.emotionInput, async (newVal) => { - if(activeTab.value=='AiEmotion'){ - isInputDisabled.value=chatStore.emotionInput; + if (activeTab.value == "AiEmotion") { + isInputDisabled.value = chatStore.emotionInput; } } ); @@ -714,6 +714,29 @@ const backToHome = () => { } }; +// 8.18金币兑换Token start +const userInfo = ref({ + username: "HomilyLink", + jwcode: "90042088", +}); +const changeRule = ref("1金币=1Token"); +const changeLevelList = ref([ + { gold: 10, token: 10 }, + { gold: 20, token: 20 }, + { gold: 50, token: 50 }, + { gold: 100, token: 100 }, + { gold: 200, token: 200 }, + { gold: 500, token: 500 }, + { gold: 1000, token: 1000 }, +]); + +const shouldPay=ref(0); +const gold=ref(0); + + + +// 8.18金币兑换Token end + onMounted(async () => { throttledJudgeDevice(); // 禁用全局触摸滚动 @@ -1011,26 +1034,34 @@ onUnmounted(() => { - - -
-

试运行期间,AI小财神可以检索全市场数据

-

(每个市场20支股票,股票详情参见【公告】页面)

- +
+
+
+ 头像 +
+
+
{{ userInfo.username }}
+
精网号:{{ userInfo.jwcode }}
+
+
+
兑换规则:{{ changeRule }}
+ +
+
+
兑换Token
+
- - - - - - - - +
+ 应付金额 +
{{ shouldPay }}
+ (金币余额:{{ gold }}) + +
+
立即兑换
@@ -1085,9 +1116,9 @@ onUnmounted(() => { /* 添加平滑滚动效果 */ } -/* .pcTabContent { - margin: 0 6%; -} */ +.pcTabContent { + padding: 0 6%; +} @media (max-width: 768px) { .tab-container { @@ -1605,7 +1636,81 @@ body { } } -.ruleContent { +.changeMsg { + display: flex; + width: 100%; + margin-bottom: 30px; +} + +.changeInfo { + display: flex; + background-color: #f8f8f8; + border-radius: 5px; + padding: 10px 20px; + /* width: 40%; */ + margin-right: 5%; + white-space: nowrap; +} + +.changeImg { + height: 100%; + display: flex; + justify-content: center; + align-items: center; +} + +.changeContent { + display: flex; + flex-direction: column; + font-weight: bold; +} + +.changeRule { + display: flex; + background-color: #f8f8f8; + border-radius: 5px; text-align: center; + align-items: center; + justify-content: center; + color: #4e86fe; + white-space: nowrap; + padding: 5px; + width: 40%; +} + +.changeLevel { + display: flex; + flex-direction: column; +} + +.changeLevelTitle { + font-weight: bold; +} + +.changeNow { + display: flex; + white-space: nowrap; + /* font-weight: bold; */ + margin-bottom: 15px; +} +.changePay { + color: #4e86fe; + margin: 0px 5px; +} + +.changeBtn { + width: 40%; + background-color: #4e86fe; + color: white; + display: flex; + justify-content: center; + align-content: center; + padding: 10px; + border-radius: 5px; + cursor: pointer; +} + +.changeBtn:hover { + background-color: #3a73e6; } From e80073131c341ea0b4e8d5868012f6d6a380d22c Mon Sep 17 00:00:00 2001 From: no99 <17663930442@163.com> Date: Mon, 18 Aug 2025 14:06:52 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=9C=A8=E5=85=AC=E5=91=8A=E9=A1=B5?= =?UTF-8?q?=E5=92=8C=E5=8F=8D=E9=A6=88=E9=A1=B5=E7=82=B9=E5=87=BB=E5=8E=86?= =?UTF-8?q?=E5=8F=B2=E8=AE=B0=E5=BD=95=E6=97=B6=EF=BC=8C=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E5=9B=9E=E5=AF=B9=E5=BA=94=E9=A1=B5=E9=9D=A2=E3=80=82=20?= =?UTF-8?q?=E6=B3=A8=E9=87=8A=E6=8E=89=E6=B5=8B=E8=AF=95token?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Selectmodel.vue | 8 ++++---- src/views/components/HistoryRecord.vue | 7 +++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/views/Selectmodel.vue b/src/views/Selectmodel.vue index c392007..08b1317 100644 --- a/src/views/Selectmodel.vue +++ b/src/views/Selectmodel.vue @@ -55,10 +55,10 @@ onMounted(() => { decodeURIComponent(String(getQueryVariable("token"))) ); - localStorage.setItem( - "localToken", - "pCtw6AYK0EHAaIexoFHsbZjtsfEAIhcmwkCFm6uKko8VPfMvyDiODL9v9c0veic9fIpQbvT8zN4sH/Si6Q" - ); + // localStorage.setItem( + // "localToken", + // "pCtw6AYK0EHAaIexoFHsbZjtsfEAIhcmwkCFm6uKko8VPfMvyDiODL9v9c0veic9fIpQbvT8zN4sH/Si6Q" + // ); }); const goToDBQBmodel = () => { diff --git a/src/views/components/HistoryRecord.vue b/src/views/components/HistoryRecord.vue index a2db4b4..aa1a69b 100644 --- a/src/views/components/HistoryRecord.vue +++ b/src/views/components/HistoryRecord.vue @@ -396,6 +396,8 @@ import moment from "moment"; import { ElMessage } from "element-plus"; import { useChatStore } from "../../store/chat"; const chatStore = useChatStore(); +import { useDataStore } from "@/store/dataList.js"; +const dataStore = useDataStore(); import { useRouter } from "vue-router"; const router = useRouter(); @@ -455,7 +457,6 @@ const categoryHistory = ref([]); let chatFirstFlag = true; let emotionTirstFlag = true; - const getHistoryList = async (params) => { try { const result = await getHistoryListAPI(params); @@ -474,14 +475,12 @@ const getHistoryList = async (params) => { if (chatFirstFlag && params.model == 1 && result.data.length != 0) { if (!isMobile.value) { - chatStore.aiChatCall = true; } chatFirstFlag = false; } if (emotionTirstFlag && params.model == 2 && result.data.length != 0) { if (!isMobile.value) { - chatStore.aiEmotionCall = true; } emotionTirstFlag = false; @@ -490,7 +489,6 @@ const getHistoryList = async (params) => { // 只在首次加载时根据chatStore状态设置折叠状态,避免搜索后自动弹出历史记录 if (isMobile.value) { - console.log("移动设备默认关闭"); isCollapsed.value = true; } else { @@ -689,6 +687,7 @@ const selectRecord = async (record) => { chatStore.aiEmotionCall = false; } } + dataStore.isFeedback = false; historyData.value = result.data; chatStore.dbqbClickRecord = historyData.value; // 构造股票数据对象,保持与现有结构一致 From 6bd7f3785595a6f8515dd2658a55ad467ed9a33d Mon Sep 17 00:00:00 2001 From: no99 <17663930442@163.com> Date: Mon, 18 Aug 2025 15:50:31 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=AE=89=E5=8D=93=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E9=9F=B3=E9=A2=91=E6=97=B6=E6=92=AD=E6=94=BE=E6=B7=B7=E4=B9=B1?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/AIchat.vue | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/src/views/AIchat.vue b/src/views/AIchat.vue index fcc71e2..c68795b 100644 --- a/src/views/AIchat.vue +++ b/src/views/AIchat.vue @@ -111,7 +111,7 @@ const playNextAudio = () => { src: [audioInfo.url], html5: false, format: ["mp3", "acc"], - // rate: 1.2, + // rate: 2, retryCount: 0, onplay: () => { audioStore.isPlaying = true; @@ -214,7 +214,6 @@ const addToAudioQueue = (url, name) => { "当前队列顺序:", audioQueue.value.map((item) => `${item.name}(${item.order})`) ); - // 只有在确实没有音频在播放且这是第一个音频时才开始播放 if ( !isPlayingAudio.value && @@ -275,6 +274,12 @@ const toggleVoiceForUser = (index) => { chatStore.messages[chatStore.currentUserIndex].audioStatus = false; } + // 强制停止所有音频实例(移动端兼容) + if (audioStore.soundInstance) { + audioStore.soundInstance.stop(); + audioStore.soundInstance = null; + } + audioPreloadStatus.one = { loaded: false, url: null }; audioPreloadStatus.two = { loaded: false, url: null }; audioPreloadStatus.three = { loaded: false, url: null }; @@ -301,20 +306,22 @@ const toggleVoiceForUser = (index) => { audioStore.soundInstance = null; currentPlayIndex = 0; isCallingPlayNext = false; - addToAudioQueue(chatStore.messages[index].audioArray[0], "API1-第一个"); - addToAudioQueue(chatStore.messages[index].audioArray[1], "API2-第二个"); - addToAudioQueue(chatStore.messages[index].audioArray[2], "API3-第三个"); - addToAudioQueue(chatStore.messages[index].audioArray[3], "API4-第四个"); + setTimeout(() => { + addToAudioQueue(chatStore.messages[index].audioArray[0], "API1-第一个"); + addToAudioQueue(chatStore.messages[index].audioArray[1], "API2-第二个"); + addToAudioQueue(chatStore.messages[index].audioArray[2], "API3-第三个"); + addToAudioQueue(chatStore.messages[index].audioArray[3], "API4-第四个"); - if (!audioStore.isVoiceEnabled) { - audioStore.toggleVoice(); - } else { - if (audioStore.currentAudioUrl || audioStore.ttsUrl) { - audioStore.togglePlayPause(); - } else { + if (!audioStore.isVoiceEnabled) { audioStore.toggleVoice(); + } else { + if (audioStore.currentAudioUrl || audioStore.ttsUrl) { + // audioStore.togglePlayPause(); + } else { + audioStore.toggleVoice(); + } } - } + }, 100); // 100ms延迟足够移动端清理音频实例 } else { if (!audioStore.isVoiceEnabled) { console.log("1111");