unknown
2024-06-13 c0e4157169e151fe4ada71d3abbd82aa78c4d71e
src/books/sportsAndHealth/view/components/index.vue
@@ -18,23 +18,20 @@
      <ChapterOne
        v-if="showCatalogList.indexOf(2) > -1"
        :showPageList="loadPageList"
        :questionData="questionDataMap"
      />
      <ChapterTwo
        v-if="showCatalogList.indexOf(3) > -1"
        :showPageList="loadPageList"
        :questionData="questionDataMap"
      />
      <ChapterThree
        v-if="showCatalogList.indexOf(4) > -1"
        :showPageList="loadPageList"
        :questionData="questionDataMap"
      />
      <ChapterFour
      <!-- <ChapterFour
        v-if="showCatalogList.indexOf(5) > -1"
        :showPageList="loadPageList"
        :questionData="questionDataMap"
      />
      /> -->
      <!-- <ChapterFive
        v-if="showCatalogList.indexOf(6) > -1"
        :showPageList="loadPageList"
@@ -106,9 +103,9 @@
<script>
import front001 from "./front001";
import ChapterOne from "./chapter001";
import ChapterTwo from "./chapter002";
import ChapterThree from "./testDynaicTable";
import ChapterFour from "./testPp";
import ChapterTwo from "./testDynaicTable";
import ChapterThree from "./testPp";
// import ChapterFour from "./testPp";
// import ChapterFive from "./chapter005";
// import chapterSix from "./chapter006";
// import chapterSeven from "./chapter007";
@@ -191,7 +188,7 @@
  },
  mounted() {
    // 默认加载章节
    this.showCatalogList = [1];
    this.showCatalogList = [4];
    // 滚动监听节流
    this.throttledScrollHandler = _.throttle(
      this.scrollFun,
@@ -267,11 +264,8 @@
  },
  methods: {
    changeDomViewer() {
      setTimeout(() => {
        this.initViewer();
      }, 500);
      this.initViewer();
    },
    // 滚动监听
    scrollFun(event) {
      // 判断向上滚动还是向下滚动
@@ -608,19 +602,19 @@
              if (testData && testData[catalog]) {
                if (testData[catalog][page]) {
                  if (Array.isArray(testData[catalog][page])) {
                      this.questionDataMap[page] = await getQuestionList(
                        page,
                        testData[catalog][page],
                        this.config.activeBook
                      );
                    this.questionDataMap[page] = await getQuestionList(
                      page,
                      testData[catalog][page],
                      this.config.activeBook
                    );
                  } else {
                    const obj = {};
                    for (let key in testData[catalog][page]) {
                          obj[key] = await getQuestionList(
                          [],
                          testData[catalog][page][key],
                          this.config.activeBook
                        );
                      obj[key] = await getQuestionList(
                        [],
                        testData[catalog][page][key],
                        this.config.activeBook
                      );
                    }
                    this.questionDataMap[page] = obj;
                  }
@@ -641,7 +635,10 @@
              // 高亮行
              setTimeout(() => {
                // 获取页面所有text节点
                const pageTextList = document.createTreeWalker(target, NodeFilter.SHOW_TEXT);
                const pageTextList = document.createTreeWalker(
                  target,
                  NodeFilter.SHOW_TEXT
                );
                // 匹配关键字
                const allPageTextNodes = [];
                let currentNode = pageTextList.nextNode();
@@ -791,7 +788,7 @@
        ChapterOne,
        ChapterTwo,
        ChapterThree,
        ChapterFour,
        // ChapterFour,
        // ChapterFive,
        // chapterSix,
        // chapterSeven,
@@ -817,7 +814,7 @@
          propsData: {
            showPageList: [],
            questionData: {},
            isSearch: true
            isSearch: true,
          },
        });
        pageExample.$mount(
@@ -849,7 +846,7 @@
              propsData: {
                showPageList: [pageNum],
                questionData: {},
                isSearch: true
                isSearch: true,
              },
            });
            pageExample.$mount(
@@ -914,7 +911,7 @@
    ChapterOne,
    ChapterTwo,
    ChapterThree,
    ChapterFour,
    // ChapterFour,
    // ChapterFive,
    // chapterSix,
    // chapterSeven,