RegViewController1.swift 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. //
  2. // LoginViewController.swift
  3. // xingchuangke
  4. //
  5. // Created by Virgil on 2019/3/22.
  6. // Copyright © 2019 Virgil. All rights reserved.
  7. //
  8. import UIKit
  9. class RegViewController1: BaseViewController {
  10. @IBOutlet weak var btnLogin: UIButton!
  11. @IBOutlet weak var btnClose: UIButton!
  12. @IBOutlet weak var txtPhone: UITextField!
  13. override func viewDidLoad() {
  14. super.viewDidLoad()
  15. self.title = "注册账号"
  16. initNavLeftBackButton()
  17. txtPhone.setContentMarginLeft(leftWidth: 15)
  18. txtPhone.setCornerRadius(size: 4)
  19. }
  20. override func KeyboardHidden(gestureRecognizer: UIGestureRecognizer) {
  21. txtPhone.resignFirstResponder()
  22. }
  23. //btnAddTarget(view: self.view, selector: #selector(self.btnMenuClick))
  24. @IBAction func btnMenuClick(_ sender: AnyObject) {
  25. switch (sender as! UIButton).tag {
  26. case 1001: // 清空手机号
  27. txtPhone.text = ""
  28. break
  29. case 1002: // 显示隐藏密码
  30. break
  31. case 1003: //
  32. break
  33. case 1004: // 下一步
  34. if txtPhone.text!.length() < 1 {
  35. SVProgressHUD.showError(withStatus: "请输入您的推荐码")
  36. return
  37. }
  38. loadData()
  39. break
  40. case 1005: //
  41. break
  42. case 1006: //
  43. break
  44. default:
  45. break
  46. }
  47. }
  48. // MARK: =============加载数据===============
  49. func loadData() {
  50. let url = RequestURL.findRecCode
  51. let params = NSMutableDictionary()
  52. params.setValue(txtPhone.text!, forKey: "recCode")
  53. submitData(url: url, params: params, tag: 1001)
  54. }
  55. override func returnData(tag: Int) {
  56. if tag == 1001 {
  57. let vc = RegViewController2()
  58. vc.recCode = txtPhone.text!
  59. toViewController(viewController: vc)
  60. }
  61. }
  62. override func returnError(tag: Int, type: String) {
  63. }
  64. override func viewWillAppear(_ animated: Bool) {
  65. super.viewWillAppear(animated)
  66. }
  67. override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
  68. super.init(nibName: "RegViewController1", bundle: nil)
  69. }
  70. required init?(coder aDecoder: NSCoder) {
  71. fatalError("init(coder:) has not been implemented")
  72. }
  73. }