闫增涛
2024-11-19 d8c24a06b3e7844ad65e7c821c022dbb36d29430
src/books/childHealth/view/content/index.vue
@@ -229,7 +229,7 @@
    // 测试页面跳转
    // setTimeout(() => {
    // this.gotoPage(8,175);
    // this.gotoPage(4,87);
    //   setTimeout(() => {
    //     this.renderSign("Highlight", {
    //       id: "2ACA9359",
@@ -276,6 +276,8 @@
    // },
    // 滚动监听
    scrollFun(event) {
      // 视频小窗方法
      this.handleVideoPicture()
      // 判断向上滚动还是向下滚动
      if (event.target.scrollTop > this.previousScrollTop) {
        // 向下
@@ -614,11 +616,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 +631,8 @@
                        this.config.activeBook
                      );
                    }
                    this.questionDataMap[page] = obj;
                    this.$set(this.questionDataMap,page,obj)
                    // this.questionDataMap[page] = obj;
                  }
                }
              }
@@ -916,6 +920,24 @@
          }
        })
      }
    },
    // 视频小窗
    handleVideoPicture() {
      let doms = (
        this.container ? this.container : document
      ).querySelectorAll(".video");
      doms = Array.from(doms)
      if(!doms.length) return false
      const playVudio = doms
        .reverse()
        .find((item) => item.paused == false);
      if(playVudio) {
        const bottomGap = playVudio.getBoundingClientRect().bottom;
        const topGap = playVudio.getBoundingClientRect().top;
        if (bottomGap < 0 || topGap > window.innerHeight) {
          playVudio.requestPictureInPicture();
        }
      }
    }
  },
  components: {