From 9ba507bed7688a1a9eee31255e40add8bf1a8689 Mon Sep 17 00:00:00 2001
From: yiming <m13691596795@163.com>
Date: 星期日, 28 四月 2024 18:54:33 +0800
Subject: [PATCH] 书展bug

---
 pages/bibliographyList/index.js |  114 ++++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 88 insertions(+), 26 deletions(-)

diff --git a/pages/bibliographyList/index.js b/pages/bibliographyList/index.js
index 7529409..a4e6b10 100644
--- a/pages/bibliographyList/index.js
+++ b/pages/bibliographyList/index.js
@@ -1,4 +1,5 @@
 // pages/bibliographyList/index.js
+import Toast from 'tdesign-miniprogram/toast/index';
 const app = getApp()
 const config =
   Page({
@@ -7,6 +8,9 @@
      * 椤甸潰鐨勫垵濮嬫暟鎹�
      */
     data: {
+      hiddenmodalput: false,
+      name: "",
+      phoneNum: '',
       input: '',
       dialogKey: '',
       showWithInput: false,
@@ -35,6 +39,10 @@
      * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
      */
     onLoad(options) {
+
+
+
+
       this.higherGet()
       this.vocationalGet()
       this.teacherGet()
@@ -46,19 +54,12 @@
         navBarHeight: navBarHeight,
         barHeight: systInfo.statusBarHeight,
       })
-
       let event = {
         detail: {
           value: "0"
         }
       }
-
       this.onTabsChange(event)
-
-
-
-
-
     },
 
     /**
@@ -72,7 +73,8 @@
      * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず
      */
     onShow() {
-      console.log(this.data.value);
+      // console.log(this.data.value);
+
     },
 
     /**
@@ -137,7 +139,7 @@
 
     //楂樼瓑鏁欒偛
     higherGet(keyword) {
-      console.log(keyword, 'keyword');
+      // console.log(keyword, 'keyword');
       let searchObj = {
         'Name*': keyword,
         '||author*': keyword,
@@ -170,12 +172,12 @@
         res.datas.forEach(item => {
           item.determine = true
         })
-        console.log(res, 789111);
+        // console.log(res, 789111);
         this.setData({
           higherList: res.datas,
           higherTotal: res.total
         })
-        console.log(this.data.higherList, '5555');
+        // console.log(this.data.higherList, '5555');
         this.setData({
           loading: false, //寮�鍚鏋跺睆鍔犺浇
           hidden: false, //鏄惁灞曠ず鍐呭
@@ -310,20 +312,32 @@
 
       const item = event.currentTarget.dataset.item
       console.log(item);
-      wx.navigateTo({
-        url: "/packageBookService/pages/components/webView/index?md5=" +
-          item.freeFile +
-          "&fileName=" +
-          item.name +
-          "&fileType=" +
-          item.fileType + "&bookBuy=true"
-        // "&freePage=" +
-        // this.data.fileInfo.freePage +
+      if (item.fileType == "pdf") {
+        wx.navigateTo({
+          url: "/packageBookService/pages/components/webView/index?md5=" +
+            item.freeFile +
+            "&fileName=" +
+            item.name +
+            "&fileType=" +
+            item.fileType + "&bookBuy=true"
+          // "&freePage=" +
+          // this.data.fileInfo.freePage +
 
-        // +
-        // "&bookId=" +
-        // this.data.bookDetail.id,
-      });
+          // +
+          // "&bookId=" +
+          // this.data.bookDetail.id,
+        });
+      } else {
+        Toast({
+          context: this,
+          selector: '#t-toast',
+          message: '姝や功涓嶈兘鏌ョ湅',
+          theme: 'warning',
+          direction: 'column',
+        });
+        console.log(456);
+      }
+
 
 
     },
@@ -424,10 +438,12 @@
 
 
       this.setData({
-        [key]: true,
-        dialogKey: key,
+        // [key]: true,
+        // dialogKey: key,
+        hiddenmodalput: true,
         input: '',
         Md5: item.datas.freeFile.FileList[0].Md5
+
       });
 
 
@@ -482,7 +498,53 @@
       });
       console.log(111);
     },
+    //鍙栨秷寮规
+    cancelM: function (e) {
+      this.setData({
+        hiddenmodalput: false,
+      })
+    },
+    //鎻愪氦
+    confirmM: function (e) {
+      console.log("濮撳悕锛�" + this.data.name + "  鐢佃瘽锛�" + this.data.phoneNum);
+      if (!this.data.emailError && this.data.name) {
 
 
 
+
+        if (this.data.name) {
+          let query = {
+            eMail: this.data.name,
+            md5s: [this.data.Md5]
+          }
+          app.MG.file.sendFileWithEmail(query).then(res => {
+            console.log(res);
+            this.setData({
+              hiddenmodalput: false,
+            })
+          })
+        }
+      } else {
+        // 鏍¢獙涓嶉�氳繃锛岀粰鍑洪敊璇彁绀�
+        wx.showToast({
+          title: '閭鏍煎紡涓嶆纭�',
+          icon: 'none',
+        });
+      }
+
+    },
+
+    iName: function (e) {
+      this.setData({
+        name: e.detail.value
+      })
+      // console.log(this.data.name);
+    },
+    iPhoneNum: function (e) {
+      this.setData({
+        phoneNum: e.detail.value
+      })
+    },
+
+
   })
\ No newline at end of file

--
Gitblit v1.9.1