From abc83f85e4b9e4fe7aaec7d9d35d65338d6e6623 Mon Sep 17 00:00:00 2001 From: yanghang Date: Fri, 18 Jul 2025 14:10:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/course/components/touchBtn.vue | 27 +++++++++++++----------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/pages/course/components/touchBtn.vue b/src/pages/course/components/touchBtn.vue index 6477cf62..07a5b70d 100644 --- a/src/pages/course/components/touchBtn.vue +++ b/src/pages/course/components/touchBtn.vue @@ -120,18 +120,21 @@ onMounted(async ()=>{ }) } }else{ - // let _recordPerm = permission.judgeIosPermission('record') - // if(!_recordPerm){ - // common.show('提示信息', '当前页面需要使用的录音权限,是否前往开启?',true, '取消','确定').then((res) => { - // if(res) { - // // 去开启权限 - // permission.gotoAppPermissionSetting() - // }else{ - // // 取消 - // common.navigateBack() - // } - // }) - // } + 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() + } } // #endif })