<image :show-menu-by-longpress='true' :src="qRCode.paymentCode" style="width: 276rpx;height: 276rpx;"></image>
// :show-menu-by-longpress=‘true’ 开启长按保存图片
handledownload(){
const that = this
uni.downloadFile({
url: that.qRCode.paymentCode, //图片的url地址
success: res => {
if (res.statusCode === 200) {
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success: function() {
uni.showToast({
title: ‘保存成功’,
duration: 2000
})
},
fail: function() {
uni.showToast({
title: '保存失败',
duration: 2000
})
}
})
} else {
uni.showToast({
title: '保存失败',
duration: 2000
})
}
}
})
},