checkImageExist() {
uni.showLoading({
mask: true,
})
let url = '图片地址'
uni.getImageInfo({
src: url,
complete: function(image) {
if (image.errMsg == 'getImageInfo:ok') {
this.downloadTaskFn();
}
}
})
},
downloadTaskFn() {
let url = '图片地址'
let downloadTask = plus.downloader.createDownload(url, {
timeout: 0, //下载任务超时时间,如果设置为0则表示永远不超时
filename: 'file://storage/emulated/0/文件夹名称/'
}, (d, status) => {
uni.hideLoading()
})
downloadTask.start();
}