From 08959a2566fcbdc669b26b33e8ff185c556fc6e8 Mon Sep 17 00:00:00 2001
From: 闫增涛 <1829501689@qq.com>
Date: 星期四, 13 六月 2024 20:28:37 +0800
Subject: [PATCH] Merge branch 'master' of http://182.92.203.7:2001/r/testbookLayout

---
 src/books/sportsAndHealth/view/components/index.vue |  118 +++++++++++++++++++++++++++++++++--------------------------
 1 files changed, 66 insertions(+), 52 deletions(-)

diff --git a/src/books/sportsAndHealth/view/components/index.vue b/src/books/sportsAndHealth/view/components/index.vue
index 2348ec2..1629e9a 100644
--- a/src/books/sportsAndHealth/view/components/index.vue
+++ b/src/books/sportsAndHealth/view/components/index.vue
@@ -101,6 +101,7 @@
 </template>
 
 <script>
+import Vue from "vue";
 import front001 from "./front001";
 import ChapterOne from "./chapter001";
 import ChapterTwo from "./testDynaicTable";
@@ -153,11 +154,6 @@
       return this.$store.state.qiankun.scale / 100;
     },
   },
-  provide() {
-    return {
-      changeQuestionData: this.changeQuestionData,
-    };
-  },
   watch: {
     showCatalogList: {
       handler(newVal, oldVal) {
@@ -178,11 +174,19 @@
       },
     },
     loadPageList: {
-      handler() {
+      handler(newVal, oldVal) {
         setTimeout(() => {
           this.initSwiper();
           this.initViewer();
         }, 200);
+      },
+    },
+    pageZoom: {
+      handler(newVal, oldVal) {
+        const scrollBox = (
+          this.container ? this.container : document
+        ).querySelector(".page-main");
+        scrollBox.scrollTop = (scrollBox.scrollTop / oldVal) * newVal;
       },
     },
   },
@@ -245,27 +249,62 @@
 
     // 娴嬭瘯椤甸潰璺宠浆
     // setTimeout(() => {
-    // this.gotoPage(1, 15);
+    // this.gotoPage(1,10);
     //   setTimeout(() => {
-    //     this.renderSign("Note", {
+    //     this.renderSign("Highlight", {
     //       id: "2ACA9359",
-    //       txt: "钀ュ吇绱犲拰鐑噺锛屾墠鑳�",
-    //       page: "100",
+    //       txt: "棰樹竴瀛︿範涓婚涓� 杩愬姩",
+    //       page: "10",
     //       type: "Highlight",
     //       color: "#F5E12A"
     //     });
-    //     setTimeout(() => {
-    //       this.delSign({
-    //         ids: ["2ACA9359"]
-    //       });
-    //     }, 2000);
-    //   }, 1000);
-    // }, 1000);
+    // setTimeout(() => {
+    //   this.delSign({
+    //     ids: ["2ACA9359"]
+    //   });
+    // }, 2000);
+    //   }, 5000);
+
+    // const pageDom = (this.container ? this.container : document)
+    //   .querySelector("#app")
+    //   .querySelectorAll(".page-box");
+    // 妫�绱�
+    // console.log(this.searchTextByPage("淇濇姢鍐呰剰鍣ㄥ畼"), "searchTextByPage");
+    // 妫�绱㈣烦杞�
+    // this.searchItemLocation({
+    //   catalog: 2,
+    //   page: 10,
+    //   txt: " 杩愬姩绯荤粺鏄敱楠ㄣ�侀杩炵粨鍜岄楠艰倢涓夐儴鍒嗙粍鎴愮殑銆傚叏韬殑楠ㄩ�氳繃楠ㄨ繛缁撶粍鎴愪汉浣撻楠硷紙瑙佸浘1-1锛夈�傞楠兼槸浜轰綋鐨勬敮鏋讹紝鍏锋湁淇濇姢鍐呰剰鍣ㄥ畼銆佷緵鑲岃倝闄勭潃鍜屼綔涓鸿倢鑲夎繍鍔ㄧ殑鏉犳潌绛変綔鐢ㄣ�傚湪绁炵粡绯荤粺鐨勬敮閰嶄笅锛岃倢鑲夋敹缂╃壍鍔ㄦ墍闄勭潃鐨勯缁曠潃鍏宠妭杞姩锛屼娇韬綋浜х敓鍚勭鍔ㄤ綔銆傛墍浠ワ紝杩愬姩绯荤粺鍏锋湁杩愬姩銆佹敮鎸佸拰淇濇姢绛夊姛鑳斤紝骞煎勾鏃舵湡鐨勯楠艰繕鍏锋湁閫犺鍔熻兘銆� ",
+    //   txtIndex: 57
+    // });
+    // }, 500);
   },
   methods: {
+    swdtChange(data) {
+      if (this.$store.state.qiankun && this.$store.state.qiankun.chooseWords) {
+        this.$store.state.qiankun.chooseWords({
+          type: data.type,
+          data: data.data,
+        });
+      }
+    },
     changeDomViewer() {
       this.initViewer();
     },
+    // setZoom1() {
+    //   let scale = this.$store.state.qiankun.scale + 10;
+    //   const scrollBox = (
+    //     this.container ? this.container : document
+    //   ).querySelector(".page-main");
+    //   this.$store.commit("setZoom", scale);
+    // },
+    // setZoom2() {
+    //   let scale = this.$store.state.qiankun.scale - 10;
+    //   const scrollBox = (
+    //     this.container ? this.container : document
+    //   ).querySelector(".page-main");
+    //   this.$store.commit("setZoom", scale);
+    // },
     // 婊氬姩鐩戝惉
     scrollFun(event) {
       // 鍒ゆ柇鍚戜笂婊氬姩杩樻槸鍚戜笅婊氬姩
@@ -415,7 +454,6 @@
         }
       }
     },
