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 |  106 ++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 93 insertions(+), 13 deletions(-)

diff --git a/packageBookService/pages/bookServices/detail/components/teachResource/index.js b/packageBookService/pages/bookServices/detail/components/teachResource/index.js
index 37b0645..37b2482 100644
--- a/packageBookService/pages/bookServices/detail/components/teachResource/index.js
+++ b/packageBookService/pages/bookServices/detail/components/teachResource/index.js
@@ -1,37 +1,117 @@
+const app = getApp();
 Component({
   properties: {
     applyState: {
       type: String,
-      value: 'none'
+      value: "none",
     },
     rejectCause: {
       type: String,
-      value: ''
+      value: "",
+    },
+    applyResourceLoading: {
+      type: Boolean,
+      value: false,
+    },
+    deadline: {
+      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: "https://jsek.bnuic.com/home/#/home/index",
+        success: function (res) {
+          wx.showToast({
+            title: "澶嶅埗鎴愬姛"
+          });
+        },
+        fail: function (res) {
+          console.log(res);
+        },
+      });
+    },
     applyResource() {
-      var myEventDetail = {} // detail瀵硅薄锛屾彁渚涚粰浜嬩欢鐩戝惉鍑芥暟
+      var myEventDetail = {};
       var myEventOption = {
         bubbles: true,
         composed: true,
-        // capturePhase: true,
-      } // 瑙﹀彂浜嬩欢鐨勯�夐」
-      this.triggerEvent('applyResource', myEventDetail, myEventOption)
+      }; // 瑙﹀彂浜嬩欢鐨勯�夐」
+      this.triggerEvent("applyResource", myEventDetail, myEventOption);
     },
     showDialog() {
       this.setData({
-        showRejectDialog: true
-      })
+        showRejectDialog: true,
+      });
     },
     closeDialog() {
       this.setData({
-        showRejectDialog: false
+        showRejectDialog: false,
+      });
+    },
+    uploadBtn() {
+      this.triggerEvent("uploadFile", true);
+    },
+
+    mailbox() {
+      this.setData({
+        dialogBox: true
       })
-    }
-  }
-})
\ No newline at end of file
+    },
+    // 寮圭獥鍙栨秷
+    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