闫增涛
2024-06-04 28f79c906721eea9ff2c74cf87ae1179a831d534
合并
5个文件已修改
1个文件已添加
81 ■■■■ 已修改文件
src/App.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/books/English/view/components/chapter001.vue 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/books/English/view/components/index.vue 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/books/childHealth/view/content/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/matching/matching.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/miniAudio/index.vue 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/App.vue
@@ -72,7 +72,7 @@
        // embedded
        // english
        // artAndDance
        this.config.resourceCtx + "lifeCare"
        this.config.resourceCtx + "english"
      );
      // 测试试读30页
      // this.activeBook.tryPageCount = 10;
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>
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);
      },
    },
@@ -586,16 +591,16 @@
          init:(value) => {
            let currentPage = value.activeIndex + 1; // 获取当前页(从1开始计数)
            let totalPages = value.slides.length; // 获取总页数
            var paginationInfoEl = dom.querySelector('.pageBox');
              var paginationInfoEl = dom.querySelector(".pageBox");
            if(paginationInfoEl)
              paginationInfoEl.textContent = currentPage + '/' + totalPages;
                paginationInfoEl.textContent = currentPage + "/" + totalPages;
          },
          slideChange:(value) => {
            let currentPage = value.activeIndex + 1; // 获取当前页(从1开始计数)
            let totalPages = value.slides.length; // 获取总页数
            var paginationInfoEl = dom.querySelector('.pageBox');
              var paginationInfoEl = dom.querySelector(".pageBox");
            if(paginationInfoEl)
              paginationInfoEl.textContent = currentPage + '/' + totalPages;
                paginationInfoEl.textContent = currentPage + "/" + totalPages;
          },
        },
      });
@@ -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>
src/books/childHealth/view/content/index.vue
@@ -171,7 +171,7 @@
  },
  mounted() {
    // 默认加载章节
    this.showCatalogList = [3];
    this.showCatalogList = [1];
    // 滚动监听节流
    this.throttledScrollHandler = _.throttle(
      this.scrollFun,
src/components/matching/matching.vue
@@ -54,7 +54,7 @@
    </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>
@@ -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 {
src/components/miniAudio/index.vue
New file
@@ -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>