From 30d147c4c92dbfd5ca1b2f8c24a617dc82d2d25b Mon Sep 17 00:00:00 2001
From: zhongshujie <2862698242@qq.com>
Date: 星期一, 28 四月 2025 18:34:51 +0800
Subject: [PATCH] Merge branch 'master' of http://182.92.203.7:2001/r/testbookLayout

---
 src/books/civilAviation/view/components/index.vue |  144 ++++++++++++++++++++++++++++-------------------
 1 files changed, 85 insertions(+), 59 deletions(-)

diff --git a/src/books/civilAviation/view/components/index.vue b/src/books/civilAviation/view/components/index.vue
index 727a816..07d47d8 100644
--- a/src/books/civilAviation/view/components/index.vue
+++ b/src/books/civilAviation/view/components/index.vue
@@ -3,28 +3,50 @@
     <div id="searchDomBox" style="display: none">
       <div id="searchContent"></div>
     </div>
-    <div class="page-content" :style="{
-      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
+      class="page-content"
+      :style="{
+        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>
 
 <script>
+import Vue from "vue";
 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 chapterfive from "./chapter005.vue";
 import NoteIcon from "@/assets/images/biji.png";
 import _ from "lodash";
 import Swiper from "swiper/bundle";
@@ -54,11 +76,15 @@
   },
   computed: {
     fontSize() {
-      this.transformDom(this.$store.state.qiankun.fontSize)
-      return this.$store.state.qiankun.fontSize ? this.$store.state.qiankun.fontSize : 18;
+      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 ? this.$store.state.qiankun.scale / 100 : 1;
+      return this.$store.state.qiankun.scale
+        ? this.$store.state.qiankun.scale / 100
+        : 1;
     },
   },
   watch: {
@@ -83,7 +109,7 @@
     loadPageList: {
       handler(newVal, oldVal) {
         setTimeout(() => {
-          this.transformDom(this.$store.state.qiankun.fontSize)
+          this.transformDom(this.$store.state.qiankun.fontSize);
           this.initSwiper();
           this.initViewer();
           this.closeAudio();
@@ -97,14 +123,13 @@
           this.container ? this.container : document
         ).querySelector(".page-main");
         scrollBox.scrollTop = (scrollBox.scrollTop / oldVal) * newVal;
-      },
+      }, 
     },
   },
   mounted() {
     // 榛樿鍔犺浇绔犺妭
     this.showCatalogList = [1];
     // 婊氬姩鐩戝惉鑺傛祦
-    debugger
     this.throttledScrollHandler = _.throttle(
       this.scrollFun,
       this.throttleThreshold,
@@ -159,22 +184,22 @@
     }, 500);
 
     // 娴嬭瘯椤甸潰璺宠浆
-    setTimeout(() => {
-      this.gotoPage(6,190);
-    //   setTimeout(() => {
-    //     this.renderSign("Highlight", {
-    //       id: "2ACA9359",
-    //       txt: "棰樹竴瀛︿範涓婚涓� 杩愬姩",
-    //       page: "10",
-    //       type: "Highlight",
-    //       color: "#F5E12A"
-    //     });
     // setTimeout(() => {
-    //   this.delSign({
-    //     ids: ["2ACA9359"]
-    //   });
-    // }, 2000);
-    }, 500);
+    //   this.gotoPage(3, 130);
+      //   setTimeout(() => {
+      //     this.renderSign("Highlight", {
+      //       id: "2ACA9359",
+      //       txt: "棰樹竴瀛︿範涓婚涓� 杩愬姩",
+      //       page: "10",
+      //       type: "Highlight",
+      //       color: "#F5E12A"
+      //     });
+      // setTimeout(() => {
+      //   this.delSign({
+      //     ids: ["2ACA9359"]
+      //   });
+      // }, 2000);
+    // }, 500);
 
     // const pageDom = (this.container ? this.container : document)
     //   .querySelector("#app")
