From 304689614daa96595aeeeed8e46e5dfa992ef2df Mon Sep 17 00:00:00 2001 From: unknown <qq1940665526@163.com> Date: 星期一, 17 六月 2024 17:33:33 +0800 Subject: [PATCH] 优化 --- src/books/childHealth/view/content/index.vue | 32 ++++++++++++++++++++++++++++---- 1 files changed, 28 insertions(+), 4 deletions(-) diff --git a/src/books/childHealth/view/content/index.vue b/src/books/childHealth/view/content/index.vue index 80a8ec5..cc40f13 100644 --- a/src/books/childHealth/view/content/index.vue +++ b/src/books/childHealth/view/content/index.vue @@ -21,51 +21,61 @@ v-if="showCatalogList.indexOf(2) > -1" :showPageList="loadPageList" :questionData="questionDataMap" + @closeVideo="closeVideo" ></chapterOne> <chapterTwo v-if="showCatalogList.indexOf(3) > -1" :showPageList="loadPageList" :questionData="questionDataMap" + @closeVideo="closeVideo" ></chapterTwo> <chapterThree v-if="showCatalogList.indexOf(4) > -1" :showPageList="loadPageList" :questionData="questionDataMap" + @closeVideo="closeVideo" ></chapterThree> <chapterFour v-if="showCatalogList.indexOf(5) > -1" :showPageList="loadPageList" :questionData="questionDataMap" + @closeVideo="closeVideo" ></chapterFour> <chapterFive v-if="showCatalogList.indexOf(6) > -1" :showPageList="loadPageList" :questionData="questionDataMap" + @closeVideo="closeVideo" ></chapterFive> <chapterSix v-if="showCatalogList.indexOf(7) > -1" :showPageList="loadPageList" :questionData="questionDataMap" + @closeVideo="closeVideo" ></chapterSix> <chapterSeven v-if="showCatalogList.indexOf(8) > -1" :showPageList="loadPageList" :questionData="questionDataMap" + @closeVideo="closeVideo" ></chapterSeven> <chapterEight v-if="showCatalogList.indexOf(9) > -1" :showPageList="loadPageList" :questionData="questionDataMap" + @closeVideo="closeVideo" ></chapterEight> <chapterNine v-if="showCatalogList.indexOf(10) > -1" :showPageList="loadPageList" :questionData="questionDataMap" + @closeVideo="closeVideo" ></chapterNine> <chapterTen v-if="showCatalogList.indexOf(11) > -1" :showPageList="loadPageList" :questionData="questionDataMap" + @closeVideo="closeVideo" ></chapterTen> <chapterEleven v-if="showCatalogList.indexOf(12) > -1" @@ -227,8 +237,8 @@ }, 500); // 娴嬭瘯椤甸潰璺宠浆 - setTimeout(() => { - this.gotoPage(1,10); + // setTimeout(() => { + // this.gotoPage(1,10); // setTimeout(() => { // this.renderSign("Highlight", { // id: "2ACA9359", @@ -242,7 +252,7 @@ // ids: ["2ACA9359"] // }); // }, 2000); - // }, 5000); + // }, 500); // const pageDom = (this.container ? this.container : document) // .querySelector("#app") @@ -256,7 +266,7 @@ // txt: " 杩愬姩绯荤粺鏄敱楠ㄣ�侀杩炵粨鍜岄楠艰倢涓夐儴鍒嗙粍鎴愮殑銆傚叏韬殑楠ㄩ�氳繃楠ㄨ繛缁撶粍鎴愪汉浣撻楠硷紙瑙佸浘1-1锛夈�傞楠兼槸浜轰綋鐨勬敮鏋讹紝鍏锋湁淇濇姢鍐呰剰鍣ㄥ畼銆佷緵鑲岃倝闄勭潃鍜屼綔涓鸿倢鑲夎繍鍔ㄧ殑鏉犳潌绛変綔鐢ㄣ�傚湪绁炵粡绯荤粺鐨勬敮閰嶄笅锛岃倢鑲夋敹缂╃壍鍔ㄦ墍闄勭潃鐨勯缁曠潃鍏宠妭杞姩锛屼娇韬綋浜х敓鍚勭鍔ㄤ綔銆傛墍浠ワ紝杩愬姩绯荤粺鍏锋湁杩愬姩銆佹敮鎸佸拰淇濇姢绛夊姛鑳斤紝骞煎勾鏃舵湡鐨勯楠艰繕鍏锋湁閫犺鍔熻兘銆� ", // txtIndex: 57 // }); - }, 500); + // }, 500); }, methods: { // setZoom1() { @@ -896,6 +906,20 @@ this.highlightData = data; // 璺宠浆 this.gotoPage(data.catalog, data.page, () => {}); + }, + closeVideo(path) { + let allVideo = ( + this.container ? this.container : document + ).querySelectorAll(".video"); + allVideo = Array.from(allVideo); + if(allVideo.length) { + for (let index = 0; index < allVideo.length; index++) { + const item = allVideo[index]; + if(item.currentSrc != path) { + item.pause() + } + } + } } }, components: { -- Gitblit v1.9.1