| | |
| | | @IBOutlet weak var tf_address: QMUITextField! |
| | | @IBOutlet weak var btn_submit: UIButton! |
| | | @IBOutlet weak var lb_uploadAuth: UILabel! |
| | | @IBOutlet weak var tf_pwd: QMUITextField! |
| | | |
| | | private var viewModel = EnterpriseViewModel() |
| | | private var uploadImgUrl = "" |
| | |
| | | tf_legalPersonPhone.text = m.legalPhone |
| | | tf_code.text = m.identifier |
| | | tf_address.text = m.contactAddress |
| | | tf_pwd.text = m.password |
| | | uploadImgUrl = m.businessLicense |
| | | lb_uploadAuth.isHidden = m.businessLicense.isEmpty |
| | | btn_submit.setTitle("修改", for: .normal) |
| | |
| | | alert(text: tf_address.placeholder ?? "");return |
| | | } |
| | | |
| | | guard !tf_pwd.text!.isEmpty else { |
| | | alert(text: tf_pwd.placeholder ?? "");return |
| | | } |
| | | |
| | | guard !uploadImgUrl.isEmpty else { |
| | | alert(text: "请上传三证合一");return |
| | | } |
| | | |
| | | viewModel.submitEnterprise(id:model?.id,name: tf_enterprise.text!, mailbox: tf_mail.text!, legalName: tf_legalPerson.text!, legalPhone: tf_legalPersonPhone.text!, identifier: tf_code.text!, contactAddress: tf_address.text!, businessLicense: uploadImgUrl) { response in |
| | | viewModel.submitEnterprise(id:model?.id,name: tf_enterprise.text!, mailbox: tf_mail.text!, legalName: tf_legalPerson.text!, legalPhone: tf_legalPersonPhone.text!, identifier: tf_code.text!, contactAddress: tf_address.text!, businessLicense: uploadImgUrl, pwd: tf_pwd.text!) { response in |
| | | switch response { |
| | | case .success(_): |
| | | |
| | |
| | | |
| | | |
| | | private func check(){ |
| | | let sequece = Observable.combineLatest(tf_enterprise.rx.text.orEmpty,tf_mail.rx.text.orEmpty,tf_legalPerson.rx.text.orEmpty,tf_legalPersonPhone.rx.text.orEmpty,tf_code.rx.text.orEmpty,tf_address.rx.text.orEmpty) |
| | | let sequece = Observable.combineLatest(tf_enterprise.rx.text.orEmpty,tf_mail.rx.text.orEmpty,tf_legalPerson.rx.text.orEmpty,tf_legalPersonPhone.rx.text.orEmpty,tf_code.rx.text.orEmpty,tf_address.rx.text.orEmpty,tf_pwd.rx.text.orEmpty) |
| | | |
| | | sequece.subscribe {[weak self] v1,v2,v3,v4,v5,v6 in |
| | | let status = !(v1.isEmpty || v2.isEmpty || v3.isEmpty || v4.isEmpty || v5.isEmpty || v6.isEmpty) |
| | | sequece.subscribe {[weak self] v1,v2,v3,v4,v5,v6,v7 in |
| | | let status = !(v1.isEmpty || v2.isEmpty || v3.isEmpty || v4.isEmpty || v5.isEmpty || v6.isEmpty || v7.isEmpty) |
| | | self?.btn_submit.isEnabled = status |
| | | if status{ |
| | | self?.btn_submit.backgroundColor = UIColor(hexString: "#45B494") |