|
|
@ -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); |
|
|
|
|
|
|
|
// 将AI消息添加到emotion 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); |
|
|
|
|
|
|
|
// 将AI消息添加到emotion 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; |
|
|
|
} |
|
|
|