saveimg:function(){
var codeurl = this.data.codeurl
codeurl=‘https:’+codeurl
wx.showLoading({
title: ‘正在保存…’,
})
console.log(codeurl,‘这里的codeurl是https://image.yzgcw.com/QR/1565020674834.png’)
wx.getSetting({
success(res) {
if (!res.authSetting[‘scope.writePhotosAlbum’]) {
wx.authorize({
scope: ‘scope.writePhotosAlbum’,
success() {
console.log(111)
wx.downloadFile({
url: codeurl,
success: function (res) {
console.log(222)
let path = res.tempFilePath
wx.saveImageToPhotosAlbum({
filePath: path,
success: function (res) {
wx.hideLoading()
console.log(222)
wx.showToast({
title: ‘保存成功’,
})
},
complete: function (res) {
wx.hideLoading()
}
})
}
})
}
})
}else{
console.log(444)
wx.downloadFile({
url:codeurl,
success:function(res){
console.log(555)
let path = res.tempFilePath
console.log(path)
wx.saveImageToPhotosAlbum({
filePath: path,
success: function (res) {
wx.hideLoading()
console.log(666)
wx.showToast({
title: ‘保存成功’,
})
},
complete: function (res) {
console.log(res)
wx.hideLoading()
}
})
}
})
}
}
})
}
麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)