| | |
| | | title = "更改绑定手机" |
| | | } |
| | | |
| | | |
| | | @IBAction func sendCodeAction(_ sender: UIButton) { |
| | | |
| | | Services.sendCode(type: .exchangePhone).subscribe(onNext: { data in |
| | | if let _ = data.data{ |
| | | sender.jq_openCountDown(60, defultTitle: "发送验证码") { |
| | | sender.titleLabel?.font = UIFont.systemFont(ofSize: 12) |
| | | sender.setTitleColor(.black.withAlphaComponent(0.3), for: .normal) |
| | | } completeClouse: { |
| | | sender.titleLabel?.font = UIFont.systemFont(ofSize: 14, weight: .medium) |
| | | sender.setTitleColor(UIColor(hexStr: "#96AD81"), for: .normal) |
| | | } |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | |
| | | @IBAction func completeAction(_ sender: UIButton) { |
| | | let vc = BindPhone_3_VC() |
| | | vc.modalPresentationStyle = .fullScreen |
| | | present(vc, animated: true) |
| | | |
| | | view.endEditing(true) |
| | | |
| | | guard !tf_phone.text!.isEmpty else{ |
| | | alertError(msg: "请输入手机号");return |
| | | } |
| | | |
| | | guard tf_phone.text!.jq_isPhone else{ |
| | | alertError(msg: "请正确的手机号");return |
| | | } |
| | | |
| | | guard !tf_code.text!.isEmpty else{ |
| | | alertError(msg: "请输入验证码");return |
| | | } |
| | | |
| | | guard tf_code.text!.count == 6 else{ |
| | | alertError(msg: "请输入6位验证码");return |
| | | } |
| | | |
| | | Services.changePhone(phone: tf_phone.text!, code: tf_code.text!).subscribe(onNext: {data in |
| | | let vc = BindPhone_3_VC() |
| | | vc.modalPresentationStyle = .fullScreen |
| | | self.present(vc, animated: true) |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | override func viewDidLayoutSubviews() { |