Commit 514fd745 authored by David黄金龙's avatar David黄金龙

处理 按钮点击的问题

parent 39406479
......@@ -240,6 +240,8 @@ extension YHApplyActivityAlert {
setNeedsLayout()
layoutIfNeeded()
updateButtonUI()
}
......@@ -290,7 +292,7 @@ extension YHApplyActivityAlert {
@objc func clickSubmitBtn() {
subButton.isEnabled = false
needCheckFlag = true
// needCheckFlag = true
DispatchQueue.main.async {
self.subButton.isEnabled = true
if self.allDataIsOK() {
......@@ -554,6 +556,24 @@ extension YHApplyActivityAlert {
let tap1 : UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(tapButton(gestureRecognizer:)))
centerView.addGestureRecognizer(tap1)
updateButtonUI()
}
func updateButtonUI() {
guard let name = nameTextField.text,name.isEmpty == false,let number = applyNumberTextField.text,number.isEmpty == false,let phone = phoneTextField.text,phone.isEmpty == false else {
self.submitButton.isEnabled = false
self.submitButton.backgroundColor = UIColor.mainTextColor18
return
}
self.submitButton.isEnabled = true
self.submitButton.backgroundColor = UIColor.brandMainColor
}
}
......
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