wx.saveImageToPhotosAlbum 保存图片失败
- 当前 Bug 的表现(可附上截图)
代码走到wx.saveImageToPhotosAlbum 没任何反应,
-
预期表现
-
复现路径
-
提供一个最简复现 Demo
//下载图片
share: function () {
let that = this;
wx.canvasToTempFilePath({
canvasId: ‘myCanvas’,
success: function (res) {
console.log(res.tempFilePath)
that.setData({
tempFilePath: res.tempFilePath
})
wx.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success: function success(res) {
wx.showModal({
title: ‘成功保存图片’,
content: ‘已成功为您保存图片到手机相册,请自行前往朋友圈分享’,
success: function () {
that.setData({
friendTrue:false
})
}
})
},
fail: function fail(e) {
wx.getSetting({
success: (res) => {
console.log(res);
console.log(res.authSetting[‘scope.writePhotosAlbum’]);
if (res.authSetting[‘scope.writePhotosAlbum’] == false) {
wx.openSetting({
success: (res) => {
console.log(res);
}
})
}
}
})
}
});
}
})
},
这个问题目前再iphone5.6.有问题, 我的手机是iPhone8就没有问题,再另外一个iphone8就有问题,不知道为啥,这段代码以前没有问题,最近才出现问题,不知道为啥,我一直没有动过
