闫增涛
2024-06-27 21dae909b36aab7d9fe48ea904eb1b7d9f44a292
src/books/childHealth/view/content/index.vue
@@ -157,6 +157,7 @@
        setTimeout(() => {
          this.initSwiper();
          this.initViewer();
          this.closeVideo()
        }, 200);
      }
    },
@@ -228,7 +229,7 @@
    // 测试页面跳转
    // setTimeout(() => {
    // this.gotoPage(1,10);
    // this.gotoPage(8,175);
    //   setTimeout(() => {
    //     this.renderSign("Highlight", {
    //       id: "2ACA9359",
@@ -242,7 +243,7 @@
    //     ids: ["2ACA9359"]
    //   });
    // }, 2000);
    //   }, 5000);
      // }, 500);
    // const pageDom = (this.container ? this.container : document)
    //   .querySelector("#app")
@@ -896,7 +897,35 @@
      this.highlightData = data;
      // 跳转
      this.gotoPage(data.catalog, data.page, () => {});
    },
    closeVideo() {
      let allVideo = (
        this.container ? this.container : document
      ).querySelectorAll(".video");
      for (let index = 0; index < allVideo.length; index++) {
        const item = allVideo[index];
        item.addEventListener('playing',(item) => {
          const path  = item.srcElement.src
          const videoList = Array.from(allVideo);
          console.log('播放',item);
          for (let cindex = 0; cindex < videoList.length; cindex++) {
            const citem = videoList[cindex];
            if(citem.currentSrc != path && path) {
              citem.pause()
            }
          }
        })
      }
    }
    //   allVideo = Array.from(allVideo);
    //   if(allVideo.length) {
    //     for (let index = 0; index < allVideo.length; index++) {
    //       const item = allVideo[index];
    //       if(item.currentSrc != path) {
    //         item.pause()
    //       }
    //     }
    //   }
  },
  components: {
    pageHeader,