From a31c8c9d7df2883b38871819239ec914c6e5ae0c Mon Sep 17 00:00:00 2001
From: zhongshujie <2862698242@qq.com>
Date: 星期一, 23 十二月 2024 11:55:58 +0800
Subject: [PATCH] 民航服务基本技能视频资源插入

---
 src/books/civilAviation/view/components/index.vue |   54 +++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 41 insertions(+), 13 deletions(-)

diff --git a/src/books/civilAviation/view/components/index.vue b/src/books/civilAviation/view/components/index.vue
index b7efa64..c1513fb 100644
--- a/src/books/civilAviation/view/components/index.vue
+++ b/src/books/civilAviation/view/components/index.vue
@@ -1,15 +1,19 @@
 <template>
-  <div class="page-main"  @scroll="throttledScrollHandler">
+  <div class="page-main" @scroll="throttledScrollHandler">
     <div id="searchDomBox" style="display: none">
       <div id="searchContent"></div>
     </div>
     <div class="page-content" :style="{
-      fontSize: fontSize ? fontSize + 'px' : '16px',
-      transform: `scale(${pageZoom ? pageZoom : 1})`,
+      fontSize: fontSize + 'px',
+      transform: `scale(${pageZoom})`,
       transformOrigin: 'center top',
     }">
       <pageHeader v-if="showCatalogList.indexOf(1) > -1" :showPageList="loadPageList"></pageHeader>
       <chapterOne v-if="showCatalogList.indexOf(2) > -1" :showPageList="loadPageList"></chapterOne>
+      <chapterTwo v-if="showCatalogList.indexOf(3) > -1" :showPageList="loadPageList"></chapterTwo>
+      <chapterThree v-if="showCatalogList.indexOf(4) > -1" :showPageList="loadPageList"></chapterThree>
+      <chapterfour v-if="showCatalogList.indexOf(5) > -1" :showPageList="loadPageList"></chapterfour>
+      <chapterfive v-if="showCatalogList.indexOf(6) > -1" :showPageList="loadPageList"></chapterfive>
     </div>
   </div>
 </template>
@@ -17,6 +21,10 @@
 <script>
 import pageHeader from "./header.vue";
 import chapterOne from "./chapter001.vue";
+import chapterTwo from "./chapter002.vue";
+import chapterThree from "./chapter003.vue";
+import chapterfour from "./chapter004.vue";
+import chapterfive from "./chapter005.vue"
 import NoteIcon from "@/assets/images/biji.png";
 import _ from "lodash";
 import Swiper from "swiper/bundle";
@@ -27,7 +35,7 @@
   name: "pageContent",
   data() {
     return {
-      catalogLength: 2, // 鎬荤珷鑺傛暟
+      catalogLength: 6, // 鎬荤珷鑺傛暟
       showCatalogList: [], // 鏄剧ず鐨勭珷鑺�
       loadThreshold: 300, // 瑙﹀彂鍔犺浇闃堝��
       throttleThreshold: 100, // 鑺傛祦闃堝��
@@ -46,10 +54,11 @@
   },
   computed: {
     fontSize() {
-      return this.$store.state.qiankun.fontSize;
+      this.transformDom(this.$store.state.qiankun.fontSize)
+      return this.$store.state.qiankun.fontSize ? this.$store.state.qiankun.fontSize : 18;
     },
     pageZoom() {
-      return this.$store.state.qiankun.scale / 100;
+      return this.$store.state.qiankun.scale ? this.$store.state.qiankun.scale / 100 : 1;
     },
   },
   watch: {
@@ -74,6 +83,7 @@
     loadPageList: {
       handler(newVal, oldVal) {
         setTimeout(() => {
+          this.transformDom(this.$store.state.qiankun.fontSize)
           this.initSwiper();
           this.initViewer();
           this.closeAudio();
@@ -149,8 +159,8 @@
     }, 500);
 
     // 娴嬭瘯椤甸潰璺宠浆
-    // setTimeout(() => {
-    //   this.gotoPage(6, 30);
+    setTimeout(() => {
+      this.gotoPage(3,52);
     //   setTimeout(() => {
     //     this.renderSign("Highlight", {
     //       id: "2ACA9359",
@@ -164,7 +174,7 @@
     //     ids: ["2ACA9359"]
     //   });
     // }, 2000);
-    // }, 500);
+    }, 500);
 
     // const pageDom = (this.container ? this.container : document)
     //   .querySelector("#app")
@@ -199,8 +209,6 @@
     scrollFun(event) {
       this.handleVideoPicture()
       // 鍒ゆ柇鍚戜笂婊氬姩杩樻槸鍚戜笅婊氬姩
-      console.log(11);
-      
       if (event.target.scrollTop > this.previousScrollTop) {
         this.getAduio();
         // 鍚戜笅
@@ -211,7 +219,7 @@
           event.target.scrollHeight - this.loadThreshold
         ) {
           console.log(1);
-          
+
           debugger
           // 鍒拌揪闃堝��
           if (
@@ -706,6 +714,10 @@
       const pageData = {
         pageHeader,
         chapterOne,
+        chapterTwo,
+        chapterThree,
+        chapterfour,
+        chapterfive,
       };
       // 閬嶅巻鎵�鏈夌珷鑺傛枃浠�
       for (const key in pageData) {
@@ -908,14 +920,30 @@
         const bottomGap = playVudio.getBoundingClientRect().bottom;
         const topGap = playVudio.getBoundingClientRect().top;
         if (bottomGap < 0 || topGap > window.innerHeight) {
-          playVudio.requestPictureInPicture();
+          if(playVudio.readyState) playVudio.requestPictureInPicture();
         }
+      }
+    },
+    //鍏朵粬绫诲悕涓嬪瓧浣撳ぇ灏忓彉鍖�
+    transformDom(fs) {
+      if(!fs) return
+      let doms = (
+        this.container ? this.container : document
+      ).querySelectorAll('.block')
+      if(!doms.length) return 
+      for (let index = 0; index < doms.length; index++) {
+        const dom = doms[index];
+        dom.style.fontSize = fs + 'px'
       }
     }
   },
   components: {
     pageHeader,
     chapterOne,
+    chapterTwo,
+    chapterThree,
+    chapterfour,
+    chapterfive,
   },
 };
 </script>

--
Gitblit v1.9.1