From cb15c57d0ff984f5a100cf25d560fb0a69c00984 Mon Sep 17 00:00:00 2001
From: yiming <m13691596795@163.com>
Date: 星期二, 16 四月 2024 18:21:05 +0800
Subject: [PATCH] 音频bug4

---
 pages/bibliographyList/index.js |  216 +++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 205 insertions(+), 11 deletions(-)

diff --git a/pages/bibliographyList/index.js b/pages/bibliographyList/index.js
index 4c3cd21..af7a83d 100644
--- a/pages/bibliographyList/index.js
+++ b/pages/bibliographyList/index.js
@@ -7,6 +7,12 @@
      * 椤甸潰鐨勫垵濮嬫暟鎹�
      */
     data: {
+      input: '',
+      dialogKey: '',
+      showWithInput: false,
+      showTextAndTitleWithInput: false,
+      downloadLoadin: false,
+      isMore: null,
       higherList: [],
       vocationalList: [],
       teacherList: [],
@@ -16,7 +22,13 @@
       value: '',
       BarHeight: '',
       navBarHeight: '',
- 
+      start: 1,
+      tabValue: '',
+      keyword: '',
+      Md5: '',
+      emailError: false,
+      loading: true, //寮�鍚鏋跺睆鍔犺浇
+      hidden: true, //鏄惁灞曠ず鍐呭
     },
 
     /**
@@ -35,7 +47,13 @@
         barHeight: systInfo.statusBarHeight,
       })
 
+      let event = {
+        detail: {
+          value: "0"
+        }
+      }
 
+      this.onTabsChange(event)
 
 
 
@@ -92,14 +110,34 @@
 
     },
     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,
+          isMore: false
+        })
+      } else if (value === '1') {
+        console.log(value);
+        this.setData({
+          tabValue: value,
+          isMore: false
+        })
+      } else if (value === '2') {
+        console.log(value);
+        this.setData({
+          tabValue: value,
+          isMore: false
+        })
+      }
     },
 
-    onTabsClick(event) {
-      console.log(`Click tab, tab-panel value is ${event.detail.value}.`);
-    },
+
     //楂樼瓑鏁欒偛
     higherGet(keyword) {
+      console.log(keyword, 'keyword');
       let searchObj = {
         'Name*': keyword,
         '||author*': keyword,
@@ -112,7 +150,7 @@
         queryType: '*',
         paging: {
           start: '0',
-          size: '999'
+          size: this.data.start * 9
         },
         coverSize: {
           width: 260
@@ -138,7 +176,12 @@
           higherTotal: res.total
         })
         console.log(this.data.higherList, '5555');
+        this.setData({
+          loading: false, //寮�鍚鏋跺睆鍔犺浇
+          hidden: false, //鏄惁灞曠ず鍐呭
+        })
       })
+      wx.stopPullDownRefresh()
 
 
     },
@@ -156,7 +199,7 @@
         queryType: '*',
         paging: {
           start: '0',
-          size: '999'
+          size: this.data.start * 9
         },
         coverSize: {
           width: 260
@@ -181,6 +224,7 @@
         })
 
       })
+      wx.stopPullDownRefresh()
     },
     // 鑱屼笟鏁欒偛
     teacherGet(keyword) {
@@ -195,7 +239,7 @@
         queryType: '*',
         paging: {
           start: '0',
-          size: '999'
+          size: this.data.start * 9
         },
         coverSize: {
           width: 260
@@ -218,12 +262,13 @@
           teacherList: res.datas,
           teacherTotal: res.total
         })
-
       })
-
-
+      wx.stopPullDownRefresh()
     },
     downloadData(event) {
+      this.setData({
+        downloadLoadin: true
+      })
       console.log(111);
       const item = event.currentTarget.dataset.item;
       // console.log(item.datas.freeFile.Value);
@@ -253,6 +298,11 @@
           console.log('涓嬭浇鏂囦欢澶辫触', res);
         }
       });
+      setTimeout(() => {
+        this.setData({
+          downloadLoadin: false
+        });
+      }, 2000);
     },
     onSearchSubmit: function (e) {
       const keyword = e.detail.value;
@@ -267,5 +317,149 @@
     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() {
+      let keyword = this.data.value
+      this.setData({
+        start: 1,
+      })
+      this.higherGet(keyword)
+      this.vocationalGet(keyword)
+      this.teacherGet(keyword)
+    },
+    // 閭鐐瑰嚮
+    mailbox(e) {
+      const key = e.currentTarget.dataset.key;
+      const item = e.currentTarget.dataset.item;
+
+
+
+      this.setData({
+        [key]: true,
+        dialogKey: key,
+        input: '',
+        Md5: item.datas.freeFile.FileList[0].Md5
+      });
+
+
+
+    },
+
+    onEmailInput(e) {
+      const isEmailValid = /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/.test(e.detail.value);
+      this.setData({
+        emailError: !isEmailValid,
+        "input": e.detail.value,
+      });
+    },
+    //寮圭獥纭
+    onConfirm() {
+      if (!this.data.emailError && this.data.input) {
+        const {
+          dialogKey
+        } = this.data;
+        this.setData({
+          [dialogKey]: false
+        });
+
+
+        console.log(this.data.input);
+        console.log(this.data.Md5);
+        if (this.data.input) {
+          let query = {
+            eMail: this.data.input,
+            md5s: [this.data.Md5]
+          }
+          app.MG.file.sendFileWithEmail(query).then(res => {
+            console.log(res);
+          })
+        }
+      } else {
+        // 鏍¢獙涓嶉�氳繃锛岀粰鍑洪敊璇彁绀�
+        wx.showToast({
+          title: '閭鏍煎紡涓嶆纭�',
+          icon: 'none',
+        });
+      }
+
+    },
+    // 寮圭獥鍙栨秷
+    closeDialog() {
+      const {
+        dialogKey
+      } = this.data;
+      this.setData({
+        [dialogKey]: false
+      });
+      console.log(111);
+    },
+
+
 
   })
\ No newline at end of file

--
Gitblit v1.9.1