| | |
| | | |
| | | // 测试页面跳转 |
| | | // setTimeout(() => { |
| | | // this.gotoPage(6,206); |
| | | // this.gotoPage(2,22); |
| | | // // setTimeout(() => { |
| | | // // this.renderSign("Highlight", { |
| | | // // id: "2ACA9359", |
| | |
| | | // 滚动监听 |
| | | scrollFun(event) { |
| | | this.handleVideoPicture(); |
| | | |
| | | // 判断向上滚动还是向下滚动 |
| | | if (event.target.scrollTop > this.previousScrollTop) { |
| | | // 向下 |
| | |
| | | }); |
| | | }, |
| | | getParentWithClass(element, className) { |
| | | console.log(element, className, "element, className"); |
| | | while (element.parentElement) { |
| | | element = element.parentElement; |
| | | if (element.classList.contains(className)) { |
| | |
| | | this.questionDataMap[page] = obj; |
| | | } |
| | | } |
| | | console.log(1, this.questionDataMap); |
| | | } |
| | | } |
| | | // 渲染这一页的标记 |
| | |
| | | ]; |
| | | if (this.questionId) { |
| | | if (this.questionId[num] && this.questionId[num][page]) { |
| | | if (num != this.questionDataIndex) { |
| | | if (num != this.questionDataIndex || !this.questionList.length) { |
| | | // 判断当前章节的题目json是否已经请求过 |
| | | const res = await axios.get( |
| | | this.config.activeBook.resourceUrl + "/question-" + num + ".json" |
| | |
| | | if (!res.data) return []; |
| | | this.questionList = res.data.data; |
| | | this.questionDataIndex = res.data.chapterNum; |
| | | console.log("章节号", num, res); |
| | | } |
| | | let ids = []; |
| | | questionIndex |