关于uinapp 华为审核相册 权限 拍摄/从相册选择,申请相机、存储权限; 需要说明用途复制可用
export default {
data() {
return {
qx_album:'',
qx_sys:''
}
},
onLoad() {
this.determine()
},
methods: {
determine:function(){
var that = this;
that.qx_album= uni.getStorageSync('QXSM_SAN');
uni.getSystemInfo({
success: function (res) {
that.qx_sys = res.platform.toUpperCase();
}
})
},
empower:function(item){
var that = this;
var _id=item.licenses_id;
if(that.qx_sys =='IOS'){
that.xxx(_id)
} else if(that.qx_sys =='ANDROID'){
if(that.qx_sys =='agree'){
that.xxx(_id)
}else if(that.qx_sys ==''){
uni.showModal({
title: "相册权限说明",
content:'便于您使用该功能上传您的照片/图片/视频,请您确认授权,否则无法使用该功能',
confirmText:'同意',
cancelText:'不同意',
success: function(res) {
if (res.confirm) {
that.requestPre(_id)
} else if (res.cancel) {
uni.navigateBack();
}
}
})
}else if(that.sc_album=='denie'){
uni.showModal({
title: "相册权限说明",
content:'便于您使用该功能上传您的照片/图片/视频,请您确认授权,否则无法使用该功能',
confirmText:'去授权',
cancelText:'算了',
success: function(res) {
if (res.confirm) {
uni.setStorageSync('CLIENT_SCAN_Permissions','');
uni.openAppAuthorizeSetting();
} else if (res.cancel) {
uni.navigateBack();
}
}
})
}
else{
that.xxx(_id)
}
}
},
requestPre:function(_id){
var that = this;
plus.android.requestPermissions(['android.permission.WRITE_EXTERNAL_STORAGE'], (e) => {
if (e.deniedAlways.length > 0) {
uni.setStorageSync('QXSM_SAN','denie');
uni.navigateBack();
}
if (e.deniedPresent.length > 0) {
uni.setStorageSync('QXSM_SAN','denie');
uni.navigateBack();
}
if(e.granted.length > 0) {
uni.setStorageSync('QXSM_SAN','agree');
that.XXX(_id);
}
});
},
}
}