| | |
| | | const app = getApp(); |
| | | Component({ |
| | | properties: { |
| | | applyState: { |
| | |
| | | type: String, |
| | | value: "", |
| | | }, |
| | | md5List: { |
| | | type: Array, |
| | | } |
| | | }, |
| | | data: { |
| | | showRejectDialog: false, |
| | |
| | | content: "知道了", |
| | | variant: "base" |
| | | }, |
| | | dialogBox: false, |
| | | input: '', |
| | | }, |
| | | methods: { |
| | | copy() { |
| | |
| | | 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 |
| | | }) |
| | | }, |
| | | }, |
| | | }); |