From 4ec664cafee7656a5d8795595ed55b30d49a6182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=88=AA?= Date: Mon, 24 Nov 2025 15:52:47 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/course/components/touchBtn.vue | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/pages/course/components/touchBtn.vue b/src/pages/course/components/touchBtn.vue index c8d0ccfe..3abca319 100644 --- a/src/pages/course/components/touchBtn.vue +++ b/src/pages/course/components/touchBtn.vue @@ -165,9 +165,14 @@ const IsAndEnv = getPhoneEnvBool('AND'); const isStartNum = ref(0); const isStopNum = ref(0); + const isGettingPermission = ref(false) const initRecord = () => { recordObjCom.value = uni.getRecorderManager(); unref(recordObjCom)?.onStop((res, duration) => { + if(isGettingPermission.value){ + isGettingPermission.value = false + return + } audioPath.value = res.tempFilePath; if (!isOut.value) { if (startFlag.value !== 2) { @@ -299,10 +304,13 @@ if (_recordPerm !== 1) { common.show('提示信息', '当前页面需要使用的录音权限,是否前往开启?', true, '取消', '确定').then((res) => { if (res) { + isGettingPermission.value = true + hideOverlayTalking() // 去开启权限 permission.gotoAppPermissionSetting(); } else { // 取消 + hideOverlayTalking() common.navigateBack(); } }); @@ -316,10 +324,13 @@ if (_state === 'denied') { common.show('提示信息', '当前页面需要使用的录音权限,是否前往开启?', true, '取消', '确定').then((res) => { if (res) { + isGettingPermission.value = true + hideOverlayTalking() // 去开启权限 uni.openAppAuthorizeSetting(); } else { // 取消 + hideOverlayTalking() common.navigateBack(); } });