diff --git a/src/components/examination/question.vue b/src/components/examination/question.vue index ce182717..678d4a7a 100644 --- a/src/components/examination/question.vue +++ b/src/components/examination/question.vue @@ -81,9 +81,9 @@ import { computed, unref, ref, toRefs, watch, onMounted, nextTick } from 'vue'; import { onUnload } from '@dcloudio/uni-app'; // import { useinnerAudio, useAudioFun } from '@/store/innerAudio'; - + import { useAudio } from './useAudio.js'; - import {downloadFile} from '@/api/common.js' + import { downloadFile } from '@/api/common.js'; const props = defineProps({ dataInfo: { default: () => ({}), @@ -128,7 +128,7 @@ }); const innerAudio = useAudio(); - + const status = computed(() => props.status); watch( () => props.status, @@ -157,6 +157,9 @@ nextTick(() => { textShow.value = true; }); + setTimeout(() => { + voiceTime.value = ''; + }, 0); } emit('buutton_click', type, props.dataInfo); }; @@ -173,7 +176,7 @@ textShow.value = false; } }; - + const playVoice = () => { // isPlaying.value = true; console.log('点击播放'); @@ -210,15 +213,18 @@ watch( () => props.dataInfo.voicePath, (newVal) => { - console.log('newVal', newVal); - if(newVal === '' && props.dataInfo.ossKey) { // 去下载oss内容 + + if (newVal === '' && props.dataInfo.ossKey) { + // 去下载oss内容 console.log('去下载oss内容'); - downloadFile(props.dataInfo.ossKey).then(res => { + downloadFile(props.dataInfo.ossKey).then((res) => { + voiceTime.value = ''; innerAudio.setAudioSrc(res.tempFilePath); - }) - } else if(newVal === undefined){ + }); + } else if (newVal === undefined) { innerAudio.stopAudio(); } else { + voiceTime.value = ''; innerAudio.setAudioSrc(newVal); } }, diff --git a/src/pages/course/components/talkingItem.vue b/src/pages/course/components/talkingItem.vue index 06453ab7..f5f1a5b1 100644 --- a/src/pages/course/components/talkingItem.vue +++ b/src/pages/course/components/talkingItem.vue @@ -10,955 +10,1074 @@ 8 问题反馈信息 9 已学完当前知识点反馈信息 --> -