1.代码提交
@ -140,6 +140,12 @@
|
||||
3754ACEE2ED945A1009EBCAD /* Dictionary+SRAdd.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3754ACED2ED945A1009EBCAD /* Dictionary+SRAdd.swift */; };
|
||||
3754ACF02ED94A4C009EBCAD /* SRFeedBackController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3754ACEF2ED94A4C009EBCAD /* SRFeedBackController.swift */; };
|
||||
3754ACF22ED975B9009EBCAD /* SRRewardController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3754ACF12ED975B9009EBCAD /* SRRewardController.swift */; };
|
||||
3754ACF42ED98609009EBCAD /* SRCoinPackCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3754ACF32ED98609009EBCAD /* SRCoinPackCell.swift */; };
|
||||
3754ACF62ED9A2D4009EBCAD /* SRCoinPackTitleview.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3754ACF52ED9A2D4009EBCAD /* SRCoinPackTitleview.swift */; };
|
||||
3754ACF82ED9A32C009EBCAD /* SRCoinPackHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3754ACF72ED9A32C009EBCAD /* SRCoinPackHeaderView.swift */; };
|
||||
3754ACFC2ED9A36C009EBCAD /* SRCoinsPackModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3754ACFB2ED9A36C009EBCAD /* SRCoinsPackModel.swift */; };
|
||||
3754ACFE2ED9A3A0009EBCAD /* SRCoinsPackReceiveModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3754ACFD2ED9A3A0009EBCAD /* SRCoinsPackReceiveModel.swift */; };
|
||||
3754AD022EDA8AF7009EBCAD /* SRLoginController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3754AD012EDA8AF7009EBCAD /* SRLoginController.swift */; };
|
||||
3779D0612ECF1CB8006B1698 /* SRShortHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3779D0602ECF1CB8006B1698 /* SRShortHeaderView.swift */; };
|
||||
47BB39E2DD30787FA591F8EB /* Pods_SynthReel.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F9255BF4D4B1CFDDB5CFFB43 /* Pods_SynthReel.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
@ -279,6 +285,12 @@
|
||||
3754ACED2ED945A1009EBCAD /* Dictionary+SRAdd.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Dictionary+SRAdd.swift"; sourceTree = "<group>"; };
|
||||
3754ACEF2ED94A4C009EBCAD /* SRFeedBackController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SRFeedBackController.swift; sourceTree = "<group>"; };
|
||||
3754ACF12ED975B9009EBCAD /* SRRewardController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SRRewardController.swift; sourceTree = "<group>"; };
|
||||
3754ACF32ED98609009EBCAD /* SRCoinPackCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SRCoinPackCell.swift; sourceTree = "<group>"; };
|
||||
3754ACF52ED9A2D4009EBCAD /* SRCoinPackTitleview.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SRCoinPackTitleview.swift; sourceTree = "<group>"; };
|
||||
3754ACF72ED9A32C009EBCAD /* SRCoinPackHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SRCoinPackHeaderView.swift; sourceTree = "<group>"; };
|
||||
3754ACFB2ED9A36C009EBCAD /* SRCoinsPackModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SRCoinsPackModel.swift; sourceTree = "<group>"; };
|
||||
3754ACFD2ED9A3A0009EBCAD /* SRCoinsPackReceiveModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SRCoinsPackReceiveModel.swift; sourceTree = "<group>"; };
|
||||
3754AD012EDA8AF7009EBCAD /* SRLoginController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SRLoginController.swift; sourceTree = "<group>"; };
|
||||
3779D0602ECF1CB8006B1698 /* SRShortHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SRShortHeaderView.swift; sourceTree = "<group>"; };
|
||||
59DC746604B26E9FF802D317 /* Pods-SynthReel.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SynthReel.debug.xcconfig"; path = "Target Support Files/Pods-SynthReel/Pods-SynthReel.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
AA88214030574193B51DE563 /* Pods-SynthReel.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SynthReel.release.xcconfig"; path = "Target Support Files/Pods-SynthReel/Pods-SynthReel.release.xcconfig"; sourceTree = "<group>"; };
|
||||
@ -573,6 +585,8 @@
|
||||
03E9A7D32EC4720F000D1067 /* Class */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3754ACFF2EDA8A43009EBCAD /* Login */,
|
||||
3754ACF92ED9A34E009EBCAD /* Store */,
|
||||
3754ACDD2ED93C14009EBCAD /* Coinpack */,
|
||||
370D2F0D2ED4532100571E77 /* User */,
|
||||
03980F542ECEEC990006E317 /* MyShort */,
|
||||
@ -702,6 +716,7 @@
|
||||
370D2F192ED45CCA00571E77 /* SRUserSettingCell.swift */,
|
||||
370D2F242ED5807600571E77 /* SRAboutHeaderVIew.swift */,
|
||||
370D2F262ED581BB00571E77 /* SRAboutCell.swift */,
|
||||
3754ACF32ED98609009EBCAD /* SRCoinPackCell.swift */,
|
||||
);
|
||||
path = view;
|
||||
sourceTree = "<group>";
|
||||
@ -759,6 +774,8 @@
|
||||
3754ACDF2ED93C36009EBCAD /* view */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3754ACF52ED9A2D4009EBCAD /* SRCoinPackTitleview.swift */,
|
||||
3754ACF72ED9A32C009EBCAD /* SRCoinPackHeaderView.swift */,
|
||||
);
|
||||
path = view;
|
||||
sourceTree = "<group>";
|
||||
@ -775,6 +792,39 @@
|
||||
path = webview;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
3754ACF92ED9A34E009EBCAD /* Store */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3754ACFA2ED9A359009EBCAD /* Model */,
|
||||
);
|
||||
path = Store;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
3754ACFA2ED9A359009EBCAD /* Model */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3754ACFB2ED9A36C009EBCAD /* SRCoinsPackModel.swift */,
|
||||
3754ACFD2ED9A3A0009EBCAD /* SRCoinsPackReceiveModel.swift */,
|
||||
);
|
||||
path = Model;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
3754ACFF2EDA8A43009EBCAD /* Login */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3754AD002EDA8ADD009EBCAD /* VC */,
|
||||
);
|
||||
path = Login;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
3754AD002EDA8ADD009EBCAD /* VC */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3754AD012EDA8AF7009EBCAD /* SRLoginController.swift */,
|
||||
);
|
||||
path = VC;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
3779D05F2ECF1C8D006B1698 /* V */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@ -929,6 +979,7 @@
|
||||
03B1A9402ECC45BA006C353F /* SRTableViewCell.swift in Sources */,
|
||||
03E9A7EA2EC4995D000D1067 /* SRKeychain.swift in Sources */,
|
||||
03E9A7D92EC47B90000D1067 /* SRNetworkReachableManager.swift in Sources */,
|
||||
3754ACF82ED9A32C009EBCAD /* SRCoinPackHeaderView.swift in Sources */,
|
||||
3754ACD72ED82774009EBCAD /* SRDetailRecommendCell.swift in Sources */,
|
||||
370D2F2D2ED5AA9700571E77 /* SRViralHitCell.swift in Sources */,
|
||||
03B1A8532EC5E12E006C353F /* UIScreen+SRAdd.swift in Sources */,
|
||||
@ -959,6 +1010,7 @@
|
||||
03B1A8E72EC7175D006C353F /* SRCategoryModel.swift in Sources */,
|
||||
370D2F2F2ED5AB2500571E77 /* SRViralHitController.swift in Sources */,
|
||||
3754ACDA2ED8374D009EBCAD /* SRPagerViewTransformer.swift in Sources */,
|
||||
3754ACFE2ED9A3A0009EBCAD /* SRCoinsPackReceiveModel.swift in Sources */,
|
||||
3754ACF22ED975B9009EBCAD /* SRRewardController.swift in Sources */,
|
||||
03B1A94A2ECC79AB006C353F /* SREpSelectorView.swift in Sources */,
|
||||
03B1A94E2ECD604B006C353F /* SREpSelectorCell.swift in Sources */,
|
||||
@ -974,6 +1026,7 @@
|
||||
03E9A7C92EC47177000D1067 /* AppDelegate.swift in Sources */,
|
||||
03E9A7FA2EC56D03000D1067 /* String+SRAdd.swift in Sources */,
|
||||
03B1A9192ECAF2E6006C353F /* SRHomePremiereNowView.swift in Sources */,
|
||||
3754ACF42ED98609009EBCAD /* SRCoinPackCell.swift in Sources */,
|
||||
03B1A92C2ECC0A7A006C353F /* SRShortDetailPlayerCell.swift in Sources */,
|
||||
3754ACC42ED6EDA6009EBCAD /* SREmpty.swift in Sources */,
|
||||
03B1A8392EC5C8D6006C353F /* SRHud.swift in Sources */,
|
||||
@ -982,6 +1035,7 @@
|
||||
370D2F092ED44A6D00571E77 /* SRListMenuCell.swift in Sources */,
|
||||
03980F532ECEDEAB0006E317 /* SRRecommendPlayerControlView.swift in Sources */,
|
||||
03B1A90F2ECAC768006C353F /* SRHomeBingeWorthyView.swift in Sources */,
|
||||
3754ACFC2ED9A36C009EBCAD /* SRCoinsPackModel.swift in Sources */,
|
||||
03B1A9072EC86656006C353F /* SRGradientView.swift in Sources */,
|
||||
370D2F292ED58EC400571E77 /* SRTopChartsViewController.swift in Sources */,
|
||||
370D2F1E2ED54C7F00571E77 /* SRHelpCenterController.swift in Sources */,
|
||||
@ -1025,8 +1079,10 @@
|
||||
03B1A92E2ECC0D7E006C353F /* SRShortDetailControlView.swift in Sources */,
|
||||
03B1A9382ECC210D006C353F /* SRSearchRecordCell.swift in Sources */,
|
||||
03E9A7D72EC47A23000D1067 /* SRResponseCryptor.swift in Sources */,
|
||||
3754ACF62ED9A2D4009EBCAD /* SRCoinPackTitleview.swift in Sources */,
|
||||
03B1A8502EC5DB2E006C353F /* SRHomeViewController.swift in Sources */,
|
||||
03B1A8E52EC715E1006C353F /* SRHomeApi.swift in Sources */,
|
||||
3754AD022EDA8AF7009EBCAD /* SRLoginController.swift in Sources */,
|
||||
03B1A8D52EC6CF37006C353F /* SRHomeChildViewController.swift in Sources */,
|
||||
03B1A8F12EC72DD7006C353F /* SRHomeViewModel.swift in Sources */,
|
||||
03E9A7FD2EC57658000D1067 /* SRUserApi.swift in Sources */,
|
||||
|
||||
@ -19,7 +19,6 @@ let kSRFeedBackHomeWebUrl = SRCampaignWebURL + "/pages/leave/index"
|
||||
let kSRFeedBackListWebUrl = SRCampaignWebURL + "/pages/leave/list"
|
||||
///反馈详情
|
||||
let kSRFeedBackDetailWebUrl = SRCampaignWebURL + "/pages/leave/detail"
|
||||
|
||||
///注销账号
|
||||
let kSRLogoutWebUrl = SRCampaignWebURL + "/pages/setting/logout"
|
||||
|
||||
|
||||
@ -8,23 +8,25 @@
|
||||
|
||||
import UIKit
|
||||
|
||||
class SRCoinPackController: UIViewController {
|
||||
class SRCoinPackController: SRViewController {
|
||||
|
||||
lazy var topImageview = UIImageView.init(image: .topCoinPack)
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
sr_setui()
|
||||
self.navigationItem.title = "My Refills".localized
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
// MARK: - Navigation
|
||||
|
||||
// In a storyboard-based application, you will often want to do a little preparation before navigation
|
||||
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
|
||||
// Get the new view controller using segue.destination.
|
||||
// Pass the selected object to the new view controller.
|
||||
}
|
||||
*/
|
||||
|
||||
extension SRCoinPackController {
|
||||
func sr_setui() {
|
||||
view.addSubview(topImageview)
|
||||
|
||||
topImageview.snp.makeConstraints { make in
|
||||
make.left.right.top.equalToSuperview()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
270
SynthReel/Class/Coinpack/view/SRCoinPackHeaderView.swift
Normal file
@ -0,0 +1,270 @@
|
||||
//
|
||||
// SRCoinPackHeaderView.swift
|
||||
// SynthReel
|
||||
//
|
||||
// Created by CSGY on 2025/11/28.
|
||||
// Copyright © 2025 SR. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class SRCoinPackHeaderView: UIView {
|
||||
|
||||
var clickClaimButton: (() -> Void)?
|
||||
|
||||
var model: SRCoinsPackModel? {
|
||||
didSet {
|
||||
coinsView1.coins = model?.week_max_total
|
||||
coinsView2.coins = model?.week_total
|
||||
|
||||
activeCountLabel.text = "\(model?.receive_count ?? 0)"
|
||||
|
||||
if let coin = model?.receive_coins, coin > 0 {
|
||||
claimButton.isEnabled = true
|
||||
} else {
|
||||
claimButton.isEnabled = false
|
||||
}
|
||||
|
||||
claimButton.setNeedsUpdateConfiguration()
|
||||
}
|
||||
}
|
||||
|
||||
private lazy var titleView: SRCoinPackTitleview = {
|
||||
let view = SRCoinPackTitleview()
|
||||
// view.dotColor = .C_5_DDF_5
|
||||
view.font = .font(ofSize: 14, weight: .regular)
|
||||
// view.textColors = [UIColor.C_5_DDF_5.cgColor, UIColor.C_5_DDF_5.cgColor]
|
||||
view.text = "fableon_rewards_overview".localized.uppercased()
|
||||
return view
|
||||
}()
|
||||
|
||||
private lazy var coinsView1: CoinsView = {
|
||||
let view = CoinsView()
|
||||
view.title = "fableon_weekly_total".localized
|
||||
view.coins = 0
|
||||
return view
|
||||
}()
|
||||
|
||||
private lazy var coinsView2: CoinsView = {
|
||||
let view = CoinsView()
|
||||
view.title = "fableon_claimable_coins".localized
|
||||
view.coins = 0
|
||||
return view
|
||||
}()
|
||||
|
||||
private lazy var lineView1: UIView = {
|
||||
let view = UIImageView(image: UIImage(named: "间隔线"))
|
||||
return view
|
||||
}()
|
||||
|
||||
private lazy var lineView2: UIView = {
|
||||
let view = UIImageView(image: UIImage(named: "横间隔虚线"))
|
||||
return view
|
||||
}()
|
||||
|
||||
private lazy var activeCountTitleLabel: UILabel = {
|
||||
let label = UILabel()
|
||||
label.font = .font(ofSize: 12, weight: .regular)
|
||||
label.textColor = .white.withAlphaComponent(0.5)
|
||||
label.text = "fableon_active_refills".localized + ": "
|
||||
return label
|
||||
}()
|
||||
|
||||
private lazy var activeCountLabel: SRLabel = {
|
||||
let label = SRLabel()
|
||||
label.font = .font(ofSize: 12, weight: .medium)
|
||||
label.textColors = [UIColor._4_CFFD_4.cgColor, UIColor._51_D_4_FF.cgColor]
|
||||
label.textStartPoint = .init(x: 0.5, y: 0)
|
||||
label.textEndPoint = .init(x: 0.5, y: 1)
|
||||
label.text = "0"
|
||||
return label
|
||||
}()
|
||||
|
||||
private lazy var claimButton: UIButton = {
|
||||
let config = UIButton.Configuration.plain()
|
||||
let button = SRGradientbutton(configuration: config, primaryAction: UIAction(handler: { [weak self] _ in
|
||||
self?.clickClaimButton?()
|
||||
}))
|
||||
button.isEnabled = false
|
||||
button.layer.cornerRadius = 24
|
||||
button.layer.masksToBounds = true
|
||||
button.fa_locations = [0, 1]
|
||||
button.fa_startPoint = .init(x: 0, y: 0.5)
|
||||
button.fa_endPoint = .init(x: 1, y: 0.5)
|
||||
button.configurationUpdateHandler = { [weak self] button in
|
||||
guard let self = self else { return }
|
||||
guard let button = button as? SRGradientbutton else { return }
|
||||
if button.isEnabled {
|
||||
// button.fa_colors = [UIColor._53_A_2_F_1.cgColor, UIColor.C_5_DDF_5.cgColor]
|
||||
button.setBackgroundImage(.claimAllHiglit, for: .normal)
|
||||
let coinImage = UIImage(named: "coins_icon_03")!
|
||||
let coinText = NSTextAttachment(image: coinImage)
|
||||
coinText.bounds = .init(x: 0, y: -2.5, width: coinImage.size.width, height: coinImage.size.height)
|
||||
let coinAtt = AttributedString(NSAttributedString(attachment: coinText))
|
||||
|
||||
let textAtt = AttributedString("fableon_claim_all".localized + " ", attributes: AttributeContainer([
|
||||
.font : UIFont.font(ofSize: 14, weight: .bold),
|
||||
.foregroundColor : UIColor.white
|
||||
]))
|
||||
|
||||
let countAtt = AttributedString(" \(self.model?.receive_coins ?? 0)".localized, attributes: AttributeContainer([
|
||||
.font : UIFont.font(ofSize: 14, weight: .bold),
|
||||
.foregroundColor : UIColor.white
|
||||
]))
|
||||
|
||||
button.configuration?.attributedTitle = textAtt + coinAtt + countAtt
|
||||
|
||||
|
||||
} else {
|
||||
// button.fa_colors = [UIColor._6_D_6_D_6_D.cgColor, UIColor._6_D_6_D_6_D.cgColor]
|
||||
button.setBackgroundImage(.claimAllNomarl, for: .normal)
|
||||
button.configuration?.attributedTitle = AttributedString("fableon_get_refill_button_text".localized, attributes: AttributeContainer([
|
||||
.font : UIFont.font(ofSize: 14, weight: .bold),
|
||||
.foregroundColor : UIColor.white.withAlphaComponent(0.5)
|
||||
]))
|
||||
}
|
||||
|
||||
}
|
||||
return button
|
||||
}()
|
||||
|
||||
override init(frame: CGRect) {
|
||||
super.init(frame: frame)
|
||||
fa_setupLayout()
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
extension SRCoinPackHeaderView {
|
||||
|
||||
private func fa_setupLayout() {
|
||||
addSubview(titleView)
|
||||
addSubview(coinsView1)
|
||||
addSubview(coinsView2)
|
||||
addSubview(lineView1)
|
||||
addSubview(activeCountTitleLabel)
|
||||
addSubview(activeCountLabel)
|
||||
addSubview(claimButton)
|
||||
addSubview(lineView2)
|
||||
|
||||
titleView.snp.makeConstraints { make in
|
||||
make.left.equalToSuperview().offset(16)
|
||||
make.top.equalToSuperview().offset(20)
|
||||
}
|
||||
|
||||
coinsView1.snp.makeConstraints { make in
|
||||
make.left.equalToSuperview().offset(28)
|
||||
make.top.equalTo(titleView.snp.bottom).offset(23)
|
||||
}
|
||||
|
||||
lineView1.snp.makeConstraints { make in
|
||||
make.centerY.equalTo(coinsView1)
|
||||
make.left.equalTo(coinsView1.snp.right).offset(18)
|
||||
}
|
||||
|
||||
coinsView2.snp.makeConstraints { make in
|
||||
make.centerY.equalTo(lineView1)
|
||||
make.left.equalTo(lineView1.snp.right).offset(18)
|
||||
}
|
||||
|
||||
activeCountTitleLabel.snp.makeConstraints { make in
|
||||
make.left.equalTo(coinsView1)
|
||||
make.top.equalTo(coinsView1.snp.bottom).offset(23)
|
||||
}
|
||||
|
||||
activeCountLabel.snp.makeConstraints { make in
|
||||
make.left.equalTo(activeCountTitleLabel.snp.right)
|
||||
make.centerY.equalTo(activeCountTitleLabel)
|
||||
}
|
||||
|
||||
claimButton.snp.makeConstraints { make in
|
||||
make.left.equalToSuperview().offset(23)
|
||||
make.centerX.equalToSuperview()
|
||||
make.top.equalTo(activeCountTitleLabel.snp.bottom).offset(12)
|
||||
make.height.equalTo(48)
|
||||
make.bottom.equalToSuperview().offset(-16)
|
||||
}
|
||||
|
||||
lineView2.snp.makeConstraints { make in
|
||||
make.left.equalTo(claimButton)
|
||||
make.right.equalTo(claimButton)
|
||||
make.bottom.equalToSuperview()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
extension SRCoinPackHeaderView {
|
||||
|
||||
class CoinsView: UIView {
|
||||
var title: String? {
|
||||
didSet {
|
||||
titleLabel.text = title
|
||||
}
|
||||
}
|
||||
|
||||
var coins: Int? {
|
||||
didSet {
|
||||
coinsLabel.text = "\(coins ?? 0)"
|
||||
}
|
||||
}
|
||||
|
||||
private lazy var titleLabel: UILabel = {
|
||||
let label = UILabel()
|
||||
label.font = .font(ofSize: 12, weight: .bold)
|
||||
label.textColor = .white.withAlphaComponent(0.5)
|
||||
return label
|
||||
}()
|
||||
|
||||
private lazy var iconImageView: UIImageView = {
|
||||
let imageView = UIImageView(image: UIImage(named: "coins_icon_09"))
|
||||
return imageView
|
||||
}()
|
||||
|
||||
private lazy var coinsLabel: SRLabel = {
|
||||
let label = SRLabel()
|
||||
label.font = .font(ofSize: 18, weight: .bold)
|
||||
label.textColors = [UIColor.srBlue.cgColor, UIColor.srBlue.cgColor]
|
||||
label.textStartPoint = .init(x: 0, y: 0.5)
|
||||
label.textEndPoint = .init(x: 1, y: 0.5)
|
||||
return label
|
||||
}()
|
||||
|
||||
override init(frame: CGRect) {
|
||||
super.init(frame: frame)
|
||||
|
||||
addSubview(titleLabel)
|
||||
addSubview(iconImageView)
|
||||
addSubview(coinsLabel)
|
||||
|
||||
titleLabel.snp.makeConstraints { make in
|
||||
make.left.equalToSuperview()
|
||||
make.top.equalToSuperview()
|
||||
make.right.lessThanOrEqualToSuperview()
|
||||
}
|
||||
|
||||
iconImageView.snp.makeConstraints { make in
|
||||
make.left.equalToSuperview()
|
||||
make.top.equalTo(titleLabel.snp.bottom).offset(4)
|
||||
make.bottom.equalToSuperview()
|
||||
}
|
||||
|
||||
coinsLabel.snp.makeConstraints { make in
|
||||
make.centerY.equalTo(iconImageView)
|
||||
make.left.equalTo(iconImageView.snp.right).offset(4)
|
||||
make.right.lessThanOrEqualToSuperview()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@MainActor required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
92
SynthReel/Class/Coinpack/view/SRCoinPackTitleview.swift
Normal file
@ -0,0 +1,92 @@
|
||||
//
|
||||
// SRCoinPackTitleview.swift
|
||||
// SynthReel
|
||||
//
|
||||
// Created by CSGY on 2025/11/28.
|
||||
// Copyright © 2025 SR. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class SRCoinPackTitleview: UIView {
|
||||
|
||||
var text: String? {
|
||||
didSet {
|
||||
label.text = text
|
||||
}
|
||||
}
|
||||
|
||||
var font: UIFont? {
|
||||
didSet {
|
||||
label.font = font
|
||||
}
|
||||
}
|
||||
|
||||
var textColors: [CGColor]? {
|
||||
didSet {
|
||||
label.textColors = textColors
|
||||
}
|
||||
}
|
||||
|
||||
var dotColor: UIColor? {
|
||||
didSet {
|
||||
dotView1.backgroundColor = dotColor
|
||||
dotView2.backgroundColor = dotColor
|
||||
}
|
||||
}
|
||||
|
||||
private lazy var dotView1: UIView = {
|
||||
let view = UIView()
|
||||
view.layer.cornerRadius = 3
|
||||
view.layer.masksToBounds = true
|
||||
return view
|
||||
}()
|
||||
|
||||
private lazy var dotView2: UIView = {
|
||||
let view = UIView()
|
||||
view.layer.cornerRadius = 3
|
||||
view.layer.masksToBounds = true
|
||||
return view
|
||||
}()
|
||||
|
||||
private lazy var label: SRLabel = {
|
||||
let label = SRLabel()
|
||||
label.textStartPoint = .init(x: 0, y: 0.5)
|
||||
label.textEndPoint = .init(x: 1, y: 0.5)
|
||||
return label
|
||||
}()
|
||||
|
||||
override init(frame: CGRect) {
|
||||
super.init(frame: frame)
|
||||
addSubview(dotView1)
|
||||
addSubview(dotView2)
|
||||
addSubview(label)
|
||||
|
||||
dotView1.snp.makeConstraints { make in
|
||||
make.centerY.equalToSuperview()
|
||||
make.left.equalToSuperview()
|
||||
make.width.height.equalTo(6)
|
||||
make.bottom.lessThanOrEqualToSuperview()
|
||||
}
|
||||
|
||||
label.snp.makeConstraints { make in
|
||||
make.centerY.equalToSuperview()
|
||||
make.bottom.lessThanOrEqualToSuperview()
|
||||
make.left.equalTo(dotView1.snp.right).offset(6)
|
||||
}
|
||||
|
||||
dotView2.snp.makeConstraints { make in
|
||||
make.centerY.equalToSuperview()
|
||||
make.bottom.lessThanOrEqualToSuperview()
|
||||
make.right.equalToSuperview()
|
||||
make.width.height.equalTo(dotView1)
|
||||
make.left.equalTo(label.snp.right).offset(6)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
}
|
||||
22
SynthReel/Class/Login/VC/SRLoginController.swift
Normal file
@ -0,0 +1,22 @@
|
||||
//
|
||||
// SRLoginController.swift
|
||||
// SynthReel
|
||||
//
|
||||
// Created by CSGY on 2025/11/29.
|
||||
// Copyright © 2025 SR. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class SRLoginController: SRViewController {
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
26
SynthReel/Class/Store/Model/SRCoinsPackModel.swift
Normal file
@ -0,0 +1,26 @@
|
||||
//
|
||||
// SRCoinsPackModel.swift
|
||||
// SynthReel
|
||||
//
|
||||
// Created by CSGY on 2025/11/28.
|
||||
// Copyright © 2025 SR. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import SmartCodable
|
||||
|
||||
struct SRCoinsPackModel: SmartCodable {
|
||||
|
||||
//当前可领取订阅数
|
||||
var receive_count: Int?
|
||||
//已领取累计金币总数
|
||||
var week_total: Int?
|
||||
//剩余可领取金币数
|
||||
var week_remaining_total: Int?
|
||||
//订阅可领取累计金币总数
|
||||
var week_max_total: Int?
|
||||
//当前可领取金币总数
|
||||
var receive_coins: Int?
|
||||
|
||||
var receive_list: [SRCoinsPackReceiveModel]?
|
||||
}
|
||||
26
SynthReel/Class/Store/Model/SRCoinsPackReceiveModel.swift
Normal file
@ -0,0 +1,26 @@
|
||||
//
|
||||
// SRCoinsPackReceiveModel.swift
|
||||
// SynthReel
|
||||
//
|
||||
// Created by CSGY on 2025/11/28.
|
||||
// Copyright © 2025 SR. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import SmartCodable
|
||||
|
||||
struct SRCoinsPackReceiveModel: SmartCodable {
|
||||
|
||||
var id: String?
|
||||
var title: String?
|
||||
//剩余可领取金币数
|
||||
var week_remaining_total: Int?
|
||||
//当前可领取金币数
|
||||
var receive_coins: Int?
|
||||
//已领取累计金币总数
|
||||
var week_total: Int?
|
||||
//可领取累计金币总数
|
||||
var week_max_total: Int?
|
||||
//领取天数文本
|
||||
var day_text: String?
|
||||
}
|
||||
@ -25,6 +25,8 @@ class SRUserViewController: SRViewController {
|
||||
collectionView.showsHorizontalScrollIndicator = false
|
||||
collectionView.register(SRUserSettingCell.self, forCellWithReuseIdentifier: "cell")
|
||||
collectionView.register(SRUserTopCell.self, forCellWithReuseIdentifier: "topcell")
|
||||
collectionView.register(SRCoinPackCell.self, forCellWithReuseIdentifier: "coincell")
|
||||
|
||||
collectionView.sr_addRefreshHeader { [weak self] in
|
||||
Task {
|
||||
await SRAccountManager.manager.updateUserInfo()
|
||||
@ -59,9 +61,11 @@ extension SRUserViewController {
|
||||
extension SRUserViewController: UICollectionViewDelegate, UICollectionViewDataSource {
|
||||
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
|
||||
|
||||
if(indexPath.section == 0){
|
||||
if indexPath.section == 0{
|
||||
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "topcell", for: indexPath) as! SRUserTopCell
|
||||
// cell.model = self.dataArr[indexPath.row];
|
||||
return cell
|
||||
} else if indexPath.section == 1 {
|
||||
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "coincell", for: indexPath) as! SRCoinPackCell
|
||||
return cell
|
||||
}
|
||||
|
||||
@ -71,14 +75,14 @@ extension SRUserViewController: UICollectionViewDelegate, UICollectionViewDataSo
|
||||
}
|
||||
|
||||
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
|
||||
if section == 0 {
|
||||
if section == 0 || section == 1{
|
||||
return 1
|
||||
}
|
||||
return self.dataArr.count
|
||||
}
|
||||
|
||||
func numberOfSections(in collectionView: UICollectionView) -> Int {
|
||||
return 2
|
||||
return 3
|
||||
}
|
||||
|
||||
func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
||||
@ -86,11 +90,13 @@ extension SRUserViewController: UICollectionViewDelegate, UICollectionViewDataSo
|
||||
}
|
||||
|
||||
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
|
||||
let model = dataArr[indexPath.row]
|
||||
|
||||
if (model.type == .about){
|
||||
|
||||
if indexPath.section == 0 { return }
|
||||
if indexPath.section == 1 {
|
||||
let vc = SRCoinPackController()
|
||||
self.navigationController?.pushViewController(vc, animated: true)
|
||||
return
|
||||
}
|
||||
let model = dataArr[indexPath.row]
|
||||
switch model.type {
|
||||
case .about:
|
||||
let aboutvc = SRAboutUsController ();
|
||||
@ -123,6 +129,7 @@ extension SRUserViewController: UICollectionViewDelegateFlowLayout {
|
||||
|
||||
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
|
||||
if indexPath.section == 0 { return CGSizeMake(UIScreen.width, 278) }
|
||||
if indexPath.section == 1 { return CGSizeMake(UIScreen.width - 30, 70) }
|
||||
return CGSizeMake(UIScreen.width, 60)
|
||||
}
|
||||
}
|
||||
|
||||
62
SynthReel/Class/User/view/SRCoinPackCell.swift
Normal file
@ -0,0 +1,62 @@
|
||||
//
|
||||
// SRCoinPackCell.swift
|
||||
// SynthReel
|
||||
//
|
||||
// Created by CSGY on 2025/11/28.
|
||||
// Copyright © 2025 SR. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class SRCoinPackCell: UICollectionViewCell {
|
||||
|
||||
lazy var bgImageView = UIImageView.init(image: UIImage(named: "userCoinCell"))
|
||||
|
||||
lazy var titleLabel : UILabel = {
|
||||
let label = UILabel()
|
||||
label.textColor = UIColor.B_5_DAE_6
|
||||
label.font = .font(ofSize: 18, weight: .init(800))
|
||||
label.text = "Daily reward ready !".localized
|
||||
return label
|
||||
}()
|
||||
|
||||
lazy var calimLabel : UILabel = {
|
||||
let label = UILabel()
|
||||
label.textColor = UIColor.white
|
||||
label.font = .font(ofSize: 14, weight: .regular)
|
||||
label.text = "Claim your rewards now".localized
|
||||
return label
|
||||
}()
|
||||
|
||||
override init(frame: CGRect) {
|
||||
super.init(frame: frame)
|
||||
|
||||
sr_setupUI()
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
}
|
||||
|
||||
extension SRCoinPackCell {
|
||||
func sr_setupUI() {
|
||||
contentView.addSubview(bgImageView)
|
||||
contentView.addSubview(titleLabel)
|
||||
contentView.addSubview(calimLabel)
|
||||
|
||||
bgImageView.snp.makeConstraints { make in
|
||||
make.edges.equalToSuperview()
|
||||
}
|
||||
|
||||
titleLabel.snp.makeConstraints { make in
|
||||
make.top.equalTo(16)
|
||||
make.left.equalTo(84)
|
||||
}
|
||||
|
||||
calimLabel.snp.makeConstraints { make in
|
||||
make.left.equalTo(titleLabel)
|
||||
make.top.equalTo(titleLabel.snp.bottom).offset(4)
|
||||
}
|
||||
}
|
||||
}
|
||||
22
SynthReel/Source/Assets.xcassets/Image/topCoinPack.imageset/Contents.json
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "topCoinPack@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "topCoinPack@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
BIN
SynthReel/Source/Assets.xcassets/Image/topCoinPack.imageset/topCoinPack@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 598 KiB |
BIN
SynthReel/Source/Assets.xcassets/Image/topCoinPack.imageset/topCoinPack@3x.png
vendored
Normal file
|
After Width: | Height: | Size: 1.2 MiB |
6
SynthReel/Source/Assets.xcassets/coin/Contents.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
22
SynthReel/Source/Assets.xcassets/coin/claimAllHiglit.imageset/Contents.json
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "claimAllHiglit@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "claimAllHiglit@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
BIN
SynthReel/Source/Assets.xcassets/coin/claimAllHiglit.imageset/claimAllHiglit@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
SynthReel/Source/Assets.xcassets/coin/claimAllHiglit.imageset/claimAllHiglit@3x.png
vendored
Normal file
|
After Width: | Height: | Size: 39 KiB |
22
SynthReel/Source/Assets.xcassets/coin/claimAllNomarl.imageset/Contents.json
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "claimAllNomarl@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "claimAllNomarl@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
BIN
SynthReel/Source/Assets.xcassets/coin/claimAllNomarl.imageset/claimAllNomarl@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
SynthReel/Source/Assets.xcassets/coin/claimAllNomarl.imageset/claimAllNomarl@3x.png
vendored
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
22
SynthReel/Source/Assets.xcassets/myShort/userCoinCell.imageset/Contents.json
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "userCoinCell@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "userCoinCell@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
BIN
SynthReel/Source/Assets.xcassets/myShort/userCoinCell.imageset/userCoinCell@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 158 KiB |
BIN
SynthReel/Source/Assets.xcassets/myShort/userCoinCell.imageset/userCoinCell@3x.png
vendored
Normal file
|
After Width: | Height: | Size: 334 KiB |
@ -37,3 +37,6 @@
|
||||
"synthreel_feedback_detail" = "Feedback Details";
|
||||
"synthreel_account_deletion" = "Account Deletion";
|
||||
"Rewards" = "Rewards";
|
||||
"Daily reward ready !" = "Daily reward ready !";
|
||||
"Claim your rewards now" = "Claim your rewards now";
|
||||
"My Refills" = "My Refills";
|
||||
|
||||