2024-02-22 19:59:38 +08:00
|
|
|
|
//
|
|
|
|
|
// AuthPrivacyView.swift
|
|
|
|
|
// yinmeng-ios
|
|
|
|
|
//
|
2024-03-05 14:04:09 +08:00
|
|
|
|
// Created by yinmeng on 2024/2/22.
|
2024-02-22 19:59:38 +08:00
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
import UIKit
|
|
|
|
|
|
2024-02-29 01:07:15 +08:00
|
|
|
|
let AuthPrivacyShowKey = "AuthPrivacyShowKey"
|
|
|
|
|
|
2024-02-22 19:59:38 +08:00
|
|
|
|
class AuthPrivacyView: BaseView {
|
|
|
|
|
|
|
|
|
|
override func loadSubViews() {
|
2024-02-29 01:07:15 +08:00
|
|
|
|
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
|
2024-03-07 16:56:48 +08:00
|
|
|
|
make.size.equalTo(CGSize(width: 335, height: 490))
|
2024-02-29 01:07:15 +08:00
|
|
|
|
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)
|
|
|
|
|
}
|
2024-02-22 19:59:38 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|