123456789101112131415161718192021222324252627282930313233343536373839404142 |
- /**
- * 审批模块 公共方法
- */
- // 预览文件
- export const preViewFile=fileurl=>{
- uni.showLoading({
- title:'文件下载中...'
- })
- uni.downloadFile({
- url:fileurl,
- success(res){
- const tempFilePath = res.tempFilePath;
- uni.openDocument({
- filePath:tempFilePath,
- showMenu:true,
- success() {
- console.log('打开成功');
- },
- fail(){
- setTimeout(() => {
- uni.showToast({
- title:'打开失败,请重试',
- icon:"none"
- })
- }, 0);
- }
- })
- },
- fail(){
- setTimeout(() => {
- uni.showToast({
- title:'下载失败,请重试',
- icon:"none"
- })
- }, 0);
- },
- complete(){
- uni.hideLoading()
- }
- })
- }
|