From abe52e53bee051e3f801d001c4de58d34a3fefd7 Mon Sep 17 00:00:00 2001
From: litian <C21AF165>
Date: 星期三, 23 十月 2024 09:54:09 +0800
Subject: [PATCH] wj

---
 packageBookService/pages/bookServices/detail/components/teachResource/index.js |   74 +++++++++++++++++++++++++++++++++---
 1 files changed, 67 insertions(+), 7 deletions(-)

diff --git a/packageBookService/pages/bookServices/detail/components/teachResource/index.js b/packageBookService/pages/bookServices/detail/components/teachResource/index.js
index 379bab2..37b2482 100644
--- a/packageBookService/pages/bookServices/detail/components/teachResource/index.js
+++ b/packageBookService/pages/bookServices/detail/components/teachResource/index.js
@@ -1,3 +1,4 @@
+const app = getApp();
 Component({
   properties: {
     applyState: {
@@ -16,22 +17,30 @@
       type: String,
       value: "",
     },
+    md5List: {
+      type: Array,
+    }
   },
   data: {
     showRejectDialog: false,
-    confirmBtn: { content: "鐭ラ亾浜�", variant: "base" },
+    confirmBtn: {
+      content: "鐭ラ亾浜�",
+      variant: "base"
+    },
+    dialogBox: false,
+    input: '',
   },
   methods: {
     copy() {
       wx.setClipboardData({
-        data: "11",
+        data: "https://jsek.bnuic.com/home/#/home/index",
         success: function (res) {
-          wx.showToast({ title: "澶嶅埗鎴愬姛" });
+          wx.showToast({
+            title: "澶嶅埗鎴愬姛"
+          });
         },
         fail: function (res) {
-          wx.showToast({
-            title: "澶辫触",
-          });
+          console.log(res);
         },
       });
     },
@@ -53,5 +62,56 @@
         showRejectDialog: false,
       });
     },
+    uploadBtn() {
+      this.triggerEvent("uploadFile", true);
+    },
+
+    mailbox() {
+      this.setData({
+        dialogBox: true
+      })
+    },
+    // 寮圭獥鍙栨秷
+    closeDialog() {
+      this.setData({
+        dialogBox: false,
+      })
+    },
+    //鎻愪氦
+    confirmM(e) {
+      wx.showLoading({
+        title: '鍙戦�佷腑...',
+      })
+      const isEmailValid = /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/.test(this.data.input);
+      if (isEmailValid && this.data.input) {
+        this.setData({
+          dialogBox: false
+        })
+        let query = {
+          eMail: this.data.input,
+          md5s: this.properties.md5List
+        }
+        app.MG.file.sendFileWithEmail(query).then(res => {
+          wx.hideLoading()
+          if (res) {
+            wx.showToast({
+              icon: 'success',
+              title: '閭欢宸插彂閫�',
+            })
+          }
+        })
+      } else {
+        // 鏍¢獙涓嶉�氳繃锛岀粰鍑洪敊璇彁绀�
+        wx.showToast({
+          title: '閭鏍煎紡涓嶆纭�',
+          icon: 'none',
+        });
+      }
+    },
+    inputChange(e) {
+      this.setData({
+        input: e.detail.value
+      })
+    },
   },
-});
+});
\ No newline at end of file

--
Gitblit v1.9.1