| | |
| | | alert(msg: "请输入验证码");return false |
| | | } |
| | | |
| | | guard tf_phone.text!.count != 6 else { |
| | | guard tf_authCode.text!.count == 6 else { |
| | | alert(msg: "请输入6位验证码");return false |
| | | } |
| | | return true |
| | |
| | | |
| | | /// 隐私协议 |
| | | @IBAction func privacyAction(_ sender: UIButton) { |
| | | let vc = CommonWebVC(type: .privacyAgreement) |
| | | let vc = CommonWebVC(type: .PrivacyPolicy) |
| | | vc.title = "隐私协议" |
| | | self.navigationController?.pushViewController(vc, animated: true) |
| | | } |
| | | |
| | | /// 用户协议 |
| | | @IBAction func privacyUserAction(_ sender: UIButton) { |
| | | let vc = CommonWebVC(type: .userAgreement) |
| | | let vc = CommonWebVC(type: .UserProtocol) |
| | | vc.title = "用户协议" |
| | | self.navigationController?.pushViewController(vc, animated: true) |
| | | } |
| | |
| | | |
| | | @IBAction func getCodeAction(_ sender: UIButton) { |
| | | guard authInputPhone() else {return} |
| | | sender.openCountDown(60, defultTitle: "获取验证码", textColor:UIColor(hexStr: "#41A2EB"), unenableColor: .gray) |
| | | Services.sendPhoneCode(phone: tf_phone.text!).subscribe(onNext: {_ in |
| | | sender.openCountDown(60, defultTitle: "获取验证码", textColor:UIColor(hexStr: "#41A2EB"), unenableColor: .gray) |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | @IBAction func loginAction(_ sender: UIButton) { |
| | |
| | | alert(msg: "请阅读并同意《隐私协议》《用户协议》");return |
| | | } |
| | | |
| | | sceneDelegate?.loginSuccess() |
| | | Services.login(phone: tf_phone.text!, code: tf_authCode.text!).subscribe(onNext: {result in |
| | | if var token = result.data?.token{ |
| | | token.request_time = Int(Date().timeIntervalSince1970) |
| | | LoginTokenModel.saveToken(token) |
| | | sceneDelegate?.loginSuccess() |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | } |