Browse Source

Merge branch 'songjie/feature-20250628160649-上线前优化' into milestone-20250710-上线前优化

dev
宋杰 2 days ago
parent
commit
d398e6ac10
  1. 52
      src/views/AiEmotion.vue
  2. 2
      src/views/components/emoEnergyConverter.vue

52
src/views/AiEmotion.vue

@ -1664,6 +1664,13 @@ const playNextAudio = () => {
emotionAudioStore.nowSound = null;
isCallingPlayNext = false;
//
const currentStock = emotionStore.activeStock;
if (currentStock) {
console.log('所有音频播放完成,重置当前股票音频状态:', currentStock.stockInfo?.name);
setStockAudioState(currentStock, { isPlaying: false, isPaused: false });
}
//
if (
audioInfo.onComplete &&
@ -1681,6 +1688,13 @@ const playNextAudio = () => {
emotionAudioStore.playbackPosition = 0;
isAudioPlaying.value = false;
isPlayingQueueAudio.value = false;
//
const currentStock = emotionStore.activeStock;
if (currentStock) {
console.log('音频被停止,重置当前股票音频状态:', currentStock.stockInfo?.name);
setStockAudioState(currentStock, { isPlaying: false, isPaused: false });
}
},
onerror: (error) => {
console.error(`${audioInfo.name}音频播放失败:`, error);
@ -1844,6 +1858,13 @@ function playAudioQueue(
}
} else {
console.log(`总共找到 ${audioQueue.value.length} 个音频,准备播放`);
//
const currentStock = emotionStore.activeStock;
if (currentStock) {
console.log('设置当前股票音频状态为播放中:', currentStock.stockInfo?.name);
setStockAudioState(currentStock, { isPlaying: true, isPaused: false });
}
}
} catch (error) {
console.error("处理音频播放失败:", error);
@ -2151,16 +2172,17 @@ async function handleSendMessage(input, onComplete) {
// refuse
// isLoading.value = false;
isPageLoaded.value = false;
const refuseMessage = response && response.msg ? response.msg : "接口返回数据异常,请重试";
const aiMessage = reactive({
sender: "ai",
text: processRefuseMessage(parsedData.refuse),
text: processRefuseMessage(refuseMessage),
});
messages.value.push(aiMessage);
// AIemotion store
emotionStore.addConversation({
sender: "ai",
text: processRefuseMessage(parsedData.refuse),
text: processRefuseMessage(refuseMessage),
timestamp: new Date().toISOString(),
});
isRotating.value = false;
@ -2372,18 +2394,6 @@ async function handleSendMessage(input, onComplete) {
isPageLoaded.value = false;
}
const aiMessage = reactive({
sender: "ai",
text: "请求工作流接口失败,请检查网络连接",
});
messages.value.push(aiMessage);
// AIemotion store
emotionStore.addConversation({
sender: "ai",
text: "请求工作流接口失败,请检查网络连接",
timestamp: new Date().toISOString(),
});
//
isRotating.value = false;
messages.value = [...previousMessages, ...messages.value];
@ -4284,7 +4294,7 @@ const emit = defineEmits(["updateMessage", "sendMessage", "ensureAIchat"]);
text-align: left;
margin-right: auto;
/* 将AI消息保持在左边 */
white-space: nowrap;
/* white-space: nowrap; */
width: fit-content;
overflow: visible;
align-items: center;
@ -4539,16 +4549,16 @@ const emit = defineEmits(["updateMessage", "sendMessage", "ensureAIchat"]);
height: auto;
}
.main {
/* .main {
min-height: 100px;
height: auto;
box-sizing: border-box;
background-color: #02107d;
margin-bottom: 10rem;
}
} */
.emotion-decoder-section {
width: 80%;
width: 80vw;
height: auto;
margin: 0 auto;
/* min-height: 38rem; */
@ -4730,7 +4740,7 @@ const emit = defineEmits(["updateMessage", "sendMessage", "ensureAIchat"]);
.bottom-radar-section {
background-size: 100% 100%;
background-repeat: no-repeat;
width: 80%;
width: 80vw;
height: auto;
/* min-height: 48rem; */
}
@ -4738,7 +4748,7 @@ const emit = defineEmits(["updateMessage", "sendMessage", "ensureAIchat"]);
.energy-converter-section {
background-size: 100% 100%;
background-repeat: no-repeat;
width: 80%;
width: 80vw;
height: auto;
margin: 0 auto;
min-height: 55vh;
@ -4808,7 +4818,7 @@ const emit = defineEmits(["updateMessage", "sendMessage", "ensureAIchat"]);
/* 超小屏幕设备 */
@media only screen and (max-width: 480px) {
.main {
width: 100%;
width: 90%;
padding: 0.3rem;
margin-bottom: 3rem;
}

2
src/views/components/emoEnergyConverter.vue

@ -152,7 +152,7 @@ function initQXNLZHEcharts(kline, qxnlzhqData) {
max: qxnlzhqData.js,
name: "【情绪临界区】",
color: "#FFC0AA",
fontColor: 'white',
fontColor: '#2D2D89',
NumberColor: 'white',
},
];

Loading…
Cancel
Save