From 8b8b2a2c0e9eb388c583171e4d9abfd6b8a88bc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E6=9D=B0?= Date: Wed, 23 Jul 2025 18:33:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=83=85=E7=BB=AA=E5=A4=A7=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E8=BE=93=E5=87=BA=E5=AE=8C=E6=88=90=E5=90=8E=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E7=A6=81=E7=94=A8=E8=BE=93=E5=85=A5=E6=A1=86=EF=BC=9B=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E6=B8=A9=E5=BA=A6=E8=AE=A1=E6=8A=98=E7=BA=BF=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=80=BB=E8=BE=91=EF=BC=9B=E6=AD=A3=E5=BC=8F=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=8E=A5=E5=8F=A3=EF=BC=9B=E4=B8=8D=E5=86=8D=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E7=94=A8=E6=88=B7=E6=9D=83=E9=99=90=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 7 ++++--- src/store/userPessionCode.js | 2 +- src/views/AIchat.vue | 13 ++++++++++++- src/views/AiEmotion.vue | 9 +++++++++ src/views/components/marketTemperature.vue | 9 ++++++--- src/views/homePage.vue | 22 +++++++++++----------- 6 files changed, 43 insertions(+), 19 deletions(-) diff --git a/.env.development b/.env.development index 981be04..d360df7 100644 --- a/.env.development +++ b/.env.development @@ -5,9 +5,10 @@ VITE_OUTPUT_DIR = 'dev' VITE_PUBLIC_PATH = / #新数据接口 -VITE_APP_API_BASE_URL = "http://39.101.133.168:8828/link" -# VITE_APP_API_BASE_URL = "https://api.homilychart.com/link" -VITE_APP_API_BASE_CAZE_URL = "http://39.101.133.168:8828/link" +# VITE_APP_API_BASE_URL = "http://39.101.133.168:8828/link" +VITE_APP_API_BASE_URL = "https://api.homilychart.com/link" +# VITE_APP_API_BASE_CAZE_URL = "http://39.101.133.168:8828/link" +VITE_APP_API_BASE_CAZE_URL = "https://api.homilychart.com/link" VITE_APP_IMG_API_BASE_URL = "http://39.101.133.168:8828/hljw/api/aws/upload" #MJ API diff --git a/src/store/userPessionCode.js b/src/store/userPessionCode.js index f8b34be..9c8b584 100644 --- a/src/store/userPessionCode.js +++ b/src/store/userPessionCode.js @@ -86,7 +86,7 @@ export const useUserStore = defineStore('user', () => { } } onMounted(() => { - init() + // init() }) return { diff --git a/src/views/AIchat.vue b/src/views/AIchat.vue index 48607e7..fa075a2 100644 --- a/src/views/AIchat.vue +++ b/src/views/AIchat.vue @@ -47,7 +47,7 @@ renderer.del = function (text) { }; // 定义自定义事件 -const emit = defineEmits(["updateMessage", "sendMessage"]); +const emit = defineEmits(["updateMessage", "sendMessage", "enableInput"]); // 音频播放方法 const playAudio = (url) => { @@ -451,6 +451,7 @@ const createTypingEffect = (message, content, speed) => { content: "工作流返回出错,请稍后重试", }); chatStore.isLoading = false; + emit('enableInput'); if (message.error == "2") { apiStatus.two.isError = true; } else if (message.error == "3") { @@ -462,6 +463,7 @@ const createTypingEffect = (message, content, speed) => { if (message.end) { chatStore.getUserCount(); chatStore.isLoading = false; + emit('enableInput'); } message.isTyping = false; nextTick(() => { @@ -580,6 +582,7 @@ const createTypingEffect = (message, content, speed) => { content: "工作流返回出错,请稍后重试", }); chatStore.isLoading = false; + emit('enableInput'); if (message.error == "2") { apiStatus.two.isError = true; } else if (message.error == "3") { @@ -612,6 +615,7 @@ const createTypingEffect = (message, content, speed) => { content: "工作流返回出错,请稍后重试", }); chatStore.isLoading = false; + emit('enableInput'); if (message.error == "2") { apiStatus.two.isError = true; } else if (message.error == "3") { @@ -738,6 +742,7 @@ watch( }); chatStore.isLoading = false; + emit('enableInput'); } } catch (e) { console.log(e, "意图识别失败"); @@ -748,6 +753,7 @@ watch( content: "工作流返回出错,请稍后重试", }); chatStore.isLoading = false; + emit('enableInput'); } if (flag) { @@ -1572,6 +1578,7 @@ watch( content: "工作流返回出错,请稍后重试", }); chatStore.isLoading = false; + emit('enableInput'); } } @@ -1671,6 +1678,7 @@ watch( content: "工作流返回出错,请稍后重试", }); chatStore.isLoading = false; + emit('enableInput'); } } } @@ -1856,6 +1864,7 @@ watch( content: "工作流返回出错,请稍后重试1111", }); chatStore.isLoading = false; + emit('enableInput'); } } } @@ -1990,6 +1999,7 @@ watch( content: "工作流返回出错,请稍后重试", }); chatStore.isLoading = false; + emit('enableInput'); } } } @@ -2166,6 +2176,7 @@ watch( content: "数据缺失,请稍后重试", }); chatStore.isLoading = false; + emit('enableInput'); } // 同时发起所有API调用 diff --git a/src/views/AiEmotion.vue b/src/views/AiEmotion.vue index 81c3f20..4e02cdf 100644 --- a/src/views/AiEmotion.vue +++ b/src/views/AiEmotion.vue @@ -797,6 +797,15 @@ function startTypewriterEffect(conclusion, onComplete) { for (let i = 0; i <= disclaimerText.length; i++) { const timer = setTimeout(() => { displayedTexts.value.disclaimer = disclaimerText.substring(0, i); + // 在免责声明打字机效果完成后调用回调函数 + if (i === disclaimerText.length) { + console.log('打字机效果完成,调用onComplete回调'); + if (onComplete && typeof onComplete === 'function') { + onComplete(); + // 清除保存的回调函数 + currentOnCompleteCallback.value = null; + } + } }, totalDelay + i * typeSpeed); typewriterTimers.value.push(timer); } diff --git a/src/views/components/marketTemperature.vue b/src/views/components/marketTemperature.vue index 3e63657..2ac0caf 100644 --- a/src/views/components/marketTemperature.vue +++ b/src/views/components/marketTemperature.vue @@ -371,11 +371,14 @@ function initChart(raw, klineDataRawValue, WDRLValue) { const stockData = raw.map((item) => Math.round(item[2])); // 处理数据重合时只显示市场温度的逻辑 - const processedStockData = stockData.map((stockTemp, index) => { + // 检查是否所有数据都重合 + const allDataMatch = stockData.every((stockTemp, index) => { const marketTemp = marketData[index]; - // 当市场温度和股票温度相同时,股票温度设为null(不显示) - return stockTemp === marketTemp ? null : stockTemp; + return stockTemp === marketTemp; }); + + // 只有当全部数据都重合时,才只显示市场温度(股票温度设为null) + const processedStockData = allDataMatch ? stockData.map(() => null) : stockData; // 创建新的图表实例 chartInstance = echarts.init(KlineCanvs.value); diff --git a/src/views/homePage.vue b/src/views/homePage.vue index 9623b6b..9d03e06 100644 --- a/src/views/homePage.vue +++ b/src/views/homePage.vue @@ -198,10 +198,10 @@ const sendMessage = async () => { // 调用 ensureAIchat 确保跳转到 AIchat 页面 ensureAIchat(); - console.log(chatStore.isLoading, "isLoading.value1111"); - if (chatStore.isLoading) return; - chatStore.isLoading=true; - console.log(chatStore.isLoading, "isLoading.value2222"); + console.log(isInputDisabled.value, "isInputDisabled.value1111"); + if (isInputDisabled.value) return; + isInputDisabled.value = true; + console.log(isInputDisabled.value, "isInputDisabled.value2222"); const messageContent = message.value; // 重置消息输入框 @@ -222,6 +222,11 @@ const sendMessage = async () => { }, 200); }; +// 重新启用输入框的方法 +const enableInput = () => { + isInputDisabled.value = false; +}; + // 公告 // 引入公告组件 import Announcement from "./Announcement.vue"; @@ -605,6 +610,7 @@ onUnmounted(() => { @updateMessage="updateMessage" @sendMessage="sendMessage" @ensureAIchat="ensureAIchat" + @enableInput="enableInput" ref="aiEmotionRef" /> @@ -679,17 +685,11 @@ onUnmounted(() => { > - -
- - - -