Commit 0b6bb7a8 authored by pete谢兆麟's avatar pete谢兆麟

登录UI

parent 080b8c80
......@@ -214,7 +214,6 @@
045EEF242B9F171A0022A143 /* YHStepView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045EEE772B9F171A0022A143 /* YHStepView.swift */; };
045EEF252B9F171A0022A143 /* YHMainInformationCardTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045EEE782B9F171A0022A143 /* YHMainInformationCardTableViewCell.swift */; };
0468D4222B493A5E00CFB916 /* YHPhoneMessageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4212B493A5E00CFB916 /* YHPhoneMessageView.swift */; };
0468D4242B494BEA00CFB916 /* YHCodeResultViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4232B494BEA00CFB916 /* YHCodeResultViewController.swift */; };
0468D4262B495A5400CFB916 /* YHPickPhoneAddressViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4252B495A5400CFB916 /* YHPickPhoneAddressViewController.swift */; };
0468D4282B50D4AF00CFB916 /* YHPrivacyAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4272B50D4AF00CFB916 /* YHPrivacyAlertView.swift */; };
0468D42B2B55019900CFB916 /* YHAnalytics.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D42A2B55019900CFB916 /* YHAnalytics.swift */; };
......@@ -270,6 +269,8 @@
04AAA8DC2BF5E5A200FE9FD5 /* YHEmptyDataView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AAA8DB2BF5E5A200FE9FD5 /* YHEmptyDataView.swift */; };
04AF514E2BEB585C00009E3A /* YHVideoPlayerVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AF514D2BEB585C00009E3A /* YHVideoPlayerVC.swift */; };
04AF58C42B4FC51C0066011A /* YHLocalizable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AF58C32B4FC51C0066011A /* YHLocalizable.swift */; };
04B9EE5A2C06CC3100A4018D /* YHCodeSueecssViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B9EE582C06CC3100A4018D /* YHCodeSueecssViewController.swift */; };
04B9EE5B2C06CC3100A4018D /* YHOtherLoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B9EE592C06CC3100A4018D /* YHOtherLoginViewController.swift */; };
04C693622B723AB8004C1758 /* YHMySettingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04C693612B723AB8004C1758 /* YHMySettingViewController.swift */; };
04C693642B723B56004C1758 /* YHMySettingCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04C693632B723B56004C1758 /* YHMySettingCell.swift */; };
04C8F4832B7216D800ADF59B /* YHUserInfoHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04C8F4822B7216D800ADF59B /* YHUserInfoHeaderView.swift */; };
......@@ -684,7 +685,6 @@
045EEE772B9F171A0022A143 /* YHStepView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHStepView.swift; sourceTree = "<group>"; };
045EEE782B9F171A0022A143 /* YHMainInformationCardTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHMainInformationCardTableViewCell.swift; sourceTree = "<group>"; };
0468D4212B493A5E00CFB916 /* YHPhoneMessageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPhoneMessageView.swift; sourceTree = "<group>"; };
0468D4232B494BEA00CFB916 /* YHCodeResultViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCodeResultViewController.swift; sourceTree = "<group>"; };
0468D4252B495A5400CFB916 /* YHPickPhoneAddressViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPickPhoneAddressViewController.swift; sourceTree = "<group>"; };
0468D4272B50D4AF00CFB916 /* YHPrivacyAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPrivacyAlertView.swift; sourceTree = "<group>"; };
0468D42A2B55019900CFB916 /* YHAnalytics.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAnalytics.swift; sourceTree = "<group>"; };
......@@ -743,6 +743,8 @@
04AAA8DB2BF5E5A200FE9FD5 /* YHEmptyDataView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHEmptyDataView.swift; sourceTree = "<group>"; };
04AF514D2BEB585C00009E3A /* YHVideoPlayerVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHVideoPlayerVC.swift; sourceTree = "<group>"; };
04AF58C32B4FC51C0066011A /* YHLocalizable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLocalizable.swift; sourceTree = "<group>"; };
04B9EE582C06CC3100A4018D /* YHCodeSueecssViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHCodeSueecssViewController.swift; sourceTree = "<group>"; };
04B9EE592C06CC3100A4018D /* YHOtherLoginViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHOtherLoginViewController.swift; sourceTree = "<group>"; };
04C693612B723AB8004C1758 /* YHMySettingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMySettingViewController.swift; sourceTree = "<group>"; };
04C693632B723B56004C1758 /* YHMySettingCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMySettingCell.swift; sourceTree = "<group>"; };
04C8F4822B7216D800ADF59B /* YHUserInfoHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHUserInfoHeaderView.swift; sourceTree = "<group>"; };
......@@ -2155,7 +2157,8 @@
A5ACE8DA2B4564F7002C94D2 /* C */ = {
isa = PBXGroup;
children = (
0468D4232B494BEA00CFB916 /* YHCodeResultViewController.swift */,
04B9EE582C06CC3100A4018D /* YHCodeSueecssViewController.swift */,
04B9EE592C06CC3100A4018D /* YHOtherLoginViewController.swift */,
0468D4252B495A5400CFB916 /* YHPickPhoneAddressViewController.swift */,
04E86E0C2B70D51D00A35F4B /* YHWebViewViewController.swift */,
A5DF3D472BF9A1D0003D5F03 /* YHPhoneLoginWithVideoBkgViewController.swift */,
......@@ -2721,6 +2724,7 @@
A5FD63BD2B623C2C00D1D9DA /* YHInformationPerfectListVC.swift in Sources */,
045EEE8D2B9F171A0022A143 /* YHPreviewInfoCell.swift in Sources */,
048FA0362BFDE04000AD3BA9 /* YHSubmitAllInfoSuccessAlertView.swift in Sources */,
04B9EE5B2C06CC3100A4018D /* YHOtherLoginViewController.swift in Sources */,
045EEF0C2B9F171A0022A143 /* YHBasicInfoFillBottomView.swift in Sources */,
A5ACE93D2B4564F7002C94D2 /* UIButton+Extension.swift in Sources */,
04CC2EF02BC3DDB2000305DD /* YHServiceBannerView.swift in Sources */,
......@@ -2851,7 +2855,6 @@
045EEEAE2B9F171A0022A143 /* YHWorkHighlightsTableViewCell.swift in Sources */,
A567E59A2BD7643D00D5D5A0 /* YHHomeKingKongBlockModel.swift in Sources */,
045EEF062B9F171A0022A143 /* YHFormItemQuestionsCell.swift in Sources */,
0468D4242B494BEA00CFB916 /* YHCodeResultViewController.swift in Sources */,
A567E5922BD7643D00D5D5A0 /* YHHomeWebViewModel.swift in Sources */,
A5D5ADEF2BB90FBC0039FA6B /* YHCheckEamilAlertView.swift in Sources */,
04A671602BA0280800C1FB91 /* YHFileRenameInputView.swift in Sources */,
......@@ -2905,6 +2908,7 @@
A56D2D612B62020C009C83A8 /* YHContractMainItemStatusCell.swift in Sources */,
045EEECF2B9F171A0022A143 /* YHScoreOptionsView.swift in Sources */,
0445E6AF2BE9CFF6003C52F9 /* YHAppVersionForceUpdateView.swift in Sources */,
04B9EE5A2C06CC3100A4018D /* YHCodeSueecssViewController.swift in Sources */,
A5DF3D4E2BF9FDAC003D5F03 /* YHCodeSueecssWithVideoBkgViewController.swift in Sources */,
045EEEC12B9F171A0022A143 /* YHOtherInfoFillModel.swift in Sources */,
0468D43A2B579EAC00CFB916 /* YHLoginViewModel.swift in Sources */,
......
......@@ -22,7 +22,7 @@ class YHBaseViewController: UIViewController {
gk_navLineHidden = true
gk_navBarAlpha = 0
gk_backImage = UIImage(named: "nav_icon_back_back")
gk_backImage = UIImage(named: "back_icon")
#if DEBUG
......
//
// YHCodeResultViewController.swift
// YHCodeSueecssViewController.swift
// galaxy
//
// Created by EDY on 2024/1/6.
// Copyright © 2024 www.davidhuang.com. All rights reserved.
// Created by EDY on 2024/2/5.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHCodeResultViewController: YHBaseViewController {
class YHCodeSueecssViewController: YHBaseViewController {
var time = 60
var bgImageView: UIImageView!
var closeButton: UIButton!
var loginTitleLabel: UILabel!
var loginSubTitleLabel: UILabel!
var phoneLabel: UILabel!
var getCodeLabel: UILabel!
var getCodeButton: UIButton!
var smscodeView: YHSmsCodeInputView!
var phoneNumber: String?
var viewModel: YHLoginViewModel?
override func viewDidLoad() {
super.viewDidLoad()
viewModel = YHLoginViewModel()
setView()
// Do any additional setup after loading the view.
startClicked()
startTime()
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
smscodeView.textField.becomeFirstResponder()
}
func setView() {
view.backgroundColor = .white
bgImageView = {
let imageView = UIImageView()
imageView.image = UIImage(named: "login_bg_image")
imageView.image = UIImage(named: "login_phone_bg_image")
imageView.isUserInteractionEnabled = true
return imageView
}()
view.addSubview(bgImageView)
bgImageView.snp.makeConstraints { make in
make.left.right.top.bottom.equalTo(view)
make.left.right.top.equalTo(view)
make.height.equalTo(300)
}
loginTitleLabel = {
let label = UILabel()
label.text = "登录后更精彩"
label.font = UIFont.PFSC_M(ofSize: 32)
label.textColor = UIColor(hex:0xffffff)
label.text = "欢迎来到银河港生活"
label.font = UIFont.PFSC_M(ofSize: 30)
label.textColor = UIColor.mainTextColor
return label
}()
view.addSubview(loginTitleLabel)
loginTitleLabel.snp.makeConstraints { make in
make.left.equalTo(14)
make.right.equalTo(-14)
make.top.equalTo(111)
make.height.equalTo(39)
make.left.equalTo(24)
make.right.equalTo(-24)
make.top.equalTo(144)
make.height.equalTo(42)
}
loginSubTitleLabel = {
let label = UILabel()
label.text = "香港美好生活期待与你的相遇"
label.font = UIFont.PFSC_R(ofSize: 20)
label.textColor = UIColor(hex:0xffffff)
label.text = "手机号首次登录自动注册"
label.font = UIFont.PFSC_R(ofSize: 15)
label.textColor = UIColor.mainTextColor50
return label
}()
view.addSubview(loginSubTitleLabel)
loginSubTitleLabel.snp.makeConstraints { make in
make.left.equalTo(14)
make.right.equalTo(-14)
make.top.equalTo(159)
make.height.equalTo(24)
}
phoneLabel = {
let label = UILabel()
label.text = "已发送验证码至13352933800"
label.font = UIFont.PFSC_M(ofSize: 17)
label.textAlignment = .left
label.textColor = UIColor(hex:0xffffff)
return label
}()
view.addSubview(phoneLabel)
phoneLabel.snp.makeConstraints { make in
make.left.equalTo(33)
make.right.equalTo(-33)
make.top.equalTo(242)
make.left.equalTo(24)
make.right.equalTo(-24)
make.top.equalTo(190)
make.height.equalTo(20)
}
smscodeView = {
let view = YHSmsCodeInputView(config: YHSmsCodeViewConfig())
view.complete = { [weak self] code in
self?.navigationController?.popToRootViewController(animated: true)
guard let self = self else { return }
if let phone = self.phoneNumber {
// 登录接口需要加一个deviceToken参数
YHHUD.show(.progress(message: "登录中..."))
if YHLoginManager.shared.deviceTokenModel.registerId.isEmpty {
JPUSHService.registrationIDCompletionHandler {
resCode, registrationID in
YHHUD.hide()
YHLoginManager.shared.deviceTokenModel.registerId = registrationID ?? ""
self.requetLogin(phone: phone, code: code)
}
} else {
self.requetLogin(phone: phone, code: code)
}
} else {
printLog("errror : 电话号码为空")
}
}
return view
}()
......@@ -94,61 +109,61 @@ class YHCodeResultViewController: YHBaseViewController {
make.height.equalTo(55)
}
getCodeLabel = {
let button = UILabel()
button.font = UIFont.PFSC_M(ofSize: 16)
button.text = "重新发送(58s)"
button.textColor = UIColor(hex:0xffffff)
button.isHidden = false
return button
}()
view.addSubview(getCodeLabel)
getCodeLabel.snp.makeConstraints { make in
make.left.equalTo(33)
make.top.equalTo(363)
make.height.equalTo(20)
make.width.equalTo(200)
}
getCodeButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 16)
button.contentHorizontalAlignment = .left
button.contentHorizontalAlignment = .center
button.setTitle("重新获取验证码", for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.backgroundColor = UIColor.brandMainColor16
button.addTarget(self, action: #selector(startClicked), for: .touchUpInside)
button.isHidden = true
button.layer.cornerRadius = 3
return button
}()
view.addSubview(getCodeButton)
getCodeButton.snp.makeConstraints { make in
make.left.equalTo(33)
make.top.equalTo(363)
make.height.equalTo(20)
make.width.equalTo(200)
make.left.equalTo(20)
make.top.equalTo(373)
make.height.equalTo(48)
make.right.equalTo(-20)
}
//测试
}
@objc func startClicked() {
getCodeLabel.isHidden = false
getCodeButton.isHidden = true
func requetLogin(phone: String, code: String) {
YHHUD.show(.progress(message: "登录中..."))
self.viewModel?.login(phone : phone, code: code, callBackBlock: {[weak self] success,error in
YHHUD.hide()
guard let self = self else { return }
if success == false {
YHHUD.flash(message: error?.errorMsg ?? "")
} else {
YHLoginManager.shared.loginSuccessActionBlock?()
YHHUD.flash(message: "登录成功")
self.dismiss(animated: true)
}
})
}
func startTime() {
let sourceTimer = DispatchSource.makeTimerSource()
sourceTimer.schedule(deadline: DispatchTime.now(), repeating: DispatchTimeInterval.milliseconds(1000), leeway: DispatchTimeInterval.milliseconds(0))
sourceTimer.setEventHandler {
if self.time != 0 {
self.time -= 1
DispatchQueue.main.async {
self.getCodeLabel?.text = String.localizedStringWithFormat("重新发送(%ds)",self.time)
self.getCodeButton.setTitle(String.localizedStringWithFormat("重新获取(%ds)",self.time), for: .normal)
self.getCodeButton.isEnabled = false
self.getCodeButton.backgroundColor = UIColor.brandMainColor16
}
} else if self.time <= 0 {
sourceTimer.cancel()
DispatchQueue.main.async {
self.time = 60
self.getCodeLabel.isHidden = true
self.getCodeButton.isHidden = false
self.getCodeButton.setTitle("重新获取验证码", for: .normal)
self.getCodeButton.isEnabled = true
self.getCodeButton.backgroundColor = UIColor.brandMainColor
}
}
}
......@@ -156,4 +171,24 @@ class YHCodeResultViewController: YHBaseViewController {
sourceTimer.resume()
}
@objc func startClicked() {
if time > 0 {
return
}
YHHUD.show(.progress(message: ""))
viewModel?.getLoginCode(phoneNumber ?? "", callBackBlock: {[weak self] success,error in
YHHUD.hide()
guard let self = self else { return }
if success == true {
// YHHUD.flash(message: "验证码已下发,请注意查收")
self.startTime()
} else {
YHHUD.flash(message: error?.errorMsg ?? "")
}
})
}
}
//
// YHPhoneLoginViewController.swift
// galaxy
//
// Created by EDY on 2024/2/5.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import IQKeyboardManagerSwift
enum YHLoginType: Int {
// 默认手机号一键登录
case normal = 0
// 常规手机号验证码登录
case phone
// 微信第三方登录
case wechat
// 苹果第三方登录
case apple
}
class YHOtherLoginViewController: YHBaseViewController {
var bgImageView: UIImageView!
var closeButton: UIButton!
var logImageView: UIImageView!
var loginTitleLabel: UILabel!
var loginSubTitleLabel: UILabel!
var phoneMessageView: YHPhoneMessageView!
var getCodeButton: UIButton!
var wechatButton: UIButton!
var appleButton: UIButton!
var privacyView: YHLoginPrivacyView!
var viewModel: YHLoginViewModel?
var type: YHLoginType = .phone
override func viewDidLoad() {
super.viewDidLoad()
viewModel = YHLoginViewModel()
setView()
updateData(type)
}
func setView() {
view.backgroundColor = .white
bgImageView = {
let imageView = UIImageView()
imageView.image = UIImage(named: "login_phone_bg_image")
imageView.isUserInteractionEnabled = true
return imageView
}()
view.addSubview(bgImageView)
bgImageView.snp.makeConstraints { make in
make.left.right.top.equalTo(view)
make.height.equalTo(300)
}
loginTitleLabel = {
let label = UILabel()
label.text = "欢迎来到银河港生活"
label.font = UIFont.PFSC_M(ofSize: 30)
label.textColor = UIColor.mainTextColor
return label
}()
view.addSubview(loginTitleLabel)
loginTitleLabel.snp.makeConstraints { make in
make.left.equalTo(24)
make.right.equalTo(-24)
make.top.equalTo(144)
make.height.equalTo(42)
}
loginSubTitleLabel = {
let label = UILabel()
label.text = "手机号首次登录自动注册"
label.font = UIFont.PFSC_R(ofSize: 15)
label.textColor = UIColor.mainTextColor50
return label
}()
view.addSubview(loginSubTitleLabel)
loginSubTitleLabel.snp.makeConstraints { make in
make.left.equalTo(24)
make.right.equalTo(-24)
make.top.equalTo(190)
make.height.equalTo(20)
}
phoneMessageView = {
let view = YHPhoneMessageView()
view.phoneBlock = {[weak self] count in
guard let self = self else { return }
if count == 0 {
self.getCodeButton.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.4)
self.getCodeButton.isEnabled = false
} else {
self.getCodeButton.backgroundColor = UIColor.brandMainColor
self.getCodeButton.isEnabled = true
}
}
return view
}()
view.addSubview(phoneMessageView)
phoneMessageView.snp.makeConstraints { make in
make.left.equalTo(20)
make.right.equalTo(-20)
make.top.equalTo(300)
make.height.equalTo(56)
}
getCodeButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.4)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 16)
button.contentHorizontalAlignment = .center
button.setTitle("获取验证码", for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.layer.cornerRadius = kCornerRadius3
button.addTarget(self, action: #selector(getCode), for: .touchUpInside)
button.isEnabled = false
return button
}()
view.addSubview(getCodeButton)
getCodeButton.snp.makeConstraints { make in
make.left.equalTo(20)
make.right.equalTo(-20)
make.top.equalTo(373)
make.height.equalTo(48)
}
privacyView = {
let view = YHLoginPrivacyView()
return view
}()
view.addSubview(privacyView)
privacyView.snp.makeConstraints { make in
make.top.equalTo(442)
make.left.equalTo(25)
make.height.equalTo(20)
make.width.equalTo(260)
}
wechatButton = {
let button = UIButton(type: .custom)
button.setImage(UIImage(named: "login_wechat"), for: .normal)
button.addTarget(self, action: #selector(wechatLogin), for: .touchUpInside)
return button
}()
view.addSubview(wechatButton)
wechatButton.snp.makeConstraints { make in
make.right.equalTo(view.snp.centerX).offset(-22)
make.bottom.equalTo(-58)
make.height.width.equalTo(44)
}
appleButton = {
let button = UIButton(type: .custom)
button.setImage(UIImage(named: "login_apple"), for: .normal)
button.addTarget(self, action: #selector(appleLogin), for: .touchUpInside)
return button
}()
view.addSubview(appleButton)
appleButton.snp.makeConstraints { make in
make.left.equalTo(view.snp.centerX).offset(22)
make.bottom.equalTo(-58)
make.height.width.equalTo(44)
}
}
func updateData(_ type: YHLoginType) {
switch type {
case .normal: break
case .phone: break
case .wechat:
loginTitleLabel.text = "手机号绑定"
loginSubTitleLabel.text = "微信号首次登录绑定手机号"
appleButton.isHidden = true
wechatButton.isHidden = true
case .apple:
loginTitleLabel.text = "手机号绑定"
loginSubTitleLabel.text = "Apple ID首次登录需绑定手机号"
appleButton.isHidden = true
wechatButton.isHidden = true
}
}
@objc func getCode() {
IQKeyboardManager.shared.resignFirstResponder()
let phoneNumer = phoneMessageView.phoneTextField.text ?? ""
guard phoneNumer.isMobile() == true else {
YHHUD.flash(message: "请输入正确的手机号")
return
}
if privacyView.isAgree {
YHHUD.show(.progress(message: ""))
viewModel?.getLoginCode(phoneNumer, callBackBlock: {[weak self] success,error in
YHHUD.hide()
guard let self = self else { return }
if success == true {
let vc = YHCodeSueecssViewController()
vc.phoneNumber = self.phoneMessageView.phoneTextField.text
self.navigationController?.pushViewController(vc)
} else {
var msg = error?.errorMsg ?? ""
if msg.isEmpty {
msg = String(error?.errorCode ?? 404)
}
YHHUD.flash(message: msg)
}
})
} else {
let view = YHPrivacyAlertView(frame: view.bounds)
view.urlBlock = { [weak self] (type,url) in
guard let self = self else { return }
let vc = YHWebViewViewController()
vc.url = url
if type == 0 {
vc.navTitle = "银河港生活隐私政策"
} else if type == 1 {
vc.navTitle = "银河港生活用户条款"
}
self.navigationController?.pushViewController(vc)
}
view.agreeBlock = { [weak self] in
guard let self = self else { return }
self.privacyView.isAgree = true
self.getCode()
}
self.view.addSubview(view)
}
}
@objc func wechatLogin() {
//第一次微信登录跳转逻辑
let vc = YHOtherLoginViewController()
vc.type = .wechat
navigationController?.pushViewController(vc)
}
@objc func appleLogin() {
//第一次appid登录跳转逻辑
let vc = YHOtherLoginViewController()
vc.type = .apple
navigationController?.pushViewController(vc)
}
}
......@@ -20,11 +20,9 @@ class YHPhoneLoginWithVideoBkgViewController: YHBaseViewController {
var phoneMessageView: YHPhoneMessageView!
var getCodeButton: UIButton!
var privacyView: YHLoginPrivacyView!
var otherLoginButton: UIButton!
var viewModel: YHLoginViewModel?
override func viewDidLoad() {
super.viewDidLoad()
setView()
......@@ -151,6 +149,23 @@ extension YHPhoneLoginWithVideoBkgViewController {
make.width.height.equalTo(30)
}
otherLoginButton = {
let button = UIButton(type: .custom)
button.setTitle("其他登录方式", for: .normal)
button.contentHorizontalAlignment = .right
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 14)
button.setTitleColor(UIColor.white, for: .normal)
button.addTarget(self, action: #selector(otherLogin), for: .touchUpInside)
return button
}()
frontHoldView.addSubview(otherLoginButton)
otherLoginButton.snp.makeConstraints { make in
make.right.equalTo(-13)
make.height.equalTo(20)
make.width.equalTo(84)
make.centerY.equalTo(closeButton.snp.centerY)
}
logImageView = {
let imageView = UIImageView()
imageView.image = UIImage(named: "login_icon")
......@@ -320,6 +335,11 @@ extension YHPhoneLoginWithVideoBkgViewController {
IQKeyboardManager.shared.enable = true
dismiss(animated: true)
}
@objc func otherLogin() {
let vc = YHOtherLoginViewController()
self.navigationController?.pushViewController(vc)
}
}
......
......@@ -32,8 +32,8 @@ class YHLoginPrivacyView: UIView {
func setView() {
agreeButton = {
let button = UIButton(type: .custom)
button.setBackgroundImage(UIImage(named: "login_privacy_disagree"), for: .normal)
button.setBackgroundImage(UIImage(named: "login_privacy_agree_white"), for: .selected)
button.setBackgroundImage(UIImage(named: "login_privacy_disagree_glay"), for: .normal)
button.setBackgroundImage(UIImage(named: "login_privacy_agree"), for: .selected)
button.addTarget(self, action: #selector(agreeClick), for: .touchUpInside)
return button
}()
......@@ -49,7 +49,7 @@ class YHLoginPrivacyView: UIView {
let label = UILabel()
label.text = "我已阅读并同意"
label.font = UIFont.PFSC_R(ofSize: 12)
label.textColor = UIColor(hex: 0xffffff, alpha: 0.7)
label.textColor = UIColor.mainTextColor50
label.textAlignment = .left
return label
}()
......@@ -65,7 +65,7 @@ class YHLoginPrivacyView: UIView {
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 12)
button.contentHorizontalAlignment = .center
button.setTitle("《隐私协议》", for: .normal)
button.setTitleColor(UIColor.white, for: .normal)
button.setTitleColor(UIColor.brandMainColor, for: .normal)
button.addTarget(self, action: #selector(firstUrlClick), for: .touchUpInside)
return button
}()
......@@ -80,7 +80,7 @@ class YHLoginPrivacyView: UIView {
let label = UILabel()
label.text = "和"
label.font = UIFont.PFSC_R(ofSize: 12)
label.textColor = UIColor(hex: 0xffffff, alpha: 0.7)
label.textColor = UIColor.mainTextColor50
label.textAlignment = .left
return label
}()
......@@ -95,7 +95,7 @@ class YHLoginPrivacyView: UIView {
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 12)
button.contentHorizontalAlignment = .center
button.setTitle("《用户条款》", for: .normal)
button.setTitleColor(UIColor.white, for: .normal)
button.setTitleColor(UIColor.brandMainColor, for: .normal)
button.addTarget(self, action: #selector(secondUrlClick), for: .touchUpInside)
return button
}()
......@@ -107,6 +107,8 @@ class YHLoginPrivacyView: UIView {
make.width.equalTo(80)
}
agreeButton.YH_clickEdgeInsets = UIEdgeInsets(top: 50, left: 50, bottom: 50, right: 50)
serviceButton.YH_clickEdgeInsets = UIEdgeInsets(top: 20, left: 0, bottom: 20, right: 0)
privacyButton.YH_clickEdgeInsets = UIEdgeInsets(top: 20, left: 0, bottom: 20, right: 0)
......
......@@ -14,7 +14,6 @@ class YHPhoneMessageView: UIView {
var block: Block?
var phoneBlock: PhoneBlock?
var messageButton: UIButton!
var pointImageView: UIImageView!
var phoneTextField: UITextField!
override init(frame: CGRect) {
super.init(frame: frame)
......@@ -30,7 +29,7 @@ class YHPhoneMessageView: UIView {
let button = UIButton(type: .custom)
button.titleLabel?.font = UIFont(name: "DINAlternate-Bold", size: 18)
button.setTitle("+86", for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.setTitleColor( UIColor(hex:0x121a26), for: .normal)
button.addTarget(self, action: #selector(messageClick), for: .touchUpInside)
button.titleLabel?.textAlignment = .left
return button
......@@ -43,24 +42,11 @@ class YHPhoneMessageView: UIView {
make.height.equalTo(20)
}
pointImageView = {
let button = UIImageView()
button.image = UIImage(named: "login_phone_point")
return button
}()
addSubview(pointImageView)
pointImageView.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalTo(messageButton.snp.right).offset(8)
make.width.equalTo(12)
make.height.equalTo(12)
}
phoneTextField = {
let text = UITextField()
text.placeholder = "请输入签约手机号"
text.font = UIFont(name: "DINAlternate-Bold", size: 18)
text.textColor = UIColor(hex:0xffffff)
text.textColor = UIColor(hex:0x121a26)
text.textAlignment = .left
text.keyboardType = .phonePad
text.clearButtonMode = .always
......@@ -71,14 +57,14 @@ class YHPhoneMessageView: UIView {
addSubview(phoneTextField)
phoneTextField.snp.makeConstraints { make in
make.top.bottom.equalToSuperview()
make.left.equalTo(pointImageView.snp.right).offset(16)
make.left.equalTo(messageButton.snp.right).offset(16)
make.height.equalTo(20)
make.right.equalToSuperview()
}
let line = UIView()
line.backgroundColor = UIColor(hex: 0xffffff, alpha: 0.8)
line.backgroundColor = UIColor(hex: 0xf0f3f7, alpha: 0.8)
addSubview(line)
line.snp.makeConstraints { make in
make.bottom.left.right.equalToSuperview()
......
......@@ -10,9 +10,9 @@ import UIKit
// 输入框UI显示配置
struct YHSmsCodeViewConfig {
var textColor : UIColor? = UIColor(hex: 0xFFFFFF)
var textColor : UIColor? = UIColor.mainTextColor
var bgColor : UIColor? = UIColor.clear
var cursorColor : UIColor? = UIColor.white
var cursorColor : UIColor? = UIColor.brandMainColor
var font: UIFont? = UIFont(name: "DINAlternate-Bold", size: 18)
// 展示输入框个数
var count : Int = 6
......@@ -185,11 +185,11 @@ class YHTextField: UITextField {
return false
}
open override func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
if let ges = gestureRecognizer as? UITapGestureRecognizer {
return true
} else {
return false
}
}
// open override func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
// if let ges = gestureRecognizer as? UITapGestureRecognizer {
// return true
// } else {
// return false
// }
// }
}
......@@ -15,12 +15,12 @@ class YHSmsCodeView: UIView {
if showCursor {
self.cursor.layer .removeAllAnimations()
self.animaitonShow(true)
self.bottomLine.backgroundColor = .white
self.bottomLine.backgroundColor = UIColor.mainTextColor
} else {
self.cursor.layer .removeAllAnimations()
self.cursor.isHidden = true
self.bottomLine.backgroundColor = UIColor.init(hex: 0xFFFFFF, alpha: 0.6)
self.bottomLine.backgroundColor = UIColor.init(hex: 0xF0F3F7)
}
}
}
......@@ -31,7 +31,7 @@ class YHSmsCodeView: UIView {
}
lazy var label : UILabel = {
let label = UILabel()
label.textColor = .white
label.textColor = UIColor.mainTextColor
label.textAlignment = .center
label.font = UIFont(name: "DINAlternate-Bold", size: 18)
return label
......@@ -39,14 +39,14 @@ class YHSmsCodeView: UIView {
lazy var cursor : UIView = {
let cursor = UIView()
cursor.backgroundColor = UIColor.white
cursor.backgroundColor = UIColor.brandMainColor
cursor.isHidden = true
return cursor
}()
lazy var bottomLine: UIView = {
let view = UIView()
view.backgroundColor = UIColor.init(hex: 0xFFFFFF, alpha: 0.6)
view.backgroundColor = UIColor.init(hex: 0xF0F3F7)
return view
}()
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "login_apple@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "login_apple@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "login_privacy_disagree_glay@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "login_privacy_disagree_glay@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "login_wechat@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "login_wechat@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment