From 6565078d7af60fe9496a43a7d3d9bf00f92f0531 Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期四, 11 七月 2024 17:38:37 +0800 Subject: [PATCH] 图书bug修改 --- src/books/English/view/components/chapter001.vue | 6 src/components/dragQuestion/index.vue | 35 ++++-- src/books/artAndDance/view/components/chapter005.vue | 63 +++++++----- src/books/artAndDance/view/components/index.vue | 120 ++++++++++++------------ src/components/examinations/index.vue | 1 src/books/childHealth/view/content/components/chapter011.vue | 8 + src/books/English/view/components/index.vue | 2 src/books/childHealth/view/content/index.vue | 8 + src/books/artAndDance/assets/main.less | 6 + 9 files changed, 144 insertions(+), 105 deletions(-) diff --git a/src/books/English/view/components/chapter001.vue b/src/books/English/view/components/chapter001.vue index 3e03549..fb97a41 100644 --- a/src/books/English/view/components/chapter001.vue +++ b/src/books/English/view/components/chapter001.vue @@ -359,7 +359,7 @@ shadow puppet show, traditional Chinese medicine, Peking Opera scenery </p> - <p class="center"><b>My Experience in Wonderland</b></p> + <p class="center"><b>My Experience in <span class="word-bc" @click="saveWord($event, 'Wonderland')">Wonderland</span> </b></p> <p class="center"> <audio :src="resource.readingOne" controls controlslist="noplaybackrate nodownload" class="audio"></audio> </p> @@ -1336,8 +1336,8 @@ 5.If </p> <!-- 鎻愪氦鎸夐挳 --> - <div class="w100 fl"> - <ul class="fl ju-ar w100"> + <div class="w100 fl ju-cn"> + <ul class="fl ju-ev" style="width:80%"> <li> <button class="btn-border btn-w" @click="saveData"> 鎻愪氦 diff --git a/src/books/English/view/components/index.vue b/src/books/English/view/components/index.vue index fd90b83..c6f483c 100644 --- a/src/books/English/view/components/index.vue +++ b/src/books/English/view/components/index.vue @@ -213,7 +213,7 @@ // 娴嬭瘯椤甸潰璺宠浆 setTimeout(() => { - this.gotoPage(2,16); + this.gotoPage(2,13); // setTimeout(() => { // this.renderSign("Highlight", { // id: "2ACA9359", diff --git a/src/books/artAndDance/assets/main.less b/src/books/artAndDance/assets/main.less index 95b4af5..714d1c2 100644 --- a/src/books/artAndDance/assets/main.less +++ b/src/books/artAndDance/assets/main.less @@ -354,12 +354,18 @@ .ju-bt { justify-content: space-between; } + .ju-cn { + justify-content: center; + } .ju-end { justify-content: flex-end; } .al-cn { align-items: center; } + .al-end { + align-items: end; + } .wh-nr { white-space: nowrap; } diff --git a/src/books/artAndDance/view/components/chapter005.vue b/src/books/artAndDance/view/components/chapter005.vue index 032ca3e..699ddd4 100644 --- a/src/books/artAndDance/view/components/chapter005.vue +++ b/src/books/artAndDance/view/components/chapter005.vue @@ -19,11 +19,17 @@ class="w100 mb-40" /> <div class="padding-96 fl ju-cn al-cn fl-cl"> - <p class="center share-img-box"> - <img :src="num >= 0 ? crane : rise" alt="" :style="{opacity:num >= 0 ? num / 10 : (-num) / 10 , width:num >= 0 ? '80%' : '70%'}"> - + <p class="center share-img-box fl ju-cn al-end"> + <img + :src="num >= 0 ? crane : rise" + alt="" + :style="{ + opacity: num >= 0 ? num / 10 : -num / 10, + width: num >= 0 ? '80%' : '70%', + }" + /> </p> - <p class="img">鈥滆タ濉炲北鍓嶇櫧楣鈥濆姩浣�</p> + <p class="img">鈥滆タ濉炲北鍓嶇櫧楣鈥濆姩浣�</p> </div> <ul class="pb-box"> <li class="ml-40"> @@ -39,10 +45,7 @@ <div class="page-box" page="22"> <div v-if="showPageList.indexOf(22) > -1"> <div> - <img - src="../../assets/images/chapter-five-header.png" - class="w100" - /> + <img src="../../assets/images/chapter-five-header.png" class="w100" /> </div> <div class="padding-96"> <h2 class="lefth2" id="b001"> @@ -66,11 +69,21 @@ <ul class="fl fl-cl al-cn audio-box"> <li class="fl al-cn"> <span class="wh-nr auido-text mr-8">鐢风闊�</span> - <audio :src="auidoPathOne" controls controlslist="noplaybackrate nodownload" class="audio" ></audio> + <audio + :src="auidoPathOne" + controls + controlslist="noplaybackrate nodownload" + class="audio" + ></audio> </li> <li class="fl al-cn mt-20"> <span class="wh-nr auido-text mr-8"> 濂崇闊� </span> - <audio :src="auidoPathTwo" controls controlslist="noplaybackrate nodownload" class="audio" ></audio> + <audio + :src="auidoPathTwo" + controls + controlslist="noplaybackrate nodownload" + class="audio" + ></audio> </li> </ul> <h3 id="c015">娓旀瓕瀛�</h3> @@ -112,7 +125,7 @@ controls controlslist="nodownload" class="w100 video" - style="margin:38px 0" + style="margin: 38px 0" ></video> <h2 class="lefth2" id="b003"> <img class="img-gn" alt="" src="../../assets/images/czysj.jpg" /> @@ -175,8 +188,8 @@ auidoPathOne: "", auidoPathTwo: "", num: 0, - crane:require("../../assets/images/crane.png"), - rise:require("../../assets/images/rise.png") + crane: require("../../assets/images/crane.png"), + rise: require("../../assets/images/rise.png"), }; }, unmounted() { @@ -200,24 +213,24 @@ ); }, addNum() { - this.addTimer = setInterval(() => { - if(this.num < 10) { - this.num ++ + this.addTimer = setInterval(() => { + if (this.num < 10) { + this.num++; } else { - clearInterval(this.addTimer) - this.cutNum() + clearInterval(this.addTimer); + this.cutNum(); } - },200) + }, 200); }, cutNum() { - this.cutTimer = setInterval(() => { - if(this.num > -10) { - this.num -- + this.cutTimer = setInterval(() => { + if (this.num > -10) { + this.num--; } else { - clearInterval(this.cutTimer) - this.addNum() + clearInterval(this.cutTimer); + this.addNum(); } - },200) + }, 200); }, }, }; diff --git a/src/books/artAndDance/view/components/index.vue b/src/books/artAndDance/view/components/index.vue index da522a6..9942c6b 100644 --- a/src/books/artAndDance/view/components/index.vue +++ b/src/books/artAndDance/view/components/index.vue @@ -25,15 +25,15 @@ > </chapterTwo> <chapterThree - v-if="showCatalogList.indexOf(4) > -1" + v-if="showCatalogList.indexOf(4) > -1" :showPageList="loadPageList" ></chapterThree> <chapterFour - v-if="showCatalogList.indexOf(5) > -1" + v-if="showCatalogList.indexOf(5) > -1" :showPageList="loadPageList" ></chapterFour> <chapterFive - v-if="showCatalogList.indexOf(6) > -1" + v-if="showCatalogList.indexOf(6) > -1" :showPageList="loadPageList" ></chapterFive> <chapterSix @@ -54,10 +54,10 @@ 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 chapterThree from "./chapter003.vue"; +import chapterFour from "./chapter004.vue"; +import chapterFive from "./chapter005.vue"; +import chapterSix from "./chapter006.vue"; import NoteIcon from "@/assets/images/biji.png"; import miniAudio from "@/components/miniAudio/index.vue"; import _ from "lodash"; @@ -66,7 +66,7 @@ import Viewer from "viewerjs"; import "viewerjs/dist/viewer.css"; export default { - name:"pageContent", + name: "pageContent", data() { return { catalogLength: 7, // 鎬荤珷鑺傛暟 @@ -191,21 +191,21 @@ // 娴嬭瘯椤甸潰璺宠浆 // setTimeout(() => { - // this.gotoPage(6, 30); - // setTimeout(() => { - // this.renderSign("Highlight", { - // id: "2ACA9359", - // txt: "棰樹竴瀛︿範涓婚涓� 杩愬姩", - // page: "10", - // type: "Highlight", - // color: "#F5E12A" - // }); - // setTimeout(() => { - // this.delSign({ - // ids: ["2ACA9359"] - // }); - // }, 2000); - // }, 500); + // this.gotoPage(6, 29); + // 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) // .querySelector("#app") @@ -240,7 +240,7 @@ scrollFun(event) { // 鍒ゆ柇鍚戜笂婊氬姩杩樻槸鍚戜笅婊氬姩 if (event.target.scrollTop > this.previousScrollTop) { - this.getAduio() + this.getAduio(); // 鍚戜笅 const currentScrollTop = event.target.scrollTop + event.target.offsetHeight; @@ -264,7 +264,7 @@ } } } else if (event.target.scrollTop < this.previousScrollTop) { - this.handleAudio() + this.handleAudio(); // 鍚戜笂 const currentScrollTop = event.target.scrollTop; if (currentScrollTop <= this.loadThreshold) { @@ -343,7 +343,10 @@ this.container ? this.container : document ).querySelector(`[page="${data.page}"]`); // 鍒涘缓 createTreeWalker 杩唬鍣紝鐢ㄤ簬閬嶅巻鏂囨湰鑺傜偣锛屼繚瀛樺埌涓�涓暟缁� - const treeWalker = document.createTreeWalker(pageDom, NodeFilter.SHOW_TEXT); + const treeWalker = document.createTreeWalker( + pageDom, + NodeFilter.SHOW_TEXT + ); const allTextNodes = []; let currentNode = treeWalker.nextNode(); while (currentNode) { @@ -608,7 +611,10 @@ // 楂樹寒琛� setTimeout(() => { // 鑾峰彇椤甸潰鎵�鏈塼ext鑺傜偣 - const pageTextList = document.createTreeWalker(target, NodeFilter.SHOW_TEXT); + const pageTextList = document.createTreeWalker( + target, + NodeFilter.SHOW_TEXT + ); // 鍖归厤鍏抽敭瀛� const allPageTextNodes = []; let currentNode = pageTextList.nextNode(); @@ -652,19 +658,15 @@ autoplay: { //鑷姩寮�濮� delay: 3000, //鏃堕棿闂撮殧 - disableOnInteraction: false //*鎵嬪姩鎿嶄綔杞挱鍥惧悗涓嶄細鏆傚仠* + disableOnInteraction: false, //*鎵嬪姩鎿嶄綔杞挱鍥惧悗涓嶄細鏆傚仠* }, paginationClickable: true, slidesPerView: 1, // 涓�缁勪笁涓� spaceBetween: 30, // 闂撮殧 // 濡傛灉闇�瑕佸墠杩涘悗閫�鎸夐挳 navigation: { - nextEl: dom.querySelector( - ".swiper-button-next" - ), - prevEl: dom.querySelector( - ".swiper-button-prev" - ) + nextEl: dom.querySelector(".swiper-button-next"), + prevEl: dom.querySelector(".swiper-button-prev"), }, // 绐楀彛鍙樺寲,閲嶆柊init,閽堝F11鍏ㄥ睆鍜屾斁澶х缉灏�,蹇呴』鍔� // observer: true, @@ -691,12 +693,8 @@ spaceBetween: 30, // 闂撮殧 // 濡傛灉闇�瑕佸墠杩涘悗閫�鎸夐挳 navigation: { - nextEl: dom.querySelector( - ".swiper-button-next" - ), - prevEl: dom.querySelector( - ".swiper-button-prev" - ) + nextEl: dom.querySelector(".swiper-button-next"), + prevEl: dom.querySelector(".swiper-button-prev"), }, // 绐楀彛鍙樺寲,閲嶆柊init,閽堝F11鍏ㄥ睆鍜屾斁澶х缉灏�,蹇呴』鍔� observer: true, @@ -715,8 +713,8 @@ var paginationInfoEl = dom.querySelector(".pageBox"); if (paginationInfoEl) paginationInfoEl.textContent = currentPage + "/" + totalPages; - } - } + }, + }, }); } }, @@ -760,7 +758,7 @@ propsData: { showPageList: [], questionData: {}, - isSearch: true + isSearch: true, }, }); pageExample.$mount( @@ -792,7 +790,7 @@ propsData: { showPageList: [pageNum], questionData: {}, - isSearch: true + isSearch: true, }, }); pageExample.$mount( @@ -806,7 +804,10 @@ .querySelector(`[page="${pageNum}"]`); if (thisPageDom) { // 鑾峰彇椤甸潰鎵�鏈塼ext鑺傜偣 - const pageTextList = document.createTreeWalker(thisPageDom, NodeFilter.SHOW_TEXT); + const pageTextList = document.createTreeWalker( + thisPageDom, + NodeFilter.SHOW_TEXT + ); // 鍖归厤鍏抽敭瀛� const allPageTextNodes = []; let currentNode = pageTextList.nextNode(); @@ -847,7 +848,7 @@ // 璺宠浆 this.gotoPage(data.catalog, data.page, () => {}); }, - // 椤甸潰鍚戜笅婊氬姩锛岄煶棰戝皬绐楁挱鏀惧姛鑳� + // 椤甸潰鍚戜笅婊氬姩锛岄煶棰戝皬绐楁挱鏀惧姛鑳� getAduio() { let allVideo = ( this.container ? this.container : document @@ -903,17 +904,16 @@ ).querySelectorAll(".audio"); for (let index = 0; index < allAudio.length; index++) { const item = allAudio[index]; - item.addEventListener('play',() => { + item.addEventListener("play", () => { const audioList = Array.from(allAudio); - for (let cindex = 0; cindex < audioList.length; cindex++) { + for (let cindex = 0; cindex < audioList.length; cindex++) { const citem = audioList[cindex]; - if(citem.currentSrc != item.src) { - citem.pause() - + if (citem.currentSrc != item.src) { + citem.pause(); } } - this.closeMiniAudio() - }) + this.closeMiniAudio(); + }); } }, // 鐐瑰嚮瑙嗛鍏抽棴鍏朵粬 @@ -923,18 +923,18 @@ ).querySelectorAll(".video"); for (let index = 0; index < allVideo.length; index++) { const item = allVideo[index]; - item.addEventListener('playing',(item) => { - const path = item.srcElement.src + item.addEventListener("playing", (item) => { + const path = item.srcElement.src; const videoList = Array.from(allVideo); for (let cindex = 0; cindex < videoList.length; cindex++) { const citem = videoList[cindex]; - if(citem.currentSrc != path && path) { - citem.pause() + if (citem.currentSrc != path && path) { + citem.pause(); } } - }) + }); } - } + }, }, components: { pageHeader, @@ -944,7 +944,7 @@ chapterFour, chapterFive, chapterSix, - miniAudio + miniAudio, }, }; </script> diff --git a/src/books/childHealth/view/content/components/chapter011.vue b/src/books/childHealth/view/content/components/chapter011.vue index b6d836e..0ff49d2 100644 --- a/src/books/childHealth/view/content/components/chapter011.vue +++ b/src/books/childHealth/view/content/components/chapter011.vue @@ -124,9 +124,15 @@ type: Array, }, }, + watch:{ + questionData:{ + handler(newVal) { + console.log('鏂板��',newVal); + } + },deep:true,immediate:true + }, data() { return { - questionData: {}, }; }, async mounted() {}, diff --git a/src/books/childHealth/view/content/index.vue b/src/books/childHealth/view/content/index.vue index 213ed4f..fb4a8ec 100644 --- a/src/books/childHealth/view/content/index.vue +++ b/src/books/childHealth/view/content/index.vue @@ -229,7 +229,7 @@ // 娴嬭瘯椤甸潰璺宠浆 // setTimeout(() => { - // this.gotoPage(8,233); + // this.gotoPage(11,282); // setTimeout(() => { // this.renderSign("Highlight", { // id: "2ACA9359", @@ -614,11 +614,12 @@ if (testData && testData[catalog]) { if (testData[catalog][page]) { if (Array.isArray(testData[catalog][page])) { - this.questionDataMap[page] = await getQuestionList( + const datas = await getQuestionList( page, testData[catalog][page], this.config.activeBook ); + this.$set(this.questionDataMap,page,datas) } else { const obj = {}; for (let key in testData[catalog][page]) { @@ -628,7 +629,8 @@ this.config.activeBook ); } - this.questionDataMap[page] = obj; + this.$set(this.questionDataMap,page,obj) + // this.questionDataMap[page] = obj; } } } diff --git a/src/components/dragQuestion/index.vue b/src/components/dragQuestion/index.vue index ddeca7d..f057489 100644 --- a/src/components/dragQuestion/index.vue +++ b/src/components/dragQuestion/index.vue @@ -1,10 +1,16 @@ <template> <div class="drag-box" :style="{ borderColor: bcColor }"> <div class="title-box"> - <p class="text" style="text-indent:2em !important"><span class="hs1">鈼�</span>{{ titileText }}</p> - <span class="svg-btn t0" @mouseenter="mouseenterTitle" @mouseleave="mouseleaveTitle"> + <p class="text" style="text-indent: 2em !important"> + <span class="hs1">鈼�</span>{{ titileText }} + </p> + <span + class="svg-btn t0" + @mouseenter="mouseenterTitle" + @mouseleave="mouseleaveTitle" + > <p class="p-title" v-if="ishowTitle">璇锋嫋鎷界瓟妗堝埌鎷彿閲屽惂</p> - <svg + <svg t="1719309984490" class="icon" viewBox="0 0 1024 1024" @@ -20,7 +26,6 @@ p-id="6317" ></path> </svg> - </span> </div> <div @@ -278,7 +283,7 @@ spaceList: [], submitState: false, isLift: false, - ishowTitle:false + ishowTitle: false, }; }, mounted() {}, @@ -302,6 +307,11 @@ }, // 榧犳爣绉诲姩 mousemove(e) { + if (this.isLift) { + this.moveDom.style.position = ""; + this.moveDom.style.left = "0px"; + this.moveDom.style.top = "0px"; + } if (!this.moveDom) return false; this.moveDom.style.position = "absolute"; // 闄愬埗鍦ㄦ棰樿寖鍥村唴鎷栧姩 @@ -310,6 +320,7 @@ const moveY = e.y - this.parentY + 40; this.moveDom.style.left = moveX + "px"; this.moveDom.style.top = moveY + "px"; + this.moveDom.style.zIndex = "99999999"; // 濡傛灉杩樻湁鏈夌┖鏍� if (this.spaceList.length) { for (let index = 0; index < this.spaceList.length; index++) { @@ -492,13 +503,13 @@ return flag; }, mouseenterTitle() { - this.ishowTitle = true - console.log(this.ishowTitle ); + this.ishowTitle = true; + console.log(this.ishowTitle); }, mouseleaveTitle() { - this.ishowTitle = false - console.log(this.ishowTitle ); - } + this.ishowTitle = false; + console.log(this.ishowTitle); + }, }, }; </script> @@ -582,7 +593,7 @@ text-indent: 0 !important; position: absolute; top: -33px; - background-color:#8fae34 ; + background-color: #8fae34; padding: 0 4px; white-space: nowrap; border-radius: 4px; @@ -593,7 +604,7 @@ margin-bottom: 20px; p { margin: 0; - text-indent: 2em ; + text-indent: 2em; } } /** 瑙f瀽 */ diff --git a/src/components/examinations/index.vue b/src/components/examinations/index.vue index ac8b3ba..30baf98 100644 --- a/src/components/examinations/index.vue +++ b/src/components/examinations/index.vue @@ -560,6 +560,7 @@ watch: { cardList: { handler(newVal) { + // console.log('鏂板��',newVal); this.cardData = this.cardList; if (newVal && newVal.length) { this.loading = false; -- Gitblit v1.9.1