saveImg: function () {
wx.openSetting({
success: (res) => {
if (res.authSetting['scope.writePhotosAlbum']) {
console.log('开启权限成功')
}
}
})
wx.downloadFile({
url: this.data.tempFilePath2,
success: function (res) {
wx.openSetting({
success(settingdata) {
console.log(settingdata)
if (settingdata.authSetting['scope.writePhotosAlbum']) {
console.log('获取权限成功,给出再次点击图片保存到相册的提示。')
}
}
})
let path = res.tempFilePath
wx.saveImageToPhotosAlbum({
filePath: path,
success(res) {
console.log(res)
},
fail(res) {
console.log(res)
},
complete(res) {
console.log(res)
}
})
}, fail: function (res) {
console.log(res);
if (res.errMsg === "saveImageToPhotosAlbum:fail auth deny") {
console.log("用户一开始拒绝了,我们想再次发起授权")
console.log('打开设置窗口')
wx.openSetting({
success(settingdata) {
console.log(settingdata)
if (settingdata.authSetting['scope.writePhotosAlbum']) {
console.log('获取权限成功,给出再次点击图片保存到相册的提示。')
}
}
})
}
}
})
},
真机调试保存成功了,但是没有相对应的一个提示?是什么问题
scope.writePhotosAlbum我现在调不出来。。。。