| | |
| | | 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> |
| | | <pageHeader v-if="showCatalogList.indexOf(1) > -1" :showPageList="loadPageList" ></pageHeader> |
| | | <chapterOne v-if="showCatalogList.indexOf(2) > -1" :showPageList="loadPageList" :interfaceQuestion="questionDataMap"></chapterOne> |
| | | <chapterTwo v-if="showCatalogList.indexOf(3) > -1" :showPageList="loadPageList" :interfaceQuestion="questionDataMap"></chapterTwo> |
| | | <chapterThree v-if="showCatalogList.indexOf(4) > -1" :showPageList="loadPageList" :interfaceQuestion="questionDataMap"></chapterThree> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | import chapterTwo from "./chapter002.vue"; |
| | | import chapterThree from "./chapter003.vue"; |
| | | import NoteIcon from "@/assets/images/biji.png"; |
| | | import getQuestionList from "@/assets/methods/examination"; |
| | | import testData from "../../assets/examinationList"; |
| | | import _ from "lodash"; |
| | | import Swiper from "swiper/bundle"; |
| | | import "swiper/swiper-bundle.css"; |
| | |
| | | // 默认加载章节 |
| | | this.showCatalogList = [1]; |
| | | // 滚动监听节流 |
| | | debugger |
| | | // debugger |
| | | this.throttledScrollHandler = _.throttle( |
| | | this.scrollFun, |
| | | this.throttleThreshold, |
| | |
| | | }, 500); |
| | | |
| | | //测试页面跳转 |
| | | // setTimeout(() => { |
| | | // this.gotoPage(2, 15); |
| | | setTimeout(() => { |
| | | this.gotoPage(3, 134); |
| | | // setTimeout(() => { |
| | | // this.renderSign("Highlight", { |
| | | // id: "2ACA9359", |
| | |
| | | // ids: ["2ACA9359"] |
| | | // }); |
| | | // }, 2000); |
| | | // }, 500); |
| | | }, 500); |
| | | |
| | | // const pageDom = (this.container ? this.container : document) |
| | | // .querySelector("#app") |
| | |
| | | ) { |
| | | console.log(1); |
| | | |
| | | debugger |
| | | // debugger |
| | | // 到达阈值 |
| | | if ( |
| | | this.showCatalogList[this.showCatalogList.length - 1] < |
| | |
| | | }); |
| | | }, |
| | | loadPageCallback(entries, observer) { |
| | | // console.log(entries,1234); |
| | | entries.forEach(async (entry) => { |
| | | if (entry.isIntersecting) { |
| | | const target = entry.target; |
| | |
| | | // 添加页码 |
| | | this.loadPageList.push(Number(page)); |
| | | const catalog = catalogDom.getAttribute("num"); |
| | | // if (!this.questionDataMap[page]) { |
| | | // 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 |
| | | // ); |
| | | // } else { |
| | | // const obj = {}; |
| | | // for (let key in testData[catalog][page]) { |
| | | // obj[key] = await getQuestionList( |
| | | // [], |
| | | // testData[catalog][page][key], |
| | | // this.config.activeBook |
| | | // ); |
| | | // } |
| | | // this.questionDataMap[page] = obj; |
| | | // } |
| | | // console.log("题目", this.questionDataMap); |
| | | // } |
| | | // } |
| | | // } |
| | | if (!this.questionDataMap[page]) { |
| | | 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 |
| | | ); |
| | | } else { |
| | | const obj = {}; |
| | | for (let key in testData[catalog][page]) { |
| | | obj[key] = await getQuestionList( |
| | | [], |
| | | testData[catalog][page][key], |
| | | this.config.activeBook |
| | | ); |
| | | } |
| | | this.questionDataMap[page] = obj; |
| | | } |
| | | console.log("题目", this.questionDataMap); |
| | | } |
| | | } |
| | | } |
| | | // 渲染这一页的标记 |
| | | for (const key in this.renderSignMap) { |
| | | if (this.renderSignMap[key][page]) { |
| | |
| | | pageExample = new pageComponent({ |
| | | propsData: { |
| | | showPageList: [], |
| | | questionData: {}, |
| | | interfaceQuestion: {}, |
| | | isSearch: true, |
| | | }, |
| | | }); |
| | |
| | | pageExample = new pageComponent({ |
| | | propsData: { |
| | | showPageList: [pageNum], |
| | | questionData: {}, |
| | | interfaceQuestion: {}, |
| | | isSearch: true, |
| | | }, |
| | | }); |