diff --git a/src/views/AiEmotion.vue b/src/views/AiEmotion.vue index b882636..446af76 100644 --- a/src/views/AiEmotion.vue +++ b/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);