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

Merge commit '1c9b4d04' into davidhuang

* commit '1c9b4d04':
  隐私协议逻辑
  //  布局警告
parents 60d64ad4 1c9b4d04
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
0468D4222B493A5E00CFB916 /* YHPhoneMessageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4212B493A5E00CFB916 /* YHPhoneMessageView.swift */; }; 0468D4222B493A5E00CFB916 /* YHPhoneMessageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4212B493A5E00CFB916 /* YHPhoneMessageView.swift */; };
0468D4242B494BEA00CFB916 /* YHCodeResultViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4232B494BEA00CFB916 /* YHCodeResultViewController.swift */; }; 0468D4242B494BEA00CFB916 /* YHCodeResultViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4232B494BEA00CFB916 /* YHCodeResultViewController.swift */; };
0468D4262B495A5400CFB916 /* YHPickPhoneAddressViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4252B495A5400CFB916 /* YHPickPhoneAddressViewController.swift */; }; 0468D4262B495A5400CFB916 /* YHPickPhoneAddressViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4252B495A5400CFB916 /* YHPickPhoneAddressViewController.swift */; };
0468D4282B50D4AF00CFB916 /* YHPrivacyAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4272B50D4AF00CFB916 /* YHPrivacyAlertView.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, ); }; };
049A48A82B49417300D0C641 /* YHAboutUsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 049A48A72B49417300D0C641 /* YHAboutUsViewController.swift */; }; 049A48A82B49417300D0C641 /* YHAboutUsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 049A48A72B49417300D0C641 /* YHAboutUsViewController.swift */; };
...@@ -119,6 +120,7 @@ ...@@ -119,6 +120,7 @@
0468D4212B493A5E00CFB916 /* YHPhoneMessageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPhoneMessageView.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>"; }; 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>"; }; 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>"; };
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>"; };
049A48A72B49417300D0C641 /* YHAboutUsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAboutUsViewController.swift; sourceTree = "<group>"; }; 049A48A72B49417300D0C641 /* YHAboutUsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAboutUsViewController.swift; sourceTree = "<group>"; };
...@@ -354,6 +356,7 @@ ...@@ -354,6 +356,7 @@
A5ACE8E52B4564F7002C94D2 /* YHLoginPrivacyView.swift */, A5ACE8E52B4564F7002C94D2 /* YHLoginPrivacyView.swift */,
A5ACE8E62B4564F7002C94D2 /* YHValidateCodeInputView.swift */, A5ACE8E62B4564F7002C94D2 /* YHValidateCodeInputView.swift */,
0468D4212B493A5E00CFB916 /* YHPhoneMessageView.swift */, 0468D4212B493A5E00CFB916 /* YHPhoneMessageView.swift */,
0468D4272B50D4AF00CFB916 /* YHPrivacyAlertView.swift */,
); );
path = V; path = V;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -807,6 +810,7 @@ ...@@ -807,6 +810,7 @@
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 */,
0468D4282B50D4AF00CFB916 /* YHPrivacyAlertView.swift in Sources */,
A5ACE9522B4564F7002C94D2 /* YHIntelligentServiceViewController.swift in Sources */, A5ACE9522B4564F7002C94D2 /* YHIntelligentServiceViewController.swift in Sources */,
A5ACE9462B4564F7002C94D2 /* BsHUDSquareBaseView.swift in Sources */, A5ACE9462B4564F7002C94D2 /* BsHUDSquareBaseView.swift in Sources */,
A5551FFE2B4C26CE00510980 /* YHBaseViewModel.swift in Sources */, A5551FFE2B4C26CE00510980 /* YHBaseViewModel.swift in Sources */,
......
...@@ -194,8 +194,14 @@ class YHLoginViewController: YHBaseViewController { ...@@ -194,8 +194,14 @@ class YHLoginViewController: YHBaseViewController {
} }
@objc func messageLogin() { @objc func messageLogin() {
let vc = YHVerificationCodeLoginController() if privacyView.isAgree {
self.navigationController?.pushViewController(vc) let vc = YHVerificationCodeLoginController()
self.navigationController?.pushViewController(vc)
} else {
let view = YHPrivacyAlertView(frame: view.bounds)
let window = UIApplication.shared.yhKeyWindow()
window?.addSubview(view)
}
} }
} }
......
...@@ -14,6 +14,7 @@ class YHLoginPrivacyView: UIView { ...@@ -14,6 +14,7 @@ class YHLoginPrivacyView: UIView {
var serviceButton: UIButton! var serviceButton: UIButton!
var andLabel: UILabel! var andLabel: UILabel!
var privacyButton: UIButton! var privacyButton: UIButton!
var isAgree: Bool = false
override init(frame: CGRect) { override init(frame: CGRect) {
super.init(frame: frame) super.init(frame: frame)
...@@ -29,6 +30,7 @@ class YHLoginPrivacyView: UIView { ...@@ -29,6 +30,7 @@ class YHLoginPrivacyView: UIView {
let button = UIButton(type: .custom) let button = UIButton(type: .custom)
button.setBackgroundImage(UIImage(named: "login_privacy_disagree"), for: .normal) button.setBackgroundImage(UIImage(named: "login_privacy_disagree"), for: .normal)
button.setBackgroundImage(UIImage(named: "login_privacy_agree"), for: .selected) button.setBackgroundImage(UIImage(named: "login_privacy_agree"), for: .selected)
button.addTarget(self, action: #selector(agreeClick), for: .touchUpInside)
return button return button
}() }()
addSubview(agreeButton) addSubview(agreeButton)
...@@ -97,4 +99,9 @@ class YHLoginPrivacyView: UIView { ...@@ -97,4 +99,9 @@ class YHLoginPrivacyView: UIView {
make.width.equalTo(96) make.width.equalTo(96)
} }
} }
@objc func agreeClick() {
agreeButton.isSelected = !agreeButton.isSelected
isAgree = agreeButton.isSelected
}
} }
//
// YHPrivacyAlertView.swift
// galaxy
//
// Created by EDY on 2024/1/12.
// Copyright © 2024 www.davidhuang.com. All rights reserved.
//
import UIKit
import RxSwift
class YHPrivacyAlertView: UIView {
typealias Block = () -> ()
var block: Block?
var centerView: UIView!
var titleLabel: UILabel!
var messageLabel: UILabel!
var agreeButton: UIButton!
var disAgressButton: UIButton!
override init(frame: CGRect) {
super.init(frame: frame)
backgroundColor = UIColor(white: 0.5, alpha: 0.1)
let tap = UITapGestureRecognizer(target: self, action: #selector(handleTap))
tap.delegate = self
addGestureRecognizer(tap)
setView()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setView() {
centerView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = 12
return view
}()
addSubview(centerView)
centerView.snp.makeConstraints { make in
make.center.equalToSuperview()
make.width.equalTo(299)
make.height.equalTo(187)
}
titleLabel = {
let label = UILabel()
label.text = "同意隐私协议"
label.font = kFont(size: 16)
label.textColor = UIColor(hex:0x222222)
label.textAlignment = .center
return label
}()
centerView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.height.equalTo(19)
make.top.equalTo(27)
}
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)
make.right.equalTo(-22)
make.height.equalTo(42)
make.top.equalTo(63)
}
disAgressButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor(hex:0xffffff)
button.titleLabel?.font = kBoldFont(size: 15)
button.contentHorizontalAlignment = .center
button.setTitle("不同意", for: .normal)
button.setTitleColor( UIColor(hex:0x3c86f8), for: .normal)
button.layer.cornerRadius = 8
button.layer.borderWidth = 1
button.layer.borderColor = UIColor(hex: 0x3c86f8).cgColor
button.addTarget(self, action: #selector(disagree), for: .touchUpInside)
return button
}()
centerView.addSubview(disAgressButton)
disAgressButton.snp.makeConstraints { make in
make.left.equalTo(16)
make.bottom.equalTo(-21)
make.width.equalTo(128)
make.height.equalTo(45)
}
agreeButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor(hex:0x3c86f8)
button.titleLabel?.font = kBoldFont(size: 15)
button.contentHorizontalAlignment = .center
button.setTitle("同意", for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.layer.cornerRadius = 8
button.addTarget(self, action: #selector(agree), for: .touchUpInside)
return button
}()
centerView.addSubview(agreeButton)
agreeButton.snp.makeConstraints { make in
make.right.equalTo(-16)
make.bottom.equalTo(-21)
make.width.equalTo(128)
make.height.equalTo(45)
}
}
@objc func agree() {
if let block = block {
block()
dismiss()
}
}
@objc private func handleTap(_ sender: AnyObject?) {
print("处理点击手势")
dismiss()
}
@objc func disagree() {
dismiss()
}
func dismiss() {
removeFromSuperview()
}
}
extension YHPrivacyAlertView: UIGestureRecognizerDelegate {
func gestureRecognizer(_ gestureRecognizer:UIGestureRecognizer, shouldReceive touch:UITouch) -> Bool {
if touch.view == self {
return true
}
return false
}
}
...@@ -40,17 +40,17 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget { ...@@ -40,17 +40,17 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 110)) let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 110))
var iconImgView = UIImageView(image: UIImage(named:"mine_head_default")) let iconImgView = UIImageView(image: UIImage(named:"mine_head_default"))
view.addSubview(iconImgView) view.addSubview(iconImgView)
var nameLabel = UILabel() let nameLabel = UILabel()
nameLabel.text = "智慧银河" nameLabel.text = "智慧银河"
nameLabel.textColor = UIColor(hexString:"#222222") nameLabel.textColor = UIColor(hexString:"#222222")
nameLabel.textAlignment = NSTextAlignment.left nameLabel.textAlignment = NSTextAlignment.left
nameLabel.font = UIFont.systemFont(ofSize: 20) nameLabel.font = UIFont.systemFont(ofSize: 20)
view.addSubview(nameLabel) view.addSubview(nameLabel)
var mobileLabel = UILabel() let mobileLabel = UILabel()
mobileLabel.text = "133****0000" mobileLabel.text = "133****0000"
mobileLabel.textColor = UIColor(hexString:"#666666") mobileLabel.textColor = UIColor(hexString:"#666666")
mobileLabel.textAlignment = NSTextAlignment.left mobileLabel.textAlignment = NSTextAlignment.left
...@@ -58,23 +58,22 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget { ...@@ -58,23 +58,22 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
view.addSubview(mobileLabel) view.addSubview(mobileLabel)
iconImgView.snp.makeConstraints { make in iconImgView.snp.makeConstraints { make in
make.left.equalTo(view.snp.left).offset(16) make.left.equalToSuperview().offset(16)
make.centerY.equalTo(view) make.centerY.equalToSuperview()
make.width.height.equalTo(55) make.width.height.equalTo(55)
} }
nameLabel.snp.makeConstraints { make in nameLabel.snp.makeConstraints { make in
make.left.equalTo(iconImgView.snp.right).offset(10) make.left.equalTo(iconImgView.snp.right).offset(10)
make.right.equalTo(view).offset(-16) make.right.equalToSuperview().offset(-16).priority(.low)
make.bottom.equalTo(view.snp.centerY) make.bottom.equalTo(view.snp.centerY)
} }
mobileLabel.snp.makeConstraints { make in mobileLabel.snp.makeConstraints { make in
make.left.equalTo(iconImgView.snp.right).offset(10) make.left.equalTo(iconImgView.snp.right).offset(10)
make.right.equalTo(view).offset(-16) make.right.equalTo(nameLabel)
make.top.equalTo(view.snp.centerY) make.top.equalTo(view.snp.centerY)
} }
return view return view
}() }()
......
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