Commit ca103051 authored by David黄金龙's avatar David黄金龙

Merge commit '6ed61473' into davidhuang

* commit '6ed61473':
  地址选择
  登录页面
parents 044ffc2a 6ed61473
...@@ -8,6 +8,10 @@ ...@@ -8,6 +8,10 @@
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
0468D41D2B47D20600CFB916 /* YHHomeNetWorkServer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D41C2B47D20600CFB916 /* YHHomeNetWorkServer.swift */; }; 0468D41D2B47D20600CFB916 /* YHHomeNetWorkServer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D41C2B47D20600CFB916 /* YHHomeNetWorkServer.swift */; };
0468D4202B49320900CFB916 /* YHVerificationCodeLoginController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D41F2B49320900CFB916 /* YHVerificationCodeLoginController.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 */; };
04808C062B4686510056D53C /* ATAuthSDK.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 04808C042B4686510056D53C /* ATAuthSDK.bundle */; }; 04808C062B4686510056D53C /* ATAuthSDK.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 04808C042B4686510056D53C /* ATAuthSDK.bundle */; };
04808C082B4686C10056D53C /* ATAuthSDK_D.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 04808C032B4686510056D53C /* ATAuthSDK_D.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 04808C082B4686C10056D53C /* ATAuthSDK_D.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 04808C032B4686510056D53C /* ATAuthSDK_D.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
6203A87EDC96313BBE789D9C /* Pods_galaxy.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 987C69D43AE8D85DC1930DCF /* Pods_galaxy.framework */; }; 6203A87EDC96313BBE789D9C /* Pods_galaxy.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 987C69D43AE8D85DC1930DCF /* Pods_galaxy.framework */; };
...@@ -105,6 +109,10 @@ ...@@ -105,6 +109,10 @@
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
0468D41C2B47D20600CFB916 /* YHHomeNetWorkServer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomeNetWorkServer.swift; sourceTree = "<group>"; }; 0468D41C2B47D20600CFB916 /* YHHomeNetWorkServer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomeNetWorkServer.swift; sourceTree = "<group>"; };
0468D41F2B49320900CFB916 /* YHVerificationCodeLoginController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHVerificationCodeLoginController.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>"; };
04808C032B4686510056D53C /* ATAuthSDK_D.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = ATAuthSDK_D.framework; sourceTree = "<group>"; }; 04808C032B4686510056D53C /* ATAuthSDK_D.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = ATAuthSDK_D.framework; sourceTree = "<group>"; };
04808C042B4686510056D53C /* ATAuthSDK.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = ATAuthSDK.bundle; sourceTree = "<group>"; }; 04808C042B4686510056D53C /* ATAuthSDK.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = ATAuthSDK.bundle; sourceTree = "<group>"; };
58C2405158A4A6632D0E7460 /* Pods-galaxy.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-galaxy.debug.xcconfig"; path = "Target Support Files/Pods-galaxy/Pods-galaxy.debug.xcconfig"; sourceTree = "<group>"; }; 58C2405158A4A6632D0E7460 /* Pods-galaxy.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-galaxy.debug.xcconfig"; path = "Target Support Files/Pods-galaxy/Pods-galaxy.debug.xcconfig"; sourceTree = "<group>"; };
...@@ -317,6 +325,9 @@ ...@@ -317,6 +325,9 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
A5ACE8DB2B4564F7002C94D2 /* YHLoginViewController.swift */, A5ACE8DB2B4564F7002C94D2 /* YHLoginViewController.swift */,
0468D41F2B49320900CFB916 /* YHVerificationCodeLoginController.swift */,
0468D4232B494BEA00CFB916 /* YHCodeResultViewController.swift */,
0468D4252B495A5400CFB916 /* YHPickPhoneAddressViewController.swift */,
); );
path = C; path = C;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -328,6 +339,7 @@ ...@@ -328,6 +339,7 @@
A5ACE8E42B4564F7002C94D2 /* YHLoginStyleButton.swift */, A5ACE8E42B4564F7002C94D2 /* YHLoginStyleButton.swift */,
A5ACE8E52B4564F7002C94D2 /* YHLoginPrivacyView.swift */, A5ACE8E52B4564F7002C94D2 /* YHLoginPrivacyView.swift */,
A5ACE8E62B4564F7002C94D2 /* YHValidateCodeInputView.swift */, A5ACE8E62B4564F7002C94D2 /* YHValidateCodeInputView.swift */,
0468D4212B493A5E00CFB916 /* YHPhoneMessageView.swift */,
); );
path = V; path = V;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -752,6 +764,7 @@ ...@@ -752,6 +764,7 @@
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
0468D4202B49320900CFB916 /* YHVerificationCodeLoginController.swift in Sources */,
A5ACE9362B4564F7002C94D2 /* YHNetworkStatusManager.swift in Sources */, A5ACE9362B4564F7002C94D2 /* YHNetworkStatusManager.swift in Sources */,
A5ACE92C2B4564F7002C94D2 /* YHLoginStyleButton.swift in Sources */, A5ACE92C2B4564F7002C94D2 /* YHLoginStyleButton.swift in Sources */,
A5ACE92F2B4564F7002C94D2 /* YHMyViewController.swift in Sources */, A5ACE92F2B4564F7002C94D2 /* YHMyViewController.swift in Sources */,
...@@ -763,6 +776,7 @@ ...@@ -763,6 +776,7 @@
A5ACE9292B4564F7002C94D2 /* YHSmsCodeInputView.swift in Sources */, A5ACE9292B4564F7002C94D2 /* YHSmsCodeInputView.swift in Sources */,
A5ACE9452B4564F7002C94D2 /* BsHUDContainerView.swift in Sources */, A5ACE9452B4564F7002C94D2 /* BsHUDContainerView.swift in Sources */,
A5ACE93A2B4564F7002C94D2 /* NSAttributedString+Extension.swift in Sources */, A5ACE93A2B4564F7002C94D2 /* NSAttributedString+Extension.swift in Sources */,
0468D4222B493A5E00CFB916 /* YHPhoneMessageView.swift in Sources */,
A5ACE9512B4564F7002C94D2 /* YhConstant.swift in Sources */, A5ACE9512B4564F7002C94D2 /* YhConstant.swift in Sources */,
A5ACE94A2B4564F7002C94D2 /* BsHUDProgressView.swift in Sources */, A5ACE94A2B4564F7002C94D2 /* BsHUDProgressView.swift in Sources */,
A5ACE9442B4564F7002C94D2 /* Array+Extension.swift in Sources */, A5ACE9442B4564F7002C94D2 /* Array+Extension.swift in Sources */,
...@@ -774,8 +788,10 @@ ...@@ -774,8 +788,10 @@
A5ACE94E2B4564F7002C94D2 /* AlignedCollectionViewFlowLayout.swift in Sources */, A5ACE94E2B4564F7002C94D2 /* AlignedCollectionViewFlowLayout.swift in Sources */,
A5ACE93B2B4564F7002C94D2 /* UIFont+Extension.swift in Sources */, A5ACE93B2B4564F7002C94D2 /* UIFont+Extension.swift in Sources */,
A5ACE9282B4564F7002C94D2 /* YHSmsCodeView.swift in Sources */, A5ACE9282B4564F7002C94D2 /* YHSmsCodeView.swift in Sources */,
0468D4262B495A5400CFB916 /* YHPickPhoneAddressViewController.swift in Sources */,
A5ACE9342B4564F7002C94D2 /* YHAllApiName.swift in Sources */, A5ACE9342B4564F7002C94D2 /* YHAllApiName.swift in Sources */,
A5ACE9502B4564F7002C94D2 /* YhCacheTool.swift in Sources */, A5ACE9502B4564F7002C94D2 /* YhCacheTool.swift in Sources */,
0468D4242B494BEA00CFB916 /* YHCodeResultViewController.swift in Sources */,
A5ACE93F2B4564F7002C94D2 /* UIViewController+Extension.swift in Sources */, A5ACE93F2B4564F7002C94D2 /* UIViewController+Extension.swift in Sources */,
A5ACE9472B4564F7002C94D2 /* YHHUD.swift in Sources */, A5ACE9472B4564F7002C94D2 /* YHHUD.swift in Sources */,
A5ACE9412B4564F7002C94D2 /* Dictionary+Extension.swift in Sources */, A5ACE9412B4564F7002C94D2 /* Dictionary+Extension.swift in Sources */,
......
//
// YHCodeResultViewController.swift
// galaxy
//
// Created by EDY on 2024/1/6.
// Copyright © 2024 www.davidhuang.com. All rights reserved.
//
import UIKit
import RxSwift
class YHCodeResultViewController: YHBaseViewController {
let disposed = DisposeBag()
let timer = Observable<Int>.interval(DispatchTimeInterval.seconds(1), scheduler: MainScheduler.instance)
var time = 60
var bgImageView: UIImageView!
var loginTitleLabel: UILabel!
var loginSubTitleLabel: UILabel!
var phoneLabel: UILabel!
var getCodeLabel: UILabel!
var getCodeButton: UIButton!
var smscodeView: YHSmsCodeInputView!
override func viewDidLoad() {
super.viewDidLoad()
setView()
// Do any additional setup after loading the view.
startClicked()
}
func setView() {
bgImageView = {
let imageView = UIImageView()
imageView.image = UIImage(named: "login_bg_image")
return imageView
}()
view.addSubview(bgImageView)
bgImageView.snp.makeConstraints { make in
make.left.right.top.bottom.equalTo(view)
}
loginTitleLabel = {
let label = UILabel()
label.text = "登录后更精彩"
label.font = kBoldFont(size: 32)
label.textColor = UIColor(hex:0xffffff)
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)
}
loginSubTitleLabel = {
let label = UILabel()
label.text = "香港美好生活期待与你的相遇"
label.font = kFont(size: 20)
label.textColor = UIColor(hex:0xffffff)
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 = kBoldFont(size: 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.height.equalTo(20)
}
smscodeView = {
let view = YHSmsCodeInputView(config: YHSmsCodeViewConfig())
view.complete = { [weak self] code in
self?.navigationController?.popToRootViewController(animated: true)
}
return view
}()
view.addSubview(smscodeView)
smscodeView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(288)
make.height.equalTo(55)
}
getCodeLabel = {
let button = UILabel()
button.font = kBoldFont(size: 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 = kBoldFont(size: 16)
button.contentHorizontalAlignment = .left
button.setTitle("重新获取验证码", for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.addTarget(self, action: #selector(startClicked), for: .touchUpInside)
button.isHidden = true
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)
}
//测试
}
@objc func startClicked() {
getCodeLabel.isHidden = false
getCodeButton.isHidden = true
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)
}
} else if self.time <= 0 {
sourceTimer.cancel()
DispatchQueue.main.async {
// self.getCodeLabel?.text = "获取验证码"
self.time = 60
self.getCodeLabel.isHidden = true
self.getCodeButton.isHidden = false
}
}
}
// 启动定时器
sourceTimer.resume()
}
}
...@@ -7,8 +7,12 @@ ...@@ -7,8 +7,12 @@
import UIKit import UIKit
import SnapKit import SnapKit
import RxSwift
import RxAlamofire
class YHLoginViewController: YHBaseViewController { class YHLoginViewController: YHBaseViewController {
let disposeBag = DisposeBag()
var bgImageView: UIImageView! var bgImageView: UIImageView!
var loginTitleLabel: UILabel! var loginTitleLabel: UILabel!
var loginSubTitleLabel: UILabel! var loginSubTitleLabel: UILabel!
...@@ -115,6 +119,7 @@ class YHLoginViewController: YHBaseViewController { ...@@ -115,6 +119,7 @@ class YHLoginViewController: YHBaseViewController {
messageButton = { messageButton = {
let button = YHLoginStyleButton() let button = YHLoginStyleButton()
button.setContent(image: UIImage(named: "login_style_message")!, message: "验证码登录") button.setContent(image: UIImage(named: "login_style_message")!, message: "验证码登录")
button.addTarget(self, action: #selector(messageLogin), for: .touchUpInside)
return button return button
}() }()
view.addSubview(messageButton) view.addSubview(messageButton)
...@@ -188,6 +193,11 @@ class YHLoginViewController: YHBaseViewController { ...@@ -188,6 +193,11 @@ class YHLoginViewController: YHBaseViewController {
} }
//测试 //测试
} }
@objc func messageLogin() {
let vc = YHVerificationCodeLoginController()
self.navigationController?.pushViewController(vc)
}
} }
......
//
// YHPickPhoneAddressViewController.swift
// galaxy
//
// Created by EDY on 2024/1/6.
// Copyright © 2024 www.davidhuang.com. All rights reserved.
//
import UIKit
class YHPickPhoneAddressViewController: YHBaseViewController {
var addressTextField: UITextField!
var addressTable: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
title = "选择国家和地区"
setView()
// Do any additional setup after loading the view.
}
func setView() {
// bgImageView = {
// let imageView = UIImageView()
// imageView.image = UIImage(named: "login_bg_image")
// return imageView
// }()
// view.addSubview(bgImageView)
// bgImageView.snp.makeConstraints { make in
// make.left.right.top.bottom.equalTo(view)
// }
// loginTitleLabel = {
// let label = UILabel()
// label.text = "登录后更精彩"
// label.font = kBoldFont(size: 32)
// label.textColor = UIColor(hex:0xffffff)
// 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)
// }
}
}
//
// YHVerificationCodeLoginController.swift
// galaxy
//
// Created by EDY on 2024/1/6.
// Copyright © 2024 www.davidhuang.com. All rights reserved.
//
import UIKit
class YHVerificationCodeLoginController: YHBaseViewController {
var bgImageView: UIImageView!
var loginTitleLabel: UILabel!
var loginSubTitleLabel: UILabel!
var phoneLabel: UILabel!
var phoneMessageView: YHPhoneMessageView!
var getCodeButton: UIButton!
var emailButton: UIButton!
var centerLine: UIView!
var centerImageView: UIImageView!
var promptsLabel: UILabel!
var wxButton: UIButton!
var privacyView: YHLoginPrivacyView!
override func viewDidLoad() {
super.viewDidLoad()
setView()
// Do any additional setup after loading the view.
}
func setView() {
bgImageView = {
let imageView = UIImageView()
imageView.image = UIImage(named: "login_bg_image")
return imageView
}()
view.addSubview(bgImageView)
bgImageView.snp.makeConstraints { make in
make.left.right.top.bottom.equalTo(view)
}
loginTitleLabel = {
let label = UILabel()
label.text = "登录后更精彩"
label.font = kBoldFont(size: 32)
label.textColor = UIColor(hex:0xffffff)
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)
}
loginSubTitleLabel = {
let label = UILabel()
label.text = "香港美好生活期待与你的相遇"
label.font = kFont(size: 20)
label.textColor = UIColor(hex:0xffffff)
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 = "未注册手机验证后完成注册"
label.font = kBoldFont(size: 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.height.equalTo(22)
}
phoneMessageView = {
let view = YHPhoneMessageView()
view.backgroundColor = UIColor(hex:0xffffff)
view.layer.cornerRadius = 24
view.block = { [weak self] in
guard let self = self else { return }
let vc = YHPickPhoneAddressViewController()
self.navigationController?.pushViewController(vc)
}
return view
}()
view.addSubview(phoneMessageView)
phoneMessageView.snp.makeConstraints { make in
make.left.equalTo(33)
make.right.equalTo(-33)
make.top.equalTo(278)
make.height.equalTo(48)
}
getCodeButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor(hex:0xd8d8d8).withAlphaComponent(0.8)
button.titleLabel?.font = kBoldFont(size: 16)
button.contentHorizontalAlignment = .center
button.setTitle("获取验证码", for: .normal)
button.setTitleColor( UIColor(hex:0x979797), for: .normal)
button.layer.cornerRadius = 24
button.addTarget(self, action: #selector(getCode), for: .touchUpInside)
return button
}()
view.addSubview(getCodeButton)
getCodeButton.snp.makeConstraints { make in
make.left.equalTo(33)
make.right.equalTo(-33)
make.top.equalTo(348)
make.height.equalTo(48)
}
emailButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = kBoldFont(size: 16)
button.setTitle("邮箱登录", for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
return button
}()
view.addSubview(emailButton)
emailButton.snp.makeConstraints { make in
make.left.equalTo(33)
make.top.equalTo(424)
make.height.equalTo(20)
make.width.equalTo(68)
}
centerImageView = {
let imageView = UIImageView()
imageView.image = UIImage(named: "login_center_image")
return imageView
}()
view.addSubview(centerImageView)
centerImageView.snp.makeConstraints { make in
make.centerX.equalTo(view)
make.width.equalTo(153)
make.height.equalTo(108)
make.bottom.equalTo(-188)
}
promptsLabel = {
let label = UILabel()
label.text = "其他登录方式(第三方账号注册需绑定手机号)"
label.font = kFont(size: 12)
label.textColor = UIColor(hex:0xffffff)
label.textAlignment = .center
return label
}()
view.addSubview(promptsLabel)
promptsLabel.snp.makeConstraints { make in
make.left.equalTo(14)
make.right.equalTo(-14)
make.bottom.equalTo(-89)
make.height.equalTo(20)
}
wxButton = {
let button = UIButton(type: .custom)
button.setBackgroundImage(UIImage(named: "login_style_wx"), for: .normal)
return button
}()
view.addSubview(wxButton)
wxButton.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.bottom.equalTo(-59)
make.height.equalTo(18)
make.width.equalTo(21)
}
privacyView = {
let view = YHLoginPrivacyView()
return view
}()
view.addSubview(privacyView)
privacyView.snp.makeConstraints { make in
make.bottom.equalTo(-24)
make.centerX.equalToSuperview()
make.height.equalTo(20)
make.width.equalTo(308)
}
//测试
}
@objc func getCode() {
let vc = YHCodeResultViewController()
self.navigationController?.pushViewController(vc)
}
}
//
// YHPhoneMessageView.swift
// galaxy
//
// Created by EDY on 2024/1/6.
// Copyright © 2024 www.davidhuang.com. All rights reserved.
//
import UIKit
class YHPhoneMessageView: UIView {
typealias Block = () -> ()
var block: Block?
var messageButton: UIButton!
var pointImageView: UIImageView!
var phoneTextField: UITextField!
override init(frame: CGRect) {
super.init(frame: frame)
setView()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setView() {
messageButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = kBoldFont(size: 16)
button.setTitle("+86", for: .normal)
button.setTitleColor( UIColor(hex:0x000000), for: .normal)
button.addTarget(self, action: #selector(messageClick), for: .touchUpInside)
return button
}()
addSubview(messageButton)
messageButton.snp.makeConstraints { make in
make.top.bottom.equalToSuperview()
make.left.equalToSuperview().offset(16)
}
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.equalToSuperview().offset(60)
make.width.equalTo(5)
make.height.equalTo(2.83)
}
phoneTextField = {
let text = UITextField()
text.placeholder = "请输入签约手机号"
text.font = kFont(size: 16)
text.textColor = UIColor(hex:0x000000)
text.textAlignment = .left
text.keyboardType = .phonePad
text.clearButtonMode = .always
return text
}()
addSubview(phoneTextField)
phoneTextField.snp.makeConstraints { make in
make.top.bottom.equalToSuperview()
make.left.equalTo(70)
make.right.equalTo(-22.5)
}
}
@objc func messageClick() {
if let block = block {
block()
}
}
}
...@@ -16,10 +16,10 @@ struct YHSmsCodeViewConfig { ...@@ -16,10 +16,10 @@ struct YHSmsCodeViewConfig {
var font: UIFont? = .systemFont(ofSize: 20) var font: UIFont? = .systemFont(ofSize: 20)
// 展示输入框个数 // 展示输入框个数
var count : Int = 6 var count : Int = 6
var width : Double = 40.0 var width : Double = 45.0
var height : Double = 50.0 var height : Double = 55.0
// 输入框之间间距 // 输入框之间间距
var gap:Double = 8 var gap:Double = 9
} }
let codeViewBaseTag = 9527 let codeViewBaseTag = 9527
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "login_phone_point@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "login_phone_point@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