| | |
| | | // embedded |
| | | // english |
| | | // artAndDance |
| | | this.config.resourceCtx + "lifeCare" |
| | | this.config.resourceCtx + "english" |
| | | ); |
| | | // 测试试读30页 |
| | | // this.activeBook.tryPageCount = 10; |
| | |
| | | <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 |
| | |
| | | </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 |
| | |
| | | :src="resource.readingTwo" |
| | | controls |
| | | style="margin-left: 10px" |
| | | class="audio" |
| | | ></audio> |
| | | <p>wonderland /ˈwʌndəlænd/ <i>n.</i> 有许多奇妙事物的地方</p> |
| | | <div class="bkbj"> |
| | |
| | | select { |
| | | height: 24px; |
| | | } |
| | | |
| | | .mini-audio { |
| | | width: 200px; |
| | | height: 200px; |
| | | position: fixed; |
| | | right:0; |
| | | background-color: red; |
| | | } |
| | | </style> |
| | |
| | | :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"; |
| | |
| | | import Viewer from "viewerjs"; |
| | | import "viewerjs/dist/viewer.css"; |
| | | export default { |
| | | name: "page-main", |
| | | data() { |
| | | return { |
| | | catalogLength: 2, // 总章节数 |
| | |
| | | loadPageList: [], |
| | | questionData: {}, |
| | | renderSignMap: {}, |
| | | audioPath:'' |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | setTimeout(() => { |
| | | this.initSwiper(); |
| | | this.initViewer(); |
| | | this.getAduio(); |
| | | }, 200); |
| | | }, |
| | | }, |
| | |
| | | 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() { |
| | |
| | | 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, |
| | |
| | | } |
| | | // 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> |
| | |
| | | }, |
| | | mounted() { |
| | | // 默认加载章节 |
| | | this.showCatalogList = [3]; |
| | | this.showCatalogList = [1]; |
| | | // 滚动监听节流 |
| | | this.throttledScrollHandler = _.throttle( |
| | | this.scrollFun, |
| | |
| | | </div> |
| | | <!-- 解析 --> |
| | | <ul class="show-answer" v-if="isShowAnswer"> |
| | | <li>答案结果:</li> |
| | | <li v-if="isRight !== null">答案结果:<span v-if="isRight" style="color: #83e089;">正确</span> <span v-if="isRight == false" style="color:#d81e06">错误</span></li> |
| | | <li class="show-answer-box"> |
| | | <div>答案:</div> |
| | | <div> |
| | |
| | | checkItemIndex: null, |
| | | isShowAnswer: false, |
| | | isRight: null, |
| | | value:[{left:0,right:0}], |
| | | value:[], |
| | | pageNum:null |
| | | }; |
| | | }, |
| | |
| | | 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, |
| | |
| | | }, |
| | | // 重做 |
| | | 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++) { |
| | |
| | | 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 { |
New file |
| | |
| | | <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> |