首次安装的弹框
This commit is contained in:
@@ -18,6 +18,7 @@ class AuthLaunchVC: BaseViewController, HiddenNavigationBarProtocol {
|
||||
view.addSubview(otherStackView)
|
||||
view.addSubview(loginStackView)
|
||||
view.addSubview(stackView)
|
||||
view.addSubview(privacyView)
|
||||
|
||||
otherStackView.addArrangedSubview(leftView)
|
||||
otherStackView.addArrangedSubview(otherLb)
|
||||
@@ -34,6 +35,10 @@ class AuthLaunchVC: BaseViewController, HiddenNavigationBarProtocol {
|
||||
protocolStackView.addArrangedSubview(andLb)
|
||||
protocolStackView.addArrangedSubview(privacyBtn)
|
||||
|
||||
privacyView.snp.makeConstraints { make in
|
||||
make.edges.equalTo(view)
|
||||
}
|
||||
|
||||
backImgView.snp.makeConstraints { make in
|
||||
make.edges.equalTo(view)
|
||||
}
|
||||
@@ -94,6 +99,13 @@ class AuthLaunchVC: BaseViewController, HiddenNavigationBarProtocol {
|
||||
make.size.equalTo(CGSize(width: 14, height: 14))
|
||||
}
|
||||
|
||||
if UserDefaults.standard.bool(forKey: AuthPrivacyShowKey) == true {
|
||||
privacyView.isHidden = true
|
||||
} else {
|
||||
UIView.animate(withDuration: 0.5) {
|
||||
self.privacyView.isHidden = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private lazy var backImgView: UIImageView = {
|
||||
@@ -256,6 +268,12 @@ class AuthLaunchVC: BaseViewController, HiddenNavigationBarProtocol {
|
||||
return button
|
||||
}()
|
||||
|
||||
private lazy var privacyView: AuthPrivacyView = {
|
||||
let view = AuthPrivacyView()
|
||||
view.backgroundColor = .clear
|
||||
view.isHidden = true
|
||||
return view
|
||||
}()
|
||||
|
||||
@objc func privacyBtnAction() {
|
||||
let web = WebViewController(url: "yinmeng/\(H5Utils.privacy.rawValue)")
|
||||
|
@@ -7,10 +7,119 @@
|
||||
|
||||
import UIKit
|
||||
|
||||
let AuthPrivacyShowKey = "AuthPrivacyShowKey"
|
||||
|
||||
class AuthPrivacyView: BaseView {
|
||||
|
||||
override func loadSubViews() {
|
||||
|
||||
backgroundColor = ThemeColor(hexStr: "#000000", alpha: 0.4)
|
||||
addSubview(effectView)
|
||||
addSubview(contentView)
|
||||
contentView.addSubview(titleLb)
|
||||
contentView.addSubview(textView)
|
||||
contentView.addSubview(agreeBtn)
|
||||
contentView.addSubview(rejectBtn)
|
||||
|
||||
effectView.snp.makeConstraints { make in
|
||||
make.edges.equalTo(contentView)
|
||||
}
|
||||
contentView.snp.makeConstraints { make in
|
||||
make.size.equalTo(CGSize(width: 335, height: 490))
|
||||
make.centerX.equalTo(self)
|
||||
make.centerY.equalTo(self)
|
||||
}
|
||||
|
||||
titleLb.snp.makeConstraints { make in
|
||||
make.centerX.equalTo(contentView)
|
||||
make.top.equalTo(contentView).offset(18)
|
||||
}
|
||||
|
||||
textView.snp.makeConstraints { make in
|
||||
make.left.right.equalTo(contentView).inset(20)
|
||||
make.top.equalTo(contentView).offset(52)
|
||||
make.bottom.equalTo(contentView).offset(-132)
|
||||
}
|
||||
|
||||
agreeBtn.snp.makeConstraints { make in
|
||||
make.left.right.equalTo(contentView).inset(32)
|
||||
make.height.equalTo(46)
|
||||
make.bottom.equalTo(rejectBtn.snp.top).offset(-20)
|
||||
}
|
||||
rejectBtn.snp.makeConstraints { make in
|
||||
make.centerX.equalTo(contentView)
|
||||
make.height.equalTo(22)
|
||||
make.bottom.equalTo(contentView).offset(-20)
|
||||
}
|
||||
}
|
||||
|
||||
private lazy var effectView: UIVisualEffectView = {
|
||||
let blurEffect = UIBlurEffect(style: .light)
|
||||
let blurView = UIVisualEffectView(effect: blurEffect)
|
||||
blurView.layer.masksToBounds = true
|
||||
blurView.layer.cornerRadius = 16
|
||||
return blurView
|
||||
}()
|
||||
|
||||
private lazy var contentView: UIView = {
|
||||
let view = UIView()
|
||||
view.backgroundColor = ThemeColor(hexStr: "#525566", alpha: 0.8)
|
||||
view.layer.masksToBounds = true
|
||||
view.layer.cornerRadius = 16
|
||||
return view
|
||||
}()
|
||||
|
||||
private lazy var titleLb: UILabel = {
|
||||
let label = UILabel()
|
||||
label.textColor = .white
|
||||
label.font = UIFont.systemFont(ofSize: 16)
|
||||
label.textAlignment = .center
|
||||
label.text = "用户隐私保护指引"
|
||||
return label
|
||||
}()
|
||||
|
||||
private lazy var textView: UITextView = {
|
||||
let view = UITextView()
|
||||
view.backgroundColor = .clear
|
||||
view.font = UIFont.systemFont(ofSize: 14)
|
||||
view.text = "欢迎使用音萌:\n\n 我们十分重视用户的隐私和个人信息保护。你在使用我们的产品或服务时,为了更好提供服务,我们可能会搜集和使用你的相关信息;\n\n1、你在我们平台上注册账户或使用软件服务时,将需要你授权和提供与使用服务相关的个人信息(包括联系方式、日志等敏感信息)和设备信息(包括Mac地址、EMID/IMEI、软件安装列表等信息);\n\n2、未经你同意,我们不会将你的信息出租、出售给第三方或用于你未授权的其他用途;\n\n3、你可以对上述信息进行访问、更正、删除及撤回同意等。"
|
||||
return view
|
||||
}()
|
||||
|
||||
private lazy var agreeBtn: UIButton = {
|
||||
let button = UIButton(type: .custom)
|
||||
button.setBackgroundImage(UIImage.gradient([ThemeColor(hexStr: "#FF60FD"), ThemeColor(hexStr: "#8974FF"), ThemeColor(hexStr: "#69EBFF")], radius: 0), for: .normal)
|
||||
button.setTitle("同意并继续", for: .normal)
|
||||
button.setTitleColor(.white, for: .normal)
|
||||
button.titleLabel?.font = UIFont.systemFont(ofSize: 16, weight: .medium)
|
||||
button.layer.masksToBounds = true
|
||||
button.layer.cornerRadius = 23
|
||||
button.addTarget(self, action: #selector(agreeClick), for: .touchUpInside)
|
||||
return button
|
||||
}()
|
||||
|
||||
private lazy var rejectBtn: UIButton = {
|
||||
let button = UIButton(type: .custom)
|
||||
button.setTitle("拒绝", for: .normal)
|
||||
button.setTitleColor(.white, for: .normal)
|
||||
button.titleLabel?.font = UIFont.systemFont(ofSize: 16, weight: .medium)
|
||||
button.addTarget(self, action: #selector(rejectClick), for: .touchUpInside)
|
||||
return button
|
||||
}()
|
||||
|
||||
@objc func agreeClick() {
|
||||
UIView.animate(withDuration: 0.5) {
|
||||
self.isHidden = true
|
||||
} completion: { com in
|
||||
self.removeFromSuperview()
|
||||
}
|
||||
UserDefaults.standard.set(true, forKey: AuthPrivacyShowKey)
|
||||
UserDefaults.standard.synchronize()
|
||||
}
|
||||
|
||||
@objc func rejectClick() {
|
||||
UIView.animate(withDuration: 0.3) {
|
||||
exit(0)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user