Fix(AI):[#4049]语音播放AI回复内容,点击[重新生成],语音仍在播放

This commit is contained in:
lifizer
2025-07-15 09:37:01 +08:00
parent 1ec7c50240
commit 6712cc844d
4 changed files with 12 additions and 0 deletions
+1
View File
@@ -170,6 +170,7 @@ export default {
url: '/aiChat/views/history' + paramsStr url: '/aiChat/views/history' + paramsStr
}) })
} }
this.$emit('enterHistory')
this.closeLayer() this.closeLayer()
}, },
closeLayer() { closeLayer() {
+9
View File
@@ -152,6 +152,7 @@ export const chatMixins = {
}, },
// 重新生成 // 重新生成
regenerateHandle(item) { regenerateHandle(item) {
this.audioStopHandle()
deleteChatItemByConversationId(item.conversationId).then(res => { deleteChatItemByConversationId(item.conversationId).then(res => {
const { success } = res const { success } = res
if (success) { if (success) {
@@ -411,6 +412,14 @@ export const chatMixins = {
console.log('send failed (' + err.code + ')') console.log('send failed (' + err.code + ')')
} }
}, },
audioStopHandle() {
// Fix bug#4049
this.audioAyy = []
if (this.audioContext) {
this.audioContext.stop()
}
this.isPlayAudio = false
},
ttsHandle(item) { ttsHandle(item) {
this.audioAyy = [] this.audioAyy = []
if (this.audioContext) { if (this.audioContext) {
+1
View File
@@ -296,6 +296,7 @@
ref="historyView" ref="historyView"
:status-bar-height="statusBarHeight" :status-bar-height="statusBarHeight"
form-module="history" form-module="history"
@enter-history="audioStopHandle"
/> />
</view> </view>
</template> </template>
+1
View File
@@ -442,6 +442,7 @@
<AiHistoryList <AiHistoryList
ref="historyView" ref="historyView"
:status-bar-height="statusBarHeight" :status-bar-height="statusBarHeight"
@enter-history="audioStopHandle"
/> />
</view> </view>
</template> </template>