From 96db8c34de3369f38873fca703a1d7dd6397ce33 Mon Sep 17 00:00:00 2001 From: zhongshujie <2862698242@qq.com> Date: 星期一, 29 七月 2024 16:05:37 +0800 Subject: [PATCH] Merge branch 'master' of http://182.92.203.7:2001/r/testbookLayout --- src/books/sportsAndHealth/view/components/index.vue | 92 +++++++++++++++++++++++++-------------------- 1 files changed, 51 insertions(+), 41 deletions(-) diff --git a/src/books/sportsAndHealth/view/components/index.vue b/src/books/sportsAndHealth/view/components/index.vue index e9e0093..cba2248 100644 --- a/src/books/sportsAndHealth/view/components/index.vue +++ b/src/books/sportsAndHealth/view/components/index.vue @@ -8,24 +8,13 @@ transform: `scale(${pageZoom ? pageZoom : 1})`, transformOrigin: 'center top', }"> - - - - - - <ChapterOne v-if="showCatalogList.indexOf(1) > -1" :showPageList="loadPageList"></ChapterOne> - <ChapterTwo v-if="showCatalogList.indexOf(2) > -1" :showPageList="loadPageList"></ChapterTwo> - - - - - - - - - <ChapterThree v-if="showCatalogList.indexOf(3) > -1" :showPageList="loadPageList"></ChapterThree> - <assemblyOne v-if="showCatalogList.indexOf(4) > -1" :showPageList="loadPageList"></assemblyOne> - <assemblyTwo v-if="showCatalogList.indexOf(5) > -1" :showPageList="loadPageList" @openPDFChange="swdtChange" /> + <pageHeader v-if="showCatalogList.indexOf(1) > -1" :showPageList="loadPageList"></pageHeader> + <chapterOne v-if="showCatalogList.indexOf(2) > -1" :showPageList="loadPageList"></chapterOne> + <chapterTwo v-if="showCatalogList.indexOf(3) > -1" :showPageList="loadPageList"></chapterTwo> + <chapterThree v-if="showCatalogList.indexOf(4) > -1" :showPageList="loadPageList"></chapterThree> + <chapterFour v-if="showCatalogList.indexOf(5) > -1" :showPageList="loadPageList"></chapterFour> + <assemblyOne v-if="showCatalogList.indexOf(6) > -1" :showPageList="loadPageList"></assemblyOne> + <!-- <assemblyTwo v-if="showCatalogList.indexOf(7) > -1" :showPageList="loadPageList" @openPDFChange="swdtChange" /> --> <!-- <ChapterFour @@ -102,17 +91,14 @@ </template> <script> - - import Vue from "vue"; - -import ChapterOne from "./front001"; -import ChapterTwo from "./chapter001"; -import ChapterThree from "./chapter002"; - - -import assemblyOne from "./testDynaicTable"; -import assemblyTwo from "./testPp"; +import pageHeader from "./front001"; +import chapterOne from "./chapter001.vue"; +import chapterTwo from "./chapter002.vue"; +import chapterThree from "./chapter003.vue"; +import chapterFour from "./chapter004.vue"; +import assemblyOne from "./testDynaicTable.vue"; +import assemblyTwo from "./testPp.vue"; // import ChapterFour from "./testPp"; // import ChapterFive from "./chapter005"; @@ -140,7 +126,7 @@ export default { data() { return { - catalogLength: 5, // 鎬荤珷鑺傛暟 + catalogLength: 7, // 鎬荤珷鑺傛暟 showCatalogList: [], // 鏄剧ず鐨勭珷鑺� loadThreshold: 300, // 瑙﹀彂鍔犺浇闃堝�� throttleThreshold: 100, // 鑺傛祦闃堝�� @@ -186,6 +172,7 @@ setTimeout(() => { this.initSwiper(); this.initViewer(); + this.readText(); }, 200); }, }, @@ -257,7 +244,7 @@ // 娴嬭瘯椤甸潰璺宠浆 setTimeout(() => { - this.gotoPage(1, 23); + this.gotoPage(4, 127); // setTimeout(() => { // this.renderSign("Highlight", { // id: "2ACA9359", @@ -271,7 +258,7 @@ // ids: ["2ACA9359"] // }); // }, 2000); - // }, 5000); + //}, 5000); // const pageDom = (this.container ? this.container : document) // .querySelector("#app") @@ -822,10 +809,11 @@ // 鎵�鏈夌珷鑺傜粍浠讹紙姣忔湰涔﹀埗浣滄椂鍗曠嫭閰嶇疆锛� const pageData = { - - ChapterOne, - ChapterTwo, - ChapterThree, + pageHeader, + chapterOne, + chapterTwo, + chapterThree, + chapterFour, assemblyOne, assemblyTwo }; @@ -929,14 +917,36 @@ // 璺宠浆 this.gotoPage(data.catalog, data.page, () => { }); }, + readText() { + const doms = ( + this.container ? this.container : document + ).querySelectorAll(".read-aloud"); + for (let index = 0; index < doms.length; index++) { + const dom = doms[index]; + let id = null; + dom.addEventListener("click", (e) => { + if (e.srcElement.nodeName == "svg") { + id = dom.getAttribute("readId") + } else if (e.srcElement.nodeName == "g") { + const svgDom = e.srcElement.parentNode; + id = svgDom.getAttribute("readId"); + } else { + const svgDom = e.srcElement.parentNode.parentNode; + id = svgDom.getAttribute("readId"); + } + const item = (this.container ? this.container : document).querySelector("#" + id).innerText; + console.log(item, 233); + + }) + } + } }, components: { - - - - ChapterOne, - ChapterTwo, - ChapterThree, + pageHeader, + chapterOne, + chapterTwo, + chapterThree, + chapterFour, assemblyOne, assemblyTwo // ChapterFour, -- Gitblit v1.9.1