From c6abdfaf883e35e9c930dbdbe533d36e2966eb23 Mon Sep 17 00:00:00 2001
From: yiming <m13691596795@163.com>
Date: 星期一, 08 七月 2024 12:00:37 +0800
Subject: [PATCH] 检索页修改

---
 pages/retrievalPage/index.js |  129 +++++++++++++++++++++++--------------------
 1 files changed, 69 insertions(+), 60 deletions(-)

diff --git a/pages/retrievalPage/index.js b/pages/retrievalPage/index.js
index 0eaae66..4346ab2 100644
--- a/pages/retrievalPage/index.js
+++ b/pages/retrievalPage/index.js
@@ -19,7 +19,6 @@
     showTextAndTitleWithInput: false,
     downloadLoadin: false,
     isMore: null,
-    tabPanelstyle: 'display:flex;justify-content:center;align-items:center;',
     navBarHeight: '',
     barHeight: '',
     searchVal: '',
@@ -39,7 +38,41 @@
       page: 1,
       total: 0,
     },
-    tabValue: '0'
+    tabValue: 0,
+    tabPanelstyle: 'display:flex;justify-content:center;align-items:center;',
+    // tab閫夐」
+    tabList: [{
+        title: "鍥句功",
+        index: "0",
+        // bookTotal: this.data.bookTotal
+      },
+      {
+        title: "璇剧▼",
+        index: "1",
+        // bookTotal: this.data.courseTotal
+      },
+      {
+        title: "鏁板瓧鏁欐潗",
+        index: "2",
+        // bookTotal: this.data.digitalTextbooksTotal
+      }, {
+        title: "涓撻",
+        index: "3",
+        // bookTotal: this.data.seminarTotal
+      },
+      {
+        title: "涔︾洰",
+        index: "4",
+        // bookTotal: this.data.bookFairTotal
+      },
+      {
+        title: "涔﹀睍",
+        index: "5",
+        // bookTotal: this.data.biblioClassificationTotal
+      },
+    ],
+    tabsId: 0, //榛樿閫夊瀷涓鸿澶�
+
   },
 
   /**
@@ -57,12 +90,12 @@
     })
     this.retrievalPageGet()
     this.bibliographyGet()
-    let event = {
+    let e = {
       detail: {
         value: "0"
       }
     }
-    // this.onTabsChange(event)
+    this.onTabsChange(e)
   },
 
   /**
@@ -125,42 +158,19 @@
     this.bibliographyGet()
   },
 
-
   //鏍囩鐨勫垏鎹�
   onTabsChange(event) {
     const value = event.detail.value
     console.log(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
-      })
+    this.setData({
+      tabValue: value,
+      isMore: false
+    })
+
+    if (value === '4') {
+      this.bibliographyGet()
+    } else {
+      this.retrievalPageGet()
     }
   },
 
@@ -219,8 +229,6 @@
       ...searchObj,
       ...fields
     }
-
-
     let courseObj = {}
     if (this.data.searchVal) {
       courseObj = {
@@ -229,7 +237,6 @@
         '||isbn*': this.data.searchVal.trim(),
         '||seriesName*': this.data.searchVal.trim()
       }
-
     }
     //璇剧▼
     let queryCourse = {
@@ -412,7 +419,6 @@
       data: body
     }).then((resp) => {
       console.log(resp, 'resp');
-
       //鍥句功       0
       const data1 = resp[0]
       const datas1 = handleQueryResourceListData({
@@ -422,12 +428,7 @@
       this.setData({
         bookData: datas1,
         bookTotal: data1.totalCount,
-
       })
-
-
-
-
       //鏁板瓧璇剧▼    1
       const data2 = resp[1]
       const datas2 = handleQueryResourceListData({
@@ -438,9 +439,6 @@
         courseData: datas2,
         courseTotal: data2.totalCount
       })
-
-
-
       // 鏁板瓧鏁欐潗    2
       const data3 = resp[2]
       const datas3 = handleQueryResourceListData({
@@ -451,15 +449,12 @@
         digitalTextbooksData: datas3,
         digitalTextbooksTotal: data3.totalCount
       })
-
       // 涓撻鐮旇   3
-
       const data4 = resp[3]
       const datas4 = handleQueryResourceListData({
         datas: data4.datas,
         fields
       })
-
       this.setData({
         seminarData: datas4,
         seminarTotal: data4.totalCount
@@ -470,7 +465,6 @@
         datas: data5.datas,
         fields
       })
-
       datas5.forEach((items) => {
         items.subtitleName = items.subtitle + items.name
       })
@@ -479,18 +473,12 @@
         biblioClassificationData: datas5,
         biblioClassificationTotal: data5.totalCount
       })
-
       this.setData({
         loading: false,
         hidden: false,
       })
-
-
     })
     wx.stopPullDownRefresh()
-
-
-
   },
   bibliographyGet() {
     let bibliographyObj = {}
@@ -534,9 +522,7 @@
     wx.stopPullDownRefresh()
   },
   downloadData(event) {
-    console.log(111);
     const item = event.currentTarget.dataset.item;
-    // console.log(item.datas.freeFile.Value);
     const URL = app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.datas.freeFile.Value
     item.determine = false
     console.log(URL, 'URL');
@@ -597,6 +583,7 @@
    * 椤甸潰涓婃媺瑙﹀簳浜嬩欢鐨勫鐞嗗嚱鏁�
    */
   onReachBottom(e) {
+    console.log(this.data.tabValue);
     if (this.data.tabValue == 0) {
       console.log(0);
       if (this.data.bookData.length < this.data.bookTotal) {
@@ -910,4 +897,26 @@
       }
     }
   },
+  onTabsClick(event) {
+    console.log(`Click tab, tab-panel value is ${event.detail.value}.`);
+  },
+  tabClick() {
+    console.log(2323);
+  },
+  // 婊戝姩鏃惰Е鍙戠殑浜嬩欢
+  slideOn(e) {
+    // 鎷垮埌褰撳墠绱㈠紩骞跺姩鎬佹敼鍙�
+    this.setData({
+      tabsId: e.detail.current
+    })
+  },
+
+  //鐐瑰嚮tab鏃惰Е鍙�
+  tabsOn(e) {
+    this.setData({
+      //鎷垮埌褰撳墠绱㈠紩骞跺姩鎬佹敼鍙�
+      tabsId: e.currentTarget.dataset.idx
+    })
+  },
+
 })
\ No newline at end of file

--
Gitblit v1.9.1