From 5cb72d6775bad13bc6b591805a817845db53c574 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E6=9D=B0?= Date: Fri, 15 Aug 2025 19:25:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=83=85=E7=BB=AA=E5=A4=A7=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E5=96=87=E5=8F=AD=E9=A2=9C=E8=89=B2=E6=A0=A1=E6=AD=A3=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/AiEmotion.vue | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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);