wangxy hace 1 mes
padre
commit
47f4b25c43
Se han modificado 2 ficheros con 15 adiciones y 7 borrados
  1. 10 5
      components/MtaPDF.vue
  2. 5 2
      pages/zsjyShengxue/zsjyShengxue.vue

+ 10 - 5
components/MtaPDF.vue

@@ -5,7 +5,8 @@
 	<uni-popup class="dljt-pdf-popup" ref="popup" type="bottom" background-color="#fff" :mask-click="false" :animation="false">
 		<view class="pdf-popup-box">
 			<uni-nav-bar class="pdf-return-btn" shadow left-icon="left" title="PDF预览" @clickLeft="handleBack" />
-			<web-view class="dljt-pdf-view" :src="pdfUrl1" v-if="showPdfUrl" ></web-view>
+			<web-view class="dljt-pdf-view" :src="pdfUrl1" v-if="showPdfUrl" >
+			</web-view>
 		</view>
 	</uni-popup>
 
@@ -14,8 +15,9 @@
 <script setup>
 	import {
 		nextTick,
-		ref
+		ref,
 	} from "vue"
+	import {addClassToWebViewIframe}from "@/utils/common.js"
 	const props = defineProps({
 		pdfUrl: {
 			type: String
@@ -25,21 +27,24 @@
 	let pdfUrl1 = '';
 	const popup = ref(null)
 
-  const emits = defineEmits(['showNav'])
+	const emits = defineEmits(['showNav'])
 
 	function handleOpen() {
 		popup.value.open('bottom')
 		pdfUrl1 = `/hybrid/html/web/viewer.html?file=${encodeURIComponent(props.pdfUrl)}`;
 		setTimeout(() => {
 			showPdfUrl.value = true;
-      emits('showNav', false)
+			emits('showNav', false)
+			setTimeout(() => {
+				addClassToWebViewIframe()
+			},10)
 		}, 50)
 	}
 
 	function handleBack() {
 		popup.value.close()
 		showPdfUrl.value = false;
-    emits('showNav', true)
+		emits('showNav', true)
 	}
 </script>
 

+ 5 - 2
pages/zsjyShengxue/zsjyShengxue.vue

@@ -15,7 +15,7 @@
 				<view class="dljt-detail-box">
 					<view class="dljt-editor-box">
 						<view class="dljt-classify-box">
-							<view class="classify-item" v-for="item in data.list" :key="item.title" @click="handleSelect(item)">{{item.title}}</view>
+							<view class="classify-item" :class="{active: data.activeId == item.id}" v-for="item in data.list" :key="item.title" @click="handleSelect(item)">{{item.title}}</view>
 						</view>
 						<!-- 富文本 -->
 						<MtaMpHtml class="dljt-editor-box" :content="data.activeData.content" ></MtaMpHtml>
@@ -67,7 +67,7 @@
 	const data = reactive({
 		list: null,
 		activeId: null,
-		activeData: null
+		activeData: {}
 	})
 
 	onLoad(() => {
@@ -84,6 +84,9 @@
 
 	function handleSelect(item) {
 		data.activeId = item.id;
+		httpApi.getCommonZSJYZhuanyeInfo({id: data.activeId}).then(res => {
+			data.activeData = res.data;
+		})
 	}
 	
 	function handleDownFile(ccite) {