pdf方法
This commit is contained in:
parent
41079458dc
commit
51367c48c9
@ -453,23 +453,40 @@ const viewGuideline = (cell) => {
|
||||
console.log(downloadTasks.value);
|
||||
downloadTasks.value.forEach(item => {
|
||||
if(item.id == cell.uuid) {
|
||||
uni.openDocument({
|
||||
filePath: item.localPath,
|
||||
fileType: 'pdf',
|
||||
success: () => console.log('打开成功'),
|
||||
fail: (err) => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: JSON.stringify(err),
|
||||
showCancel: false,
|
||||
confirmText: '确定',
|
||||
success: (res) => {
|
||||
if(res.confirm){
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
console.log(2222222222);
|
||||
console.log(item.localPath);
|
||||
plus.runtime.openFile(item.localPath, function(e) {
|
||||
console.log('打开成功');
|
||||
}, function(e) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: JSON.stringify(e),
|
||||
showCancel: false,
|
||||
confirmText: '确定',
|
||||
success: (res) => {
|
||||
if(res.confirm){
|
||||
}
|
||||
}
|
||||
});
|
||||
console.log('打开失败:' + e.message);
|
||||
});
|
||||
// uni.openDocument({
|
||||
// filePath: item.localPath,
|
||||
// fileType: 'pdf',
|
||||
// success: () => console.log('打开成功'),
|
||||
// fail: (err) => {
|
||||
// uni.showModal({
|
||||
// title: '提示',
|
||||
// content: JSON.stringify(err),
|
||||
// showCancel: false,
|
||||
// confirmText: '确定',
|
||||
// success: (res) => {
|
||||
// if(res.confirm){
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
// let url = "https://view.xdocin.com/view?src=" + encodeURIComponent(pdfUrl);
|
||||
// uni.downloadFile({
|
||||
// url: pdfUrl,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user