错误信息:{"errMsg": "chooseMedia:fail api scope is not declared in the privacy agreement", "errno": 112}
wx.getSetting({
success(res){
if(!res.authSetting['scope.camera']){
wx.authorize({
scope: 'scope.camera',
success(){
uni.chooseMedia({
count:1,
mediaType:["image"],
sourceType:['album','camera'],
sizeType:['original','compressed'],
camera:"back",
success: function(res){
console.log(res)
var file = res.tempFiles;
file = file[0];
file = file.tempFilePath
var suffix =file.substring(file.lastIndexOf(".")+1);
_this.goJump('/pages/search/result/image?url='+file+"&fileType="+suffix);
},
fail: function(err){
console.log('开启摄像头失败')
console.log(err)
}
})
},
fail(err){
console.log(err)
}
})
}else{
uni.chooseMedia({
count:1,
mediaType:["image"],
sourceType:['album','camera'],
sizeType:['original','compressed'],
camera:"back",
success: function(res){
console.log(res)
var file = res.tempFiles;
file = file[0];
file = file.tempFilePath
var suffix =file.substring(file.lastIndexOf(".")+1);
_this.goJump('/pages/search/result/image?url='+file+"&fileType="+suffix);
},
fail: function(err){
console.log('开启摄像头失败')
console.log(err)
}
})
}
},
fail(err){
console.log(err)
}
})