| | |
| | | import RxRelay |
| | | import QMUIKit |
| | | import AuthenticationServices |
| | | import CoreTelephony |
| | | |
| | | |
| | | let LoginSuccess_Noti = Notification.Name.init("LoginSuccess_Noti") |
| | |
| | | @IBOutlet weak var btn_wechat: UIButton! |
| | | @IBOutlet weak var image_security: UIImageView! |
| | | |
| | | private var cellularData:CTCellularData! |
| | | |
| | | |
| | | private var viewModel = LoginViewModel() |
| | | |
| | |
| | | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | |
| | | cellularData = CTCellularData() |
| | | cellularData.cellularDataRestrictionDidUpdateNotifier = {[weak self] state in |
| | | guard let weakSelf = self else { return } |
| | | |
| | | switch state{ |
| | | case .notRestricted: |
| | | if UserDefaultSettingViewModel.getSetting()?.userFirstLaunch ?? true{ |
| | | DispatchQueue.main.async { |
| | | let vc = LoginTreatyVC() |
| | | vc.topIndex = 0 |
| | | vc.clickHandle { state in |
| | | if !state{ |
| | | exit(0) |
| | | }else{ |
| | | if var m = UserDefaultSettingViewModel.getSetting(){ |
| | | m.userFirstLaunch = false |
| | | UserDefaultSettingViewModel.saveSetting(m) |
| | | } |
| | | } |
| | | } |
| | | vc.modalPresentationStyle = .custom |
| | | weakSelf.present(vc, animated: true) |
| | | } |
| | | } |
| | | default:break |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | override func setRx() { |
| | |
| | | |
| | | @IBAction func userRegisterTreatyAction(_ sender: UIButton) { |
| | | |
| | | let vc = WebVC(type: .user) |
| | | vc.title = "用户注册协议" |
| | | push(vc: vc) |
| | | // let vc = WebVC(type: .user) |
| | | // vc.title = "用户注册协议" |
| | | // push(vc: vc) |
| | | |
| | | // let vc = LoginTreatyVC() |
| | | // vc.topIndex = 0 |
| | | // vc.clickHandle {[unowned self] state in |
| | | // self.btn_isRead.isSelected = state |
| | | // } |
| | | // vc.modalPresentationStyle = .custom |
| | | // present(vc, animated: true) |
| | | let vc = LoginTreatyVC() |
| | | vc.topIndex = 0 |
| | | vc.clickHandle {[unowned self] state in |
| | | self.btn_isRead.isSelected = state |
| | | } |
| | | vc.modalPresentationStyle = .custom |
| | | present(vc, animated: true) |
| | | } |
| | | |
| | | @IBAction func userPrivateTreatyAction(_ sender: UIButton) { |
| | | // let vc = LoginTreatyVC() |
| | | // vc.topIndex = 1 |
| | | // vc.clickHandle {[unowned self] state in |
| | | // self.btn_isRead.isSelected = state |
| | | // } |
| | | // vc.modalPresentationStyle = .custom |
| | | // present(vc, animated: true) |
| | | let vc = WebVC(type: .privacy) |
| | | vc.title = "用户隐私协议" |
| | | push(vc: vc) |
| | | let vc = LoginTreatyVC() |
| | | vc.topIndex = 1 |
| | | vc.clickHandle {[unowned self] state in |
| | | self.btn_isRead.isSelected = state |
| | | } |
| | | vc.modalPresentationStyle = .custom |
| | | present(vc, animated: true) |
| | | // let vc = WebVC(type: .privacy) |
| | | // vc.title = "用户隐私协议" |
| | | // push(vc: vc) |
| | | } |
| | | |
| | | @IBAction func registerAction(_ sender: UIButton) { |