1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- //
- // MobileLoginViewController.swift
- // RainbowPlanet
- //
- // Created by 南鑫林 on 2019/3/27.
- // Copyright © 2019 南鑫林. All rights reserved.
- //
- import UIKit
- import RxSwift
- import RxCocoa
- class MobileLoginViewController: BaseViewController {
- override func viewDidLoad() {
- super.viewDidLoad()
- setupViews()
- setupLayouts()
- }
- override func setupViews() {
- view.addSubview(mobileLoginView)
- }
- override func setupLayouts() {
- mobileLoginView.snp.makeConstraints { (make) in
- make.top.equalTo(navigationBar.snp.bottom)
- make.left.right.bottom.equalToSuperview()
- }
- }
- private lazy var mobileLoginView: MobileLoginView = {
- let mobileLoginView = MobileLoginView()
- //获取验证
- mobileLoginView.sendSmSBlock = {
- (sendSmsButton,phoneNumber) in
- SwiftMoyaNetWorkServiceSMS.shared().smsSendSMSApi(mobile: phoneNumber, appNameType: AppNameType.app, sendType: SendType.ali, smsType: SMSType.account_login, completion: {_ in
- sendSmsButton.countdown = true
- })
- }
- // 登录
- mobileLoginView.loginBlock = {
- (phoneNumber,sms,invitationCode) in
- SwiftMoyaNetWorkServiceUser.shared().userMobileRegisterApi(mobile: phoneNumber, sms_code: sms,invitationCode:invitationCode, completion: { [weak self] (data) -> (Void) in
- self?.navigationController?.pushViewController(LocationViewController(), animated: true)
- })
-
- }
- //密码登录
- mobileLoginView.passwordLoginBlock = {
- [weak self] in
- self?.navigationController?.pushViewController(PasswordLoginViewController(), animated: true)
- }
- return mobileLoginView
- }()
- }
|