Commit 14b80b9b authored by pete谢兆麟's avatar pete谢兆麟

Merge branch 'xiezhaolin' into develop

# Conflicts:
#	galaxy/galaxy.xcodeproj/project.pbxproj
parents 028d8c27 45b99655
......@@ -72,7 +72,10 @@
04A7BC8F2B6B2BC2000E8D47 /* YHFamilyRequestViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04A7BC8E2B6B2BC2000E8D47 /* YHFamilyRequestViewModel.swift */; };
04A7BC912B6B7B89000E8D47 /* YHTwoOptionAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04A7BC902B6B7B89000E8D47 /* YHTwoOptionAlertView.swift */; };
04AF58C42B4FC51C0066011A /* YHLocalizable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AF58C32B4FC51C0066011A /* YHLocalizable.swift */; };
04D765732B6A173C0055ECBB /* YHSpouseInfoContainerVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D765722B6A173C0055ECBB /* YHSpouseInfoContainerVC.swift */; };
04E86E092B707ACE00A35F4B /* YHPhoneLoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E86E082B707ACE00A35F4B /* YHPhoneLoginViewController.swift */; };
04E86E0B2B70C13300A35F4B /* YHCodeSueecssViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E86E0A2B70C13300A35F4B /* YHCodeSueecssViewController.swift */; };
04E86E0D2B70D51D00A35F4B /* YHWebViewViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E86E0C2B70D51D00A35F4B /* YHWebViewViewController.swift */; };
04E86E0F2B70DE9400A35F4B /* YHSpouseInfoContainerVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E86E0E2B70DE9400A35F4B /* YHSpouseInfoContainerVC.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 */; };
......@@ -297,7 +300,10 @@
04A7BC8E2B6B2BC2000E8D47 /* YHFamilyRequestViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFamilyRequestViewModel.swift; sourceTree = "<group>"; };
04A7BC902B6B7B89000E8D47 /* YHTwoOptionAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHTwoOptionAlertView.swift; sourceTree = "<group>"; };
04AF58C32B4FC51C0066011A /* YHLocalizable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLocalizable.swift; sourceTree = "<group>"; };
04D765722B6A173C0055ECBB /* YHSpouseInfoContainerVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSpouseInfoContainerVC.swift; sourceTree = "<group>"; };
04E86E082B707ACE00A35F4B /* YHPhoneLoginViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPhoneLoginViewController.swift; sourceTree = "<group>"; };
04E86E0A2B70C13300A35F4B /* YHCodeSueecssViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCodeSueecssViewController.swift; sourceTree = "<group>"; };
04E86E0C2B70D51D00A35F4B /* YHWebViewViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHWebViewViewController.swift; sourceTree = "<group>"; };
04E86E0E2B70DE9400A35F4B /* YHSpouseInfoContainerVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHSpouseInfoContainerVC.swift; 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>"; };
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>"; };
......@@ -508,8 +514,8 @@
041B52962B5E8E3B007EBCEB /* C */ = {
isa = PBXGroup;
children = (
04E86E0E2B70DE9400A35F4B /* YHSpouseInfoContainerVC.swift */,
041B52972B5E8EA0007EBCEB /* YHFamilyMemberFormVC.swift */,
04D765722B6A173C0055ECBB /* YHSpouseInfoContainerVC.swift */,
041B52D52B5F899E007EBCEB /* YHSpousePrimaryInfoVC.swift */,
042FBBBA2B62806D00F9DE23 /* YHCertificateInfoController.swift */,
042FBBBE2B639F0300F9DE23 /* YHSpouseBasicInfoVC.swift */,
......@@ -890,6 +896,9 @@
0468D41F2B49320900CFB916 /* YHVerificationCodeLoginController.swift */,
0468D4232B494BEA00CFB916 /* YHCodeResultViewController.swift */,
0468D4252B495A5400CFB916 /* YHPickPhoneAddressViewController.swift */,
04E86E082B707ACE00A35F4B /* YHPhoneLoginViewController.swift */,
04E86E0A2B70C13300A35F4B /* YHCodeSueecssViewController.swift */,
04E86E0C2B70D51D00A35F4B /* YHWebViewViewController.swift */,
);
path = C;
sourceTree = "<group>";
......@@ -1463,6 +1472,7 @@
A5F78C822B68F39600EEA170 /* YHPersonInfoCommonCell.swift in Sources */,
A5ACE94B2B4564F7002C94D2 /* YHHUDRotatingImageView.swift in Sources */,
041B52DD2B60A889007EBCEB /* YHTest.swift in Sources */,
04E86E0F2B70DE9400A35F4B /* YHSpouseInfoContainerVC.swift in Sources */,
0468D47E2B68CEA200CFB916 /* YHImagePickerView.swift in Sources */,
A5ACE94F2B4564F7002C94D2 /* YhOverlayView.swift in Sources */,
A53026902B4E6F2700F35102 /* YHHomeCustomCell.swift in Sources */,
......@@ -1496,8 +1506,8 @@
042FBBC32B63DA4C00F9DE23 /* YHParentInfoVC.swift in Sources */,
A5ACE9392B4564F7002C94D2 /* UIDevice+Extension.swift in Sources */,
041B52912B5E67F3007EBCEB /* YHFormItemEnterDetailCell.swift in Sources */,
04E86E092B707ACE00A35F4B /* YHPhoneLoginViewController.swift in Sources */,
A5ACE9422B4564F7002C94D2 /* AppDelegate+Extension.swift in Sources */,
04D765732B6A173C0055ECBB /* YHSpouseInfoContainerVC.swift in Sources */,
A5FD63BF2B6250BC00D1D9DA /* YHInformationPerfectCell.swift in Sources */,
A510441A2B495DD0006B60BB /* UIView+Extension.swift in Sources */,
A5ACE93E2B4564F7002C94D2 /* UIImage+Extension.swift in Sources */,
......@@ -1553,11 +1563,13 @@
042FBBC72B64CFBF00F9DE23 /* YHChildPrimaryInfoVC.swift in Sources */,
A5234E2A2B6E349600A33433 /* YHBasicInfoFillBottomView.swift in Sources */,
04A7BC912B6B7B89000E8D47 /* YHTwoOptionAlertView.swift in Sources */,
04E86E0D2B70D51D00A35F4B /* YHWebViewViewController.swift in Sources */,
0468D4792B68A08600CFB916 /* YHAddressViewController.swift in Sources */,
A5ACE9562B4564F7002C94D2 /* YHBouncesContentView.swift in Sources */,
042FBBCB2B65058000F9DE23 /* YHChildBasicInfoVC.swift in Sources */,
A5ACE9302B4564F7002C94D2 /* Algorithm.swift in Sources */,
A5C5B32B2B57D17600A7C5D1 /* YHDavidCell5.swift in Sources */,
04E86E0B2B70C13300A35F4B /* YHCodeSueecssViewController.swift in Sources */,
A5ACE92D2B4564F7002C94D2 /* YHLoginPrivacyView.swift in Sources */,
0468D4552B6889A500CFB916 /* YHDatePickView.swift in Sources */,
A5C5B3272B57C8D500A7C5D1 /* YHDavidCell2.swift in Sources */,
......
//
// YHCodeSueecssViewController.swift
// galaxy
//
// Created by EDY on 2024/2/5.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHCodeSueecssViewController: YHBaseViewController {
var time = 60
var bgImageView: UIImageView!
var closeButton: UIButton!
var loginTitleLabel: UILabel!
var loginSubTitleLabel: UILabel!
var getCodeLabel: UILabel!
var getCodeButton: UIButton!
var smscodeView: YHSmsCodeInputView!
override func viewDidLoad() {
super.viewDidLoad()
gk_navBackgroundColor = .clear
gk_navShadowColor = .clear
gk_navigationBar.isHidden = true
setView()
// Do any additional setup after loading the view.
startClicked()
}
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)
}
closeButton = {
let button = UIButton(type: .custom)
button.setImage(UIImage(named: "login_back"), for: .normal)
button.addTarget(self, action: #selector(close), for: .touchUpInside)
return button
}()
view.addSubview(closeButton)
closeButton.snp.makeConstraints { make in
make.left.equalTo(13)
make.top.equalTo(51)
make.width.height.equalTo(30)
}
loginTitleLabel = {
let label = UILabel()
label.text = "请输入验证码"
label.font = kBoldFont(size: 28)
label.textColor = UIColor(hex:0x222222)
return label
}()
view.addSubview(loginTitleLabel)
loginTitleLabel.snp.makeConstraints { make in
make.left.equalTo(24)
make.right.equalTo(-24)
make.top.equalTo(203)
make.height.equalTo(25)
}
loginSubTitleLabel = {
let label = UILabel()
label.text = "已发送至 +86 188****2882"
label.font = kFont(size: 13)
label.textColor = UIColor(hex:0xc0c0c0)
return label
}()
view.addSubview(loginSubTitleLabel)
loginSubTitleLabel.snp.makeConstraints { make in
make.left.equalTo(24)
make.right.equalTo(-24)
make.top.equalTo(233)
make.height.equalTo(20)
}
smscodeView = {
let view = YHSmsCodeInputView(config: YHSmsCodeViewConfig())
view.complete = { [weak self] code in
self?.dismiss(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: 12)
button.text = "重新发送(58s)"
button.textColor = UIColor(hex:0xc0c0c0)
button.textAlignment = .center
button.isHidden = false
button.layer.cornerRadius = 4
button.layer.borderWidth = 1
button.layer.borderColor = UIColor(hex: 0xebeef4).cgColor
return button
}()
view.addSubview(getCodeLabel)
getCodeLabel.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.top.equalTo(382)
make.height.equalTo(28)
make.width.equalTo(91)
}
getCodeButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = kBoldFont(size: 12)
button.contentHorizontalAlignment = .center
button.setTitle("获取验证码", for: .normal)
button.setTitleColor( UIColor(hex:0x222222), for: .normal)
button.addTarget(self, action: #selector(startClicked), for: .touchUpInside)
button.isHidden = true
button.layer.cornerRadius = 4
button.layer.borderWidth = 1
button.layer.borderColor = UIColor(hex: 0xebeef4).cgColor
return button
}()
view.addSubview(getCodeButton)
getCodeButton.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.top.equalTo(382)
make.height.equalTo(28)
make.width.equalTo(91)
}
//测试
}
@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()
}
@objc func close() {
self.navigationController?.popViewController()
}
}
//
// YHPhoneLoginViewController.swift
// galaxy
//
// Created by EDY on 2024/2/5.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHPhoneLoginViewController: YHBaseViewController {
var bgImageView: UIImageView!
var closeButton: UIButton!
var logImageView: UIImageView!
var loginTitleLabel: UILabel!
var loginSubTitleLabel: UILabel!
var phoneMessageView: YHPhoneMessageView!
var getCodeButton: UIButton!
var privacyView: YHLoginPrivacyView!
override func viewDidLoad() {
super.viewDidLoad()
setView()
gk_navBackgroundColor = .clear
gk_navShadowColor = .clear
gk_navigationBar.isHidden = true
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
YHAnalytics.timeStrat("loginTime")
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
YHAnalytics.timeEnd("loginTime")
}
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)
}
closeButton = {
let button = UIButton(type: .custom)
button.setImage(UIImage(named: "login_close"), for: .normal)
button.addTarget(self, action: #selector(close), for: .touchUpInside)
return button
}()
view.addSubview(closeButton)
closeButton.snp.makeConstraints { make in
make.left.equalTo(13)
make.top.equalTo(51)
make.width.height.equalTo(30)
}
logImageView = {
let imageView = UIImageView()
imageView.image = UIImage(named: "login_phone_log_image")
return imageView
}()
view.addSubview(logImageView)
logImageView.snp.makeConstraints { make in
make.left.equalTo(24)
make.width.height.equalTo(53)
make.top.equalTo(120)
}
loginTitleLabel = {
let label = UILabel()
label.text = "手机号登录"
label.font = kBoldFont(size: 28)
label.textColor = UIColor(hex:0x222222)
return label
}()
view.addSubview(loginTitleLabel)
loginTitleLabel.snp.makeConstraints { make in
make.left.equalTo(24)
make.right.equalTo(-24)
make.top.equalTo(203)
make.height.equalTo(25)
}
loginSubTitleLabel = {
let label = UILabel()
label.text = "手机号首次登录自动注册"
label.font = kFont(size: 13)
label.textColor = UIColor(hex:0xc0c0c0)
return label
}()
view.addSubview(loginSubTitleLabel)
loginSubTitleLabel.snp.makeConstraints { make in
make.left.equalTo(24)
make.right.equalTo(-24)
make.top.equalTo(233)
make.height.equalTo(20)
}
phoneMessageView = {
let view = YHPhoneMessageView()
view.backgroundColor = UIColor(hex:0xf8f9fb)
view.layer.cornerRadius = 6
view.layer.borderWidth = 1
view.layer.borderColor = UIColor(hex:0xebeef4).cgColor
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(hex:0x2274ee).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 = 6
button.addTarget(self, action: #selector(getCode), for: .touchUpInside)
return button
}()
view.addSubview(getCodeButton)
getCodeButton.snp.makeConstraints { make in
make.left.equalTo(20)
make.right.equalTo(-20)
make.top.equalTo(376)
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)
}
//测试
}
@objc func getCode() {
if privacyView.isAgree {
let vc = YHCodeSueecssViewController()
self.navigationController?.pushViewController(vc)
} else {
let view = YHPrivacyAlertView(frame: view.bounds)
view.urlBlock = { [weak self] url in
guard let self = self else { return }
let vc = YHWebViewViewController()
vc.url = url
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 close() {
self.dismiss(animated: true)
}
}
//
// YHWebViewViewController.swift
// galaxy
//
// Created by EDY on 2024/2/5.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import WebKit
class YHWebViewViewController: YHBaseViewController, WKUIDelegate, WKNavigationDelegate {
var webview = WKWebView()
var progBar = UIProgressView()
var url = "https://www.baidu.com"
override func viewDidLoad() {
super.viewDidLoad()
//获取导航栏高度
let navHeight = self.navigationController?.navigationBar.frame.height
//获取状态栏高度
let statusHeight = k_Height_statusBar()
// 创建wkwebview
webview = WKWebView(frame: CGRect(x: 0, y: statusHeight + navHeight!, width: self.view.frame.width, height: self.view.frame.height))
webview.navigationDelegate = self
// 创建网址
let url = NSURL(string: url)
// 创建请求
let request = NSURLRequest(url: url! as URL)
// 加载请求
webview.load(request as URLRequest)
// 添加wkwebview
self.view.addSubview(webview)
// 加载网页的进度条
progBar = UIProgressView(frame: CGRect(x: 0, y: 0, width: self.view.frame.width, height: 30))
progBar.progress = 0.0
progBar.tintColor = UIColor.red
webview.addSubview(progBar)
// 监听网页加载的进度
webview.addObserver(self, forKeyPath: "estimatedProgress", options: .new, context: nil)
}
override func viewWillDisappear(_ animated: Bool) {
webview.removeObserver(self, forKeyPath: "estimatedProgress")
}
// MARK: - WKNavigationDelegate
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
self.navigationItem.title = webview.title
}
// MARK: - WKUIDelegate
func webView(_ webView: WKWebView, createWebViewWith configuration: WKWebViewConfiguration, for navigationAction: WKNavigationAction, windowFeatures: WKWindowFeatures) -> WKWebView? {
// 实现非安全链接的跳转。如果目标主视图不为空,则允许导航
if !(navigationAction.targetFrame?.isMainFrame != nil) {
webview.load(navigationAction.request)
}
return nil
}
func webView(_ webView: WKWebView, runJavaScriptAlertPanelWithMessage message: String, initiatedByFrame frame: WKFrameInfo, completionHandler: @escaping () -> Void) {
// 修复弹窗弹出的问题
let alert = UIAlertController(title: nil, message: message, preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "Ok", style: .default, handler: { (_) -> Void in
completionHandler()
}))
self.present(alert, animated: true, completion: nil)
}
// MARK: - webview function
@objc func toBack() {
if webview.canGoBack {
webview.goBack()
}
}
@objc func toForward() {
if webview.canGoForward {
webview.goForward()
}
}
// MARK: - KVO
override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
if keyPath == "estimatedProgress" {
self.progBar.alpha = 1.0
progBar.setProgress(Float(webview.estimatedProgress), animated: true)
//进度条的值最大为1.0
if(self.webview.estimatedProgress >= 1.0) {
UIView.animate(withDuration: 0.3, delay: 0.1, options: .curveEaseInOut, animations: { () -> Void in
self.progBar.alpha = 0.0
}, completion: { (finished:Bool) -> Void in
self.progBar.progress = 0
})
}
}
}
override class func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
}
}
......@@ -45,7 +45,7 @@ class YHLoginPrivacyView: UIView {
let label = UILabel()
label.text = "我已阅读并同意"
label.font = kFont(size: 12)
label.textColor = UIColor(hex:0xffffff)
label.textColor = UIColor(hex:0x888f98)
label.textAlignment = .left
return label
}()
......@@ -60,7 +60,8 @@ class YHLoginPrivacyView: UIView {
let button = UIButton(type: .custom)
button.titleLabel?.font = kBoldFont(size: 12)
button.contentHorizontalAlignment = .center
button.setTitle("《银河服务条款》", for: .normal)
button.setTitle("《隐私协议》", for: .normal)
button.setTitleColor(UIColor(hex: 0x2f7ef6), for: .normal)
return button
}()
addSubview(serviceButton)
......@@ -68,13 +69,13 @@ class YHLoginPrivacyView: UIView {
make.left.equalTo(messageLabel.snp.right).offset(1)
make.centerY.equalToSuperview()
make.height.equalTo(20)
make.width.equalTo(96)
make.width.equalTo(80)
}
andLabel = {
let label = UILabel()
label.text = "和"
label.font = kFont(size: 12)
label.textColor = UIColor(hex:0xffffff)
label.textColor = UIColor(hex:0x888f98)
label.textAlignment = .left
return label
}()
......@@ -88,7 +89,8 @@ class YHLoginPrivacyView: UIView {
let button = UIButton(type: .custom)
button.titleLabel?.font = kBoldFont(size: 12)
button.contentHorizontalAlignment = .center
button.setTitle("《银河隐私政策》", for: .normal)
button.setTitle("《用户条款》", for: .normal)
button.setTitleColor(UIColor(hex: 0x2f7ef6), for: .normal)
return button
}()
addSubview(privacyButton)
......@@ -96,7 +98,7 @@ class YHLoginPrivacyView: UIView {
make.left.equalTo(andLabel.snp.right).offset(1)
make.centerY.equalToSuperview()
make.height.equalTo(20)
make.width.equalTo(96)
make.width.equalTo(80)
}
}
......
......@@ -7,10 +7,13 @@
//
import UIKit
import AttributedString
class YHPrivacyAlertView: UIView {
typealias Block = () -> ()
var block: Block?
typealias UrlBlock = (_ url: String) -> ()
typealias AgreeBlock = () -> ()
var urlBlock: UrlBlock?
var agreeBlock: AgreeBlock?
var centerView: UIView!
var titleLabel: UILabel!
var messageLabel: UILabel!
......@@ -45,30 +48,28 @@ class YHPrivacyAlertView: UIView {
make.height.equalTo(187)
}
titleLabel = {
messageLabel = {
let label = UILabel()
label.text = "同意隐私协议"
label.font = kFont(size: 16)
label.textColor = UIColor(hex:0x222222)
label.textAlignment = .center
label.numberOfLines = 0
return label
}()
centerView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.height.equalTo(19)
make.top.equalTo(27)
let aa: ASAttributedString = .init("请先阅读并同意", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.mainTextColor))
let cc: ASAttributedString = .init("《隐私协议》", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.brandMainColor), .action {
if let block = self.urlBlock {
block("https://www.baidu.com")
}
})
let bb: ASAttributedString = .init("和", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.mainTextColor))
let dd: ASAttributedString = .init("《用户条款》", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.brandMainColor), .action {
if let block = self.urlBlock {
block("https://www.baidu.com")
}
})
messageLabel.attributed.text = aa + cc + bb + dd
messageLabel = {
let label = UILabel()
label.text = "登录注册需要您阅读并同意我们的《银河服务条款》和《银河隐私政策》"
label.font = kFont(size: 14)
label.textColor = UIColor(hex:0x222222)
label.textAlignment = .left
label.numberOfLines = 0
return label
}()
centerView.addSubview(messageLabel)
messageLabel.snp.makeConstraints { make in
make.left.equalTo(22)
......@@ -120,10 +121,10 @@ class YHPrivacyAlertView: UIView {
}
@objc func agree() {
if let block = block {
if let block = self.agreeBlock {
block()
dismiss()
}
dismiss()
}
@objc private func handleTap(_ sender: AnyObject?) {
......
......@@ -10,16 +10,16 @@ import UIKit
// 输入框UI显示配置
struct YHSmsCodeViewConfig {
var textColor : UIColor? = .white
var bgColor : UIColor? = .init(white: 1, alpha: 0.3)
var cursorColor : UIColor? = .black
var textColor : UIColor? = UIColor(hex: 0x000000)
var bgColor : UIColor? = UIColor(hex: 0xebeef4)
var cursorColor : UIColor? = UIColor(hex: 0x2f7ef6)
var font: UIFont? = .systemFont(ofSize: 20)
// 展示输入框个数
var count : Int = 6
var width : Double = 45.0
var height : Double = 55.0
var height : Double = 50.0
// 输入框之间间距
var gap:Double = 9
var gap:Double = 10
}
let codeViewBaseTag = 9527
......
......@@ -15,9 +15,12 @@ class YHSmsCodeView: UIView {
if showCursor {
self.cursor.layer .removeAllAnimations()
self.animaitonShow(true)
self.layer.borderWidth = 1
self.layer.borderColor = UIColor(hex: 0x2f7ef6).cgColor
} else {
self.cursor.layer .removeAllAnimations()
self.cursor.isHidden = true
self.layer.borderWidth = 0
}
}
}
......@@ -36,7 +39,7 @@ class YHSmsCodeView: UIView {
var cursor : UIView = {
let cursor = UIView()
cursor.backgroundColor = .black
cursor.backgroundColor = UIColor(hex: 0x2f7ef6)
cursor.isHidden = true
return cursor
}()
......
......@@ -126,9 +126,11 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if (indexPath.row >= items.count) { return }
let vc = YHFamilyMemberFormVC(orderId: 133971)
self.navigationController?.pushViewController(vc)
let vc = UINavigationController(rootVC: YHPhoneLoginViewController())
vc.modalPresentationStyle = .custom
self.navigationController?.present(vc, animated: true)
// let vc = YHFamilyMemberFormVC(orderId: 133971)
// self.navigationController?.pushViewController(vc)
return
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "login_back@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "login_back@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "login_close@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "login_close@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "login_phone_bg_image@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "login_phone_bg_image@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "login_phone_log_image@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "login_phone_log_image@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