From f86bd75868eb9b0e81d5cb43d6e76c08a0da3083 Mon Sep 17 00:00:00 2001
From: yiming <m13691596795@163.com>
Date: 星期一, 15 四月 2024 16:55:49 +0800
Subject: [PATCH] 音频bug3

---
 pages/retrievalPage/index.js |  209 +++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 198 insertions(+), 11 deletions(-)

diff --git a/pages/retrievalPage/index.js b/pages/retrievalPage/index.js
index bd94d94..659db87 100644
--- a/pages/retrievalPage/index.js
+++ b/pages/retrievalPage/index.js
@@ -11,6 +11,13 @@
    * 椤甸潰鐨勫垵濮嬫暟鎹�
    */
   data: {
+    loading: true,
+    hidden: true,
+    input: '',
+    dialogKey: '',
+    showWithInput: false,
+    showTextAndTitleWithInput: false,
+    downloadLoadin: false,
     isMore: null,
     tabPanelstyle: 'display:flex;justify-content:center;align-items:center;',
     navBarHeight: '',
@@ -60,6 +67,8 @@
       }
     }
     this.onTabsChange(event)
+
+
   },
 
   /**
@@ -126,11 +135,8 @@
   //鏍囩鐨勫垏鎹�
   onTabsChange(event) {
     const value = event.detail.value
-    // if (this.data.bookData <= 0 || this.data.courseData <= 0 || this.data.digitalTextbooksData <= 0 || this.data.seminarData <= 0 || this.data.biblioClassificationData <= 0 || this.data.bookFairData <= 0) {
-    //   this.setData({
-    //     isMore: true
-    //   })
-    // }
+    console.log(value);
+
     if (value === '0') {
       this.setData({
         tabValue: value,
@@ -487,7 +493,10 @@
         biblioClassificationTotal: data5.totalCount
       })
 
-
+      this.setData({
+        loading: false,
+        hidden: false,
+      })
 
 
     })
@@ -709,17 +718,13 @@
             isMore: false
           })
         }, 100)
-
       }
     }
-
-
-
   },
 
   // 涓嬫媺鍑芥暟
   onPullDownRefresh() {
-
+    console.log(456);
     if (this.data.tabValue == 4) {
       this.setData({
         "pageCount.page": 1
@@ -731,8 +736,190 @@
       })
       this.retrievalPageGet()
     }
+  },
 
+  underConstruction() {
+    wx.showToast({
+      title: "寤鸿涓�",
+      icon: 'none',
+      duration: 1000
+    })
+  },
+  // 閭鐐瑰嚮
+  mailbox(e) {
+    console.log(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);
+  },
+  onScrollToLower() {
+    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)
+      }
+    }
+  },
+  onTabsClick(event) {
+    console.log(`Click tab, tab-panel value is ${event.detail.value}.`);
   },
 })
\ No newline at end of file

--
Gitblit v1.9.1