YM
2024-05-29 0787340ac90df571d7be9a405d42d33e53fb251f
src/books/childHealth/view/content/index.vue
@@ -146,6 +146,7 @@
    },
    loadPageList: {
      handler(newVal, oldVal) {
        console.log(newVal, "this.loadPageList");
        setTimeout(() => {
          this.initSwiper();
          this.initViewer();
@@ -201,8 +202,8 @@
    }, 500);
    // 测试页面跳转
    setTimeout(() => {
      this.gotoPage(1, 11);
    // setTimeout(() => {
      // this.gotoPage(1, 15);
      //   setTimeout(() => {
      //     this.renderSign("Note", {
      //       id: "2ACA9359",
@@ -217,7 +218,7 @@
      //       });
      //     }, 2000);
      //   }, 1000);
    }, 1000);
    // }, 1000);
  },
  methods: {
    // 滚动监听
@@ -374,7 +375,7 @@
            return false;
          }
        }
        //observer 观察每个元素,以便在它们进入或离开视窗时触发回调函数。
        // observer 观察每个元素,以便在它们进入或离开视窗时触发回调函数。
        const isObserver = section.getAttribute("observer");
        const isLoadObserver = section.getAttribute("loadObserver");
        if (!isObserver) {
@@ -487,10 +488,8 @@
            "chapter"
          );
          const catalog = catalogDom.getAttribute("num");
          console.log(page, "page", catalog, "catalog");
          let text = null;
          if (target.querySelector("p")) {
            console.log(target.querySelector("p").textContent.substring(0, 20));
            text = target.querySelector("p").textContent.substring(0, 20);
          }
          // 返回页码和章节信息
@@ -513,7 +512,6 @@
          const target = entry.target;
          const page = target.getAttribute("page");
          if (this.loadPageList.indexOf(page) == -1) {
            //
            const catalogDom = this.tool.getParentNodeByClassName(
              target,
              "chapter"