| | |
| | | v-if="showCatalogList.indexOf(2) > -1" |
| | | :showPageList="loadPageList" |
| | | :questionData="questionDataMap" |
| | | :isSearch="isSearch" |
| | | ></chapterOne> |
| | | <chapterTwo |
| | | v-if="showCatalogList.indexOf(3) > -1" |
| | | :showPageList="loadPageList" |
| | | :questionData="questionDataMap" |
| | | :isSearch="isSearch" |
| | | ></chapterTwo> |
| | | <chapterThree |
| | | v-if="showCatalogList.indexOf(4) > -1" |
| | | :showPageList="loadPageList" |
| | | :questionData="questionDataMap" |
| | | :isSearch="isSearch" |
| | | ></chapterThree> |
| | | <chapterFour |
| | | v-if="showCatalogList.indexOf(5) > -1" |
| | | :showPageList="loadPageList" |
| | | :questionData="questionDataMap" |
| | | :isSearch="isSearch" |
| | | ></chapterFour> |
| | | <chapterFive |
| | | v-if="showCatalogList.indexOf(6) > -1" |
| | | :showPageList="loadPageList" |
| | | :questionData="questionDataMap" |
| | | :isSearch="isSearch" |
| | | ></chapterFive> |
| | | <chapterSix |
| | | v-if="showCatalogList.indexOf(7) > -1" |
| | | :showPageList="loadPageList" |
| | | :questionData="questionDataMap" |
| | | :isSearch="isSearch" |
| | | ></chapterSix> |
| | | <chapterSeven |
| | | v-if="showCatalogList.indexOf(8) > -1" |
| | | :showPageList="loadPageList" |
| | | :questionData="questionDataMap" |
| | | :isSearch="isSearch" |
| | | ></chapterSeven> |
| | | <chapterEight |
| | | v-if="showCatalogList.indexOf(9) > -1" |
| | | :showPageList="loadPageList" |
| | | :questionData="questionDataMap" |
| | | :isSearch="isSearch" |
| | | ></chapterEight> |
| | | <chapterNine |
| | | v-if="showCatalogList.indexOf(10) > -1" |
| | | :showPageList="loadPageList" |
| | | :questionData="questionDataMap" |
| | | :isSearch="isSearch" |
| | | ></chapterNine> |
| | | <chapterTen |
| | | v-if="showCatalogList.indexOf(11) > -1" |
| | | :showPageList="loadPageList" |
| | | :questionData="questionDataMap" |
| | | :isSearch="isSearch" |
| | | ></chapterTen> |
| | | <chapterEleven |
| | | v-if="showCatalogList.indexOf(12) > -1" |
| | |
| | | questionDataMap: {}, |
| | | renderSignMap: {}, |
| | | highlightData: null, |
| | | isSearch:false |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | }, |
| | | mounted() { |
| | | // 默认加载章节 |
| | | this.showCatalogList = [1]; |
| | | this.showCatalogList = [8]; |
| | | // 滚动监听节流 |
| | | this.throttledScrollHandler = _.throttle( |
| | | this.scrollFun, |
| | |
| | | const catalog = catalogDom.getAttribute("num"); |
| | | let text = null; |
| | | if (target.querySelector("p")) { |
| | | text = target.querySelector("p").textContent.substring(0, 20); |
| | | text = target.querySelector("p").textContent.substring(0, 50); |
| | | } |
| | | // 返回页码和章节信息 |
| | | if (this.$store.state.qiankun && this.$store.state.qiankun.pageChange) |
| | |
| | | target, |
| | | "chapter" |
| | | ); |
| | | // 添加页码 |
| | | 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 |
| | | ); |
| | | 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; |
| | | } |
| | | console.log("题目", this.questionDataMap); |
| | | } |
| | | } |
| | | } |
| | | // 添加页码 |
| | | this.loadPageList.push(Number(page)); |
| | | // 渲染这一页的标记 |
| | | for (const key in this.renderSignMap) { |
| | | if (this.renderSignMap[key][page]) { |
| | |
| | | propsData: { |
| | | showPageList: [], |
| | | questionData: {}, |
| | | isSearch: true |
| | | }, |
| | | }); |
| | | pageExample.$mount( |
| | |
| | | propsData: { |
| | | showPageList: [pageNum], |
| | | questionData: {}, |
| | | isSearch: true |
| | | }, |
| | | }); |
| | | pageExample.$mount( |