litian
2025-03-11 2c1a13eae201887fdee0a7e0007b7dccdfb4e1db
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
const app = getApp();
Component({
  properties: {
    applyState: {
      type: String,
      value: "none",
    },
    rejectCause: {
      type: String,
      value: "",
    },
    applyResourceLoading: {
      type: Boolean,
      value: false,
    },
    deadline: {
      type: String,
      value: "",
    },
    md5List: {
      type: Array,
    }
  },
  data: {
    showRejectDialog: false,
    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 = {};
      var myEventOption = {
        bubbles: true,
        composed: true,
      }; // 触发事件的选项
      this.triggerEvent("applyResource", myEventDetail, myEventOption);
    },
    showDialog() {
      this.setData({
        showRejectDialog: true,
      });
    },
    closeDialog() {
      this.setData({
        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
      })
    },
  },
});