From 28f79c906721eea9ff2c74cf87ae1179a831d534 Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期二, 04 六月 2024 17:43:59 +0800 Subject: [PATCH] 合并 --- src/books/English/view/components/chapter001.vue | 13 +++- src/components/matching/matching.vue | 12 ++-- src/components/miniAudio/index.vue | 24 ++++++++ src/App.vue | 2 src/books/English/view/components/index.vue | 86 +++++++++++++++++----------- src/books/childHealth/view/content/index.vue | 2 6 files changed, 95 insertions(+), 44 deletions(-) diff --git a/src/App.vue b/src/App.vue index 57de654..8f7eebb 100644 --- a/src/App.vue +++ b/src/App.vue @@ -72,7 +72,7 @@ // embedded // english // artAndDance - this.config.resourceCtx + "lifeCare" + this.config.resourceCtx + "english" ); // 娴嬭瘯璇曡30椤� // this.activeBook.tryPageCount = 10; diff --git a/src/books/English/view/components/chapter001.vue b/src/books/English/view/components/chapter001.vue index 11382cc..d7b3a6e 100644 --- a/src/books/English/view/components/chapter001.vue +++ b/src/books/English/view/components/chapter001.vue @@ -505,7 +505,7 @@ <div class="bodystyle"> <h3 id="c002" class="fl al-cn"> <span class="bjh3">Listening</span> - <audio :src="resource.listenOne" controls></audio> + <audio :src="resource.listenOne" controls class="audio"></audio> </h3> <p> <b @@ -526,7 +526,7 @@ </div> <h3 id="c003" class="fl al-cn"> <span class="bjh3">Reading</span> - <audio :src="resource.readingOne" controls></audio> + <audio :src="resource.readingOne" controls class="audio"></audio> </h3> <p> 1.How was Chinese culture introduced to the world in ancient @@ -735,6 +735,7 @@ :src="resource.readingTwo" controls style="margin-left: 10px" + class="audio" ></audio> <p>wonderland /藞w蕦nd蓹l忙nd/ <i>n.</i> 鏈夎澶氬濡欎簨鐗╃殑鍦版柟</p> <div class="bkbj"> @@ -2800,5 +2801,11 @@ select { height: 24px; } - +.mini-audio { + width: 200px; + height: 200px; + position: fixed; + right:0; + background-color: red; +} </style> diff --git a/src/books/English/view/components/index.vue b/src/books/English/view/components/index.vue index a8700d0..3af9f8a 100644 --- a/src/books/English/view/components/index.vue +++ b/src/books/English/view/components/index.vue @@ -18,12 +18,14 @@ :showPageList="loadPageList" ></chapterOne> </div> + <miniAudio :path="audioPath"></miniAudio> </div> </template> <script> import pageHeader from "./header.vue"; import chapterOne from "./chapter001.vue"; +import miniAudio from "@/components/miniAudio/index.vue"; import NoteIcon from "@/assets/images/biji.png"; import _ from "lodash"; import Swiper from "swiper/bundle"; @@ -31,6 +33,7 @@ import Viewer from "viewerjs"; import "viewerjs/dist/viewer.css"; export default { + name: "page-main", data() { return { catalogLength: 2, // 鎬荤珷鑺傛暟 @@ -44,6 +47,7 @@ loadPageList: [], questionData: {}, renderSignMap: {}, + audioPath:'' }; }, computed: { @@ -78,6 +82,7 @@ setTimeout(() => { this.initSwiper(); this.initViewer(); + this.getAduio(); }, 200); }, }, @@ -565,40 +570,40 @@ for (let i = 0; i < pptDoms.length; i++) { const dom = pptDoms[i]; new Swiper(dom, { - loop: false, // 鏃犵紳 - autoplay: false, - paginationClickable: true, - slidesPerView: 1, // 涓�缁勪笁涓� - spaceBetween: 30, // 闂撮殧 - // 濡傛灉闇�瑕佸墠杩涘悗閫�鎸夐挳 - navigation: { - nextEl: (this.container ? this.container : document).querySelector( - ".swiper-button-next" - ), - prevEl: (this.container ? this.container : document).querySelector( - ".swiper-button-prev" - ), - }, - // 绐楀彛鍙樺寲,閲嶆柊init,閽堝F11鍏ㄥ睆鍜屾斁澶х缉灏�,蹇呴』鍔� - observer: true, - observeParents: true, - on: { - init:(value) => { - let currentPage = value.activeIndex + 1; // 鑾峰彇褰撳墠椤碉紙浠�1寮�濮嬭鏁帮級 - let totalPages = value.slides.length; // 鑾峰彇鎬婚〉鏁� - var paginationInfoEl = dom.querySelector('.pageBox'); - if(paginationInfoEl) - paginationInfoEl.textContent = currentPage + '/' + totalPages; + loop: false, // 鏃犵紳 + autoplay: false, + paginationClickable: true, + slidesPerView: 1, // 涓�缁勪笁涓� + spaceBetween: 30, // 闂撮殧 + // 濡傛灉闇�瑕佸墠杩涘悗閫�鎸夐挳 + navigation: { + nextEl: (this.container ? this.container : document).querySelector( + ".swiper-button-next" + ), + prevEl: (this.container ? this.container : document).querySelector( + ".swiper-button-prev" + ), }, - slideChange:(value) => { - let currentPage = value.activeIndex + 1; // 鑾峰彇褰撳墠椤碉紙浠�1寮�濮嬭鏁帮級 - let totalPages = value.slides.length; // 鑾峰彇鎬婚〉鏁� - var paginationInfoEl = dom.querySelector('.pageBox'); - if(paginationInfoEl) - paginationInfoEl.textContent = currentPage + '/' + totalPages; + // 绐楀彛鍙樺寲,閲嶆柊init,閽堝F11鍏ㄥ睆鍜屾斁澶х缉灏�,蹇呴』鍔� + observer: true, + observeParents: true, + on: { + init: (value) => { + let currentPage = value.activeIndex + 1; // 鑾峰彇褰撳墠椤碉紙浠�1寮�濮嬭鏁帮級 + let totalPages = value.slides.length; // 鑾峰彇鎬婚〉鏁� + var paginationInfoEl = dom.querySelector(".pageBox"); + if (paginationInfoEl) + paginationInfoEl.textContent = currentPage + "/" + totalPages; + }, + slideChange: (value) => { + let currentPage = value.activeIndex + 1; // 鑾峰彇褰撳墠椤碉紙浠�1寮�濮嬭鏁帮級 + let totalPages = value.slides.length; // 鑾峰彇鎬婚〉鏁� + var paginationInfoEl = dom.querySelector(".pageBox"); + if (paginationInfoEl) + paginationInfoEl.textContent = currentPage + "/" + totalPages; + }, }, - }, - }); + }); } }, initViewer() { @@ -622,7 +627,7 @@ console.log("鐢熷兓瀛�", event, word); if (this.$store.state.qiankun && this.$store.state.qiankun.chooseWords) { this.$store.state.qiankun.chooseWords({ - type:"word", + type: "word", word, x: event.pageX, y: event.pageY, @@ -630,10 +635,25 @@ } // chooseWords }, + // 鑾峰彇auido瀹炰緥 + getAduio() { + let allVideo = ( + this.container ? this.container : document + ).querySelectorAll(".audio"); + allVideo = Array.from(allVideo) + if (allVideo.length) { + const playAudio = allVideo.reverse().find((item) => item.paused == false); + if (playAudio) { + console.log("绗釜闊抽鍦ㄦ挱鏀�", playAudio.src); + this.audioPath = playAudio.src + } + } + }, }, components: { pageHeader, chapterOne, + miniAudio, }, }; </script> diff --git a/src/books/childHealth/view/content/index.vue b/src/books/childHealth/view/content/index.vue index cfac6ed..663fc02 100644 --- a/src/books/childHealth/view/content/index.vue +++ b/src/books/childHealth/view/content/index.vue @@ -171,7 +171,7 @@ }, mounted() { // 榛樿鍔犺浇绔犺妭 - this.showCatalogList = [3]; + this.showCatalogList = [1]; // 婊氬姩鐩戝惉鑺傛祦 this.throttledScrollHandler = _.throttle( this.scrollFun, diff --git a/src/components/matching/matching.vue b/src/components/matching/matching.vue index 85cb98d..875ff46 100644 --- a/src/components/matching/matching.vue +++ b/src/components/matching/matching.vue @@ -54,7 +54,7 @@ </div> <!-- 瑙f瀽 --> <ul class="show-answer" v-if="isShowAnswer"> - <li>绛旀缁撴灉锛�</li> + <li v-if="isRight !== null">绛旀缁撴灉锛�<span v-if="isRight" style="color: #83e089;">姝g‘</span> <span v-if="isRight == false" style="color:#d81e06">閿欒</span></li> <li class="show-answer-box"> <div>绛旀:</div> <div> @@ -85,7 +85,7 @@ checkItemIndex: null, isShowAnswer: false, isRight: null, - value:[{left:0,right:0}], + value:[], pageNum:null }; }, @@ -336,13 +336,13 @@ const rightIndex = this.item.options.linkValues.findIndex( (citem) => citem.oldId == item.oldId ); - debugger; answerArr.push({ left: index, right: rightIndex, }); } this.isRight = this.areArraysEqual(this.item.userChoise,answerArr) + this.item.showAnswer = true console.log( "绛旀", answerArr, @@ -385,6 +385,7 @@ }, // 閲嶅仛 redo() { + this.item.showAnswer = false localStorage.removeItem(this.config.activeBook.name + '-matching-' + this.pageNum) this.value = [] for (let index = 0; index < this.leftArr.length; index++) { @@ -460,10 +461,9 @@ margin: 30px auto; width: 100%; height: min-content; - // background-color: pink; box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); - .show-answer-box { - padding: 10px; + li { + padding:10px } } .btn-bottom { diff --git a/src/components/miniAudio/index.vue b/src/components/miniAudio/index.vue new file mode 100644 index 0000000..a014da5 --- /dev/null +++ b/src/components/miniAudio/index.vue @@ -0,0 +1,24 @@ +<template> + <div class="mini-audio" v-if="path"> + <audio controls :src="path"></audio> + </div> +</template> + +<script> + export default { + name:"mini-audio", + props:{ + path:{ + type:String + } + } + } +</script> + +<style lang="less" scoped> +.mini-audio { + position: fixed; + right:40px; + bottom: 100px; +} +</style> \ No newline at end of file -- Gitblit v1.9.1