saveImgToLocal(e) {
let _this = this;
uni.showModal({
title: '提示',
content: '确定保存到相册吗',
success: function(res) {
if (res.confirm) {
//#ifdef APP-PLUS
var p = plus.io.convertLocalFileSystemURL(_this.QRcodeImg);
this.initImagePath = 'file:///' + p;
//#endif
console.log("图片: " + JSON.stringify(this.initImagePath));
uni.saveImageToPhotosAlbum({
filePath: this.initImagePath,
success: function(e) {
console.log("保存成功");
uni.showToast({
title: "保存成功",
icon: "none"
});
},
fail: function(e) {
console.log("保存失败");
uni.showToast({
title: "保存失败",
icon: "none"
});
}
});
} else if (res.cancel) {
}
}
});
}
转载请注明原文地址:https://ipadbbs.8miu.com/read-24434.html