diff --git a/MoviaBox.xcodeproj/project.pbxproj b/MoviaBox.xcodeproj/project.pbxproj index 85bcf42..99cfee1 100644 --- a/MoviaBox.xcodeproj/project.pbxproj +++ b/MoviaBox.xcodeproj/project.pbxproj @@ -220,6 +220,7 @@ ARCHS = "$(ARCHS_STANDARD)"; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = MoviaBox/MoviaBox.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; @@ -264,6 +265,7 @@ ARCHS = "$(ARCHS_STANDARD)"; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = MoviaBox/MoviaBox.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; diff --git a/MoviaBox/Base/Extension/UIColor+SPAdd.swift b/MoviaBox/Base/Extension/UIColor+SPAdd.swift index 8e89a61..40b98d5 100644 --- a/MoviaBox/Base/Extension/UIColor+SPAdd.swift +++ b/MoviaBox/Base/Extension/UIColor+SPAdd.swift @@ -380,5 +380,13 @@ extension UIColor { static func colorFF1F1F(alpha: CGFloat = 1) -> UIColor { return color(hex: 0xFF1F1F, alpha: alpha) } + + static func colorFF3232(alpha: CGFloat = 1) -> UIColor { + return color(hex: 0xFF3232, alpha: alpha) + } + + static func color362020(alpha: CGFloat = 1) -> UIColor { + return color(hex: 0x362020, alpha: alpha) + } } diff --git a/MoviaBox/Base/Extension/UIFont+SPAdd.swift b/MoviaBox/Base/Extension/UIFont+SPAdd.swift index 66e896d..545485e 100644 --- a/MoviaBox/Base/Extension/UIFont+SPAdd.swift +++ b/MoviaBox/Base/Extension/UIFont+SPAdd.swift @@ -9,6 +9,18 @@ import UIKit extension UIFont { + static func regularFontName() -> String { + return ".AppleSystemUIFont" + } + + static func mediumFontName() -> String { + return ".AppleSystemUIFontMedium" + } + + static func boldFontName() -> String { + return ".AppleSystemUIFontBold" + } + static func fontRegular(ofSize: CGFloat) -> UIFont { return .systemFont(ofSize: ofSize, weight: .regular) } diff --git a/MoviaBox/Base/Networking/API/SPUserAPI.swift b/MoviaBox/Base/Networking/API/SPUserAPI.swift index 1976cc7..ed53265 100644 --- a/MoviaBox/Base/Networking/API/SPUserAPI.swift +++ b/MoviaBox/Base/Networking/API/SPUserAPI.swift @@ -20,6 +20,23 @@ class SPUserAPI: NSObject { } } + ///用户登录 + + + ///退出登录 + static func requestSignout() { + var param = SPNetworkParameters(path: "customer/signout") + param.isLoding = true + + SPNetwork.request(parameters: param) { (response: SPNetworkResponse) in + if response.code == SPNetworkCodeSucceed { +// completer?(true) + } else { +// completer?(false) + } + } + } + ///注销账户 static func requestLogoff(completer: ((_ isFinish: Bool) -> Void)?) { var param = SPNetworkParameters(path: "/customer/logoff") diff --git a/MoviaBox/Class/Mine/Model/SPMineItem.swift b/MoviaBox/Class/Mine/Model/SPMineItem.swift index 63a1d5f..17654e1 100644 --- a/MoviaBox/Class/Mine/Model/SPMineItem.swift +++ b/MoviaBox/Class/Mine/Model/SPMineItem.swift @@ -35,8 +35,6 @@ struct SPMineItem { case settings ///消费记录 case consumptionRecords - ///订单记录 - case purchaseRecords ///赠币记录 case rewardCoins ///清理缓存 diff --git a/MoviaBox/Class/Player/View/SPPlayBuyView.swift b/MoviaBox/Class/Player/View/SPPlayBuyView.swift index 575fc07..f746314 100644 --- a/MoviaBox/Class/Player/View/SPPlayBuyView.swift +++ b/MoviaBox/Class/Player/View/SPPlayBuyView.swift @@ -10,7 +10,6 @@ import UIKit class SPPlayBuyView: HWPanModalContentView { - //MARK: UI属性 private lazy var bgView: UIImageView = { let view = UIImageView(image: UIImage(named: "buy_bg_image_01")) diff --git a/MoviaBox/Class/Player/View/SPPlayerDetailControlView.swift b/MoviaBox/Class/Player/View/SPPlayerDetailControlView.swift index d32c458..55198fe 100644 --- a/MoviaBox/Class/Player/View/SPPlayerDetailControlView.swift +++ b/MoviaBox/Class/Player/View/SPPlayerDetailControlView.swift @@ -219,19 +219,8 @@ extension SPPlayerDetailControlView { toolView.addSubview(progressTimeLabel) addSubview(retreatButton) addSubview(advanceButton) -// addSubview(speedButton) -// addSubview(speedSelectedView) - -// self.progressView.snp.remakeConstraints { make in -// make.left.equalToSuperview().offset(15) -// make.centerX.equalToSuperview() -// make.height.equalTo(30) -// make.bottom.equalToSuperview().offset(-(kSPTabbarSafeBottomMargin + 10)) -// } self.progressTimeLabel.snp.makeConstraints { make in -// make.left.equalTo(self.progressView) -// make.bottom.equalTo(self.progressView).offset(-12) make.centerY.equalToSuperview() make.left.equalToSuperview().offset(16) } @@ -246,18 +235,6 @@ extension SPPlayerDetailControlView { make.left.equalTo(playImageView.snp.right).offset(kSPMainW(50)) } -// speedButton.snp.makeConstraints { make in -// make.centerY.equalTo(self.progressTimeLabel) -// make.right.equalToSuperview().offset(-15) -// make.width.equalTo(40) -// make.height.equalTo(20) -// } - -// speedSelectedView.snp.makeConstraints { make in -// make.left.right.equalToSuperview() -// make.bottom.equalTo(self.speedButton.snp.top).offset(-30) -// } - } } diff --git a/MoviaBox/Class/Wallet/Controller/SPCoinOrderRecordViewController.swift b/MoviaBox/Class/Wallet/Controller/SPCoinOrderRecordViewController.swift new file mode 100644 index 0000000..6dbe6cf --- /dev/null +++ b/MoviaBox/Class/Wallet/Controller/SPCoinOrderRecordViewController.swift @@ -0,0 +1,58 @@ +// +// SPCoinOrderRecordViewController.swift +// MoviaBox +// +// Created by 佳尔 on 2025/4/29. +// + +import UIKit + +class SPCoinOrderRecordViewController: SPViewController { + + //MARK: UI属性 + private lazy var tableView: SPTableView = { + let tableView = SPTableView(frame: .zero, style: .plain) + tableView.delegate = self + tableView.dataSource = self + tableView.rowHeight = 70 + SPCoinOrderRecordCell.registerCell(tableView: tableView) + return tableView + }() + + + override func viewDidLoad() { + super.viewDidLoad() + setBackgroundView(isShowGradient: false, bgImage: nil, backgroundColor: .clear) + + _setupUI() + } + + + + +} + +extension SPCoinOrderRecordViewController { + private func _setupUI() { + view.addSubview(tableView) + + tableView.snp.makeConstraints { make in + make.edges.equalToSuperview() + } + + } +} + +//MARK: -------------- UITableViewDelegate & UITableViewDataSource -------------- +extension SPCoinOrderRecordViewController: UITableViewDelegate, UITableViewDataSource { + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = SPCoinOrderRecordCell.dequeueReusableCell(tableView: tableView, indexPath: indexPath) + return cell + } + + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return 10 + } + +} diff --git a/MoviaBox/Class/Wallet/Controller/SPConsumptionRecordsViewController.swift b/MoviaBox/Class/Wallet/Controller/SPConsumptionRecordsViewController.swift new file mode 100644 index 0000000..5e1e4eb --- /dev/null +++ b/MoviaBox/Class/Wallet/Controller/SPConsumptionRecordsViewController.swift @@ -0,0 +1,61 @@ +// +// SPConsumptionRecordsViewController.swift +// MoviaBox +// +// Created by 佳尔 on 2025/4/29. +// + +import UIKit + +///消费记录 +class SPConsumptionRecordsViewController: SPViewController { + + //MARK: UI属性 + private lazy var tableView: SPTableView = { + let tableView = SPTableView(frame: .zero, style: .plain) + tableView.delegate = self + tableView.dataSource = self + tableView.rowHeight = 72 + tableView.separatorInset = .init(top: 0, left: 32, bottom: 0, right: 32) + SPConsumptionRecordsCell.registerCell(tableView: tableView) + return tableView + }() + + override func viewDidLoad() { + super.viewDidLoad() + self.title = "Consumption Records".localized + self.edgesForExtendedLayout = .top + + _setupUI() + } + + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + self.navigationController?.setNavigationBarHidden(false, animated: true) + setNavigationNormalStyle(backgroundColor: .clear, isTranslucent: true) + + } +} + +extension SPConsumptionRecordsViewController { + private func _setupUI() { + view.addSubview(tableView) + + tableView.snp.makeConstraints { make in + make.left.right.bottom.equalToSuperview() + make.top.equalToSuperview().offset(kSPNavBarHeight) + } + } +} + +//MARK: -------------- UITableViewDelegate & UITableViewDataSource -------------- +extension SPConsumptionRecordsViewController: UITableViewDelegate, UITableViewDataSource { + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = SPConsumptionRecordsCell.dequeueReusableCell(tableView: tableView, indexPath: indexPath) + return cell + } + + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return 10 + } +} diff --git a/MoviaBox/Class/Wallet/Controller/SPOrderRecordsPageViewController.swift b/MoviaBox/Class/Wallet/Controller/SPOrderRecordsPageViewController.swift new file mode 100644 index 0000000..c3f0218 --- /dev/null +++ b/MoviaBox/Class/Wallet/Controller/SPOrderRecordsPageViewController.swift @@ -0,0 +1,106 @@ +// +// SPOrderRecordsPageViewController.swift +// MoviaBox +// +// Created by 佳尔 on 2025/4/29. +// + +import UIKit + +class SPOrderRecordsPageViewController: SPViewController { + + private lazy var titles: [String] = ["Coin Record".localized, "VIP Record".localized] + private lazy var viewControllers: [UIViewController] = { + let vc1 = SPCoinOrderRecordViewController() + let vc2 = SPVIPOrderRecordViewController() + return [vc1, vc2] + }() + + //MARK: UI属性 + private lazy var pageView: WMPageController = { + let pageView = WMPageController() + pageView.delegate = self + pageView.dataSource = self + pageView.titleFontName = UIFont.mediumFontName() + pageView.titleSizeNormal = 16 + pageView.titleSizeSelected = 16 + pageView.titleColorNormal = .colorFFFFFF(alpha: 0.45) + pageView.titleColorSelected = .colorFF3232() + pageView.progressColor = .colorFFFFFF() + pageView.menuViewStyle = .flood + pageView.menuViewLayoutMode = .center + pageView.progressHeight = 36 + pageView.menuItemWidth = (kSPScreenWidth - 44) / 2 + return pageView + }() + + private lazy var menuBgView: UIView = { + let view = UIView() + view.backgroundColor = .color362020() + view.layer.cornerRadius = 16 + view.layer.masksToBounds = true + return view + }() + + override func viewDidLoad() { + super.viewDidLoad() + self.title = "Order Records".localized + self.edgesForExtendedLayout = .top + + _setupUI() + } + + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + self.navigationController?.setNavigationBarHidden(false, animated: true) + setNavigationNormalStyle(backgroundColor: .clear, isTranslucent: true) + + } + +} + +extension SPOrderRecordsPageViewController { + + private func _setupUI() { + addChild(self.pageView) + + view.addSubview(menuBgView) + view.addSubview(self.pageView.view) + + self.pageView.view.snp.makeConstraints { make in + make.left.right.bottom.equalToSuperview() + make.top.equalToSuperview().offset(kSPNavBarHeight) + } + + menuBgView.snp.makeConstraints { make in + make.left.equalToSuperview().offset(16) + make.centerX.equalToSuperview() + make.top.equalToSuperview().offset(kSPNavBarHeight) + make.height.equalTo(48) + } + } + +} + +//MARK: -------------- WMPageControllerDelegate & WMPageControllerDataSource -------------- +extension SPOrderRecordsPageViewController: WMPageControllerDelegate, WMPageControllerDataSource { + func pageController(_ pageController: WMPageController, preferredFrameForContentView contentView: WMScrollView) -> CGRect { + return CGRect(x: 0, y: 48, width: kSPScreenWidth, height: kSPScreenHeight - kSPNavBarHeight - 48) + } + + func pageController(_ pageController: WMPageController, preferredFrameFor menuView: WMMenuView) -> CGRect { + return CGRect(x: 0, y: 0, width: kSPScreenWidth, height: 48) + } + + func numbersOfChildControllers(in pageController: WMPageController) -> Int { + return self.titles.count + } + + func pageController(_ pageController: WMPageController, titleAt index: Int) -> String { + return self.titles[index] + } + + func pageController(_ pageController: WMPageController, viewControllerAt index: Int) -> UIViewController { + return viewControllers[index] + } +} diff --git a/MoviaBox/Class/Wallet/Controller/SPRewardCoinsViewController.swift b/MoviaBox/Class/Wallet/Controller/SPRewardCoinsViewController.swift new file mode 100644 index 0000000..0c007ef --- /dev/null +++ b/MoviaBox/Class/Wallet/Controller/SPRewardCoinsViewController.swift @@ -0,0 +1,64 @@ +// +// SPRewardCoinsViewController.swift +// MoviaBox +// +// Created by 佳尔 on 2025/4/29. +// + +import UIKit + +//赠币记录 +class SPRewardCoinsViewController: SPViewController { + + //MARK: UI属性 + private lazy var tableView: SPTableView = { + let tableView = SPTableView(frame: .zero, style: .plain) + tableView.delegate = self + tableView.dataSource = self + tableView.rowHeight = 96 + SPRewardCoinsCell.registerCell(tableView: tableView) + return tableView + }() + + override func viewDidLoad() { + super.viewDidLoad() + self.title = "Reward Coins".localized + self.edgesForExtendedLayout = .top + + _setupUI() + } + + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + self.navigationController?.setNavigationBarHidden(false, animated: true) + setNavigationNormalStyle(backgroundColor: .clear, isTranslucent: true) + + } + + +} + +extension SPRewardCoinsViewController { + + private func _setupUI() { + view.addSubview(tableView) + + tableView.snp.makeConstraints { make in + make.left.right.bottom.equalToSuperview() + make.top.equalToSuperview().offset(kSPNavBarHeight) + } + } + +} + +//MARK: -------------- UITableViewDelegate & UITableViewDataSource -------------- +extension SPRewardCoinsViewController: UITableViewDelegate, UITableViewDataSource { + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = SPRewardCoinsCell.dequeueReusableCell(tableView: tableView, indexPath: indexPath) + return cell + } + + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return 10 + } +} diff --git a/MoviaBox/Class/Wallet/Controller/SPVIPOrderRecordViewController.swift b/MoviaBox/Class/Wallet/Controller/SPVIPOrderRecordViewController.swift new file mode 100644 index 0000000..a0ee283 --- /dev/null +++ b/MoviaBox/Class/Wallet/Controller/SPVIPOrderRecordViewController.swift @@ -0,0 +1,57 @@ +// +// SPVIPOrderRecordViewController.swift +// MoviaBox +// +// Created by 佳尔 on 2025/4/29. +// + +import UIKit + +class SPVIPOrderRecordViewController: SPViewController { + + //MARK: UI属性 + private lazy var tableView: SPTableView = { + let tableView = SPTableView(frame: .zero, style: .plain) + tableView.delegate = self + tableView.dataSource = self + tableView.rowHeight = 74 + SPVIPOrderRecordCell.registerCell(tableView: tableView) + return tableView + }() + + + override func viewDidLoad() { + super.viewDidLoad() + setBackgroundView(isShowGradient: false, bgImage: nil, backgroundColor: .clear) + + _setupUI() + } + + + +} + +extension SPVIPOrderRecordViewController { + private func _setupUI() { + view.addSubview(tableView) + + tableView.snp.makeConstraints { make in + make.edges.equalToSuperview() + } + + } +} + +//MARK: -------------- UITableViewDelegate & UITableViewDataSource -------------- +extension SPVIPOrderRecordViewController: UITableViewDelegate, UITableViewDataSource { + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = SPVIPOrderRecordCell.dequeueReusableCell(tableView: tableView, indexPath: indexPath) + return cell + } + + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return 10 + } + +} diff --git a/MoviaBox/Class/Wallet/Controller/SPWalletViewController.swift b/MoviaBox/Class/Wallet/Controller/SPWalletViewController.swift index c460c82..7c21c69 100644 --- a/MoviaBox/Class/Wallet/Controller/SPWalletViewController.swift +++ b/MoviaBox/Class/Wallet/Controller/SPWalletViewController.swift @@ -12,7 +12,7 @@ class SPWalletViewController: SPViewController { private lazy var dataArr: [SPMineItem] = { let arr = [ SPMineItem(type: .consumptionRecords, iconImage: UIImage(named: "records_icon_01"), title: "Consumption records".localized), - SPMineItem(type: .purchaseRecords, iconImage: UIImage(named: "records_icon_02"), title: "Purchase records".localized), + SPMineItem(type: .orderRecord, iconImage: UIImage(named: "records_icon_02"), title: "Purchase records".localized), SPMineItem(type: .rewardCoins, iconImage: UIImage(named: "coin_icon_03"), title: "Reward Coins".localized), SPMineItem(type: .feedBack, iconImage: UIImage(named: "feed_back_icon_03"), title: "FeedBack".localized), ] @@ -87,6 +87,18 @@ extension SPWalletViewController: UITableViewDelegate, UITableViewDataSource { let vc = SPFeedbackViewController() self.navigationController?.pushViewController(vc, animated: true) + case .rewardCoins: + let vc = SPRewardCoinsViewController() + self.navigationController?.pushViewController(vc, animated: true) + + case .consumptionRecords: + let vc = SPConsumptionRecordsViewController() + self.navigationController?.pushViewController(vc, animated: true) + + case .orderRecord: + let vc = SPOrderRecordsPageViewController() + self.navigationController?.pushViewController(vc, animated: true) + default: break } diff --git a/MoviaBox/Class/Wallet/View/SPCoinOrderRecordCell.swift b/MoviaBox/Class/Wallet/View/SPCoinOrderRecordCell.swift new file mode 100644 index 0000000..4103b8a --- /dev/null +++ b/MoviaBox/Class/Wallet/View/SPCoinOrderRecordCell.swift @@ -0,0 +1,83 @@ +// +// SPCoinOrderRecordCell.swift +// MoviaBox +// +// Created by 佳尔 on 2025/4/29. +// + +import UIKit + +class SPCoinOrderRecordCell: SPTableViewCell { + + //MARK: UI属性 + private lazy var titleLabel: UILabel = { + let label = UILabel() + label.font = .fontMedium(ofSize: 16) + label.textColor = .colorFF3232() + return label + }() + + private lazy var timeLabel: UILabel = { + let label = UILabel() + label.font = .fontRegular(ofSize: 14) + label.textColor = .colorFFFFFF() + return label + }() + + private lazy var coinLabel: UILabel = { + let label = UILabel() + label.font = .fontMedium(ofSize: 16) + label.textColor = .colorFF3232() + return label + }() + + private lazy var coinImageView: UIImageView = { + let imageView = UIImageView(image: UIImage(named: "coin_icon_06")) + return imageView + }() + + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + super.init(style: style, reuseIdentifier: reuseIdentifier) + titleLabel.text = "Recharge Coins" + timeLabel.text = "2024-6-10 23:41:18" + coinLabel.text = "+20000" + + _setupUI() + } + + @MainActor required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + +} + +extension SPCoinOrderRecordCell { + + private func _setupUI() { + contentView.addSubview(titleLabel) + contentView.addSubview(timeLabel) + contentView.addSubview(coinLabel) + contentView.addSubview(coinImageView) + + titleLabel.snp.makeConstraints { make in + make.left.equalToSuperview().offset(32) + make.top.equalToSuperview().offset(15) + } + + timeLabel.snp.makeConstraints { make in + make.left.equalTo(titleLabel) + make.bottom.equalToSuperview().offset(-15) + } + + coinImageView.snp.makeConstraints { make in + make.centerY.equalToSuperview() + make.right.equalTo(coinLabel.snp.left).offset(-4) + } + + coinLabel.snp.makeConstraints { make in + make.centerY.equalToSuperview() + make.right.equalToSuperview().offset(-25) + } + } + +} diff --git a/MoviaBox/Class/Wallet/View/SPConsumptionRecordsCell.swift b/MoviaBox/Class/Wallet/View/SPConsumptionRecordsCell.swift new file mode 100644 index 0000000..0103a1d --- /dev/null +++ b/MoviaBox/Class/Wallet/View/SPConsumptionRecordsCell.swift @@ -0,0 +1,87 @@ +// +// SPConsumptionRecordsCell.swift +// MoviaBox +// +// Created by 佳尔 on 2025/4/29. +// + +import UIKit + +class SPConsumptionRecordsCell: SPTableViewCell { + + //MARK: UI属性 + private lazy var titleLabel: UILabel = { + let label = UILabel() + label.font = .fontRegular(ofSize: 12) + label.textColor = .colorFF3232() + return label + }() + + private lazy var timeLabel: UILabel = { + let label = UILabel() + label.font = .fontRegular(ofSize: 12) + label.textColor = .colorFFFFFF() + return label + }() + + private lazy var desLabel: UILabel = { + let label = UILabel() + label.font = .fontRegular(ofSize: 12) + label.textColor = .colorFFFFFF() + return label + }() + + private lazy var coinLabel: UILabel = { + let label = UILabel() + label.font = .fontRegular(ofSize: 12) + label.textColor = .colorFF3232() + return label + }() + + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + super.init(style: style, reuseIdentifier: reuseIdentifier) + titleLabel.text = "Purchase Single Episode" + timeLabel.text = "2024-6-10 23:41:18" + desLabel.text = "Ep.8 Romantic Flash Marriage In Progress" + coinLabel.text = "-500 Coins" + + _setupUI() + } + + @MainActor required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + +} + +extension SPConsumptionRecordsCell { + + private func _setupUI() { + contentView.addSubview(titleLabel) + contentView.addSubview(timeLabel) + contentView.addSubview(desLabel) + contentView.addSubview(coinLabel) + + titleLabel.snp.makeConstraints { make in + make.left.equalToSuperview().offset(32) + make.top.equalToSuperview().offset(16) + } + + timeLabel.snp.makeConstraints { make in + make.right.equalToSuperview().offset(-32) + make.centerY.equalTo(titleLabel) + } + + desLabel.snp.makeConstraints { make in + make.left.equalTo(titleLabel) + make.bottom.equalToSuperview().offset(-16) + make.width.lessThanOrEqualTo(kSPScreenWidth - 190) + } + + coinLabel.snp.makeConstraints { make in + make.centerY.equalTo(desLabel) + make.right.equalTo(timeLabel) + } + } + +} diff --git a/MoviaBox/Class/Wallet/View/SPRewardCoinsCell.swift b/MoviaBox/Class/Wallet/View/SPRewardCoinsCell.swift new file mode 100644 index 0000000..6378d3e --- /dev/null +++ b/MoviaBox/Class/Wallet/View/SPRewardCoinsCell.swift @@ -0,0 +1,110 @@ +// +// SPRewardCoinsCell.swift +// MoviaBox +// +// Created by 佳尔 on 2025/4/29. +// + +import UIKit + +class SPRewardCoinsCell: SPTableViewCell { + + private lazy var timeLabel: UILabel = { + let label = UILabel() + label.font = .fontMedium(ofSize: 14) + label.textColor = .colorFFFFFF() + return label + }() + + private lazy var nameLabel: UILabel = { + let label = UILabel() + label.font = .fontMedium(ofSize: 16) + label.textColor = .colorFFFFFF() + return label + }() + + private lazy var expireIconImageView: UIImageView = { + let imageView = UIImageView(image: UIImage(named: "expire_icon_01")) + return imageView + }() + + private lazy var expireLabel: UILabel = { + let label = UILabel() + label.font = .fontRegular(ofSize: 12) + label.textColor = .colorFF3232() + return label + }() + + private lazy var coinLabel: UILabel = { + let label = UILabel() + label.font = .fontMedium(ofSize: 16) + label.textColor = .colorFF3232() + return label + }() + + private lazy var remainingLabel: UILabel = { + let label = UILabel() + label.font = .fontMedium(ofSize: 12) + label.textColor = .colorFFFFFF() + return label + }() + + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + super.init(style: style, reuseIdentifier: reuseIdentifier) + timeLabel.text = "2024-6-10 23:41:18" + nameLabel.text = "Check in" + expireLabel.text = "Expires in 30 days" + coinLabel.text = "+30" + remainingLabel.text = "Remaining:30" + + _setupUI() + } + + @MainActor required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + +} + +extension SPRewardCoinsCell { + + private func _setupUI() { + contentView.addSubview(timeLabel) + contentView.addSubview(nameLabel) + contentView.addSubview(expireIconImageView) + contentView.addSubview(expireLabel) + contentView.addSubview(coinLabel) + contentView.addSubview(remainingLabel) + + timeLabel.snp.makeConstraints { make in + make.left.equalToSuperview().offset(32) + make.top.equalToSuperview().offset(17) + } + + nameLabel.snp.makeConstraints { make in + make.left.equalTo(timeLabel) + make.top.equalTo(timeLabel.snp.bottom).offset(6) + } + + expireIconImageView.snp.makeConstraints { make in + make.left.equalTo(timeLabel) + make.bottom.equalToSuperview().offset(-17) + } + + expireLabel.snp.makeConstraints { make in + make.centerY.equalTo(expireIconImageView) + make.left.equalTo(expireIconImageView.snp.right).offset(4) + } + + coinLabel.snp.makeConstraints { make in + make.right.equalToSuperview().offset(-32) + make.top.equalToSuperview().offset(28) + } + + remainingLabel.snp.makeConstraints { make in + make.right.equalTo(coinLabel) + make.bottom.equalToSuperview().offset(-17) + } + } + +} diff --git a/MoviaBox/Class/Wallet/View/SPVIPOrderRecordCell.swift b/MoviaBox/Class/Wallet/View/SPVIPOrderRecordCell.swift new file mode 100644 index 0000000..213bb6f --- /dev/null +++ b/MoviaBox/Class/Wallet/View/SPVIPOrderRecordCell.swift @@ -0,0 +1,74 @@ +// +// SPVIPOrderRecordCell.swift +// MoviaBox +// +// Created by 佳尔 on 2025/4/29. +// + +import UIKit + +class SPVIPOrderRecordCell: SPTableViewCell { + + //MARK: UI属性 + private lazy var titleLabel: UILabel = { + let label = UILabel() + label.font = .fontMedium(ofSize: 16) + label.textColor = .colorFF3232() + return label + }() + + private lazy var timeLabel: UILabel = { + let label = UILabel() + label.font = .fontRegular(ofSize: 14) + label.textColor = .colorFFFFFF() + return label + }() + + private lazy var dayLabel: UILabel = { + let label = UILabel() + label.font = .fontMedium(ofSize: 16) + label.textColor = .colorFF3232() + return label + }() + + + + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + super.init(style: style, reuseIdentifier: reuseIdentifier) + titleLabel.text = "Purchase VIP" + timeLabel.text = "2024-6-10 23:41:18" + dayLabel.text = "+30 days" + + _setupUI() + } + + @MainActor required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + +} + +extension SPVIPOrderRecordCell { + + private func _setupUI() { + contentView.addSubview(titleLabel) + contentView.addSubview(timeLabel) + contentView.addSubview(dayLabel) + + titleLabel.snp.makeConstraints { make in + make.left.equalToSuperview().offset(32) + make.top.equalToSuperview().offset(15) + } + + timeLabel.snp.makeConstraints { make in + make.left.equalTo(titleLabel) + make.bottom.equalToSuperview().offset(-15) + } + + + dayLabel.snp.makeConstraints { make in + make.centerY.equalToSuperview() + make.right.equalToSuperview().offset(-25) + } + } +} diff --git a/MoviaBox/MoviaBox.entitlements b/MoviaBox/MoviaBox.entitlements new file mode 100644 index 0000000..a812db5 --- /dev/null +++ b/MoviaBox/MoviaBox.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.developer.applesignin + + Default + + + diff --git a/MoviaBox/Source/Assets.xcassets/icon/coin_icon_06.imageset/Contents.json b/MoviaBox/Source/Assets.xcassets/icon/coin_icon_06.imageset/Contents.json new file mode 100644 index 0000000..54604f5 --- /dev/null +++ b/MoviaBox/Source/Assets.xcassets/icon/coin_icon_06.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "image 20@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "image 20@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MoviaBox/Source/Assets.xcassets/icon/coin_icon_06.imageset/image 20@2x.png b/MoviaBox/Source/Assets.xcassets/icon/coin_icon_06.imageset/image 20@2x.png new file mode 100644 index 0000000..2699aba Binary files /dev/null and b/MoviaBox/Source/Assets.xcassets/icon/coin_icon_06.imageset/image 20@2x.png differ diff --git a/MoviaBox/Source/Assets.xcassets/icon/coin_icon_06.imageset/image 20@3x.png b/MoviaBox/Source/Assets.xcassets/icon/coin_icon_06.imageset/image 20@3x.png new file mode 100644 index 0000000..f9c9c50 Binary files /dev/null and b/MoviaBox/Source/Assets.xcassets/icon/coin_icon_06.imageset/image 20@3x.png differ diff --git a/MoviaBox/Source/Assets.xcassets/icon/expire_icon_01.imageset/Contents.json b/MoviaBox/Source/Assets.xcassets/icon/expire_icon_01.imageset/Contents.json new file mode 100644 index 0000000..6efec3a --- /dev/null +++ b/MoviaBox/Source/Assets.xcassets/icon/expire_icon_01.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "time icon@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "time icon@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MoviaBox/Source/Assets.xcassets/icon/expire_icon_01.imageset/time icon@2x.png b/MoviaBox/Source/Assets.xcassets/icon/expire_icon_01.imageset/time icon@2x.png new file mode 100644 index 0000000..616856a Binary files /dev/null and b/MoviaBox/Source/Assets.xcassets/icon/expire_icon_01.imageset/time icon@2x.png differ diff --git a/MoviaBox/Source/Assets.xcassets/icon/expire_icon_01.imageset/time icon@3x.png b/MoviaBox/Source/Assets.xcassets/icon/expire_icon_01.imageset/time icon@3x.png new file mode 100644 index 0000000..0049739 Binary files /dev/null and b/MoviaBox/Source/Assets.xcassets/icon/expire_icon_01.imageset/time icon@3x.png differ diff --git a/MoviaBox/Source/en.lproj/Localizable.strings b/MoviaBox/Source/en.lproj/Localizable.strings index 2ce907e..1f903da 100644 --- a/MoviaBox/Source/en.lproj/Localizable.strings +++ b/MoviaBox/Source/en.lproj/Localizable.strings @@ -72,6 +72,9 @@ "Clear Cache" = "Clear Cache"; "Delete Account" = "Delete Account"; "Account Deletion" = "Account Deletion"; +"Order Records" = "Order Records"; +"Coin Record" = "Coin Record"; +"VIP Record" = "VIP Record"; "kLoginAgreementText" = "By continuing, you agree to the User Agreement and Privacy Policy";