From 6565078d7af60fe9496a43a7d3d9bf00f92f0531 Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期四, 11 七月 2024 17:38:37 +0800 Subject: [PATCH] 图书bug修改 --- src/books/artAndDance/view/components/index.vue | 120 ++++++++++++++++++++++++++++++------------------------------ 1 files changed, 60 insertions(+), 60 deletions(-) diff --git a/src/books/artAndDance/view/components/index.vue b/src/books/artAndDance/view/components/index.vue index da522a6..9942c6b 100644 --- a/src/books/artAndDance/view/components/index.vue +++ b/src/books/artAndDance/view/components/index.vue @@ -25,15 +25,15 @@ > </chapterTwo> <chapterThree - v-if="showCatalogList.indexOf(4) > -1" + v-if="showCatalogList.indexOf(4) > -1" :showPageList="loadPageList" ></chapterThree> <chapterFour - v-if="showCatalogList.indexOf(5) > -1" + v-if="showCatalogList.indexOf(5) > -1" :showPageList="loadPageList" ></chapterFour> <chapterFive - v-if="showCatalogList.indexOf(6) > -1" + v-if="showCatalogList.indexOf(6) > -1" :showPageList="loadPageList" ></chapterFive> <chapterSix @@ -54,10 +54,10 @@ import pageHeader from "./header.vue"; import chapterOne from "./chapter001.vue"; import chapterTwo from "./chapter002.vue"; -import chapterThree from "./chapter003.vue" -import chapterFour from './chapter004.vue' -import chapterFive from './chapter005.vue' -import chapterSix from './chapter006.vue' +import chapterThree from "./chapter003.vue"; +import chapterFour from "./chapter004.vue"; +import chapterFive from "./chapter005.vue"; +import chapterSix from "./chapter006.vue"; import NoteIcon from "@/assets/images/biji.png"; import miniAudio from "@/components/miniAudio/index.vue"; import _ from "lodash"; @@ -66,7 +66,7 @@ import Viewer from "viewerjs"; import "viewerjs/dist/viewer.css"; export default { - name:"pageContent", + name: "pageContent", data() { return { catalogLength: 7, // 鎬荤珷鑺傛暟 @@ -191,21 +191,21 @@ // 娴嬭瘯椤甸潰璺宠浆 // setTimeout(() => { - // this.gotoPage(6, 30); - // setTimeout(() => { - // this.renderSign("Highlight", { - // id: "2ACA9359", - // txt: "棰樹竴瀛︿範涓婚涓� 杩愬姩", - // page: "10", - // type: "Highlight", - // color: "#F5E12A" - // }); - // setTimeout(() => { - // this.delSign({ - // ids: ["2ACA9359"] - // }); - // }, 2000); - // }, 500); + // this.gotoPage(6, 29); + // setTimeout(() => { + // this.renderSign("Highlight", { + // id: "2ACA9359", + // txt: "棰樹竴瀛︿範涓婚涓� 杩愬姩", + // page: "10", + // type: "Highlight", + // color: "#F5E12A" + // }); + // setTimeout(() => { + // this.delSign({ + // ids: ["2ACA9359"] + // }); + // }, 2000); + // }, 500); // const pageDom = (this.container ? this.container : document) // .querySelector("#app") @@ -240,7 +240,7 @@ scrollFun(event) { // 鍒ゆ柇鍚戜笂婊氬姩杩樻槸鍚戜笅婊氬姩 if (event.target.scrollTop > this.previousScrollTop) { - this.getAduio() + this.getAduio(); // 鍚戜笅 const currentScrollTop = event.target.scrollTop + event.target.offsetHeight; @@ -264,7 +264,7 @@ } } } else if (event.target.scrollTop < this.previousScrollTop) { - this.handleAudio() + this.handleAudio(); // 鍚戜笂 const currentScrollTop = event.target.scrollTop; if (currentScrollTop <= this.loadThreshold) { @@ -343,7 +343,10 @@ this.container ? this.container : document ).querySelector(`[page="${data.page}"]`); // 鍒涘缓 createTreeWalker 杩唬鍣紝鐢ㄤ簬閬嶅巻鏂囨湰鑺傜偣锛屼繚瀛樺埌涓�涓暟缁� - const treeWalker = document.createTreeWalker(pageDom, NodeFilter.SHOW_TEXT); + const treeWalker = document.createTreeWalker( + pageDom, + NodeFilter.SHOW_TEXT + ); const allTextNodes = []; let currentNode = treeWalker.nextNode(); while (currentNode) { @@ -608,7 +611,10 @@ // 楂樹寒琛� setTimeout(() => { // 鑾峰彇椤甸潰鎵�鏈塼ext鑺傜偣 - const pageTextList = document.createTreeWalker(target, NodeFilter.SHOW_TEXT); + const pageTextList = document.createTreeWalker( + target, + NodeFilter.SHOW_TEXT + ); // 鍖归厤鍏抽敭瀛� const allPageTextNodes = []; let currentNode = pageTextList.nextNode(); @@ -652,19 +658,15 @@ autoplay: { //鑷姩寮�濮� delay: 3000, //鏃堕棿闂撮殧 - disableOnInteraction: false //*鎵嬪姩鎿嶄綔杞挱鍥惧悗涓嶄細鏆傚仠* + disableOnInteraction: false, //*鎵嬪姩鎿嶄綔杞挱鍥惧悗涓嶄細鏆傚仠* }, paginationClickable: true, slidesPerView: 1, // 涓�缁勪笁涓� spaceBetween: 30, // 闂撮殧 // 濡傛灉闇�瑕佸墠杩涘悗閫�鎸夐挳 navigation: { - nextEl: dom.querySelector( - ".swiper-button-next" - ), - prevEl: dom.querySelector( - ".swiper-button-prev" - ) + nextEl: dom.querySelector(".swiper-button-next"), + prevEl: dom.querySelector(".swiper-button-prev"), }, // 绐楀彛鍙樺寲,閲嶆柊init,閽堝F11鍏ㄥ睆鍜屾斁澶х缉灏�,蹇呴』鍔� // observer: true, @@ -691,12 +693,8 @@ spaceBetween: 30, // 闂撮殧 // 濡傛灉闇�瑕佸墠杩涘悗閫�鎸夐挳 navigation: { - nextEl: dom.querySelector( - ".swiper-button-next" - ), - prevEl: dom.querySelector( - ".swiper-button-prev" - ) + nextEl: dom.querySelector(".swiper-button-next"), + prevEl: dom.querySelector(".swiper-button-prev"), }, // 绐楀彛鍙樺寲,閲嶆柊init,閽堝F11鍏ㄥ睆鍜屾斁澶х缉灏�,蹇呴』鍔� observer: true, @@ -715,8 +713,8 @@ var paginationInfoEl = dom.querySelector(".pageBox"); if (paginationInfoEl) paginationInfoEl.textContent = currentPage + "/" + totalPages; - } - } + }, + }, }); } }, @@ -760,7 +758,7 @@ propsData: { showPageList: [], questionData: {}, - isSearch: true + isSearch: true, }, }); pageExample.$mount( @@ -792,7 +790,7 @@ propsData: { showPageList: [pageNum], questionData: {}, - isSearch: true + isSearch: true, }, }); pageExample.$mount( @@ -806,7 +804,10 @@ .querySelector(`[page="${pageNum}"]`); if (thisPageDom) { // 鑾峰彇椤甸潰鎵�鏈塼ext鑺傜偣 - const pageTextList = document.createTreeWalker(thisPageDom, NodeFilter.SHOW_TEXT); + const pageTextList = document.createTreeWalker( + thisPageDom, + NodeFilter.SHOW_TEXT + ); // 鍖归厤鍏抽敭瀛� const allPageTextNodes = []; let currentNode = pageTextList.nextNode(); @@ -847,7 +848,7 @@ // 璺宠浆 this.gotoPage(data.catalog, data.page, () => {}); }, - // 椤甸潰鍚戜笅婊氬姩锛岄煶棰戝皬绐楁挱鏀惧姛鑳� + // 椤甸潰鍚戜笅婊氬姩锛岄煶棰戝皬绐楁挱鏀惧姛鑳� getAduio() { let allVideo = ( this.container ? this.container : document @@ -903,17 +904,16 @@ ).querySelectorAll(".audio"); for (let index = 0; index < allAudio.length; index++) { const item = allAudio[index]; - item.addEventListener('play',() => { + item.addEventListener("play", () => { const audioList = Array.from(allAudio); - for (let cindex = 0; cindex < audioList.length; cindex++) { + for (let cindex = 0; cindex < audioList.length; cindex++) { const citem = audioList[cindex]; - if(citem.currentSrc != item.src) { - citem.pause() - + if (citem.currentSrc != item.src) { + citem.pause(); } } - this.closeMiniAudio() - }) + this.closeMiniAudio(); + }); } }, // 鐐瑰嚮瑙嗛鍏抽棴鍏朵粬 @@ -923,18 +923,18 @@ ).querySelectorAll(".video"); for (let index = 0; index < allVideo.length; index++) { const item = allVideo[index]; - item.addEventListener('playing',(item) => { - const path = item.srcElement.src + 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() + if (citem.currentSrc != path && path) { + citem.pause(); } } - }) + }); } - } + }, }, components: { pageHeader, @@ -944,7 +944,7 @@ chapterFour, chapterFive, chapterSix, - miniAudio + miniAudio, }, }; </script> -- Gitblit v1.9.1