From a979901edc84fa2771281a9fc0a891e078a4affa Mon Sep 17 00:00:00 2001
From: YM <479443481@qq.com>
Date: 星期三, 15 五月 2024 12:20:06 +0800
Subject: [PATCH] 通信

---
 src/books/childHealth/view/content/index.vue |   41 +++++++++++++++++++++++++++--------------
 1 files changed, 27 insertions(+), 14 deletions(-)

diff --git a/src/books/childHealth/view/content/index.vue b/src/books/childHealth/view/content/index.vue
index 4fcaab1..9693c89 100644
--- a/src/books/childHealth/view/content/index.vue
+++ b/src/books/childHealth/view/content/index.vue
@@ -45,20 +45,21 @@
       loadThreshold: 300, // 瑙﹀彂鍔犺浇闃堝��
       throttleThreshold: 100, // 鑺傛祦闃堝��
       previousScrollTop: 0,
-      throttledScrollHandler: null,
+      throttledScrollHandler: null
     };
   },
   watch: {
     showCatalogList: {
       handler(newVal) {
         console.log("鏄剧ず绔犺妭", newVal);
-        if (this.$store.state.qiankun.windowSelection) {
-          this.$store.state.qiankun.windowSelection({
-            showCatalogList: newVal,
+        if (this.$store.state.qiankun && this.$store.state.qiankun.catalogChange) {
+          // 璋冪敤鐖跺眰鏂规硶
+          this.$store.state.qiankun.catalogChange({
+            showCatalogList: newVal
           });
         }
-      },
-    },
+      }
+    }
   },
   mounted() {
     // 榛樿鍔犺浇绔犺妭
@@ -72,16 +73,19 @@
     // 鎻愪緵椤甸潰璺宠浆鍔熻兘
     if (this.setGlobalState) {
       console.log("setGlobalState");
+      // 瀹氫箟瀛愬眰鏂规硶
       this.setGlobalState({
         gotoPage: (catalog, page) => {
+          console.log(catalog, page, "gotoPage锛歝atalog, page");
           this.gotoPage(catalog, page);
-        },
+        }
       });
     }
+
     // 娴嬭瘯椤甸潰璺宠浆
-    // setTimeout(() => {
-    //   this.gotoPage(5, 100);
-    // }, 3000);
+    setTimeout(() => {
+      this.gotoPage(5, 100);
+    }, 3000);
   },
   methods: {
     scrollFun(e) {
@@ -126,6 +130,15 @@
       console.log(this.showCatalogList);
       // 鏇存柊涓婁竴娆℃粴鍔ㄧ殑浣嶇疆
       this.previousScrollTop = event.target.scrollTop;
+
+      // 杩斿洖椤电爜鍜岀珷鑺備俊鎭�
+      if (this.$store.state.qiankun && this.$store.state.qiankun.pageChange)
+        this.$store.state.qiankun.pageChange({
+          page: 100,
+          catalog: 5,
+          catalogId: "",
+          catalogName: ""
+        });
     },
     gotoPage(catalog, page) {
       if (catalog >= 0 && catalog <= this.catalogLength) {
@@ -136,7 +149,7 @@
           this.showCatalogList = [
             this.catalogLength - 2,
             this.catalogLength - 1,
-            this.catalogLength,
+            this.catalogLength
           ];
         } else {
           this.showCatalogList = [catalog - 1, catalog, catalog + 1];
@@ -153,7 +166,7 @@
       } else {
         console.log("绔犺妭閿欒锛�");
       }
-    },
+    }
   },
   components: {
     pageHeader,
@@ -169,8 +182,8 @@
     chapterTen,
     chapterEleven,
     chapterTwelve,
-    chapterThirteen,
-  },
+    chapterThirteen
+  }
 };
 </script>
 

--
Gitblit v1.9.1