From 266cc7451f5f4a95cd3ec7ed172e0db8682eca34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=B9=E6=9E=9C=E7=94=B5=E8=84=91?= Date: Fri, 18 Jul 2025 14:35:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E8=B7=B3=E8=BD=AC=E5=88=B0?= =?UTF-8?q?=E6=9D=83=E9=99=90=E9=A1=B5=E9=9D=A22?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/course/components/touchBtn.vue | 35 +++++++++++++----------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/src/pages/course/components/touchBtn.vue b/src/pages/course/components/touchBtn.vue index 07a5b70d..eb69ea22 100644 --- a/src/pages/course/components/touchBtn.vue +++ b/src/pages/course/components/touchBtn.vue @@ -88,10 +88,15 @@ const initRecord = () => { unref(recordObjCom)?.onStop((res, duration)=>{ audioPath.value = res.tempFilePath }) + unref(recordObjCom).onStart(() => { + console.log('开始录音了'); + showTalkingModel.value = true + }) } const startRecord = () => { unref(recordObjCom).start({format:'mp3'}) } + const stopRecord = () => { if(unref(recordObjCom).stop){ unref(recordObjCom)?.stop?.() @@ -120,21 +125,18 @@ onMounted(async ()=>{ }) } }else{ - let _recordPerm = uni.getAppAuthorizeSetting() - let _state = _recordPerm.microphoneAuthorized - if(_state === 'denied'){ - common.show('提示信息', '当前页面需要使用的录音权限,是否前往开启?',true, '取消','确定').then((res) => { - if(res) { - // 去开启权限 - permission.gotoAppPermissionSetting() - }else{ - // 取消 - common.navigateBack() - } - }) - }else if(_state === 'not determined'){ - startRecord() - } + // let _recordPerm = permission.judgeIosPermission('record') + // if(!_recordPerm){ + // common.show('提示信息', '当前页面需要使用的录音权限,是否前往开启?',true, '取消','确定').then((res) => { + // if(res) { + // // 去开启权限 + // permission.gotoAppPermissionSetting() + // }else{ + // // 取消 + // common.navigateBack() + // } + // }) + // } } // #endif }) @@ -158,6 +160,7 @@ const recNum = ref(1) const activeNum = ref(1) const getRecordPermission = async (obj) => { + //#ifdef APP-PLUS // 安卓端 // let _recordPerm = await permission.requestAndroidPermission('android.permission.RECORD_AUDIO') @@ -184,7 +187,7 @@ const showOverlayTalking = (obj) => { emit('startRecord') recNum.value += 1 if(!isDisabled.value){ - showTalkingModel.value = true + touchX.value = obj.changedTouches[0].pageX touchY.value = obj.changedTouches[0].pageY baseY.value = obj.currentTarget.offsetTop