zhongshujie
4 天以前 20f565e134743664045fc42376ef5acd826acbe3
src/books/preventiveDentistry/view/components/index.vue
@@ -9,32 +9,44 @@
      transformOrigin: 'center top',
    }">
      <pageHeader v-if="showCatalogList.indexOf(1) > -1" :showPageList="loadPageList"></pageHeader>
      <chapterOne v-if="showCatalogList.indexOf(2) > -1" :showPageList="loadPageList" :resourceList="resourceList">
      <chapterOne v-if="showCatalogList.indexOf(2) > -1" :showPageList="loadPageList"
        :getResourceInfo="resourceListFun">
      </chapterOne>
      <chapterTwo v-if="showCatalogList.indexOf(3) > -1" :showPageList="loadPageList" :resourceList="resourceList">
      <chapterTwo v-if="showCatalogList.indexOf(3) > -1" :showPageList="loadPageList"
        :getResourceInfo="resourceListFun">
      </chapterTwo>
      <chapterThree v-if="showCatalogList.indexOf(4) > -1" :showPageList="loadPageList" :resourceList="resourceList">
      <chapterThree v-if="showCatalogList.indexOf(4) > -1" :showPageList="loadPageList"
        :getResourceInfo="resourceListFun">
      </chapterThree>
      <chapterFour v-if="showCatalogList.indexOf(5) > -1" :showPageList="loadPageList" :resourceList="resourceList">
      <chapterFour v-if="showCatalogList.indexOf(5) > -1" :showPageList="loadPageList"
        :getResourceInfo="resourceListFun">
      </chapterFour>
      <chapterFive v-if="showCatalogList.indexOf(6) > -1" :showPageList="loadPageList" :resourceList="resourceList">
      <chapterFive v-if="showCatalogList.indexOf(6) > -1" :showPageList="loadPageList"
        :getResourceInfo="resourceListFun">
      </chapterFive>
      <chapterSix v-if="showCatalogList.indexOf(7) > -1" :showPageList="loadPageList" :resourceList="resourceList">
      <chapterSix v-if="showCatalogList.indexOf(7) > -1" :showPageList="loadPageList"
        :getResourceInfo="resourceListFun">
      </chapterSix>
      <chapterSeven v-if="showCatalogList.indexOf(8) > -1" :showPageList="loadPageList" :resourceList="resourceList">
      <chapterSeven v-if="showCatalogList.indexOf(8) > -1" :showPageList="loadPageList"
        :getResourceInfo="resourceListFun">
      </chapterSeven>
      <chapterEight v-if="showCatalogList.indexOf(9) > -1" :showPageList="loadPageList" :resourceList="resourceList">
      <chapterEight v-if="showCatalogList.indexOf(9) > -1" :showPageList="loadPageList"
        :getResourceInfo="resourceListFun">
      </chapterEight>
      <chapterNine v-if="showCatalogList.indexOf(10) > -1" :showPageList="loadPageList" :resourceList="resourceList">
      <chapterNine v-if="showCatalogList.indexOf(10) > -1" :showPageList="loadPageList"
        :getResourceInfo="resourceListFun">
      </chapterNine>
      <chapterTen v-if="showCatalogList.indexOf(11) > -1" :showPageList="loadPageList" :resourceList="resourceList">
      <chapterTen v-if="showCatalogList.indexOf(11) > -1" :showPageList="loadPageList"
        :getResourceInfo="resourceListFun">
      </chapterTen>
      <chapterEleven v-if="showCatalogList.indexOf(12) > -1" :showPageList="loadPageList" :resourceList="resourceList">
      <chapterEleven v-if="showCatalogList.indexOf(12) > -1" :showPageList="loadPageList"
        :getResourceInfo="resourceListFun">
      </chapterEleven>
      <chapterTwelve v-if="showCatalogList.indexOf(13) > -1" :showPageList="loadPageList" :resourceList="resourceList">
      <chapterTwelve v-if="showCatalogList.indexOf(13) > -1" :showPageList="loadPageList"
        :getResourceInfo="resourceListFun">
      </chapterTwelve>
      <chapterThirteen v-if="showCatalogList.indexOf(14) > -1" :showPageList="loadPageList"
        :resourceList="resourceList">
        :getResourceInfo="resourceListFun">
      </chapterThirteen>
    </div>
  </div>
@@ -81,7 +93,7 @@
      audioPath: "",
      currentTime: null,
      videoList: [],
      resourceList: {},
      resourceList: [],
    };
  },
  computed: {
@@ -112,7 +124,6 @@
        // 启动页码观察
        setTimeout(() => {
          this.initObservation();
          this.initThemeColor();
        }, 500);
      },
    },
@@ -124,6 +135,7 @@
          this.initViewer();
          this.closeAudio();
          this.closeVideo();
          this.initThemeColor();
        }, 200);
      },
    },
@@ -142,6 +154,8 @@
    },
  },
  mounted() {
    console.log("666");
    // 默认加载章节
    this.showCatalogList = [1];
    // 滚动监听节流
@@ -197,13 +211,12 @@
    // 启动页码观察
    setTimeout(() => {
      this.initObservation();
      this.initThemeColor();
    }, 500);
    // 测试页面跳转
    // setTimeout(() => {
    //   this.gotoPage(14, 196);
    // }, 500);
    setTimeout(() => {
      this.gotoPage(2, 14);
    }, 500);
    // const pageDom = (this.container ? this.container : document)
    //   .querySelector("#app")
@@ -242,6 +255,12 @@
          ? process.env.VUE_APP_BOOK_ID
          : "preventiveDentistry")
      );
      console.log(this.resourceList, "resourceList");
    },
    resourceListFun(id, key) {
      let data = this.resourceList.find(item => item.key == id)
      return key ? data[key] : data
    },
    // 滚动监听
    scrollFun(event) {