From 9f72bfb9b1877411b375d1a07c44249eee8ad19a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=88=AA?= Date: Tue, 13 Jan 2026 10:48:48 +0800 Subject: [PATCH] =?UTF-8?q?JLBA202505130001=5F=E5=85=B3=E4=BA=8E=E5=90=89?= =?UTF-8?q?=E6=9E=97=E9=93=B6=E8=A1=8C=E6=96=B0=E5=BB=BAAI=E6=99=BA?= =?UTF-8?q?=E8=83=BD=E5=9F=B9=E8=AE=AD=E7=B3=BB=E7=BB=9F=E7=9A=84=E9=9C=80?= =?UTF-8?q?=E6=B1=82=5Ffix=EF=BC=9A=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/index/components/question.vue | 31 ++++++++++++++++--------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/src/pages/index/components/question.vue b/src/pages/index/components/question.vue index 1d59196a..e95e15bb 100644 --- a/src/pages/index/components/question.vue +++ b/src/pages/index/components/question.vue @@ -126,18 +126,27 @@ import { onUnload } from '@dcloudio/uni-app'; } } const setVoiceTime = (sum) => { - sum += 1 - if(Math.ceil(talkVoiceObj.value.duration)>0){ - voiceTime.value = (Math.ceil(talkVoiceObj.value.duration) || 1 ) + 's' - }else{ - if(sum === 20) { - voiceTime.value = (unref(dataInfo).voiceTime || 0) + 's'; - return + plus.io.getAudioInfo({ + filePath: unref(dataInfo).talkingVoice, + success:(res)=>{ + voiceTime.value = (Math.floor(res.duration) || 1) + 's' + }, + fail:(res)=>{ + voiceTime.value = (unref(dataInfo).voiceTime || 1) + 's' } - setTimeout(()=>{ - setVoiceTime(sum) - },200) - } + }) + // sum += 1 + // if(Math.ceil(talkVoiceObj.value.duration)>0){ + // voiceTime.value = (Math.ceil(talkVoiceObj.value.duration) || 1 ) + 's' + // }else{ + // if(sum === 20) { + // voiceTime.value = (unref(dataInfo).voiceTime || 0) + 's'; + // return + // } + // setTimeout(()=>{ + // setVoiceTime(sum) + // },200) + // } }