Fix(云灵AI):[#5394]在云灵ai历史记录对话窗口,点击【语音播放】,播放中时点击重新生成,语音播放还在继续

This commit is contained in:
lifizer
2026-06-29 16:59:00 +08:00
parent 87f9efe143
commit 785b59c2ad
2 changed files with 16 additions and 10 deletions
+8 -5
View File
@@ -100,10 +100,7 @@ export const chatMixins = {
}.bind(this)).exec()
},
onUnload() {
if (this.audioContext) {
this.audioContext.stop()
}
wx.getBackgroundAudioManager().stop()
this.audioStopHandle()
this.closeWsFn()
},
created() {
@@ -447,9 +444,15 @@ export const chatMixins = {
this.audioAyy = []
if (this.audioContext) {
this.audioContext.stop()
this.audioContext.destroy() // 强制销毁释放资源
this.audioContext = null
}
this.isPlayAudio = false
wx.getBackgroundAudioManager().stop()
// 强制关闭微信小程序背景音频
if (typeof wx !== 'undefined' && wx.getBackgroundAudioManager) {
wx.getBackgroundAudioManager().stop()
}
},
ttsHandle(item) {
this.audioAyy = []
+8 -5
View File
@@ -81,10 +81,7 @@ export const chatMixinsV2 = {
}.bind(this)).exec()
},
onUnload() {
if (this.audioContext) {
this.audioContext.stop()
}
wx.getBackgroundAudioManager().stop()
this.audioStopHandle()
this.closeWsFn()
},
created() {
@@ -670,9 +667,15 @@ export const chatMixinsV2 = {
this.audioAyy = []
if (this.audioContext) {
this.audioContext.stop()
this.audioContext.destroy() // 强制销毁释放资源
this.audioContext = null
}
this.isPlayAudio = false
wx.getBackgroundAudioManager().stop()
// 强制关闭微信小程序背景音频
if (typeof wx !== 'undefined' && wx.getBackgroundAudioManager) {
wx.getBackgroundAudioManager().stop()
}
},
ttsHandle(item) {
this.audioAyy = []