From d8c24a06b3e7844ad65e7c821c022dbb36d29430 Mon Sep 17 00:00:00 2001
From: 闫增涛 <1829501689@qq.com>
Date: 星期二, 19 十一月 2024 17:15:08 +0800
Subject: [PATCH] 各图书bug修改

---
 src/books/childHealth/view/content/index.vue |   28 +++++++++++++++++++++++++---
 1 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/src/books/childHealth/view/content/index.vue b/src/books/childHealth/view/content/index.vue
index 213ed4f..3f1280e 100644
--- a/src/books/childHealth/view/content/index.vue
+++ b/src/books/childHealth/view/content/index.vue
@@ -229,7 +229,7 @@
 
     // 娴嬭瘯椤甸潰璺宠浆
     // setTimeout(() => {
-    // this.gotoPage(8,233);
+    // 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: {

--
Gitblit v1.9.1