download(e) {
let t = this;
$.showloading()
wx.downloadFile({
url: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1591007826562&di=c6d5dfb0816ec0bffb2d0bd9ee33a7ec&imgtype=0&src=http%3A%2F%2Fn.sinaimg.cn%2Fsinacn01%2F173%2Fw580h393%2F20180417%2Ff585-fzcyxmv6432698.jpg',
success: function (res) {
console.log(res);
$.hideloading();
var filePath = res.tempFilePath;
console.log(filePath);
wx.openDocument({
filePath: filePath,
success: function (res) {
console.log(res)
},
fail: function (res) {
console.log(res);
},
complete: function (res) {
console.log(res);
}
})
},
fail: function (res) {
$.toast("文件下载失败")
setTimeout(() => {
$.hideloading();
}, 2000)
},
complete: function (res) {},
})
}
本文地址:https://blog.csdn.net/WangYi0118/article/details/107457353
如对本文有疑问, 点击进行留言回复!!
springmvc之ResponseBody响应json数据遇到的错误及解决
uni-app 后台升级 静默升级 uniapp 后台更新 静默更新 在线升级
SpringBoot多Module启动报错Could not transfer metadata
Hibernate项目报错:Cannot call sendError() after the response has been committed
网友评论