保存图片到相册,只支持APP
//下载海报,只在APP内有效
down(){
uni.downloadFile({//下载
url: this.ewmLink, //图片下载地址
success: res => {
if (res.statusCode === 200) {
uni.saveImageToPhotosAlbum({//保存图片到系统相册。
filePath: res.tempFilePath,//图片文件路径
success: function() {
uni.showToast({
title: '图片保存成功',
icon: 'none',
});
},
fail: function(e) {
console.log(e);
uni.showToast({
title: '图片保存失败',
icon: 'none',
});
}
});
}
}
});
},