//
|
// BindPhoneVC.swift
|
// WanPai
|
//
|
// Created by 无故事王国 on 2023/10/9.
|
//
|
|
import UIKit
|
import QMUIKit
|
import JQTools
|
|
class BindPhoneVC: BaseVC {
|
|
@IBOutlet weak var tf_phone: QMUITextField!
|
@IBOutlet weak var tf_code: QMUITextField!
|
@IBOutlet weak var btn_code: UIButton!
|
|
override func viewDidLoad() {
|
super.viewDidLoad()
|
title = "绑定手机号"
|
}
|
|
@IBAction func getCodeAction(_ sender: UIButton) {
|
guard tf_phone.text!.jq_isPhone else {
|
alert(msg: "请输入正确的手机号码");return
|
}
|
|
Services.getSMSCode(phone: tf_phone.text!, type: .bindPhone).subscribe(onNext: {result in
|
sender.jq_openCountDown()
|
}) { error in
|
alertError(msg: error.localizedDescription)
|
}.disposed(by: disposeBag)
|
}
|
|
@IBAction func bindAction(_ sender: UIButton) {
|
guard tf_phone.text!.jq_isPhone else {
|
alert(msg: "请输入正确的手机号码");return
|
}
|
|
guard !tf_code.text!.isEmpty else {
|
alert(msg: "请输入验证码");return
|
}
|
|
}
|
|
}
|