QYF-GitLab1
16 小时以前 b5d1cc7fde9823f39c0c9595f21c7aee2582ac59
src/books/preschoolEvaluation/view/components/index.vue
@@ -1,59 +1,40 @@
<template>
    <div class="page-main" @scroll="throttledScrollHandler">
      <div id="searchDomBox" style="display: none">
        <div id="searchContent"></div>
      </div>
      <div
        class="page-content"
        :style="{
    <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>
        <chapterSix v-if="showCatalogList.indexOf(7) > -1"
          :showPageList="loadPageList" >
    }">
      <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>
      <chapterSix v-if="showCatalogList.indexOf(7) > -1" :showPageList="loadPageList">
        </chapterSix>
        <chapterSeven  v-if="showCatalogList.indexOf(8) > -1"
          :showPageList="loadPageList" >
        </chapterSeven> -->
      <chapterSeven v-if="showCatalogList.indexOf(8) > -1" :showPageList="loadPageList">
      </chapterSeven>
      <chapterEight v-if="showCatalogList.indexOf(9) > -1" :showPageList="loadPageList"></chapterEight>
      <chapterNine v-if="showCatalogList.indexOf(10) > -1" :showPageList="loadPageList"></chapterNine>
      <chapterTen  v-if="showCatalogList.indexOf(11) > -1" :showPageList="loadPageList"></chapterTen>
      </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 chapterSix from "./chapter006.vue";
//   import chapterSeven from "./chapter007.vue";
import chapterTwo from "./chapter002.vue";
import chapterThree from "./chapter003.vue";
import chapterFour from "./chapter004.vue";
import chapterFive from "./chapter005.vue";
import chapterSix from "./chapter006.vue";
import chapterSeven from "./chapter007.vue";
import chapterEight from "./chapter008.vue"
import chapterNine from "./chapter009.vue"
import chapterTen from "./chapter010.vue"
  import NoteIcon from "@/assets/images/biji.png";
  import _ from "lodash";
  import Swiper from "swiper/bundle";
@@ -64,7 +45,7 @@
    name: "pageContent",
    data() {
      return {
        catalogLength: 2, // 总章节数
      catalogLength: 11, // 总章节数
        showCatalogList: [], // 显示的章节
        loadThreshold: 300, // 触发加载阈值
        throttleThreshold: 100, // 节流阈值
@@ -745,12 +726,15 @@
        const pageData = {
          pageHeader,
          chapterOne,
        //   chapterTwo,
        //   chapterThree,
        //   chapterFour,
        //   chapterFive,
        //   chapterSix,
        //   chapterSeven
        chapterTwo,
        chapterThree,
        chapterFour,
        chapterFive,
        chapterSix,
        chapterSeven,
        chapterEight,
        chapterNine,
        chapterTen
        };
        // 遍历所有章节文件
        for (const key in pageData) {
@@ -952,7 +936,11 @@
          const topGap = playVudio.getBoundingClientRect().top;
          if (bottomGap < 0 || topGap > window.innerHeight) {
            try {
              if (playVudio.readyState) playVudio.requestPictureInPicture();
            if (playVudio.readyState) {
              setTimeout(()=>{
                playVudio.requestPictureInPicture();
              },0)
            }
            } catch (error) {
              console.log(error, "小窗错误error");
            }
@@ -975,12 +963,15 @@
    components: {
      pageHeader,
      chapterOne,
    //   chapterTwo,
    //   chapterThree,
    //   chapterFour,
    //   chapterFive,
    //   chapterSix,
    //   chapterSeven
    chapterTwo,
    chapterThree,
    chapterFour,
    chapterFive,
    chapterSix,
    chapterSeven,
    chapterEight,
    chapterNine,
    chapterTen
    },
  };
  </script>
@@ -988,7 +979,7 @@
  <style lang="less" scoped>
  .page-main {
    width: 100% !important;
    // height: 100% !important;
  height: 100% !important;
    overflow: auto;
  
    .page-content {
@@ -999,4 +990,3 @@
    }
  }
  </style>