From fe52c75b42ef2815dc5c66e964c2b388ed09d097 Mon Sep 17 00:00:00 2001 From: zhongshujie <2862698242@qq.com> Date: 星期五, 25 四月 2025 11:28:21 +0800 Subject: [PATCH] 环境变量修改 --- src/books/civilAviation/view/components/index.vue | 152 ++++++++++++++++++++++++++++++++++---------------- 1 files changed, 104 insertions(+), 48 deletions(-) diff --git a/src/books/civilAviation/view/components/index.vue b/src/books/civilAviation/view/components/index.vue index efbc8d7..07d47d8 100644 --- a/src/books/civilAviation/view/components/index.vue +++ b/src/books/civilAviation/view/components/index.vue @@ -1,22 +1,52 @@ <template> - <div class="page-main" @scroll="throttledScrollHandler"> + <div class="page-main" @scroll="throttledScrollHandler"> <div id="searchDomBox" style="display: none"> <div id="searchContent"></div> </div> - <div class="page-content" :style="{ - fontSize: fontSize ? fontSize + 'px' : '18px', - transform: `scale(${pageZoom ? pageZoom : 1})`, - transformOrigin: 'center top', - }"> - <pageHeader v-if="showCatalogList.indexOf(1) > -1" :showPageList="loadPageList"></pageHeader> - <chapterOne v-if="showCatalogList.indexOf(2) > -1" :showPageList="loadPageList"></chapterOne> + <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> </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 NoteIcon from "@/assets/images/biji.png"; import _ from "lodash"; import Swiper from "swiper/bundle"; @@ -27,7 +57,7 @@ name: "pageContent", data() { return { - catalogLength: 2, // 鎬荤珷鑺傛暟 + catalogLength: 6, // 鎬荤珷鑺傛暟 showCatalogList: [], // 鏄剧ず鐨勭珷鑺� loadThreshold: 300, // 瑙﹀彂鍔犺浇闃堝�� throttleThreshold: 100, // 鑺傛祦闃堝�� @@ -46,10 +76,15 @@ }, computed: { fontSize() { - return this.$store.state.qiankun.fontSize; + this.transformDom(this.$store.state.qiankun.fontSize); + return this.$store.state.qiankun.fontSize + ? this.$store.state.qiankun.fontSize + : 18; }, pageZoom() { - return this.$store.state.qiankun.scale / 100; + return this.$store.state.qiankun.scale + ? this.$store.state.qiankun.scale / 100 + : 1; }, }, watch: { @@ -74,6 +109,7 @@ loadPageList: { handler(newVal, oldVal) { setTimeout(() => { + this.transformDom(this.$store.state.qiankun.fontSize); this.initSwiper(); this.initViewer(); this.closeAudio(); @@ -87,14 +123,13 @@ this.container ? this.container : document ).querySelector(".page-main"); scrollBox.scrollTop = (scrollBox.scrollTop / oldVal) * newVal; - }, + }, }, }, mounted() { // 榛樿鍔犺浇绔犺妭 this.showCatalogList = [1]; // 婊氬姩鐩戝惉鑺傛祦 - debugger this.throttledScrollHandler = _.throttle( this.scrollFun, this.throttleThreshold, @@ -150,20 +185,20 @@ // 娴嬭瘯椤甸潰璺宠浆 // setTimeout(() => { - // this.gotoPage(6, 30); - // setTimeout(() => { - // this.renderSign("Highlight", { - // id: "2ACA9359", - // txt: "棰樹竴瀛︿範涓婚涓� 杩愬姩", - // page: "10", - // type: "Highlight", - // color: "#F5E12A" - // }); - // setTimeout(() => { - // this.delSign({ - // ids: ["2ACA9359"] - // }); - // }, 2000); + // this.gotoPage(3, 130); + // 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) @@ -197,7 +232,7 @@ // }, // 婊氬姩鐩戝惉 scrollFun(event) { - this.handleVideoPicture() + this.handleVideoPicture(); // 鍒ゆ柇鍚戜笂婊氬姩杩樻槸鍚戜笅婊氬姩 if (event.target.scrollTop > this.previousScrollTop) { this.getAduio(); @@ -209,8 +244,7 @@ event.target.scrollHeight - this.loadThreshold ) { console.log(1); - - debugger + // 鍒拌揪闃堝�� if ( this.showCatalogList[this.showCatalogList.length - 1] < @@ -441,8 +475,8 @@ page && pageThemeColor && pageThemeColor[page] ? pageThemeColor[page] : chapterNum && chapterThemeColor && chapterThemeColor[chapterNum] - ? chapterThemeColor[chapterNum] - : bookThemeColor; + ? chapterThemeColor[chapterNum] + : bookThemeColor; if (themeColor) { domItem.style.color = themeColor; } @@ -459,8 +493,8 @@ page && pageThemeColor && pageThemeColor[page] ? pageThemeColor[page] : chapterNum && chapterThemeColor && chapterThemeColor[chapterNum] - ? chapterThemeColor[chapterNum] - : bookThemeColor; + ? chapterThemeColor[chapterNum] + : bookThemeColor; if (themeColor) { domItem.style.backgroundColor = themeColor; } @@ -477,8 +511,8 @@ page && pageThemeColor && pageThemeColor[page] ? pageThemeColor[page] : chapterNum && chapterThemeColor && chapterThemeColor[chapterNum] - ? chapterThemeColor[chapterNum] - : bookThemeColor; + ? chapterThemeColor[chapterNum] + : bookThemeColor; if (themeColor) { domItem.style.borderColor = themeColor; } @@ -702,8 +736,12 @@ let catalogIndex = 0; // 鎵�鏈夌珷鑺傜粍浠讹紙姣忔湰涔﹀埗浣滄椂鍗曠嫭閰嶇疆锛� const pageData = { - pageHeader, + pageHeader, chapterOne, + chapterTwo, + chapterThree, + chapterfour, + chapterfive, }; // 閬嶅巻鎵�鏈夌珷鑺傛枃浠� for (const key in pageData) { @@ -803,7 +841,7 @@ // 璁板綍楂樹寒淇℃伅 this.highlightData = data; // 璺宠浆 - this.gotoPage(data.catalog, data.page, () => { }); + this.gotoPage(data.catalog, data.page, () => {}); }, // 椤甸潰鍚戜笅婊氬姩锛岄煶棰戝皬绐楁挱鏀惧姛鑳� getAduio() { @@ -894,26 +932,44 @@ }, // 瑙嗛灏忕獥 handleVideoPicture() { - let doms = ( - this.container ? this.container : document - ).querySelectorAll(".video"); - doms = Array.from(doms) - if (!doms.length) return false - const playVudio = doms - .reverse() - .find((item) => item.paused == false); + let doms = (this.container ? this.container : document).querySelectorAll( + ".video" + ); + doms = Array.from(doms); + if (!doms.length) return false; + const playVudio = doms.reverse().find((item) => item.paused == false); if (playVudio) { const bottomGap = playVudio.getBoundingClientRect().bottom; const topGap = playVudio.getBoundingClientRect().top; if (bottomGap < 0 || topGap > window.innerHeight) { - playVudio.requestPictureInPicture(); + try { + if (playVudio.readyState) playVudio.requestPictureInPicture(); + } catch (error) { + console.log(error, "灏忕獥閿欒error"); + } } } - } + }, + //鍏朵粬绫诲悕涓嬪瓧浣撳ぇ灏忓彉鍖� + transformDom(fs) { + if (!fs) return; + let doms = (this.container ? this.container : document).querySelectorAll( + ".block" + ); + if (!doms.length) return; + for (let index = 0; index < doms.length; index++) { + const dom = doms[index]; + dom.style.fontSize = fs + "px"; + } + }, }, components: { pageHeader, chapterOne, + chapterTwo, + chapterThree, + chapterfour, + chapterfive, }, }; </script> -- Gitblit v1.9.1