| | |
| | | |
| | | // 测试页面跳转 |
| | | // setTimeout(() => { |
| | | // this.gotoPage(8,233); |
| | | // this.gotoPage(4,87); |
| | | // setTimeout(() => { |
| | | // this.renderSign("Highlight", { |
| | | // id: "2ACA9359", |
| | |
| | | // }, |
| | | // 滚动监听 |
| | | scrollFun(event) { |
| | | // 视频小窗方法 |
| | | this.handleVideoPicture() |
| | | // 判断向上滚动还是向下滚动 |
| | | if (event.target.scrollTop > this.previousScrollTop) { |
| | | // 向下 |
| | |
| | | if (testData && testData[catalog]) { |
| | | if (testData[catalog][page]) { |
| | | if (Array.isArray(testData[catalog][page])) { |
| | | this.questionDataMap[page] = await getQuestionList( |
| | | const datas = await getQuestionList( |
| | | page, |
| | | testData[catalog][page], |
| | | this.config.activeBook |
| | | ); |
| | | this.$set(this.questionDataMap,page,datas) |
| | | } else { |
| | | const obj = {}; |
| | | for (let key in testData[catalog][page]) { |
| | |
| | | this.config.activeBook |
| | | ); |
| | | } |
| | | this.questionDataMap[page] = obj; |
| | | this.$set(this.questionDataMap,page,obj) |
| | | // this.questionDataMap[page] = obj; |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | // 视频小窗 |
| | | handleVideoPicture() { |
| | | let doms = ( |
| | | this.container ? this.container : document |
| | | ).querySelectorAll(".video"); |
| | | doms = Array.from(doms) |
| | | if(!doms.length) return false |
| | | const playVudio = doms |
| | | .reverse() |
| | | .find((item) => item.paused == false); |
| | | if(playVudio) { |
| | | const bottomGap = playVudio.getBoundingClientRect().bottom; |
| | | const topGap = playVudio.getBoundingClientRect().top; |
| | | if (bottomGap < 0 || topGap > window.innerHeight) { |
| | | playVudio.requestPictureInPicture(); |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | components: { |