-
     // 鍒犻櫎鏍囪娓叉煋
     delSign({ ids, type }) {
       if (ids && ids.length) {
@@ -443,7 +481,6 @@
         }
       }
     },
-
     initObservation() {
       const sections = (
         this.container ? this.container : document
@@ -472,7 +509,6 @@
         }
       });
     },
-
     initThemeColor() {
       // 鑾峰彇鍚勭闇�瑕佷富棰樿壊鐨勮妭鐐�
       const colorDom = (
@@ -552,7 +588,15 @@
         }
       });
     },
-
+    getParentWithClass(element, className) {
+      console.log(element, className, "element, className");
+      while (element.parentElement) {
+        element = element.parentElement;
+        if (element.classList.contains(className)) {
+          return element;
+        }
+      }
+    },
     pageChangeCallback(entries, observer) {
       //entries锛氫唬琛ㄨ瀵熷埌鐨勭洰鏍囧厓绱犵殑闆嗗悎銆� observer锛氫唬琛ㄨ瀵熻�呭璞°��
       entries.forEach((entry) => {
@@ -584,7 +628,6 @@
         }
       });
     },
-
     loadPageCallback(entries, observer) {
       entries.forEach(async (entry) => {
         if (entry.isIntersecting) {
@@ -621,7 +664,6 @@
                 }
               }
             }
-
             // 娓叉煋杩欎竴椤电殑鏍囪
             for (const key in this.renderSignMap) {
               if (this.renderSignMap[key][page]) {
@@ -671,7 +713,6 @@
         }
       });
     },
-
     initSwiper() {
       const doms = (
         this.container ? this.container : document
@@ -751,7 +792,6 @@
         });
       }
     },
-
     initViewer() {
       const doms = (
         this.container ? this.container : document
@@ -768,16 +808,6 @@
         });
       }
     },
-
-    swdtChange(data) {
-      if (this.$store.state.qiankun && this.$store.state.qiankun.chooseWords) {
-        this.$store.state.qiankun.chooseWords({
-          type: data.type,
-          data: data.data,
-        });
-      }
-    },
-
     // 鏍规嵁鍏抽敭瀛楀叏鏂囨绱�
     searchTextByPage(keyword) {
       const searchResult = [];
@@ -788,21 +818,6 @@
         ChapterOne,
         ChapterTwo,
         ChapterThree,
-        // ChapterFour,
-        // ChapterFive,
-        // chapterSix,
-        // chapterSeven,
-        // chapterEight,
-        // chapterNine,
-        // chapter010,
-        // chapter011,
-        // chapter012,
-        // chapter013,
-        // chapter014,
-        // chapter015,
-        // chapter016,
-        // chapter017,
-        // chapter018,
       };
       // 閬嶅巻鎵�鏈夌珷鑺傛枃浠�
       for (const key in pageData) {
@@ -894,10 +909,9 @@
         }
       }
       // 杈撳嚭鎼滅储缁撴灉
-      // console.log(searchResult);
+      console.log(searchResult);
       return searchResult;
     },
-
     // 鏍规嵁妫�绱㈢粨鏋滆烦杞搴斾綅缃苟楂樹寒
     searchItemLocation(data) {
       // 璁板綍楂樹寒淇℃伅

--
Gitblit v1.9.1