JLBA202505130001_关于吉林银行新建AI智能培训系统的需求_fix: bug

This commit is contained in:
杨航
2026-03-23 16:39:07 +08:00
parent 18377d025b
commit d23ed6ac2e
+9 -6
View File
@@ -68,7 +68,7 @@
activeVoiceId,
dataInfo
} = toRefs(props)
const storageStore = useStorageStore();
const emit = defineEmits(['changePlay'])
watch(() => props.dataInfo, () => {}, {
@@ -112,6 +112,7 @@
emit('changePlay', unref(dataInfo)?.id)
console.log(unref(dataInfo)?.id)
isPlaying.value = true
if (talkVoiceObj.value && talkVoiceObj.value.src) {
console.log(1, talkVoiceObj.value.src)
setTimeout(() => {
@@ -133,7 +134,7 @@
voiceLoading.value = false;
itemVoice.value = url;
talkVoiceObj.value.src = url;
if(unref(dataInfo)?.id !== props.activeVoiceId) return
if (unref(dataInfo)?.id !== props.activeVoiceId) return
talkVoiceObj.value.play();
} else {
downloadFile(unref(dataInfo).bucketKey)
@@ -145,29 +146,32 @@
voiceLoading.value = false;
itemVoice.value = res.tempFilePath;
talkVoiceObj.value.src = res.tempFilePath;
if(unref(dataInfo)?.id !== props.activeVoiceId) return
if (unref(dataInfo)?.id !== props.activeVoiceId) return
talkVoiceObj.value.play();
storageStore.setStorage('audio', unref(dataInfo).bucketKey, itemVoice.value);
})
.catch((err) => {
isPlaying.value = false
voiceLoading.value = false;
emit('changePlay', '');
});
}
});
}
}
const initVoice = () => {
console.log('init')
talkVoiceObj.value = uni.createInnerAudioContext()
talkVoiceObj.value.onEnded(() => {
emit('changePlay', '')
isPlaying.value = false
// talkVoiceObj.value.src = ''
})
talkVoiceObj.value.onError((err) => {
console.log(err)
isPlaying.value = false
talkVoiceObj.value.src = ''
})
// if (unref(dataInfo).intrctWay === '02') {
@@ -241,7 +245,6 @@
immediate: true
}
)
</script>
<style scoped lang="scss">