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/retrievalPage/index.js |  227 +++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 205 insertions(+), 22 deletions(-)

diff --git a/pages/retrievalPage/index.js b/pages/retrievalPage/index.js
index 77f1025..3524d4a 100644
--- a/pages/retrievalPage/index.js
+++ b/pages/retrievalPage/index.js
@@ -9,6 +9,7 @@
    * 椤甸潰鐨勫垵濮嬫暟鎹�
    */
   data: {
+    isMore: null,
     tabPanelstyle: 'display:flex;justify-content:center;align-items:center;',
     navBarHeight: '',
     barHeight: '',
@@ -24,7 +25,12 @@
     biblioClassificationData: [],//涔﹀睍
     biblioClassificationTotal: 0,
     bookFairData: [],//涔︾洰
-    bookFairTotal: 0
+    bookFairTotal: 0,
+    pageCount: {
+      page: 1,
+      total: 0,
+    },
+    tabValue: ''
   },
 
   /**
@@ -35,7 +41,6 @@
     const menu = wx.getMenuButtonBoundingClientRect(); // 鑳跺泭淇℃伅
     const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 瀵艰埅鏍忛珮搴�
     this.setData({
-
       navBarHeight: navBarHeight,
       barHeight: systInfo.statusBarHeight,
       searchVal: options.searchVal
@@ -44,6 +49,13 @@
 
     this.retrievalPageGet()
     this.bibliographyGet()
+    let event = {
+      detail: {
+
+        value: "0"
+      }
+    }
+    this.onTabsChange(event)
   },
 
   /**
@@ -105,13 +117,47 @@
     this.retrievalPageGet()
     this.bibliographyGet()
   },
+
+
+  //鏍囩鐨勫垏鎹�
   onTabsChange(event) {
-    console.log(`Change tab, tab-panel searchVal is ${event.detail.searchVal}.`);
+    const value = event.detail.value
+    if (value === '0') {
+      this.setData({
+        tabValue: value,
+        isMore: false
+      })
+    } else if (value === '1') {
+      console.log(value, 'tab');
+      this.setData({
+        tabValue: value,
+        isMore: false
+      })
+    } else if (value === '2') {
+      this.setData({
+        tabValue: value,
+        isMore: false
+      })
+    } else if (value === '3') {
+      this.setData({
+        tabValue: value,
+        isMore: false
+      })
+    } else if (value === '4') {
+      this.setData({
+        tabValue: value,
+        isMore: false
+      })
+    } else if (value === '5') {
+      this.setData({
+        tabValue: value,
+        isMore: false
+      })
+    }
+
   },
 
-  onTabsClick(event) {
-    console.log(`Click tab, tab-panel searchVal is ${event.detail.searchVal}.`);
-  },
+
 
 
   retrievalPageGet() {
@@ -149,7 +195,7 @@
       },
       PageQuery: {
         Start: 0,
-        Size: 999
+        Size: this.data.pageCount.page * 9,
       },
       SortQuery: [
         {
@@ -194,7 +240,7 @@
       },
       PageQuery: {
         Start: 0,
-        Size: 999
+        Size: this.data.pageCount.page * 4
       },
       SortQuery: [
         {
@@ -238,7 +284,7 @@
       },
       PageQuery: {
         Start: 0,
-        Size: 999
+        Size: this.data.pageCount.page * 9,
       },
       SortQuery: [
         {
@@ -283,7 +329,7 @@
       },
       PageQuery: {
         Start: 0,
-        Size: 999
+        Size: this.data.pageCount.page * 6,
       },
       SortQuery: [
         {
@@ -327,7 +373,7 @@
 
       PageQuery: {
         Start: 0,
-        Size: 999
+        Size: this.data.pageCount.page * 10
       },
       SortQuery: [
         {
@@ -382,7 +428,8 @@
       })
       this.setData({
         bookData: datas1,
-        bookTotal: data1.totalCount
+        bookTotal: data1.totalCount,
+
       })
 
 
@@ -434,7 +481,7 @@
       datas5.forEach((items) => {
         items.subtitleName = items.subtitle + items.name
       })
-      console.log(datas5, 'sadasd');
+      // console.log(datas5, 'sadasd');
       this.setData({
         biblioClassificationData: datas5,
         biblioClassificationTotal: data5.totalCount
@@ -444,7 +491,7 @@
 
 
     })
-
+    wx.stopPullDownRefresh()
   },
   bibliographyGet() {
     let bibliographyObj = {}
@@ -462,7 +509,7 @@
       queryType: '*',
       paging: {
         start: 0,
-        size: 999
+        size: this.data.pageCount.page * 9,
       },
       coverSize: {
         width: 260
@@ -478,13 +525,14 @@
       },
       SysType: "CmsItem"
     }).then(res => {
-      // console.log(res);
+
       this.setData({
         bookFairData: res.datas,
         bookFairTotal: res.total
       })
 
     })
+    wx.stopPullDownRefresh()
   },
   downloadData(event) {
     console.log(111);
@@ -527,8 +575,6 @@
     const item = e.currentTarget.dataset.item
     wx.navigateTo({
       url: '/packageBookService/pages/bookServices/detail/index?id=' + item.id + '&name=' + item.name
-
-
     })
   },
   onBookExhibitionDetails(e) {
@@ -539,14 +585,151 @@
       url: '/pages/bookExhibitionDetails/index?id=' + item.id + '&bookName=' + item.name // 鍋囪璺宠浆鍒拌鎯呴〉闈紝骞朵紶閫掍簡id鍙傛暟
     });
   },
-  //瑙﹀簳鍑芥暟
-  onReachBottom() {
-    console.log("涓婃媺鍔犺浇....");
-  },
+
   //涓婃媺鍑芥暟
   onPullDownRefresh() {
     console.log("涓嬫媺鍒锋柊...");
   },
+  /**
+     * 椤甸潰涓婃媺瑙﹀簳浜嬩欢鐨勫鐞嗗嚱鏁�
+     */
+  onReachBottom(e) {
+    if (this.data.tabValue == 0) {
+      console.log(0);
+      if (this.data.bookData.length < this.data.bookTotal) {
+        this.setData({
+          isMore: true,
+          "pageCount.page": this.data.pageCount.page + 1
+        })
+        this.retrievalPageGet()
+      } else {
+        this.setData({
+          isMore: true,
+        })
+        setTimeout(() => {
+          this.setData({
+            isMore: false
+          })
+        }, 100)
+
+      }
+
+    } else if (this.data.tabValue == 1) {
+
+      if (this.data.courseData.length < this.data.courseTotal) {
+        this.setData({
+          isMore: true,
+          "pageCount.page": this.data.pageCount.page + 1
+        })
+        this.retrievalPageGet()
+      } else {
+        this.setData({
+          isMore: true,
+        })
+        setTimeout(() => {
+          this.setData({
+            isMore: false
+          })
+        }, 100)
+
+      }
+      console.log(2);
+    } else if (this.data.tabValue == 2) {
+
+      if (this.data.digitalTextbooksData.length < this.data.digitalTextbooksTotal && this.data.digitalTextbooksData.length > 9) {
+        this.setData({
+          isMore: true,
+          "pageCount.page": this.data.pageCount.page + 1
+        })
+        this.retrievalPageGet()
+      } else {
+        this.setData({
+          isMore: true,
+        })
+        setTimeout(() => {
+          this.setData({
+            isMore: false
+          })
+        }, 100)
+
+      }
+      console.log(2);
+    } else if (this.data.tabValue == 3) {
+      if (this.data.seminarData.length < this.data.seminarTotal) {
+        this.setData({
+          isMore: true,
+          "pageCount.page": this.data.pageCount.page + 1
+        })
+        this.retrievalPageGet()
+      } else {
+        this.setData({
+          isMore: true,
+        })
+        setTimeout(() => {
+          this.setData({
+            isMore: false
+          })
+        }, 100)
+      }
+      console.log(3);
+    } else if (this.data.tabValue == 4) {
+      if (this.data.bookFairData.length < this.data.bookFairTotal) {
+        this.setData({
+          isMore: true,
+          "pageCount.page": this.data.pageCount.page + 1
+        })
+        this.bibliographyGet()
+      } else {
+        this.setData({
+          isMore: true,
+        })
+        setTimeout(() => {
+          this.setData({
+            isMore: false
+          })
+        }, 100)
+      }
+      console.log(4);
+    } else if (this.data.tabValue == 5) {
+      if (this.data.biblioClassificationData.length < this.data.biblioClassificationTotal) {
+        this.setData({
+          isMore: true,
+          "pageCount.page": this.data.pageCount.page + 1
+        })
+        this.retrievalPageGet()
+      } else {
+        this.setData({
+          isMore: true,
+        })
+        setTimeout(() => {
+          this.setData({
+            isMore: false
+          })
+        }, 100)
+
+      }
+    }
 
 
+
+  },
+
+  // 涓嬫媺鍑芥暟
+  onPullDownRefresh() {
+
+    if (this.data.tabValue == 4) {
+      this.setData({
+        "pageCount.page": 1
+      })
+      this.bibliographyGet()
+    } else {
+      this.setData({
+        "pageCount.page": 1
+      })
+      this.retrievalPageGet()
+    }
+
+
+
+  },
 })
\ No newline at end of file

--
Gitblit v1.9.1