From f595c881b800d50ccb4c94ea3277f833aa248df4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B9=96=E5=8C=97=E7=A7=A6=E4=B9=9D?= Date: Wed, 14 Jan 2026 15:34:51 +0800 Subject: [PATCH] 1 --- Fableon.xcodeproj/project.pbxproj | 4 +-- Fableon/Object/Base/View/FALabel.swift | 4 +-- .../Object/Libs/Alert/FAPayRetainAlert.swift | 29 +++++++++++++------ .../Libs/Alert/FAPayRetainAlertData.swift | 15 +--------- 4 files changed, 25 insertions(+), 27 deletions(-) diff --git a/Fableon.xcodeproj/project.pbxproj b/Fableon.xcodeproj/project.pbxproj index 0ee7f7b..f17a976 100644 --- a/Fableon.xcodeproj/project.pbxproj +++ b/Fableon.xcodeproj/project.pbxproj @@ -2734,7 +2734,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Fableon/Fableon.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; DEVELOPMENT_TEAM = 6XALB8RSYF; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; GENERATE_INFOPLIST_FILE = YES; @@ -2777,7 +2777,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Fableon/Fableon.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; DEVELOPMENT_TEAM = 6XALB8RSYF; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = Fableon/Source/Info.plist; diff --git a/Fableon/Object/Base/View/FALabel.swift b/Fableon/Object/Base/View/FALabel.swift index fd82e42..761d446 100644 --- a/Fableon/Object/Base/View/FALabel.swift +++ b/Fableon/Object/Base/View/FALabel.swift @@ -27,7 +27,7 @@ class FALabel: UILabel { override var intrinsicContentSize: CGSize { let size = super.intrinsicContentSize - return .init(width: size.width + borderLineWidth, height: size.height) + return .init(width: size.width + borderLineWidth, height: size.height + borderLineWidth) } override func drawText(in rect: CGRect) { @@ -58,7 +58,7 @@ class FALabel: UILabel { let textSize = self.attributedText?.boundingRect(with: rect.size, options: [.usesLineFragmentOrigin, .usesFontLeading], context: nil).size ?? .zero let x = borderLineWidth / 2 - let y = 0.0 + let y = borderLineWidth / 2 let textRect = CGRect(x: x, y: y, width: textSize.width, height: textSize.height) diff --git a/Fableon/Object/Libs/Alert/FAPayRetainAlert.swift b/Fableon/Object/Libs/Alert/FAPayRetainAlert.swift index 2ee9d75..6d3809d 100644 --- a/Fableon/Object/Libs/Alert/FAPayRetainAlert.swift +++ b/Fableon/Object/Libs/Alert/FAPayRetainAlert.swift @@ -75,7 +75,7 @@ class FAPayRetainAlert: FABaseAlert { let view = UICollectionView(frame: .zero, collectionViewLayout: layout) view.backgroundColor = .clear - view.isScrollEnabled = false + view.isScrollEnabled = true view.showsVerticalScrollIndicator = false view.dataSource = self view.delegate = self @@ -103,31 +103,38 @@ extension FAPayRetainAlert { contentView.backgroundColor = .clear contentView.layer.cornerRadius = 0 contentView.layer.masksToBounds = true + + closeButton.setImage(UIImage(named: "close_icon_02"), for: .normal) contentView.addSubview(bgView) contentView.addSubview(titleLabel) contentView.addSubview(countdownView) contentView.addSubview(bonusTagView) contentView.addSubview(collectionView) + - + closeButton.snp.remakeConstraints { make in + make.centerX.equalToSuperview() + make.top.equalTo(contentView.snp.bottom).offset(14) + } + bgView.snp.makeConstraints { make in make.edges.equalToSuperview() } titleLabel.snp.makeConstraints { make in - make.top.equalToSuperview().offset(143) + make.top.equalToSuperview().offset(140) make.centerX.equalToSuperview() make.right.lessThanOrEqualToSuperview().offset(0) } countdownView.snp.makeConstraints { make in - make.left.equalToSuperview().offset(FAPayRetainAlertData.Layout.countdownLeft) - make.top.equalTo(titleLabel.snp.bottom).offset(2) + make.centerX.equalToSuperview() + make.top.equalTo(titleLabel.snp.bottom).offset(0) } bonusTagView.snp.makeConstraints { make in - make.top.equalTo(titleLabel.snp.bottom).offset(35) + make.top.equalTo(titleLabel.snp.bottom).offset(30) make.centerX.equalToSuperview() make.right.lessThanOrEqualToSuperview().offset(-10) make.height.equalTo(FAPayRetainAlertData.Layout.bonusTagHeight) @@ -185,6 +192,7 @@ extension FAPayRetainAlert { } private static let defaultCountdownSeconds = 4 * 60 * 60 +// private static let defaultCountdownSeconds = 10 private static let countdownEndTimeKey = "FAPayRetainCountdownEndTime" private var countdownTimer: Timer? private var remainingSeconds: Int = 0 @@ -436,7 +444,7 @@ final class FAPayRetainPackCell: UICollectionViewCell { view.fa_locations = [0, 1] view.fa_startPoint = .init(x: 0, y: 0.5) view.fa_endPoint = .init(x: 1, y: 0.5) - view.layer.cornerRadius = FAPayRetainAlertData.Layout.priceSize.height / 2 + view.layer.cornerRadius = 20 view.layer.masksToBounds = true view.layer.borderWidth = 1 view.layer.borderColor = UIColor.fa_hex(0xFFFFFF).cgColor @@ -526,12 +534,15 @@ final class FAPayRetainPackCell: UICollectionViewCell { priceView.snp.makeConstraints { make in make.right.equalToSuperview().offset(-14) - make.top.equalToSuperview().offset(FAPayRetainAlertData.Layout.priceTop) - make.size.equalTo(FAPayRetainAlertData.Layout.priceSize) + make.centerY.equalToSuperview() + make.height.equalTo(40) +// make.width.lessThanOrEqualTo(90) + make.width.greaterThanOrEqualTo(90) } priceLabel.snp.makeConstraints { make in make.center.equalToSuperview() + make.right.lessThanOrEqualToSuperview().offset(-10) } } } diff --git a/Fableon/Object/Libs/Alert/FAPayRetainAlertData.swift b/Fableon/Object/Libs/Alert/FAPayRetainAlertData.swift index 6aa25bd..3044458 100644 --- a/Fableon/Object/Libs/Alert/FAPayRetainAlertData.swift +++ b/Fableon/Object/Libs/Alert/FAPayRetainAlertData.swift @@ -15,11 +15,6 @@ enum FAPayRetainAlertData { static let countdown = Countdown(hours: "03", minutes: "29", seconds: "55") - static let packItems: [PackItem] = [ - PackItem(coinCount: 3500, bonusText: "+700 free coins", priceText: "$4.99"), - PackItem(coinCount: 3500, bonusText: "+700 free coins", priceText: "$4.99"), - PackItem(coinCount: 3500, bonusText: "+700 free coins", priceText: "$4.99") - ] static let defaultSelectedIndex = -1 static let defaultCenterIndex = 1 @@ -30,12 +25,6 @@ enum FAPayRetainAlertData { let seconds: String } - struct PackItem { - let coinCount: Int - let bonusText: String - let priceText: String - } - struct Assets { // 资源名集中管理,便于从 Assets.xcassets 替换 static let background = "pay_retain_bg_image" @@ -52,7 +41,6 @@ enum FAPayRetainAlertData { static let titleTop: CGFloat = 164 static let countdownTop: CGFloat = 72 - static let countdownLeft: CGFloat = 10 static let bonusTagTop: CGFloat = 105 static let bonusTagLeft: CGFloat = 22 static let bonusTagHeight: CGFloat = 32 @@ -63,8 +51,7 @@ enum FAPayRetainAlertData { static let packItemSpacing: CGFloat = 10 static let packListHeight: CGFloat = 224 - static let priceSize = CGSize(width: 97, height: 40) - static let priceTop: CGFloat = 14 + static let coinStackLeft: CGFloat = 62 static let coinStackTop: CGFloat = 15 static let bonusTopSpacing: CGFloat = 5