This commit is contained in:
杨航
2025-11-24 16:13:30 +08:00
parent 7a8f2587e3
commit 82f0598da5
2 changed files with 15 additions and 11 deletions
+7 -5
View File
@@ -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);
+8 -6
View File
@@ -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);