无故事王国
2023-10-09 0408b5d7b07077dc9f451a03a1a859038e4e5bf5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//
//  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
        }
 
    }
    
}