Jelajahi Sumber

材料审核预览

liurongli 1 bulan lalu
induk
melakukan
ed519fc794

+ 14 - 7
pages/materialCollection/reviewMaterial/auditResult.vue

@@ -115,20 +115,27 @@
 			})
 			// #endif
 			// #ifdef APP-PLUS
-			if(docType == 'pptx'){
-				ssdownload?.value?.toDownload({
-					type:'2',
-					src:state.fileContent.filePath,
-					fileName:state.fileContent.fileName
-				});
-			}else{
+			if(docType != 'pptx'){
 				nextTick(()=>{
 					appPreviewOfficeRef.value && appPreviewOfficeRef.value.open();
 				})
+			}else{
+				appPreviewOfficeRef.value && appPreviewOfficeRef.value.close();
 			}
 			// #endif
+		}else{
+			webPreviewFile.value && webPreviewFile.value.close();
+			appPreviewOfficeRef.value && appPreviewOfficeRef.value.close();
 		}
 	}
+	//下载
+	const ToDownloadFile = () => {
+		ssdownload?.value?.toDownload({
+			type:'2',
+			src:state.fileContent.filePath,
+			fileName:state.fileContent.fileName
+		});
+	}
 	//通过
 	const HandlePassHonor = () => {
 		if(state.taskStatus==2 || (state.taskStatus==1 && state.reviewStatus == 1)){

+ 18 - 4
uni_modules/cjx-previewOffice/components/cjx-previewOffice/cjx-previewOffice.vue

@@ -91,13 +91,17 @@ const open = () => {
 	// console.log(11, uni.getSystemInfoSync())
 	const { statusBarHeight, windowHeight, screenHeight } = uni.getSystemInfoSync()
 	pagesHeight.value = Number(windowHeight) - Number(statusBarHeight) + 'px'
-	console.log(windowHeight,windowHeight,windowHeight - statusBarHeight)
+	let headerFootHeight = 44;
+	if(!props.showCloseBtn){
+		headerFootHeight = rpxToPx(220) + rpxToPx(170)
+	}
+	
 	webview = plus.webview.create(
 		`${typeMapSrc[props.type]}${encodeURIComponent(props.value)}&safeBottom=${safeBottom.value}`,
 		'id', 
 		{ 
-			bottom: 0,
-			height: windowHeight - statusBarHeight - 44,
+			bottom: !props.showCloseBtn?rpxToPx(170):0,
+			height: windowHeight - statusBarHeight - headerFootHeight,
 		},
 
 	); 
@@ -109,7 +113,10 @@ const open = () => {
 	webview.show('id', 'slide-in-bottom')
 	// #endif
 }
-
+const rpxToPx = (rpx)=> {
+	const sys = uni.getSystemInfoSync()
+	return rpx * sys.screenWidth / 750
+}
 const close = () => {
 	
 	pagesHeight.value = '0'
@@ -188,6 +195,13 @@ onMounted(() => {
 				position: static;
 				height: 100% !important;
 			}
+			.webview{
+				height: 100% !important;
+			}
+			.cjx-previewOffice-iframe{
+				top:0 !important;
+				height: 100% !important;
+			}
 			.cjx-previewOffice-mask{
 				display: none;
 			}