From b25a0073b805e82416934d0f123c10e9063e3c57 Mon Sep 17 00:00:00 2001 From: zhongshujie <2862698242@qq.com> Date: 星期三, 23 七月 2025 10:26:41 +0800 Subject: [PATCH] 婴幼儿运动安全替换 --- src/books/preschoolEvaluation/view/components/index.vue | 163 ++++++++++++++++++++++++++++-------------------------- 1 files changed, 84 insertions(+), 79 deletions(-) diff --git a/src/books/preschoolEvaluation/view/components/index.vue b/src/books/preschoolEvaluation/view/components/index.vue index a98f8db..e016158 100644 --- a/src/books/preschoolEvaluation/view/components/index.vue +++ b/src/books/preschoolEvaluation/view/components/index.vue @@ -1,56 +1,48 @@ <template> <div class="page-main" @scroll="throttledScrollHandler"> - <div - class="page-content" - :style="{ - fontSize: fontSize + 'px', - transform: `scale(${pageZoom})`, - transformOrigin: 'center top', - }" - > - <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> - <chapterFive - v-if="showCatalogList.indexOf(6) > -1" - :showPageList="loadPageList" - ></chapterFive> - <chapterSix v-if="showCatalogList.indexOf(7) > -1" - :showPageList="loadPageList" > - </chapterSix> - <chapterSeven v-if="showCatalogList.indexOf(8) > -1" - :showPageList="loadPageList" > - </chapterSeven> --> + <div class="page-content" :style="{ + fontSize: fontSize + 'px', + transform: `scale(${pageZoom})`, + transformOrigin: 'center top', + }"> + <pageHeader v-if="showCatalogList.indexOf(1) > -1" :showPageList="loadPageList"></pageHeader> + <chapterOne v-if="showCatalogList.indexOf(2) > -1" :showPageList="loadPageList" :resourceList="resourceList"> + </chapterOne> + <chapterTwo v-if="showCatalogList.indexOf(3) > -1" :showPageList="loadPageList" :resourceList="resourceList"> + </chapterTwo> + <chapterThree v-if="showCatalogList.indexOf(4) > -1" :showPageList="loadPageList" :resourceList="resourceList"> + </chapterThree> + <chapterFour v-if="showCatalogList.indexOf(5) > -1" :showPageList="loadPageList" :resourceList="resourceList"> + </chapterFour> + <chapterFive v-if="showCatalogList.indexOf(6) > -1" :showPageList="loadPageList" :resourceList="resourceList"> + </chapterFive> + <chapterSix v-if="showCatalogList.indexOf(7) > -1" :showPageList="loadPageList" :resourceList="resourceList"> + </chapterSix> + <chapterSeven v-if="showCatalogList.indexOf(8) > -1" :showPageList="loadPageList" :resourceList="resourceList"> + </chapterSeven> + <chapterEight v-if="showCatalogList.indexOf(9) > -1" :showPageList="loadPageList" :resourceList="resourceList"> + </chapterEight> + <chapterNine v-if="showCatalogList.indexOf(10) > -1" :showPageList="loadPageList" :resourceList="resourceList"> + </chapterNine> + <chapterTen v-if="showCatalogList.indexOf(11) > -1" :showPageList="loadPageList" :resourceList="resourceList"> + </chapterTen> </div> </div> </template> <script> +import Vue from "vue"; 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 chapterSeven from "./chapter007.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 chapterSeven from "./chapter007.vue"; +import chapterEight from "./chapter008.vue" +import chapterNine from "./chapter009.vue" +import chapterTen from "./chapter010.vue" import NoteIcon from "@/assets/images/biji.png"; import _ from "lodash"; import Swiper from "swiper/bundle"; @@ -61,7 +53,7 @@ name: "pageContent", data() { return { - catalogLength: 2, // 鎬荤珷鑺傛暟 + catalogLength: 11, // 鎬荤珷鑺傛暟 showCatalogList: [], // 鏄剧ず鐨勭珷鑺� loadThreshold: 300, // 瑙﹀彂鍔犺浇闃堝�� throttleThreshold: 100, // 鑺傛祦闃堝�� @@ -76,6 +68,7 @@ audioPath: "", currentTime: null, videoList: [], + resourceList: {}, }; }, computed: { @@ -127,6 +120,11 @@ this.container ? this.container : document ).querySelector(".page-main"); scrollBox.scrollTop = (scrollBox.scrollTop / oldVal) * newVal; + }, + }, + resourceList: { + handler(newVal, oldVal) { + this.resourceList = newVal; }, }, }, @@ -181,6 +179,8 @@ threshold: 0, // 鎸囧畾浜ゅ弶姣斾緥锛岃繖閲岃涓� 0.5锛岃〃绀哄綋鐩爣鍏冪礌涓�鍗婃垨鏇村鏄剧ず鍦ㄨ绐椾腑鏃惰Е鍙戝洖璋冨嚱鏁般�� }); + this.getBookResourceList(); + // 鍚姩椤电爜瑙傚療 setTimeout(() => { this.initObservation(); @@ -189,20 +189,7 @@ // 娴嬭瘯椤甸潰璺宠浆 // setTimeout(() => { - // this.gotoPage(1, 1); - // setTimeout(() => { - // this.renderSign("Highlight", { - // id: "2ACA9359", - // txt: "棰樹竴瀛︿範涓婚涓� 杩愬姩", - // page: "10", - // type: "Highlight", - // color: "#F5E12A" - // }); - // setTimeout(() => { - // this.delSign({ - // ids: ["2ACA9359"] - // }); - // }, 2000); + // this.gotoPage(4, 68); // }, 500); // const pageDom = (this.container ? this.container : document) @@ -234,6 +221,14 @@ // ).querySelector(".page-main"); // this.$store.commit("setZoom", scale); // }, + // 璇锋眰璧勬簮Json + async getBookResourceList() { + this.resourceList = await this.config.getBookResources( + process.env.VUE_APP_RESOURCE_CTX + (process.env.VUE_APP_ENV == "product" + ? process.env.VUE_APP_BOOK_ID + : "preschoolEvaluation") + ); + }, // 婊氬姩鐩戝惉 scrollFun(event) { this.handleVideoPicture(); @@ -479,8 +474,8 @@ page && pageThemeColor && pageThemeColor[page] ? pageThemeColor[page] : chapterNum && chapterThemeColor && chapterThemeColor[chapterNum] - ? chapterThemeColor[chapterNum] - : bookThemeColor; + ? chapterThemeColor[chapterNum] + : bookThemeColor; if (themeColor) { domItem.style.color = themeColor; } @@ -497,8 +492,8 @@ page && pageThemeColor && pageThemeColor[page] ? pageThemeColor[page] : chapterNum && chapterThemeColor && chapterThemeColor[chapterNum] - ? chapterThemeColor[chapterNum] - : bookThemeColor; + ? chapterThemeColor[chapterNum] + : bookThemeColor; if (themeColor) { domItem.style.backgroundColor = themeColor; } @@ -515,8 +510,8 @@ page && pageThemeColor && pageThemeColor[page] ? pageThemeColor[page] : chapterNum && chapterThemeColor && chapterThemeColor[chapterNum] - ? chapterThemeColor[chapterNum] - : bookThemeColor; + ? chapterThemeColor[chapterNum] + : bookThemeColor; if (themeColor) { domItem.style.borderColor = themeColor; } @@ -742,12 +737,15 @@ const pageData = { pageHeader, chapterOne, - // chapterTwo, - // chapterThree, - // chapterFour, - // chapterFive, - // chapterSix, - // chapterSeven + chapterTwo, + chapterThree, + chapterFour, + chapterFive, + chapterSix, + chapterSeven, + chapterEight, + chapterNine, + chapterTen }; // 閬嶅巻鎵�鏈夌珷鑺傛枃浠� for (const key in pageData) { @@ -847,7 +845,7 @@ // 璁板綍楂樹寒淇℃伅 this.highlightData = data; // 璺宠浆 - this.gotoPage(data.catalog, data.page, () => {}); + this.gotoPage(data.catalog, data.page, () => { }); }, // 椤甸潰鍚戜笅婊氬姩锛岄煶棰戝皬绐楁挱鏀惧姛鑳� getAduio() { @@ -949,7 +947,11 @@ const topGap = playVudio.getBoundingClientRect().top; if (bottomGap < 0 || topGap > window.innerHeight) { try { - if (playVudio.readyState) playVudio.requestPictureInPicture(); + if (playVudio.readyState) { + setTimeout(() => { + playVudio.requestPictureInPicture(); + }, 0) + } } catch (error) { console.log(error, "灏忕獥閿欒error"); } @@ -972,12 +974,15 @@ components: { pageHeader, chapterOne, - // chapterTwo, - // chapterThree, - // chapterFour, - // chapterFive, - // chapterSix, - // chapterSeven + chapterTwo, + chapterThree, + chapterFour, + chapterFive, + chapterSix, + chapterSeven, + chapterEight, + chapterNine, + chapterTen }, }; </script> -- Gitblit v1.9.1