showPdf: function(fileId) {
uni.downloadFile({
// 下面一行是拼接预览PDF的地址!!!
url: this.$api.PDF_VIEW + fileId,
success: function(res) {
var filePath = res.tempFilePath;
if (!filePath) return
uni.openDocument({
filePath: filePath,
success: function(res) {
console.log('打开文档成功');
}
});
}
});
},
uni-app安卓端打开文件(PDF,img)
最新推荐文章于 2024-06-06 17:18:49 发布