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 |   57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 57 insertions(+), 0 deletions(-)

diff --git a/packageBookService/pages/bookServices/detail/components/teachResource/index.js b/packageBookService/pages/bookServices/detail/components/teachResource/index.js
index a515c77..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,6 +17,9 @@
       type: String,
       value: "",
     },
+    md5List: {
+      type: Array,
+    }
   },
   data: {
     showRejectDialog: false,
@@ -23,6 +27,8 @@
       content: "鐭ラ亾浜�",
       variant: "base"
     },
+    dialogBox: false,
+    input: '',
   },
   methods: {
     copy() {
@@ -56,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