mui.plusReady(function() {
//shareImgs为图片路径序列,逗号分开
var shareImgs = plus.webview.currentWebview().shareImgs;
var arrCopyImg = shareImgs.split(",");
for(var i = 0; i < arrCopyImg.length; i++) {
if(arrCopyImg[i] != "") {
downloadFile(arrCopyImg[i]);
}
}
});
// 下载
function downloadFile(imgUrl) {
var downLoader = plus.downloader.createDownload(imgUrl, {}, function(download, status) {
if(status == 200) {
plus.gallery.save(download.filename, function() {
console.log("success:" + imgUrl);
}, function(e) {
console.log("error:" + imgUrl + JSON.stringify(e)); //部分保存成功,部分报写入正忙
});
}
});
downLoader.start();
}
有部分数据保存成功:
HBuilder版本:9.0.2.201803061935
请问如何解决?