From 66d96053e0283c081b95bed87afa42e837389a7e Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期三, 29 五月 2024 14:24:09 +0800 Subject: [PATCH] swiper --- src/books/childHealth/view/content/index.vue | 42 ++++++++++++++++++++++++------------------ 1 files changed, 24 insertions(+), 18 deletions(-) diff --git a/src/books/childHealth/view/content/index.vue b/src/books/childHealth/view/content/index.vue index 4dd0a6a..125467f 100644 --- a/src/books/childHealth/view/content/index.vue +++ b/src/books/childHealth/view/content/index.vue @@ -9,70 +9,70 @@ }" > <pageHeader - v-if="showCatalogList.indexOf(0) > -1" + v-if="showCatalogList.indexOf(1) > -1" :showPageList="loadPageList" ></pageHeader> <chapterOne - v-if="showCatalogList.indexOf(1) > -1" + v-if="showCatalogList.indexOf(2) > -1" :showPageList="loadPageList" :questionData="questionData" ></chapterOne> <chapterTwo - v-if="showCatalogList.indexOf(2) > -1" + v-if="showCatalogList.indexOf(3) > -1" :showPageList="loadPageList" :questionData="questionData" ></chapterTwo> <chapterThree - v-if="showCatalogList.indexOf(3) > -1" + v-if="showCatalogList.indexOf(4) > -1" :showPageList="loadPageList" :questionData="questionData" ></chapterThree> <chapterFour - v-if="showCatalogList.indexOf(4) > -1" + v-if="showCatalogList.indexOf(5) > -1" :showPageList="loadPageList" :questionData="questionData" ></chapterFour> <chapterFive - v-if="showCatalogList.indexOf(5) > -1" + v-if="showCatalogList.indexOf(6) > -1" :showPageList="loadPageList" :questionData="questionData" ></chapterFive> <chapterSix - v-if="showCatalogList.indexOf(6) > -1" + v-if="showCatalogList.indexOf(7) > -1" :showPageList="loadPageList" :questionData="questionData" ></chapterSix> <chapterSeven - v-if="showCatalogList.indexOf(7) > -1" + v-if="showCatalogList.indexOf(8) > -1" :showPageList="loadPageList" :questionData="questionData" ></chapterSeven> <chapterEight - v-if="showCatalogList.indexOf(8) > -1" + v-if="showCatalogList.indexOf(9) > -1" :showPageList="loadPageList" :questionData="questionData" ></chapterEight> <chapterNine - v-if="showCatalogList.indexOf(9) > -1" + v-if="showCatalogList.indexOf(10) > -1" :showPageList="loadPageList" :questionData="questionData" ></chapterNine> <chapterTen - v-if="showCatalogList.indexOf(10) > -1" + v-if="showCatalogList.indexOf(11) > -1" :showPageList="loadPageList" :questionData="questionData" ></chapterTen> <chapterEleven - v-if="showCatalogList.indexOf(11) > -1" + v-if="showCatalogList.indexOf(12) > -1" :showPageList="loadPageList" :questionData="questionData" ></chapterEleven> <chapterTwelve - v-if="showCatalogList.indexOf(12) > -1" + v-if="showCatalogList.indexOf(13) > -1" :showPageList="loadPageList" ></chapterTwelve> <chapterThirteen - v-if="showCatalogList.indexOf(13) > -1" + v-if="showCatalogList.indexOf(14) > -1" :showPageList="loadPageList" ></chapterThirteen> </div> @@ -143,7 +143,7 @@ }, mounted() { // 榛樿鍔犺浇绔犺妭 - this.showCatalogList = [0]; + this.showCatalogList = [1]; // 婊氬姩鐩戝惉鑺傛祦 this.throttledScrollHandler = _.throttle( this.scrollFun, @@ -314,7 +314,7 @@ // 绗旇 pageDom.innerHTML = pageDom.innerHTML.replace( reg, - `<span datatype="Note" dataid="${data.id}" style="border-bottom-color:${data.color}" class="notesline" onclick="signClick('Note','${data.id}','${data.chapterNum}')" onmouseover="noteHover('Note','${data.id}','${data.chapterNum}')" onmouseout="noteOut">${data.txt}<img src="${NoteIcon}"/></span>` + `<span datatype="Note" dataid="${data.id}" style="border-bottom-color:${data.color}" class="notesline" onclick="signClick('Note','${data.id}','${data.chapterNum}')" onmouseover="noteHover('Note','${data.id}','${data.chapterNum}')" onmouseout="noteOut('Note')">${data.txt}<img src="${NoteIcon}"/></span>` ); break; } @@ -475,12 +475,18 @@ "chapter" ); const catalog = catalogDom.getAttribute("num"); - console.log(page, "page", catalog, "catalog"); + console.log(page, "page", catalog, "catalog",); + let text = null + if(target.querySelector('p')) { + console.log(target.querySelector('p').textContent.substring(0, 20)); + text = target.querySelector('p').textContent.substring(0, 20) + } // 杩斿洖椤电爜鍜岀珷鑺備俊鎭� if (this.$store.state.qiankun && this.$store.state.qiankun.pageChange) this.$store.state.qiankun.pageChange({ page: page, - catalog: catalog + catalog: catalog, + text, }); // const sections = Array.from(document.querySelectorAll(".section")); //sections锛氳幏鍙栨墍鏈夊叿鏈� .section 绫诲悕鐨勫厓绱狅紝骞惰浆鎹负鏁扮粍銆� -- Gitblit v1.9.1