openPdf(pid, fileUrl,biaoshi) {
var _that = this;
console.log('fileUrl:' + fileUrl);
// let platform = uni.getSystemInfoSync().platform
// if (platform == 'ios') {
// //调用系统相关应用打开,无相关应用则不能打开
// console.log(fileUrl);
// uni.downloadFile({
// url: fileUrl,
// success: function(res) {
// var filePath = res.tempFilePath;
// uni.openDocument({
// filePath: filePath,
// success: function(res) {
// console.log('打开文档成功');
// }
// });
// }
// });
// } else if (platform == 'android') {
// //插件地址:https://ext.dcloud.net.cn/plugin?id=1314
// const office = uni.requireNativePlugin('Jiang-OfficeView');
// office.open({
// url: fileUrl,
// topBarColor: '#3394EC',
// title: 'Xls文档',
// fileType: 'xls'
// }, result => {
// if (result.code == 1) {
// }
// });
// }
// #ifdef H5
//插件地址:https://ext.dcloud.net.cn/plugin?id=1314
//console.log('2222222222222222222');
const office = uni.requireNativePlugin('Jiang-OfficeView');
office.open({
url: fileUrl,
topBarColor: '#3394EC',
title: 'Xls文档',
fileType: 'xls'
}, result => {
if (result.code == 1) {
}
});
// #endif
uni.showLoading({
title: '加载中...'
})
//腾讯TBS浏览器
uni.downloadFile({
url: encodeURI(fileUrl),
success: function(res) {
var filePath = res.tempFilePath;
console.log("11111111111111111111111111111"+JSON.stringify(res))
if (uni.getSystemInfoSync().platform == 'android') {
const docPreview = uni.requireNativePlugin('Dasu-doc_preview');
console.log(plus.io.convertLocalFileSystemURL(filePath))
docPreview.openDoc(plus.io.convertLocalFileSystemURL(filePath))
// alert(plus.io.convertLocalFileSystemURL(filePath));
uni.hideLoading()
if(biaoshi===1){
_that.updateReads(pid);
}
else{
_that.updateNoticeReads(pid);
}
} else {
uni.openDocument({
filePath: filePath,
success: function(res) {
console.log('打开文档成功');
uni.hideLoading()
if(biaoshi===1){
_that.updateReads(pid);
}
else{
_that.updateNoticeReads(pid);
}
}
});
}
},
fail(e) {
console.log(e)
uni.hideLoading()
},
complete(w) {
console.log(w)
uni.hideLoading()
}
});
},
1***@qq.com (作者)
只能降到上一个版本,不能降到指定版本呀
2021-12-21 09:13
小枫叶
回复 1***@qq.com: 你可以重新从官网下载啊
2021-12-21 11:44