注释跳转到权限页面2
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user