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
})
}
this.$emit('enterHistory')
this.closeLayer()
},
closeLayer() {
+9
View File
@@ -152,6 +152,7 @@ export const chatMixins = {
},
// 重新生成
regenerateHandle(item) {
this.audioStopHandle()
deleteChatItemByConversationId(item.conversationId).then(res => {
const { success } = res
if (success) {
@@ -411,6 +412,14 @@ export const chatMixins = {
console.log('send failed (' + err.code + ')')
}
},
audioStopHandle() {
// Fix bug#4049
this.audioAyy = []
if (this.audioContext) {
this.audioContext.stop()
}
this.isPlayAudio = false
},
ttsHandle(item) {
this.audioAyy = []
if (this.audioContext) {
+1
View File
@@ -296,6 +296,7 @@
ref="historyView"
:status-bar-height="statusBarHeight"
form-module="history"
@enter-history="audioStopHandle"
/>
</view>
</template>
+1
View File
@@ -442,6 +442,7 @@
<AiHistoryList
ref="historyView"
:status-bar-height="statusBarHeight"
@enter-history="audioStopHandle"
/>
</view>
</template>