From 88d80c9f40935c6ce7ea51683c6cdc1a80d1997b Mon Sep 17 00:00:00 2001
From: 闫增涛 <1829501689@qq.com>
Date: 星期五, 22 三月 2024 11:17:45 +0800
Subject: [PATCH] Merge refs/remotes/origin/master into refs/heads/master

---
 pages/bibliographyList/index.js |  121 +++++++++++++++++++++++++++++++++++++---
 1 files changed, 111 insertions(+), 10 deletions(-)

diff --git a/pages/bibliographyList/index.js b/pages/bibliographyList/index.js
index 4c3cd21..0a4cd71 100644
--- a/pages/bibliographyList/index.js
+++ b/pages/bibliographyList/index.js
@@ -7,6 +7,7 @@
      * 椤甸潰鐨勫垵濮嬫暟鎹�
      */
     data: {
+      isMore: null,
       higherList: [],
       vocationalList: [],
       teacherList: [],
@@ -16,7 +17,8 @@
       value: '',
       BarHeight: '',
       navBarHeight: '',
- 
+      start: 1,
+      tabValue: ''
     },
 
     /**
@@ -35,7 +37,12 @@
         barHeight: systInfo.statusBarHeight,
       })
 
+      let event =
+      {
+        detail: { value: "0" }
+      }
 
+      this.onTabsChange(event)
 
 
 
@@ -92,12 +99,28 @@
 
     },
     onTabsChange(event) {
-      console.log(`Change tab, tab-panel value is ${event.detail.value}.`);
+
+      const value = event.detail.value
+
+      if (value === '0') {
+        console.log(value);
+        this.setData({
+          tabValue: value
+        })
+      } else if (value === '1') {
+        console.log(value);
+        this.setData({
+          tabValue: value
+        })
+      } else if (value === '2') {
+        console.log(value);
+        this.setData({
+          tabValue: value
+        })
+      }
     },
 
-    onTabsClick(event) {
-      console.log(`Click tab, tab-panel value is ${event.detail.value}.`);
-    },
+
     //楂樼瓑鏁欒偛
     higherGet(keyword) {
       let searchObj = {
@@ -112,7 +135,7 @@
         queryType: '*',
         paging: {
           start: '0',
-          size: '999'
+          size: this.data.start * 9
         },
         coverSize: {
           width: 260
@@ -139,7 +162,7 @@
         })
         console.log(this.data.higherList, '5555');
       })
-
+      wx.stopPullDownRefresh()
 
     },
 
@@ -156,7 +179,7 @@
         queryType: '*',
         paging: {
           start: '0',
-          size: '999'
+          size: this.data.start * 9
         },
         coverSize: {
           width: 260
@@ -181,6 +204,7 @@
         })
 
       })
+      wx.stopPullDownRefresh()
     },
     // 鑱屼笟鏁欒偛
     teacherGet(keyword) {
@@ -195,7 +219,7 @@
         queryType: '*',
         paging: {
           start: '0',
-          size: '999'
+          size: this.data.start * 9
         },
         coverSize: {
           width: 260
@@ -220,7 +244,7 @@
         })
 
       })
-
+      wx.stopPullDownRefresh()
 
     },
     downloadData(event) {
@@ -267,5 +291,82 @@
     goBack() {
       wx.navigateBack();
     },
+    onReachBottom(e) {
+      if (this.data.tabValue == 0) {
+        console.log(0);
+        if (this.data.higherList.length < this.data.higherTotal) {
+          this.setData({
+            isMore: true,
+            start: this.data.start + 1
+          })
+          this.higherGet()
+        } else {
+          this.setData({
+            isMore: true,
+          })
+          setTimeout(() => {
+            this.setData({
+              isMore: false
+            })
+          }, 100)
+
+        }
+
+      } else if (this.data.tabValue == 1) {
+
+        if (this.data.teacherList.length < this.data.teacherTotal) {
+          this.setData({
+            isMore: true,
+            start: this.data.start + 1
+          })
+          this.teacherGet()
+        } else {
+          this.setData({
+            isMore: true,
+          })
+          setTimeout(() => {
+            this.setData({
+              isMore: false
+            })
+          }, 100)
+
+        }
+        console.log(2);
+      } else if (this.data.tabValue == 2) {
+
+        if (this.data.vocationalList.length < this.data.vocationalTotal && this.data.vocationalList.length > 9) {
+          this.setData({
+            isMore: true,
+            start: this.data.start + 1
+          })
+          this.vocationalGet()
+        } else {
+          this.setData({
+            isMore: true,
+          })
+          setTimeout(() => {
+            this.setData({
+              isMore: false
+            })
+          }, 100)
+
+        }
+        console.log(2);
+      }
+
+
+
+    },
+    onPullDownRefresh() {
+
+
+      this.setData({
+        start: 1
+      })
+      this.vocationalGet()
+      this.higherGet()
+      this.teacherGet()
+
+    },
 
   })
\ No newline at end of file

--
Gitblit v1.9.1