http.contract_download(this.info.order_id).then(res=>{
if(!this.isEmpty(res.data)){
let fileUrl = res.data.docs[0]['fileUrl']; //pdf文件链接
uni.downloadFile({
url: fileUrl,
success: (res) => {
if (res.statusCode === 200) {
var FilePath = res.tempFilePath;
let platform = uni.getSystemInfoSync().platform;
if(platform=='ios'){
FilePath = escape(FilePath); //使用转码
}
setTimeout(()=>{
uni.openDocument({
filePath: FilePath,
success: function (FileRes) {
console.log('打开文档成功');
},fail: function (e) {
console.log(e);
},
});
},2000)
}
}
});
}
})
文件链接:https://esignoss.esign.cn/1111563786/736df9f7-f318-41af-9f43-1c0c03a73a91/FIL%E7%A1%AC%E4%BB%B6%E8%AE%BE%E5%A4%87%E9%87%87%E9%94%80%E5%90%88%E5%90%8C.pdf?Expires=1628408407&OSSAccessKeyId=LTAI4G23YViiKnxTC28ygQzF&Signature=q7II0IL4p2VQ1BCDBRoQ6QPd4tk%3D
在ios上转码报错:{"errMsg":"openDocument:fail 编码错误"} ,
不转码又返回:{"errMsg":"openDocument:fail 文件没有发现"}
1***@qq.com
- 发布:2021-08-08 14:40
- 更新:2021-08-19 09:30
- 阅读:2320
1***@163.com
麻烦问下,怎么升级版本啊
2023-01-09 16:56