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()