From ef3e4aab333da27d800484fea465428e0fd61cbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=88=AA?= Date: Fri, 8 Aug 2025 15:34:24 +0800 Subject: [PATCH] fix: bug --- src/pages/course/components/touchBtn.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/pages/course/components/touchBtn.vue b/src/pages/course/components/touchBtn.vue index 1bf5d163..00856383 100644 --- a/src/pages/course/components/touchBtn.vue +++ b/src/pages/course/components/touchBtn.vue @@ -148,17 +148,25 @@ const initRecord = () => { let _recordPerm = uni.getAppAuthorizeSetting() let _state = _recordPerm.microphoneAuthorized if(_state === 'authorized'){ - showTalkingModel.value = true + if(isStopNum.value === isStartNum.value){ + stopRecord() + }else{ + showTalkingModel.value = true + } } }) } const startFlag = ref(1) // const canStart = ref(true) +const isStartNum = ref(0) +const isStopNum = ref(0) const startRecord = () => { + isStartNum.value += 1 unref(recordObjCom).start({format:'mp3'}) } const stopRecord = () => { + isStopNum.value = isStartNum.value try{ if(unref(recordObjCom).stop){ unref(recordObjCom).stop()