소스 검색

直接跳转webview打开pdf文件

htc 3 일 전
부모
커밋
de3a9f9878
1개의 변경된 파일13개의 추가작업 그리고 1개의 파일을 삭제
  1. 13 1
      pagesHome/components/report/receiveList.vue

+ 13 - 1
pagesHome/components/report/receiveList.vue

@@ -49,8 +49,20 @@
 			},
 			reviewReport(item){
 				if(!item.fileUrl) return this.$showToast('报告pdf为空,请稍后再试。')
+				// uni.navigateTo({
+				// 	url:`/pagesHome/reportDetail?pdfUrl=${item.fileUrl}&reportId=${item.reportId}&fileName=${this.typeCfg[item.type]||'基础版'}-${item.reportName}`
+				// })
+				// wx.downloadFile({
+				//   url:item.fileUrl,
+				//   success: function (res) {
+				//     const filePath = res.tempFilePath
+				//     wx.openDocument({
+				//       filePath: filePath
+				//     })
+				//   }
+				// })
 				uni.navigateTo({
-					url:`/pagesHome/reportDetail?pdfUrl=${item.fileUrl}&reportId=${item.reportId}&fileName=${this.typeCfg[item.type]||'基础版'}-${item.reportName}`
+					url:'/pages/webView?src='+item.fileUrl
 				})
 			}
 		}