|
|
|
@ -930,6 +930,11 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
async onLoad(args) { |
|
|
|
uni.$on('selectVoice', (voiceId) => { |
|
|
|
console.log('收到音色选择:', voiceId); |
|
|
|
|
|
|
|
this.selectedVoiceId = voiceId |
|
|
|
}) |
|
|
|
this.courseId = args.courseId |
|
|
|
// 重置音频状态 |
|
|
|
this.resetAudioState() |
|
|
|
@ -941,6 +946,7 @@ export default { |
|
|
|
|
|
|
|
// 页面卸载时清理音频资源 |
|
|
|
onUnload() { |
|
|
|
uni.$off('selectVoice') |
|
|
|
if (this.currentAudio) { |
|
|
|
this.currentAudio.destroy(); |
|
|
|
this.currentAudio = null; |
|
|
|
|