| | |
| | | setTimeout(() => { |
| | | this.initSwiper(); |
| | | this.initViewer(); |
| | | this.closeVideo() |
| | | }, 200); |
| | | } |
| | | }, |
| | |
| | | |
| | | // 测试页面跳转 |
| | | // setTimeout(() => { |
| | | // this.gotoPage(1,10); |
| | | // this.gotoPage(11,282); |
| | | // setTimeout(() => { |
| | | // this.renderSign("Highlight", { |
| | | // id: "2ACA9359", |
| | |
| | | // ids: ["2ACA9359"] |
| | | // }); |
| | | // }, 2000); |
| | | // }, 5000); |
| | | // }, 500); |
| | | |
| | | // const pageDom = (this.container ? this.container : document) |
| | | // .querySelector("#app") |
| | |
| | | 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; |
| | | } |
| | | } |
| | | } |
| | |
| | | spaceBetween: 30, // 间隔 |
| | | // 如果需要前进后退按钮 |
| | | navigation: { |
| | | nextEl: (this.container ? this.container : document).querySelector( |
| | | nextEl: dom.querySelector( |
| | | ".swiper-button-next" |
| | | ), |
| | | prevEl: (this.container ? this.container : document).querySelector( |
| | | prevEl: dom.querySelector( |
| | | ".swiper-button-prev" |
| | | ) |
| | | }, |
| | |
| | | spaceBetween: 30, // 间隔 |
| | | // 如果需要前进后退按钮 |
| | | navigation: { |
| | | nextEl: (this.container ? this.container : document).querySelector( |
| | | nextEl: dom.querySelector( |
| | | ".swiper-button-next" |
| | | ), |
| | | prevEl: (this.container ? this.container : document).querySelector( |
| | | prevEl: dom.querySelector( |
| | | ".swiper-button-prev" |
| | | ) |
| | | }, |
| | |
| | | this.highlightData = data; |
| | | // 跳转 |
| | | this.gotoPage(data.catalog, data.page, () => {}); |
| | | }, |
| | | // 点击视频关闭其他 |
| | | closeVideo() { |
| | | let allVideo = ( |
| | | this.container ? this.container : document |
| | | ).querySelectorAll(".video"); |
| | | for (let index = 0; index < allVideo.length; index++) { |
| | | const item = allVideo[index]; |
| | | item.addEventListener('playing',(item) => { |
| | | const path = item.srcElement.src |
| | | const videoList = Array.from(allVideo); |
| | | for (let cindex = 0; cindex < videoList.length; cindex++) { |
| | | const citem = videoList[cindex]; |
| | | if(citem.currentSrc != path && path) { |
| | | citem.pause() |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | components: { |