|
@@ -0,0 +1,187 @@
|
|
|
+//
|
|
|
+// TSUploadPhotoPrivacyAlertVC.swift
|
|
|
+// AIEmoji
|
|
|
+//
|
|
|
+// Created by 100Years on 2025/4/8.
|
|
|
+//
|
|
|
+
|
|
|
+class TSUploadPhotoPrivacyAlertVC: TSBaseVC {
|
|
|
+
|
|
|
+ var clickHandle:(()->Void)?
|
|
|
+ lazy var cusStackView: TSCustomStackView = {
|
|
|
+ let cusStackView = TSCustomStackView(axis: .vertical,spacing: 0)
|
|
|
+ return cusStackView
|
|
|
+ }()
|
|
|
+
|
|
|
+
|
|
|
+ lazy var submitBtn: UIButton = {
|
|
|
+ let submitBtn = kCreateNormalSubmitBtn(title: "Accept".localized) { [weak self] in
|
|
|
+ guard let self = self else { return }
|
|
|
+ dismiss()
|
|
|
+ clickHandle?()
|
|
|
+ }
|
|
|
+ submitBtn.cornerRadius = 24.0
|
|
|
+ return submitBtn
|
|
|
+ }()
|
|
|
+
|
|
|
+ lazy var topImageTtileView: UIView = {
|
|
|
+ let topImageTtileView = UIView()
|
|
|
+
|
|
|
+ let imageView:UIImageView = UIImageView.createImageView(imageName: "privacy_shield")
|
|
|
+ topImageTtileView.addSubview(imageView)
|
|
|
+ imageView.snp.makeConstraints { make in
|
|
|
+ make.trailing.equalTo(-23)
|
|
|
+ make.centerY.equalToSuperview()
|
|
|
+ make.width.equalTo(85)
|
|
|
+ make.height.equalTo(98)
|
|
|
+ make.top.bottom.equalTo(0)
|
|
|
+ }
|
|
|
+
|
|
|
+ let textLabel = UILabel.createLabel(text: "We Value Your Privacy".localized,font: .font(name: .PoppinsBlackItalic,size: 24),textColor: .white,numberOfLines: 0)
|
|
|
+ topImageTtileView.addSubview(textLabel)
|
|
|
+ textLabel.snp.makeConstraints { make in
|
|
|
+ make.leading.equalTo(16)
|
|
|
+ make.trailing.equalTo(imageView.snp.leading).offset(-10)
|
|
|
+ make.centerY.equalToSuperview()
|
|
|
+ }
|
|
|
+ return topImageTtileView
|
|
|
+ }()
|
|
|
+
|
|
|
+
|
|
|
+ override func createView() {
|
|
|
+ setNavBarViewHidden(true)
|
|
|
+
|
|
|
+ contentView.addSubview(submitBtn)
|
|
|
+ submitBtn.snp.makeConstraints { make in
|
|
|
+ make.centerX.equalToSuperview()
|
|
|
+ make.width.equalTo(250*kDesignScale)
|
|
|
+ make.height.equalTo(48)
|
|
|
+ make.bottom.equalTo(-10-k_Height_safeAreaInsetsBottom())
|
|
|
+ }
|
|
|
+
|
|
|
+ contentView.addSubview(cusStackView)
|
|
|
+ cusStackView.snp.makeConstraints { make in
|
|
|
+ make.top.equalTo(0)
|
|
|
+ make.leading.trailing.equalToSuperview()
|
|
|
+ make.bottom.equalTo(submitBtn.snp.top).offset(-10)
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ setUpUI()
|
|
|
+ }
|
|
|
+
|
|
|
+ let lineSpacing = 6.0
|
|
|
+ func setUpUI(){
|
|
|
+
|
|
|
+ cusStackView.addSpacing(height: 28+k_Height_StatusBar)
|
|
|
+ cusStackView.addSubviewToStack(topImageTtileView)
|
|
|
+ cusStackView.addSpacing(height: 23)
|
|
|
+
|
|
|
+ let textLabel = UILabel.createLabel(text: "We need your consent to use this feature:".localized,font: .font(size: 16),textColor: .white,numberOfLines: 0)
|
|
|
+ textLabel.setLineSpacing(8)
|
|
|
+ cusStackView.addSubviewToStack(textLabel)
|
|
|
+ textLabel.snp.makeConstraints { make in
|
|
|
+ make.leading.equalTo(16)
|
|
|
+ make.trailing.equalTo(-35)
|
|
|
+ }
|
|
|
+ cusStackView.addSpacing(height: 16)
|
|
|
+ addTextInfo()
|
|
|
+ cusStackView.addSpacing(height: 16)
|
|
|
+ addTextPrivacy()
|
|
|
+ }
|
|
|
+
|
|
|
+ func addTextInfo(){
|
|
|
+ cusStackView.addSubviewToStack(getTextInfoCell(text: "This App is photo or video editors that allow you to edit portraits with highly realistic facial transformations. We do not use photos or videos you provide when you use the Apps for any reason other than to provide you with the editing functionality of the Apps.".localized))
|
|
|
+
|
|
|
+ cusStackView.addSpacing(height: lineSpacing)
|
|
|
+
|
|
|
+ cusStackView.addSubviewToStack(getTextInfoCell(text: "Every photo you select for editing will be encrypted and temporarily cached on cloud servers for image processing and face transformation.".localized))
|
|
|
+
|
|
|
+ cusStackView.addSpacing(height: lineSpacing)
|
|
|
+
|
|
|
+ cusStackView.addSubviewToStack(getTextInfoCell(text: "We use third-party cloud providers - Amazon Web Services - to process and edit photos and videos.".localized))
|
|
|
+
|
|
|
+ cusStackView.addSpacing(height: lineSpacing)
|
|
|
+
|
|
|
+ cusStackView.addSubviewToStack(getTextInfoCell(text: "Photos or videos only remain in the cloud for a maximum limited period of 24 to 48 hours, for improved performance and lower bandwidth allowing additional changes to recently selected photos or videos in an optimal manner.".localized))
|
|
|
+ }
|
|
|
+
|
|
|
+ func getTextInfoCell(text:String) -> UIView {
|
|
|
+
|
|
|
+ let bgView = UIView()
|
|
|
+ let pointView = UIView()
|
|
|
+ pointView.backgroundColor = .white.withAlphaComponent(0.7)
|
|
|
+ pointView.cornerRadius = 2
|
|
|
+ bgView.addSubview(pointView)
|
|
|
+ pointView.snp.makeConstraints { make in
|
|
|
+ make.top.equalTo(7)
|
|
|
+ make.leading.equalTo(22)
|
|
|
+ make.width.height.equalTo(4)
|
|
|
+ }
|
|
|
+
|
|
|
+ let textLabel1 = UILabel.createLabel(text: text,font: .font(size: 14),textColor: .white.withAlphaComponent(0.7),numberOfLines: 0)
|
|
|
+ textLabel1.setLineSpacing(lineSpacing)
|
|
|
+ bgView.addSubview(textLabel1)
|
|
|
+ textLabel1.snp.makeConstraints { make in
|
|
|
+ make.top.bottom.equalToSuperview()
|
|
|
+ make.leading.equalTo(16+16)
|
|
|
+ make.trailing.equalTo(-16)
|
|
|
+ }
|
|
|
+ return bgView
|
|
|
+ }
|
|
|
+
|
|
|
+ func addTextPrivacy(){
|
|
|
+ let bgView = UIView()
|
|
|
+ let fullText = "By clicking \"Accept\", you give explicit consent that our Privacy Policy. To learn more about how we handle your personal data and our third-party partners, please refer to our Privacy Policy."
|
|
|
+ let label = TSClickableLinkLabel()
|
|
|
+ label.translatesAutoresizingMaskIntoConstraints = false
|
|
|
+ label.setText(
|
|
|
+ fullText,
|
|
|
+ linkTexts: ["Privacy Policy"],
|
|
|
+ highlightLastOccurrence: true, // 关键参数,只高亮最后一个匹配项
|
|
|
+ lineSpacing: lineSpacing, // 设置行间距为8点
|
|
|
+ normalAttributes: [
|
|
|
+ .foregroundColor: UIColor.white.withAlphaComponent(0.8),
|
|
|
+ .font: UIFont.font(size: 14)
|
|
|
+ ],
|
|
|
+ linkAttributes: [
|
|
|
+ .foregroundColor: "#4E89FF".uiColor,
|
|
|
+ .underlineStyle: NSUnderlineStyle.single.rawValue,
|
|
|
+ .font: UIFont.font(size: 14)
|
|
|
+ ]) { [weak self] linkText in
|
|
|
+ guard let self = self else { return }
|
|
|
+ print("Link tapped: \(linkText)")
|
|
|
+ // 处理点击事件,例如打开隐私政策页面
|
|
|
+
|
|
|
+ let vc = TSBusinessWebVC(urlType: .privacy)
|
|
|
+ kPresentModalVC(target: self, modelVC: vc,transitionStyle:.crossDissolve)
|
|
|
+ }
|
|
|
+
|
|
|
+ cusStackView.addSubviewToStack(bgView)
|
|
|
+ bgView.snp.makeConstraints { make in
|
|
|
+ make.leading.equalTo(0)
|
|
|
+ make.trailing.equalTo(0)
|
|
|
+ }
|
|
|
+
|
|
|
+ bgView.addSubview(label)
|
|
|
+ label.snp.makeConstraints { make in
|
|
|
+ make.top.bottom.equalToSuperview()
|
|
|
+ make.leading.equalTo(16)
|
|
|
+ make.trailing.equalTo(-16)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ static var isShowUploadImagePrivacyHint:Bool{
|
|
|
+ get {
|
|
|
+ return UserDefaults.standard.string(forKey: "isFirstUploadPhotoPrivacy") == nil
|
|
|
+ }
|
|
|
+
|
|
|
+ set {
|
|
|
+ UserDefaults.standard.set(newValue ? nil : "1", forKey: "isFirstUploadPhotoPrivacy")
|
|
|
+ UserDefaults.standard.synchronize()
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|