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

// 确认发送邮件弹窗

parent b94c4cf1
...@@ -520,16 +520,22 @@ extension YHPrincipleUploadListVC: UITableViewDelegate, UITableViewDataSource { ...@@ -520,16 +520,22 @@ extension YHPrincipleUploadListVC: UITableViewDelegate, UITableViewDataSource {
printLog("mail : \(mail)") printLog("mail : \(mail)")
if let template = model.file_url.first { if let template = model.file_url.first {
YHHUD.show(.progress(message:"发送邮件中")) // 确认发送弹窗
self.viewModel.sendMail(mail, template: template) { success, error in YHCheckEamilAlertView.show(nil, mail, "取消", "确认", .center) {
YHHUD.hide() YHHUD.show(.progress(message:"发送邮件中"))
if success { self.viewModel.sendMail(mail, template: template) { success, error in
YHHUD.flash(message: "发送成功") YHHUD.hide()
} else { if success {
let errMsg = error?.errorMsg ?? "发送失败" YHHUD.flash(message: "发送成功")
YHHUD.flash(message: errMsg) } else {
let errMsg = error?.errorMsg ?? "发送失败"
YHHUD.flash(message: errMsg)
}
} }
} }
} 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