From 0673f7fe45966e537c4b6263dd7dfc8cbd1f5ad5 Mon Sep 17 00:00:00 2001 From: QYF-GitLab1 <1940665526@qq.com> Date: 星期三, 21 五月 2025 17:37:55 +0800 Subject: [PATCH] 中药手册 --- src/books/hotelEnglishTrainingBrochure2nd/view/components/index.vue | 78 ++++++++++++++++++++------------------- 1 files changed, 40 insertions(+), 38 deletions(-) diff --git a/src/books/hotelEnglishTrainingBrochure2nd/view/components/index.vue b/src/books/hotelEnglishTrainingBrochure2nd/view/components/index.vue index 76c00a1..e60699f 100644 --- a/src/books/hotelEnglishTrainingBrochure2nd/view/components/index.vue +++ b/src/books/hotelEnglishTrainingBrochure2nd/view/components/index.vue @@ -3,23 +3,14 @@ <div id="searchDomBox" style="display: none"> <div id="searchContent"></div> </div> - <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" - :interfaceQuestion="questionDataMap" - ></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" + :interfaceQuestion="questionDataMap"></chapterOne> <!-- <chapterTwo v-if="showCatalogList.indexOf(2) > -1" :showPageList="loadPageList" @@ -38,12 +29,8 @@ :interfaceQuestion="questionDataMap" ></chapterFive> --> </div> - <translateWord - :pageX="pageX" - :pageY="pageY" - :showWord="showWord" - v-if="showWord" - /> + <translateWord :pageX="pageX" :pageY="pageY" :showWord="showWord" :IPA="IPA" :prototype="prototype" + :translate="translate" v-if="showWord" /> </div> </template> @@ -58,6 +45,7 @@ import NoteIcon from "@/assets/images/biji.png"; // import getQuestionList from "@/assets/methods/examination"; // import testData from "../../assets/examinationList"; +import keyWordData from "../../assets/englishKeyWords.js"; import _ from "lodash"; import Swiper from "swiper/bundle"; import "swiper/swiper-bundle.css"; @@ -85,6 +73,10 @@ pageX: 0, pageY: 0, showWord: "", + prototype: "", + IPA: "", + translate: "", + keywordList: keyWordData }; }, computed: { @@ -198,9 +190,9 @@ }, 500); // 娴嬭瘯椤甸潰璺宠浆 - setTimeout(() => { - this.gotoPage(2, 6); - }, 500); + // setTimeout(() => { + // this.gotoPage(2, 18); + // }, 500); // const pageDom = (this.container ? this.container : document) // .querySelector("#app") @@ -476,8 +468,8 @@ page && pageThemeColor && pageThemeColor[page] ? pageThemeColor[page] : chapterNum && chapterThemeColor && chapterThemeColor[chapterNum] - ? chapterThemeColor[chapterNum] - : bookThemeColor; + ? chapterThemeColor[chapterNum] + : bookThemeColor; if (themeColor) { domItem.style.color = themeColor; } @@ -494,8 +486,8 @@ page && pageThemeColor && pageThemeColor[page] ? pageThemeColor[page] : chapterNum && chapterThemeColor && chapterThemeColor[chapterNum] - ? chapterThemeColor[chapterNum] - : bookThemeColor; + ? chapterThemeColor[chapterNum] + : bookThemeColor; if (themeColor) { domItem.style.backgroundColor = themeColor; } @@ -512,8 +504,8 @@ page && pageThemeColor && pageThemeColor[page] ? pageThemeColor[page] : chapterNum && chapterThemeColor && chapterThemeColor[chapterNum] - ? chapterThemeColor[chapterNum] - : bookThemeColor; + ? chapterThemeColor[chapterNum] + : bookThemeColor; if (themeColor) { domItem.style.borderColor = themeColor; } @@ -842,7 +834,7 @@ // 璁板綍楂樹寒淇℃伅 this.highlightData = data; // 璺宠浆 - this.gotoPage(data.catalog, data.page, () => {}); + this.gotoPage(data.catalog, data.page, () => { }); }, // 椤甸潰鍚戜笅婊氬姩锛岄煶棰戝皬绐楁挱鏀惧姛鑳� getAduio() { @@ -972,14 +964,20 @@ dom.onmouseenter = (event) => { if (this.showWord != event.target.innerText) { const rect = dom.getBoundingClientRect(); - this.pageX = event.pageX - rect.width; - this.pageY = event.pageY + 20; - this.showWord = event.target.innerText; - console.log(event); + this.pageX = rect.left; + this.pageY = rect.top + rect.height; + this.keywordList.forEach((item) => { + if (item.name == event.target.innerText) { + this.showWord = item.name + this.prototype = item.prototype + this.IPA = item.IPA + this.translate = item.translate + } + }); } }; dom.onmouseleave = (event) => { - if(this.showWord == event.target.innerText) { + if (this.showWord == event.target.innerText) { this.showWord = ""; } }; @@ -1000,6 +998,10 @@ <style lang="less" scoped> .page-main { + width: 100% !important; + height: 100% !important; + overflow: auto; + .page-content { max-width: 816px; min-width: 375px; -- Gitblit v1.9.1