@@ -207,7 +232,7 @@
     // },
     // 婊氬姩鐩戝惉
     scrollFun(event) {
-      this.handleVideoPicture()
+      this.handleVideoPicture();
       // 鍒ゆ柇鍚戜笂婊氬姩杩樻槸鍚戜笅婊氬姩
       if (event.target.scrollTop > this.previousScrollTop) {
         this.getAduio();
@@ -220,7 +245,6 @@
         ) {
           console.log(1);
 
-          debugger
           // 鍒拌揪闃堝��
           if (
             this.showCatalogList[this.showCatalogList.length - 1] <
@@ -451,8 +475,8 @@
           page && pageThemeColor && pageThemeColor[page]
             ? pageThemeColor[page]
             : chapterNum && chapterThemeColor && chapterThemeColor[chapterNum]
-              ? chapterThemeColor[chapterNum]
-              : bookThemeColor;
+            ? chapterThemeColor[chapterNum]
+            : bookThemeColor;
         if (themeColor) {
           domItem.style.color = themeColor;
         }
@@ -469,8 +493,8 @@
           page && pageThemeColor && pageThemeColor[page]
             ? pageThemeColor[page]
             : chapterNum && chapterThemeColor && chapterThemeColor[chapterNum]
-              ? chapterThemeColor[chapterNum]
-              : bookThemeColor;
+            ? chapterThemeColor[chapterNum]
+            : bookThemeColor;
         if (themeColor) {
           domItem.style.backgroundColor = themeColor;
         }
@@ -487,8 +511,8 @@
           page && pageThemeColor && pageThemeColor[page]
             ? pageThemeColor[page]
             : chapterNum && chapterThemeColor && chapterThemeColor[chapterNum]
-              ? chapterThemeColor[chapterNum]
-              : bookThemeColor;
+            ? chapterThemeColor[chapterNum]
+            : bookThemeColor;
         if (themeColor) {
           domItem.style.borderColor = themeColor;
         }
@@ -712,7 +736,7 @@
       let catalogIndex = 0;
       // 鎵�鏈夌珷鑺傜粍浠讹紙姣忔湰涔﹀埗浣滄椂鍗曠嫭閰嶇疆锛�
       const pageData = {
-        pageHeader,
+        pageHeader, 
         chapterOne,
         chapterTwo,
         chapterThree,
@@ -817,7 +841,7 @@
       // 璁板綍楂樹寒淇℃伅
       this.highlightData = data;
       // 璺宠浆
-      this.gotoPage(data.catalog, data.page, () => { });
+      this.gotoPage(data.catalog, data.page, () => {});
     },
     // 椤甸潰鍚戜笅婊氬姩锛岄煶棰戝皬绐楁挱鏀惧姛鑳�
     getAduio() {
@@ -908,34 +932,36 @@
     },
     // 瑙嗛灏忕獥
     handleVideoPicture() {
-      let doms = (
-        this.container ? this.container : document
-      ).querySelectorAll(".video");
-      doms = Array.from(doms)
-      if (!doms.length) return false
-      const playVudio = doms
-        .reverse()
-        .find((item) => item.paused == false);
+      let doms = (this.container ? this.container : document).querySelectorAll(
+        ".video"
+      );
+      doms = Array.from(doms);
+      if (!doms.length) return false;
+      const playVudio = doms.reverse().find((item) => item.paused == false);
       if (playVudio) {
         const bottomGap = playVudio.getBoundingClientRect().bottom;
         const topGap = playVudio.getBoundingClientRect().top;
         if (bottomGap < 0 || topGap > window.innerHeight) {
-          playVudio.requestPictureInPicture();
+          try {
+            if (playVudio.readyState) playVudio.requestPictureInPicture();
+          } catch (error) {
+            console.log(error, "灏忕獥閿欒error");
+          }
         }
       }
     },
     //鍏朵粬绫诲悕涓嬪瓧浣撳ぇ灏忓彉鍖�
     transformDom(fs) {
-      if(!fs) return
-      let doms = (
-        this.container ? this.container : document
-      ).querySelectorAll('.block')
-      if(!doms.length) return 
+      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'
+        dom.style.fontSize = fs + "px";
       }
-    }
+    },
   },
   components: {
     pageHeader,

--
Gitblit v1.9.1