Commit bff1d87e authored by Steven杜宇's avatar Steven杜宇

// 确认发送邮件弹窗

parent b94c4cf1
...@@ -520,6 +520,8 @@ extension YHPrincipleUploadListVC: UITableViewDelegate, UITableViewDataSource { ...@@ -520,6 +520,8 @@ extension YHPrincipleUploadListVC: UITableViewDelegate, UITableViewDataSource {
printLog("mail : \(mail)") printLog("mail : \(mail)")
if let template = model.file_url.first { if let template = model.file_url.first {
// 确认发送弹窗
YHCheckEamilAlertView.show(nil, mail, "取消", "确认", .center) {
YHHUD.show(.progress(message:"发送邮件中")) YHHUD.show(.progress(message:"发送邮件中"))
self.viewModel.sendMail(mail, template: template) { success, error in self.viewModel.sendMail(mail, template: template) { success, error in
YHHUD.hide() YHHUD.hide()
...@@ -531,6 +533,10 @@ extension YHPrincipleUploadListVC: UITableViewDelegate, UITableViewDataSource { ...@@ -531,6 +533,10 @@ extension YHPrincipleUploadListVC: UITableViewDelegate, UITableViewDataSource {
} }
} }
} }
} else {
YHHUD.flash(message: "模版链接为空")
}
} }
mailView.show() mailView.show()
......
...@@ -18,10 +18,11 @@ class YHCheckEamilAlertView: UIView { ...@@ -18,10 +18,11 @@ class YHCheckEamilAlertView: UIView {
var agreeButton: UIButton! var agreeButton: UIButton!
var disAgressButton: UIButton! var disAgressButton: UIButton!
static func show(_ title: String? = nil, _ message: String? = nil, _ leftButtonString: String? = nil, _ rightButtonString: String? = nil, callBack: @escaping (() -> Void)) { static func show(_ title: String? = nil, _ message: String? = nil, _ leftButtonString: String? = nil, _ rightButtonString: String? = nil, _ textAlignment: NSTextAlignment = .left, callBack: @escaping (() -> Void)) {
let view = YHCheckEamilAlertView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight)) let view = YHCheckEamilAlertView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight))
view.agreeBlock = callBack view.agreeBlock = callBack
view.setContent(title, message, leftButtonString, rightButtonString) view.setContent(title, message, leftButtonString, rightButtonString)
view.messageLabel.textAlignment = textAlignment
let window = UIApplication.shared.yhKeyWindow() let window = UIApplication.shared.yhKeyWindow()
window?.addSubview(view) window?.addSubview(view)
} }
...@@ -61,19 +62,19 @@ class YHCheckEamilAlertView: UIView { ...@@ -61,19 +62,19 @@ class YHCheckEamilAlertView: UIView {
disAgressButton.snp.removeConstraints() disAgressButton.snp.removeConstraints()
disAgressButton.snp.remakeConstraints { make in disAgressButton.snp.remakeConstraints { make in
make.top.equalTo(messageLabel.snp.bottom).offset(kMargin) make.top.equalTo(messageLabel.snp.bottom).offset(19)
make.left.equalTo(16) make.left.equalTo(16)
make.width.equalTo(128) make.width.equalTo(128)
make.height.equalTo(45) make.height.equalTo(45)
make.bottom.equalTo(-21) make.bottom.equalTo(-16)
} }
agreeButton.snp.removeConstraints() agreeButton.snp.removeConstraints()
agreeButton.snp.makeConstraints { make in agreeButton.snp.remakeConstraints { make in
make.right.equalTo(-16) make.right.equalTo(-16)
make.width.equalTo(128) make.width.equalTo(128)
make.height.equalTo(45) make.height.equalTo(45)
make.top.equalTo(messageLabel.snp.bottom).offset(kMargin) make.top.equalTo(disAgressButton)
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment