闫增涛
2024-11-19 d8c24a06b3e7844ad65e7c821c022dbb36d29430
src/books/childHealth/view/content/index.vue
@@ -229,7 +229,7 @@
    // 测试页面跳转
    // setTimeout(() => {
    // this.gotoPage(11,282);
    // this.gotoPage(4,87);
    //   setTimeout(() => {
    //     this.renderSign("Highlight", {
    //       id: "2ACA9359",
@@ -276,6 +276,8 @@
    // },
    // 滚动监听
    scrollFun(event) {
      // 视频小窗方法
      this.handleVideoPicture()
      // 判断向上滚动还是向下滚动
      if (event.target.scrollTop > this.previousScrollTop) {
        // 向下
@@ -918,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: {