Commit 56c03b72 authored by Steven杜宇's avatar Steven杜宇

Merge branch 'develop' into duyu

parents e97dd36b ca103051
......@@ -8,12 +8,17 @@
/* Begin PBXBuildFile section */
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 */; };
04808C082B4686C10056D53C /* ATAuthSDK_D.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 04808C032B4686510056D53C /* ATAuthSDK_D.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
049A48A82B49417300D0C641 /* YHAboutUsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 049A48A72B49417300D0C641 /* YHAboutUsViewController.swift */; };
049A48AA2B49536000D0C641 /* YHAboutUsAdvantageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 049A48A92B49536000D0C641 /* YHAboutUsAdvantageCell.swift */; };
6203A87EDC96313BBE789D9C /* Pods_galaxy.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 987C69D43AE8D85DC1930DCF /* Pods_galaxy.framework */; };
A51044182B493675006B60BB /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = A51044172B493675006B60BB /* README.md */; };
A510441A2B495DD0006B60BB /* UIView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A51044192B495DD0006B60BB /* UIView+Extension.swift */; };
A5573ED22B317BFF00D98EC0 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5573ED12B317BFF00D98EC0 /* AppDelegate.swift */; };
A5573EDB2B317C0000D98EC0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A5573EDA2B317C0000D98EC0 /* Assets.xcassets */; };
A5573EE92B317C0100D98EC0 /* galaxyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5573EE82B317C0100D98EC0 /* galaxyTests.swift */; };
......@@ -106,6 +111,10 @@
/* Begin PBXFileReference section */
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>"; };
04808C042B4686510056D53C /* ATAuthSDK.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = ATAuthSDK.bundle; sourceTree = "<group>"; };
049A48A72B49417300D0C641 /* YHAboutUsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAboutUsViewController.swift; sourceTree = "<group>"; };
......@@ -113,6 +122,7 @@
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>"; };
987C69D43AE8D85DC1930DCF /* Pods_galaxy.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_galaxy.framework; sourceTree = BUILT_PRODUCTS_DIR; };
A51044172B493675006B60BB /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
A51044192B495DD0006B60BB /* UIView+Extension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIView+Extension.swift"; sourceTree = "<group>"; };
A5573ECE2B317BFF00D98EC0 /* galaxy.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = galaxy.app; sourceTree = BUILT_PRODUCTS_DIR; };
A5573ED12B317BFF00D98EC0 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
A5573EDA2B317C0000D98EC0 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
......@@ -291,9 +301,9 @@
A5ACE8D72B4564F7002C94D2 /* Classes */ = {
isa = PBXGroup;
children = (
A5ACE91B2B4564F7002C94D2 /* Modules */,
A5ACE91E2B4564F7002C94D2 /* Base */,
A5ACE8EE2B4564F7002C94D2 /* Tools */,
A5ACE91B2B4564F7002C94D2 /* Modules */,
);
path = Classes;
sourceTree = "<group>";
......@@ -319,6 +329,9 @@
isa = PBXGroup;
children = (
A5ACE8DB2B4564F7002C94D2 /* YHLoginViewController.swift */,
0468D41F2B49320900CFB916 /* YHVerificationCodeLoginController.swift */,
0468D4232B494BEA00CFB916 /* YHCodeResultViewController.swift */,
0468D4252B495A5400CFB916 /* YHPickPhoneAddressViewController.swift */,
);
path = C;
sourceTree = "<group>";
......@@ -330,6 +343,7 @@
A5ACE8E42B4564F7002C94D2 /* YHLoginStyleButton.swift */,
A5ACE8E52B4564F7002C94D2 /* YHLoginPrivacyView.swift */,
A5ACE8E62B4564F7002C94D2 /* YHValidateCodeInputView.swift */,
0468D4212B493A5E00CFB916 /* YHPhoneMessageView.swift */,
);
path = V;
sourceTree = "<group>";
......@@ -404,6 +418,7 @@
A5ACE8F72B4564F7002C94D2 /* Extention */ = {
isa = PBXGroup;
children = (
A51044192B495DD0006B60BB /* UIView+Extension.swift */,
A5ACE8F82B4564F7002C94D2 /* UIApplication+Extension.swift */,
A5ACE8F92B4564F7002C94D2 /* UIDevice+Extension.swift */,
A5ACE8FA2B4564F7002C94D2 /* NSAttributedString+Extension.swift */,
......@@ -755,6 +770,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
0468D4202B49320900CFB916 /* YHVerificationCodeLoginController.swift in Sources */,
A5ACE9362B4564F7002C94D2 /* YHNetworkStatusManager.swift in Sources */,
A5ACE92C2B4564F7002C94D2 /* YHLoginStyleButton.swift in Sources */,
A5ACE92F2B4564F7002C94D2 /* YHMyViewController.swift in Sources */,
......@@ -767,6 +783,7 @@
A5ACE9292B4564F7002C94D2 /* YHSmsCodeInputView.swift in Sources */,
A5ACE9452B4564F7002C94D2 /* BsHUDContainerView.swift in Sources */,
A5ACE93A2B4564F7002C94D2 /* NSAttributedString+Extension.swift in Sources */,
0468D4222B493A5E00CFB916 /* YHPhoneMessageView.swift in Sources */,
A5ACE9512B4564F7002C94D2 /* YhConstant.swift in Sources */,
A5ACE94A2B4564F7002C94D2 /* BsHUDProgressView.swift in Sources */,
A5ACE9442B4564F7002C94D2 /* Array+Extension.swift in Sources */,
......@@ -778,8 +795,10 @@
A5ACE94E2B4564F7002C94D2 /* AlignedCollectionViewFlowLayout.swift in Sources */,
A5ACE93B2B4564F7002C94D2 /* UIFont+Extension.swift in Sources */,
A5ACE9282B4564F7002C94D2 /* YHSmsCodeView.swift in Sources */,
0468D4262B495A5400CFB916 /* YHPickPhoneAddressViewController.swift in Sources */,
A5ACE9342B4564F7002C94D2 /* YHAllApiName.swift in Sources */,
A5ACE9502B4564F7002C94D2 /* YhCacheTool.swift in Sources */,
0468D4242B494BEA00CFB916 /* YHCodeResultViewController.swift in Sources */,
A5ACE93F2B4564F7002C94D2 /* UIViewController+Extension.swift in Sources */,
A5ACE9472B4564F7002C94D2 /* YHHUD.swift in Sources */,
A5ACE9412B4564F7002C94D2 /* Dictionary+Extension.swift in Sources */,
......@@ -787,6 +806,7 @@
A5ACE9532B4564F7002C94D2 /* YHBaseViewController.swift in Sources */,
A5ACE9392B4564F7002C94D2 /* UIDevice+Extension.swift in Sources */,
A5ACE9422B4564F7002C94D2 /* AppDelegate+Extension.swift in Sources */,
A510441A2B495DD0006B60BB /* UIView+Extension.swift in Sources */,
A5ACE93E2B4564F7002C94D2 /* UIImage+Extension.swift in Sources */,
A5ACE94C2B4564F7002C94D2 /* BsHUDErrorView.swift in Sources */,
A5D6AB1B2B46A1CC001C10A5 /* YHHomeModel.swift in Sources */,
......
......@@ -107,10 +107,6 @@ extension AppDelegate {
}
YHNetworkStatusManager.shared.listenNetWorkStatus()
}
//1.设置主窗口
......
......@@ -37,7 +37,9 @@ class YHBaseViewController: UIViewController {
}
deinit {
#if DEBUG
print(#function)
// print(type(of: self))
// print("执行了方法:",terminator: "\t")
printLog(#function)
#endif
}
}
......
......@@ -17,6 +17,13 @@ class YHHomeViewController: YHBaseViewController {
return YHHomePageViewModel()
}()
lazy var headBkgImagV: UIImageView = {
let imagV = UIImageView()
imagV.image = UIImage(named: "home_head_bkg")
imagV.contentMode = .scaleAspectFill
return imagV
}()
override func viewDidLoad() {
super.viewDidLoad()
......@@ -52,8 +59,18 @@ class YHHomeViewController: YHBaseViewController {
}
private func initView()->Void {
navigationItem.title = "首页"
navigationItem.title = ""
view.backgroundColor = UIColor(hex:0xE9E9E9)
view.addSubview(headBkgImagV)
headBkgImagV.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.height.equalTo(307)
}
}
}
......@@ -30,7 +30,7 @@ extension YHHomePageViewModel {
return
}
self.subject.onNext(YHHomeCofigMode())
print("model 是 ==>",model)
printLog("model 是 ==> \(model)")
} failBlock: { err in
print(err)
}
......
//
// 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 @@
import UIKit
import SnapKit
import RxSwift
import RxAlamofire
class YHLoginViewController: YHBaseViewController {
let disposeBag = DisposeBag()
var bgImageView: UIImageView!
var loginTitleLabel: UILabel!
var loginSubTitleLabel: UILabel!
......@@ -115,6 +119,7 @@ class YHLoginViewController: YHBaseViewController {
messageButton = {
let button = YHLoginStyleButton()
button.setContent(image: UIImage(named: "login_style_message")!, message: "验证码登录")
button.addTarget(self, action: #selector(messageLogin), for: .touchUpInside)
return button
}()
view.addSubview(messageButton)
......@@ -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 {
var font: UIFont? = .systemFont(ofSize: 20)
// 展示输入框个数
var count : Int = 6
var width : Double = 40.0
var height : Double = 50.0
var width : Double = 45.0
var height : Double = 55.0
// 输入框之间间距
var gap:Double = 8
var gap:Double = 9
}
let codeViewBaseTag = 9527
......
......@@ -187,14 +187,3 @@ extension String {
}
}
/// 打印
///
/// - Parameters:
/// - message: 打印内容
/// - file: 所在文件
/// - method: 所在方法
/// - line: 所在行
public func printLog<T>(_ message: T, file: String = #file, method: String = #function, line: Int = #line) {
print("\n[文件]:\((file as NSString).lastPathComponent) [所在行]:\(line),[方法名称]:\(method),[具体信息]:\(message)")
}
//
// UIView+Extension.swift
// Example
//
// Created by QuintGao on 2022/3/21.
// Copyright © 2022 QuintGao. All rights reserved.
//
import Foundation
import QuartzCore
extension UIView {
func image(with colors: [Any]) -> UIImage? {
addGradualLayer(colors)
return convertToImage()
}
func addGradualLayer(_ colors: [Any]) {
if colors.count == 0 { return }
let gradientLayer = CAGradientLayer()
gradientLayer.colors = colors
gradientLayer.locations = [0, 1.0]
gradientLayer.startPoint = CGPoint(x: 0.02, y: 0.5)
gradientLayer.endPoint = CGPoint(x: 1.0, y: 0.5)
gradientLayer.frame = self.bounds
self.layer.addSublayer(gradientLayer)
}
func convertToImage() -> UIImage? {
let size = self.bounds.size
if size.width <= 0 || size.height <= 0 { return nil }
UIGraphicsBeginImageContextWithOptions(size, false, UIScreen.main.scale)
guard let context = UIGraphicsGetCurrentContext() else { return nil }
self.layer.render(in: context)
let image = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return image
}
}
......@@ -12,14 +12,20 @@ import UIKit
let APP_NAME = Bundle.main.infoDictionary!["CFBundleName"] as! String
func YHLOG<T>(message:T,file:String = #file,funcName:String = #function,lineName:Int = #line){
//这个DEBUG 是一个debug时候的一个flag需要自己去xcode设置项设置。
/// 打印
///
/// - Parameters:
/// - message: 打印内容
/// - file: 所在文件
/// - method: 所在方法
/// - line: 所在行
public func printLog<T>(_ message: T, file: String = #file, method: String = #function, line: Int = #line) {
#if DEBUG
let flieName = (file as NSString).lastPathComponent
print("\(APP_NAME)/\(flieName)/\(funcName)/\(lineName):\(message)")
print("\n开始一段日志输出=========>\n[文件]:\((file as NSString).lastPathComponent)\n[所在行]:\(line)\n[方法名称]:\(method)\n[打印信息]:\(message)\n结束该段日志输出<=========\n\n\n")
#endif
}
///屏幕宽度
let KScreenWidth = UIScreen.main.bounds.size.width
///屏幕高度
......
......@@ -106,7 +106,7 @@ class YHNetRequest: NSObject {
httpRequest?.responseString(completionHandler: { string in
#if DEBUG
print("\n网络请求已返回 string=\(string)")
printLog("\n网络请求已返回 string=\(string)")
#endif
self.completeHandle(string: string)
})
......@@ -207,12 +207,12 @@ class YHNetRequest: NSObject {
extension YHNetRequest {
class func getRequest(url:String, params:[String:Any] = [:], successBlock: SuccessHandlerType!, failBlock: FailureHandlerType!) -> Request? {
YHLOG(message:"\n发起请求的URL是===> url = \(url)")
printLog("\n发起请求的URL是===> url = \(url)")
return YHNetRequest().url(url).requestType(.get).success(successBlock).failed(failBlock).startRequest()
}
class func postRequest(url:String, params:[String:Any] = [:], successBlock: SuccessHandlerType!, failBlock: FailureHandlerType!) -> Request? {
YHLOG(message:"\n发起请求的URL是===> url = \(url)")
printLog("\n发起请求的URL是===> url = \(url)")
return YHNetRequest().url(url).requestType(.post).success(successBlock).failed(failBlock).startRequest()
}
}
......
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "Rectangle 8235.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Rectangle 8235@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Rectangle 8235@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"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