diff --git a/src/pages/course/components/touchBtn.vue b/src/pages/course/components/touchBtn.vue index 3abca319..900d17ee 100644 --- a/src/pages/course/components/touchBtn.vue +++ b/src/pages/course/components/touchBtn.vue @@ -277,7 +277,7 @@ const activeNum = ref(1); const hasPermission = ref(false) - const getRecordPermission = (obj) => { + const getRecordPermission = async (obj) => { if (isDisabled.value) return; if (isTalking.value) { common.msg('操作频繁,请稍后重试!'); @@ -286,8 +286,9 @@ }, 500); return; } + //#ifdef APP-PLUS if(!hasPermission.value){ - let _res = getPermission() + let _res = await getPermission() if (_res) { hasPermission.value = true showOverlayTalking(obj); @@ -295,6 +296,7 @@ }else{ showOverlayTalking(obj); } + // #endif }; const getPermission = async () => { //#ifdef APP-PLUS @@ -341,9 +343,9 @@ } } // #endif - //#ifndef APP-PLUS - return true - // #endif + // //#ifndef APP-PLUS + // return true + // // #endif } const isMoving = ref(false); const isTalking = ref(false); diff --git a/src/pages/sparring/components/touchBtn.vue b/src/pages/sparring/components/touchBtn.vue index f75e6813..d5f52b4c 100644 --- a/src/pages/sparring/components/touchBtn.vue +++ b/src/pages/sparring/components/touchBtn.vue @@ -217,7 +217,7 @@ const activeNum = ref(1); const hasPermission = ref(false) - const getRecordPermission = (obj) => { + const getRecordPermission = async (obj) => { if (isDisabled.value) return; if (isTalking.value) { common.msg('操作频繁,请稍后重试!'); @@ -226,8 +226,9 @@ }, 500); return; } + // #ifdef APP-PLUS if (!hasPermission.value) { - let _res = getPermission() + let _res = await getPermission() if (_res) { hasPermission.value = true showOverlayTalking(obj); @@ -235,9 +236,10 @@ } else { showOverlayTalking(obj); } + // #endif }; const getPermission = async () => { - //#ifdef APP-PLUS + // #ifdef APP-PLUS // 安卓端 if (IsAndEnv) { let _recordPerm = await permission.requestAndroidPermission('android.permission.RECORD_AUDIO'); @@ -281,9 +283,9 @@ } } // #endif - //#ifndef APP-PLUS - return true - // #endif + // //#ifndef APP-PLUS + // return true + // // #endif } const isMoving = ref(false); const isTalking = ref(false);