diff --git a/Veloria.xcodeproj/project.pbxproj b/Veloria.xcodeproj/project.pbxproj index d603a62..e2d2ed9 100644 --- a/Veloria.xcodeproj/project.pbxproj +++ b/Veloria.xcodeproj/project.pbxproj @@ -199,6 +199,15 @@ BFF5B2482DF051D90044227A /* AppDelegate+Thirdparty.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFF5B2472DF051D90044227A /* AppDelegate+Thirdparty.swift */; }; BFF5B24A2DF0524D0044227A /* AppDelegate+Open.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFF5B2492DF0524D0044227A /* AppDelegate+Open.swift */; }; BFF5B24C2DF052E80044227A /* VPLoginManager+fb.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFF5B24B2DF052E80044227A /* VPLoginManager+fb.swift */; }; + BFF5B24E2DF128B30044227A /* VPRechargeRecordModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFF5B24D2DF128B30044227A /* VPRechargeRecordModel.swift */; }; + BFF5B2502DF12FBC0044227A /* VPConsumptionRecordsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFF5B24F2DF12FBC0044227A /* VPConsumptionRecordsViewController.swift */; }; + BFF5B2522DF130E00044227A /* VPConsumptionRecordsCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFF5B2512DF130E00044227A /* VPConsumptionRecordsCell.swift */; }; + BFF5B2542DF132540044227A /* VPConsumptionRecordsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFF5B2532DF132540044227A /* VPConsumptionRecordsModel.swift */; }; + BFF5B2562DF139200044227A /* VPGiveCoinRecordsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFF5B2552DF139200044227A /* VPGiveCoinRecordsViewController.swift */; }; + BFF5B2582DF13A9C0044227A /* VPGiveCoinRecordModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFF5B2572DF13A9C0044227A /* VPGiveCoinRecordModel.swift */; }; + BFF5B25A2DF13BE50044227A /* VPGiveCoinRecordsCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFF5B2592DF13BE50044227A /* VPGiveCoinRecordsCell.swift */; }; + BFF5B25C2DF13F850044227A /* Date+VPAdd.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFF5B25B2DF13F850044227A /* Date+VPAdd.swift */; }; + BFF5B25E2DF1423F0044227A /* VPWalletBaseCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFF5B25D2DF1423F0044227A /* VPWalletBaseCell.swift */; }; F939C04AD4003BA127F15C28 /* Pods_Veloria.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 34F57E87E765BF8D72A43DCA /* Pods_Veloria.framework */; }; /* End PBXBuildFile section */ @@ -403,6 +412,15 @@ BFF5B2472DF051D90044227A /* AppDelegate+Thirdparty.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AppDelegate+Thirdparty.swift"; sourceTree = ""; }; BFF5B2492DF0524D0044227A /* AppDelegate+Open.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AppDelegate+Open.swift"; sourceTree = ""; }; BFF5B24B2DF052E80044227A /* VPLoginManager+fb.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "VPLoginManager+fb.swift"; sourceTree = ""; }; + BFF5B24D2DF128B30044227A /* VPRechargeRecordModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPRechargeRecordModel.swift; sourceTree = ""; }; + BFF5B24F2DF12FBC0044227A /* VPConsumptionRecordsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPConsumptionRecordsViewController.swift; sourceTree = ""; }; + BFF5B2512DF130E00044227A /* VPConsumptionRecordsCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPConsumptionRecordsCell.swift; sourceTree = ""; }; + BFF5B2532DF132540044227A /* VPConsumptionRecordsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPConsumptionRecordsModel.swift; sourceTree = ""; }; + BFF5B2552DF139200044227A /* VPGiveCoinRecordsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPGiveCoinRecordsViewController.swift; sourceTree = ""; }; + BFF5B2572DF13A9C0044227A /* VPGiveCoinRecordModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPGiveCoinRecordModel.swift; sourceTree = ""; }; + BFF5B2592DF13BE50044227A /* VPGiveCoinRecordsCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPGiveCoinRecordsCell.swift; sourceTree = ""; }; + BFF5B25B2DF13F850044227A /* Date+VPAdd.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Date+VPAdd.swift"; sourceTree = ""; }; + BFF5B25D2DF1423F0044227A /* VPWalletBaseCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPWalletBaseCell.swift; sourceTree = ""; }; E0BDA3570E00C90877E45AA0 /* Pods-VideoPlayer.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-VideoPlayer.debug.xcconfig"; path = "Target Support Files/Pods-VideoPlayer/Pods-VideoPlayer.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -608,6 +626,7 @@ BF0FA7402DDEFBC700C9E5F2 /* UIScrollView+VPRefresh.swift */, BF0FA77A2DE0788A00C9E5F2 /* UIStackView+VPAdd.swift */, BF0FA7A42DE4384100C9E5F2 /* AttributedString+VPAdd.swift */, + BFF5B25B2DF13F850044227A /* Date+VPAdd.swift */, ); path = Extension; sourceTree = ""; @@ -1069,6 +1088,8 @@ BFF5AFCB2DE98C7F0044227A /* VPOrderRecordsViewController.swift */, BFF5AFCD2DE99C730044227A /* VPCoinRecordViewController.swift */, BFF5AFD12DE9A58A0044227A /* VPVIPRecordViewController.swift */, + BFF5B24F2DF12FBC0044227A /* VPConsumptionRecordsViewController.swift */, + BFF5B2552DF139200044227A /* VPGiveCoinRecordsViewController.swift */, ); path = Controller; sourceTree = ""; @@ -1081,8 +1102,11 @@ BFF5AFC72DE9473B0044227A /* VPCoinsBuyCell.swift */, BFF5AFD52DE9A8D70044227A /* VPWalletHeaderView.swift */, BFF5AFD72DE9B8010044227A /* VPWalletHeaderItemView.swift */, + BFF5B25D2DF1423F0044227A /* VPWalletBaseCell.swift */, BFF5AFCF2DE9A0370044227A /* VPCoinRecordCell.swift */, BFF5AFD32DE9A5FB0044227A /* VPVIPRecordCell.swift */, + BFF5B2512DF130E00044227A /* VPConsumptionRecordsCell.swift */, + BFF5B2592DF13BE50044227A /* VPGiveCoinRecordsCell.swift */, ); path = View; sourceTree = ""; @@ -1092,6 +1116,9 @@ children = ( BFF5AFBF2DE837D60044227A /* VPPayTemplateModel.swift */, BFF5AFC12DE837FC0044227A /* VPPayTemplateItem.swift */, + BFF5B24D2DF128B30044227A /* VPRechargeRecordModel.swift */, + BFF5B2532DF132540044227A /* VPConsumptionRecordsModel.swift */, + BFF5B2572DF13A9C0044227A /* VPGiveCoinRecordModel.swift */, ); path = Model; sourceTree = ""; @@ -1272,6 +1299,7 @@ files = ( 1B056E742DDB2DD7007EE38D /* UIView+VPAdd.swift in Sources */, BF0FA6F12DDC600200C9E5F2 /* VPNetwork.swift in Sources */, + BFF5B25A2DF13BE50044227A /* VPGiveCoinRecordsCell.swift in Sources */, BF0FA7502DDF0A9900C9E5F2 /* VPVideoPlayerCell.swift in Sources */, BF5E75B62DE46DB600DE9DFE /* UIScrollView+Empty.swift in Sources */, 1B056E572DDACC6B007EE38D /* VPHomePageViewController.swift in Sources */, @@ -1306,6 +1334,7 @@ BF0FA7302DDEBB1600C9E5F2 /* UIButton+VPAdd.swift in Sources */, BF0FA74C2DDF060200C9E5F2 /* VPVideoPlayerViewController.swift in Sources */, BF0FA79B2DE1984B00C9E5F2 /* VPCollectListViewController.swift in Sources */, + BFF5B25C2DF13F850044227A /* Date+VPAdd.swift in Sources */, BF0FA7A32DE1AB1800C9E5F2 /* VPWatchHistoryCell.swift in Sources */, BFF5B24C2DF052E80044227A /* VPLoginManager+fb.swift in Sources */, BF0FA76D2DE053C100C9E5F2 /* VPScrollView.swift in Sources */, @@ -1345,6 +1374,7 @@ BFF5B2342DEFF2030044227A /* VPDeleteAccountTipView.swift in Sources */, BF5E75D32DE5692D00DE9DFE /* JXBaseAnimatedTransition.swift in Sources */, 1B056E462DDAC370007EE38D /* UIScreen+VPAdd.swift in Sources */, + BFF5B24E2DF128B30044227A /* VPRechargeRecordModel.swift in Sources */, BFF5AFDE2DEEBF370044227A /* VPPlayerRechargeView.swift in Sources */, BFF5AFAA2DE7070A0044227A /* VPMeCoinItemView.swift in Sources */, BF0FA7692DE0502900C9E5F2 /* VPEpisodeCell.swift in Sources */, @@ -1368,7 +1398,9 @@ BF0FA75F2DDFFDB000C9E5F2 /* VPDetailPlayerViewController.swift in Sources */, BFF5AFCE2DE99C730044227A /* VPCoinRecordViewController.swift in Sources */, BF0FA7732DE0671200C9E5F2 /* VPRateSelectedCell.swift in Sources */, + BFF5B25E2DF1423F0044227A /* VPWalletBaseCell.swift in Sources */, 1B056E4D2DDAC7C1007EE38D /* VPTabBarController.swift in Sources */, + BFF5B2522DF130E00044227A /* VPConsumptionRecordsCell.swift in Sources */, BFF5AFDC2DEEA09F0044227A /* VPVideoUnlockModel.swift in Sources */, BF5E75C02DE5566200DE9DFE /* VPHomePageControlView.swift in Sources */, BFF5AFC22DE837FC0044227A /* VPPayTemplateItem.swift in Sources */, @@ -1389,12 +1421,14 @@ BF0FA7912DE16CBF00C9E5F2 /* VPSearchHistoryView.swift in Sources */, BFF5AFE22DEED2960044227A /* VPPlayerCoinBuyView.swift in Sources */, BFF5B2272DEF022F0044227A /* VPThirdSignModel.swift in Sources */, + BFF5B2582DF13A9C0044227A /* VPGiveCoinRecordModel.swift in Sources */, BFF5B22A2DEFDDF10044227A /* VPMeFooterView.swift in Sources */, BF0FA7992DE1951A00C9E5F2 /* VPMyListViewController.swift in Sources */, BF0FA7452DDF027900C9E5F2 /* VPPlayer.swift in Sources */, BFF5AFC62DE863C00044227A /* VPGradientButton.swift in Sources */, BFF5AFA82DE704DC0044227A /* VPMeCoinCell.swift in Sources */, BFF5AFAE2DE717BB0044227A /* VPVipPageViewController.swift in Sources */, + BFF5B2502DF12FBC0044227A /* VPConsumptionRecordsViewController.swift in Sources */, BF0FA70E2DDC6ACC00C9E5F2 /* VPHomeItemContentCell.swift in Sources */, BF0FA6D72DDC5BE100C9E5F2 /* VPURLPath.swift in Sources */, 1B056E5B2DDACD80007EE38D /* UIColor+VPAdd.swift in Sources */, @@ -1413,6 +1447,7 @@ BF0FA76F2DE062A700C9E5F2 /* VPRateSelectedView.swift in Sources */, BF0FA7772DE0735800C9E5F2 /* VPSearchInputView.swift in Sources */, BFF5AFB62DE803A30044227A /* VPVipPrivilegeItemView.swift in Sources */, + BFF5B2542DF132540044227A /* VPConsumptionRecordsModel.swift in Sources */, BFF5AFB82DE832580044227A /* VPVipBuyCell.swift in Sources */, BFF5B22E2DEFEEAF0044227A /* VPDeleteAccountContentView.swift in Sources */, BFF5B2252DEF02080044227A /* VPLoginManager+Apple.swift in Sources */, @@ -1428,6 +1463,7 @@ 1B056E442DDAC355007EE38D /* UIDevice+VPAdd.swift in Sources */, BF0FA7632DE006E700C9E5F2 /* VPDetailPlayerCell.swift in Sources */, BF0FA73F2DDEF26E00C9E5F2 /* VPHomeSearchButton.swift in Sources */, + BFF5B2562DF139200044227A /* VPGiveCoinRecordsViewController.swift in Sources */, 1B056E512DDACBE5007EE38D /* VPViewController.swift in Sources */, BF0FA7122DDC6D2C00C9E5F2 /* VPHomeModuleItem.swift in Sources */, BFF5B2482DF051D90044227A /* AppDelegate+Thirdparty.swift in Sources */, diff --git a/Veloria/Base/Extension/Date+VPAdd.swift b/Veloria/Base/Extension/Date+VPAdd.swift new file mode 100644 index 0000000..49d3c8e --- /dev/null +++ b/Veloria/Base/Extension/Date+VPAdd.swift @@ -0,0 +1,18 @@ +// +// Date+VPAdd.swift +// Veloria +// +// Created by 湖南秦九 on 2025/6/5. +// + +import UIKit + +extension Date { + + ///相差天数 + func differenceDay(date: Date) -> Int { + let dateComponents = Calendar.current.dateComponents([.day], from: self, to: date) + return dateComponents.day ?? 0 + } + +} diff --git a/Veloria/Base/Networking/API/VPWalletAPI.swift b/Veloria/Base/Networking/API/VPWalletAPI.swift index aaeba1f..9ca9e2f 100644 --- a/Veloria/Base/Networking/API/VPWalletAPI.swift +++ b/Veloria/Base/Networking/API/VPWalletAPI.swift @@ -38,4 +38,46 @@ class VPWalletAPI { completer?(response.data) } } + + ///充值记录 + static func requestRechargeRecord(buyType: BuyType, page: Int, completer: ((_ listModel: VPListModel?) -> Void)?) { + var param = VPNetworkParameters(path: "/getCustomerOrder") + param.method = .get + param.parameters = [ + "page_size" : 20, + "current_page" : page, + "buy_type" : buyType.rawValue + ] + + VPNetwork.request(parameters: param) { (response: VPNetworkResponse>) in + completer?(response.data) + } + } + + ///消费记录 + static func requestConsumptionRecords(page: Int, completer: ((_ listModel: VPListModel?) -> Void)?) { + var param = VPNetworkParameters(path: "/getCustomerBuyRecords") + param.method = .get + param.parameters = [ + "page_size" : 20, + "current_page" : page, + ] + + VPNetwork.request(parameters: param) { (response: VPNetworkResponse>) in + completer?(response.data) + } + } + + ///赠币记录 + static func reuqestGiveCoinRecords(page: Int, completer: ((_ listModel: VPListModel?) -> Void)?) { + + var param = VPNetworkParameters(path: "/sendCoinList") + param.parameters = [ + "page_size" : 20, + "current_page" : page + ] + VPNetwork.request(parameters: param) { (response: VPNetworkResponse>) in + completer?(response.data) + } + } } diff --git a/Veloria/Base/Networking/Base/VPNetwork.swift b/Veloria/Base/Networking/Base/VPNetwork.swift index 254ffce..081788c 100644 --- a/Veloria/Base/Networking/Base/VPNetwork.swift +++ b/Veloria/Base/Networking/Base/VPNetwork.swift @@ -149,13 +149,10 @@ class VPNetwork: NSObject { static private func _deserialize(data: String) -> VPNetworkResponse { var response: VPNetworkResponse? - let time = Date().timeIntervalSince1970 let decrypted = VPCryptorService.decrypt(data: data) vpLog(message: decrypted) response = VPNetworkResponse.deserialize(from: decrypted) response?.rawData = decrypted - - vpLog(message: Date().timeIntervalSince1970 - time) if let response = response { return response diff --git a/Veloria/Class/Wallet/Controller/VPCoinRecordViewController.swift b/Veloria/Class/Wallet/Controller/VPCoinRecordViewController.swift index 0fab73f..8317c1c 100644 --- a/Veloria/Class/Wallet/Controller/VPCoinRecordViewController.swift +++ b/Veloria/Class/Wallet/Controller/VPCoinRecordViewController.swift @@ -10,6 +10,9 @@ import UIKit class VPCoinRecordViewController: VPViewController { + private lazy var dataArr: [VPRechargeRecordModel] = [] + private lazy var page = 1 + private lazy var lineView: UIView = { let view = UIView() view.backgroundColor = .colorFFFFFF(alpha: 0.1) @@ -20,8 +23,14 @@ class VPCoinRecordViewController: VPViewController { let tableView = VPTableView(frame: .zero, style: .plain) tableView.delegate = self tableView.dataSource = self + tableView.rowHeight = 80 + tableView.separatorStyle = .none tableView.contentInset = .init(top: 0, left: 0, bottom: UIScreen.tabbarSafeBottomMargin + 10, right: 0) tableView.showsVerticalScrollIndicator = false + tableView.vp_addRefreshBackFooter(insetBottom: tableView.contentInset.bottom) { [weak self] in + self?.handleFooterRefresh(nil) + } + tableView.vp_addNormalEmpty() tableView.register(VPCoinRecordCell.self, forCellReuseIdentifier: "cell") return tableView }() @@ -33,16 +42,26 @@ class VPCoinRecordViewController: VPViewController { self.view.backgroundColor = .clear vp_setupUI() + + requestDataList(page: 1, completer: nil) } + override func handleHeaderRefresh(_ completer: (() -> Void)?) { + requestDataList(page: 1, completer: completer) + } + override func handleFooterRefresh(_ completer: (() -> Void)?) { + requestDataList(page: self.page + 1) { [weak self] in + self?.tableView.vp_endFooterRefreshing() + } + } } extension VPCoinRecordViewController { private func vp_setupUI() { - view.addSubview(lineView) view.addSubview(tableView) + view.addSubview(lineView) lineView.snp.makeConstraints { make in make.left.equalToSuperview().offset(15) @@ -66,18 +85,15 @@ extension VPCoinRecordViewController: UITableViewDelegate, UITableViewDataSource func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! VPCoinRecordCell + cell.model = dataArr[indexPath.row] + cell.isRadius = indexPath.row == self.dataArr.count - 1 return cell } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return 20 + return self.dataArr.count } -// func scrollViewDidScroll(_ scrollView: UIScrollView) { -// if scrollView.contentOffset.y < 0 { -// scrollView.contentOffset = .init(x: 0, y: 0) -// } -// } } @@ -88,3 +104,24 @@ extension VPCoinRecordViewController: WMZPageProtocol { } } + +extension VPCoinRecordViewController { + + private func requestDataList(page: Int, completer: (() -> Void)?) { + VPWalletAPI.requestRechargeRecord(buyType: .coins, page: page) { [weak self] listModel in + guard let self = self else { return } + + if let list = listModel?.list { + if page == 1 { + self.dataArr.removeAll() + } + self.dataArr += list + self.page = page + self.tableView.reloadData() + } + + completer?() + } + } + +} diff --git a/Veloria/Class/Wallet/Controller/VPConsumptionRecordsViewController.swift b/Veloria/Class/Wallet/Controller/VPConsumptionRecordsViewController.swift new file mode 100644 index 0000000..5f23ef0 --- /dev/null +++ b/Veloria/Class/Wallet/Controller/VPConsumptionRecordsViewController.swift @@ -0,0 +1,121 @@ +// +// VPConsumptionRecordsViewController.swift +// Veloria +// +// Created by 湖南秦九 on 2025/6/5. +// + +import UIKit + +class VPConsumptionRecordsViewController: VPViewController { + + private lazy var dataArr: [VPConsumptionRecordsModel] = [] + private lazy var page: Int = 1 + + private lazy var lineView: UIView = { + let view = UIView() + view.backgroundColor = .colorFFFFFF(alpha: 0.1) + return view + }() + + private lazy var tableView: VPTableView = { + let tableView = VPTableView(frame: .zero, style: .plain) + tableView.delegate = self + tableView.dataSource = self + tableView.rowHeight = 80 + tableView.separatorStyle = .none + tableView.contentInset = .init(top: 0, left: 0, bottom: UIScreen.tabbarSafeBottomMargin + 10, right: 0) + tableView.showsVerticalScrollIndicator = false + tableView.vp_addRefreshBackFooter(insetBottom: tableView.contentInset.bottom) { [weak self] in + self?.handleFooterRefresh(nil) + } + tableView.vp_addNormalEmpty() + tableView.register(VPConsumptionRecordsCell.self, forCellReuseIdentifier: "cell") + return tableView + }() + + override func viewDidLoad() { + super.viewDidLoad() + self.bgImageView.isHidden = true + self.view.backgroundColor = .clear + + vp_setupUI() + + requestDataList(page: 1, completer: nil) + } + + override func handleHeaderRefresh(_ completer: (() -> Void)?) { + requestDataList(page: 1, completer: completer) + } + + override func handleFooterRefresh(_ completer: (() -> Void)?) { + requestDataList(page: self.page + 1) { [weak self] in + self?.tableView.vp_endFooterRefreshing() + } + } +} + +extension VPConsumptionRecordsViewController { + + private func vp_setupUI() { + view.addSubview(tableView) + view.addSubview(lineView) + + lineView.snp.makeConstraints { make in + make.left.equalToSuperview().offset(15) + make.right.equalToSuperview().offset(-15) + make.top.equalToSuperview() + make.height.equalTo(0.5) + } + + tableView.snp.makeConstraints { make in + make.left.equalToSuperview().offset(15) + make.centerX.equalToSuperview() + make.top.equalToSuperview() + make.bottom.equalToSuperview() + } + } + +} + +//MARK: -------------- UITableViewDelegate UITableViewDataSource -------------- +extension VPConsumptionRecordsViewController: UITableViewDelegate, UITableViewDataSource { + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! VPConsumptionRecordsCell + cell.model = dataArr[indexPath.row] + cell.isRadius = indexPath.row == self.dataArr.count - 1 + return cell + } + + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return self.dataArr.count + } + +} + +//MARK: -------------- WMZPageProtocol -------------- +extension VPConsumptionRecordsViewController: WMZPageProtocol { + func getMyScrollView() -> UIScrollView { + self.tableView + } +} + +extension VPConsumptionRecordsViewController { + + private func requestDataList(page: Int, completer: (() -> Void)?) { + VPWalletAPI.requestConsumptionRecords(page: page) { [weak self] listModel in + guard let self = self else { return } + + if let list = listModel?.list { + if page == 1 { + self.dataArr.removeAll() + } + self.dataArr += list + self.page = page + self.tableView.reloadData() + } + completer?() + } + } + +} diff --git a/Veloria/Class/Wallet/Controller/VPGiveCoinRecordsViewController.swift b/Veloria/Class/Wallet/Controller/VPGiveCoinRecordsViewController.swift new file mode 100644 index 0000000..d9fe269 --- /dev/null +++ b/Veloria/Class/Wallet/Controller/VPGiveCoinRecordsViewController.swift @@ -0,0 +1,122 @@ +// +// VPGiveCoinRecordsViewController.swift +// Veloria +// +// Created by 湖南秦九 on 2025/6/5. +// + +import UIKit + +class VPGiveCoinRecordsViewController: VPViewController { + + private lazy var dataArr: [VPGiveCoinRecordModel] = [] + private lazy var page: Int = 1 + + private lazy var lineView: UIView = { + let view = UIView() + view.backgroundColor = .colorFFFFFF(alpha: 0.1) + return view + }() + + private lazy var tableView: VPTableView = { + let tableView = VPTableView(frame: .zero, style: .plain) + tableView.delegate = self + tableView.dataSource = self + tableView.rowHeight = 80 + tableView.separatorStyle = .none + tableView.contentInset = .init(top: 0, left: 0, bottom: UIScreen.tabbarSafeBottomMargin + 10, right: 0) + tableView.showsVerticalScrollIndicator = false + tableView.vp_addRefreshBackFooter(insetBottom: tableView.contentInset.bottom) { [weak self] in + self?.handleFooterRefresh(nil) + } + tableView.register(VPGiveCoinRecordsCell.self, forCellReuseIdentifier: "cell") + return tableView + }() + + override func viewDidLoad() { + super.viewDidLoad() + self.bgImageView.isHidden = true + self.view.backgroundColor = .clear + + vp_setupUI() + + requestDataList(page: 1, completer: nil) + } + + override func handleHeaderRefresh(_ completer: (() -> Void)?) { + requestDataList(page: 1, completer: completer) + } + + override func handleFooterRefresh(_ completer: (() -> Void)?) { + requestDataList(page: self.page + 1) { [weak self] in + self?.tableView.vp_endFooterRefreshing() + } + } + +} + +extension VPGiveCoinRecordsViewController { + + private func vp_setupUI() { + view.addSubview(tableView) + view.addSubview(lineView) + + lineView.snp.makeConstraints { make in + make.left.equalToSuperview().offset(15) + make.right.equalToSuperview().offset(-15) + make.top.equalToSuperview() + make.height.equalTo(0.5) + } + + tableView.snp.makeConstraints { make in + make.left.equalToSuperview().offset(15) + make.centerX.equalToSuperview() + make.top.equalToSuperview() + make.bottom.equalToSuperview() + } + } + +} + +//MARK: -------------- UITableViewDelegate UITableViewDataSource -------------- +extension VPGiveCoinRecordsViewController: UITableViewDelegate, UITableViewDataSource { + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! VPGiveCoinRecordsCell + cell.model = dataArr[indexPath.row] + cell.isRadius = indexPath.row == self.dataArr.count - 1 + return cell + } + + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return self.dataArr.count + } + +} + +//MARK: -------------- WMZPageProtocol -------------- +extension VPGiveCoinRecordsViewController: WMZPageProtocol { + func getMyScrollView() -> UIScrollView { + self.tableView + } +} + +extension VPGiveCoinRecordsViewController { + + private func requestDataList(page: Int, completer: (() -> Void)?) { + VPWalletAPI.reuqestGiveCoinRecords(page: page) { [weak self] listModel in + guard let self = self else { return } + + if let list = listModel?.list { + if page == 1 { + self.dataArr.removeAll() + } + self.dataArr += list + self.page = page + self.tableView.reloadData() + } + self.tableView.vp_addNormalEmpty() + completer?() + } + } + +} diff --git a/Veloria/Class/Wallet/Controller/VPOrderRecordsViewController.swift b/Veloria/Class/Wallet/Controller/VPOrderRecordsViewController.swift index 683fdcf..4ad22ef 100644 --- a/Veloria/Class/Wallet/Controller/VPOrderRecordsViewController.swift +++ b/Veloria/Class/Wallet/Controller/VPOrderRecordsViewController.swift @@ -81,6 +81,10 @@ class VPOrderRecordsViewController: WMZPageController { super.viewDidLayoutSubviews() self.view.sendSubviewToBack(menuBgView) } + + func handleHeaderRefresh(_ completer: (() -> Void)?) { + (self.upSc.currentVC as? VPViewController)?.handleHeaderRefresh(completer) + } } diff --git a/Veloria/Class/Wallet/Controller/VPVIPRecordViewController.swift b/Veloria/Class/Wallet/Controller/VPVIPRecordViewController.swift index ca06279..cc117d6 100644 --- a/Veloria/Class/Wallet/Controller/VPVIPRecordViewController.swift +++ b/Veloria/Class/Wallet/Controller/VPVIPRecordViewController.swift @@ -9,6 +9,9 @@ import UIKit class VPVIPRecordViewController: VPViewController { + private lazy var dataArr: [VPRechargeRecordModel] = [] + private lazy var page = 1 + private lazy var lineView: UIView = { let view = UIView() view.backgroundColor = .colorFFFFFF(alpha: 0.1) @@ -19,8 +22,14 @@ class VPVIPRecordViewController: VPViewController { let tableView = VPTableView(frame: .zero, style: .plain) tableView.delegate = self tableView.dataSource = self + tableView.rowHeight = 80 + tableView.separatorStyle = .none tableView.contentInset = .init(top: 0, left: 0, bottom: UIScreen.tabbarSafeBottomMargin + 10, right: 0) tableView.showsVerticalScrollIndicator = false + tableView.vp_addRefreshBackFooter(insetBottom: tableView.contentInset.bottom) { [weak self] in + self?.handleFooterRefresh(nil) + } + tableView.vp_addNormalEmpty() tableView.register(VPVIPRecordCell.self, forCellReuseIdentifier: "cell") return tableView }() @@ -31,6 +40,18 @@ class VPVIPRecordViewController: VPViewController { self.view.backgroundColor = .clear vp_setupUI() + + requestDataList(page: 1, completer: nil) + } + + override func handleHeaderRefresh(_ completer: (() -> Void)?) { + requestDataList(page: 1, completer: completer) + } + + override func handleFooterRefresh(_ completer: (() -> Void)?) { + requestDataList(page: self.page + 1) { [weak self] in + self?.tableView.vp_endFooterRefreshing() + } } } @@ -38,8 +59,8 @@ class VPVIPRecordViewController: VPViewController { extension VPVIPRecordViewController { private func vp_setupUI() { - view.addSubview(lineView) view.addSubview(tableView) + view.addSubview(lineView) lineView.snp.makeConstraints { make in make.left.equalToSuperview().offset(15) @@ -63,18 +84,15 @@ extension VPVIPRecordViewController: UITableViewDelegate, UITableViewDataSource func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! VPVIPRecordCell + cell.model = dataArr[indexPath.row] + cell.isRadius = indexPath.row == self.dataArr.count - 1 return cell } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return 10 + return dataArr.count } -// func scrollViewDidScroll(_ scrollView: UIScrollView) { -// if scrollView.contentOffset.y < 0 { -// scrollView.contentOffset = .init(x: 0, y: 0) -// } -// } } @@ -84,3 +102,23 @@ extension VPVIPRecordViewController: WMZPageProtocol { self.tableView } } + +extension VPVIPRecordViewController { + + private func requestDataList(page: Int, completer: (() -> Void)?) { + VPWalletAPI.requestRechargeRecord(buyType: .subVip, page: page) { [weak self] listModel in + guard let self = self else { return } + + if let list = listModel?.list { + if page == 1 { + self.dataArr.removeAll() + } + self.dataArr += list + self.page = page + self.tableView.reloadData() + } + completer?() + } + } + +} diff --git a/Veloria/Class/Wallet/Controller/VPWalletViewController.swift b/Veloria/Class/Wallet/Controller/VPWalletViewController.swift index 5213ec0..060b101 100644 --- a/Veloria/Class/Wallet/Controller/VPWalletViewController.swift +++ b/Veloria/Class/Wallet/Controller/VPWalletViewController.swift @@ -13,8 +13,8 @@ class VPWalletViewController: WMZPageController { private lazy var viewControllers: [UIViewController] = { let vc1 = VPOrderRecordsViewController() - let vc2 = VPViewController() - let vc3 = VPViewController() + let vc2 = VPConsumptionRecordsViewController() + let vc3 = VPGiveCoinRecordsViewController() return [vc1, vc2, vc3] }() @@ -136,13 +136,29 @@ class VPWalletViewController: WMZPageController { } view.sendSubviewToBack(bgImageView) } - + + func handleHeaderRefresh() { + + if let vc = self.upSc.currentVC as? VPViewController { + vc.handleHeaderRefresh { [weak self] in + self?.downSc?.vp_endHeaderRefreshing() + } + } else if let vc = self.upSc.currentVC as? VPOrderRecordsViewController { + vc.handleHeaderRefresh { [weak self] in + self?.downSc?.vp_endHeaderRefreshing() + } + } + } } extension VPWalletViewController { private func vp_setupUI() { + self.downSc?.vp_addRefreshHeader(block: { [weak self] in + self?.handleHeaderRefresh() + }) + view.addSubview(bgImageView) view.sendSubviewToBack(bgImageView) diff --git a/Veloria/Class/Wallet/Model/VPConsumptionRecordsModel.swift b/Veloria/Class/Wallet/Model/VPConsumptionRecordsModel.swift new file mode 100644 index 0000000..4ad13f7 --- /dev/null +++ b/Veloria/Class/Wallet/Model/VPConsumptionRecordsModel.swift @@ -0,0 +1,21 @@ +// +// VPConsumptionRecordsModel.swift +// Veloria +// +// Created by 湖南秦九 on 2025/6/5. +// + +import UIKit +import SmartCodable + +class VPConsumptionRecordsModel: VPModel, SmartCodable { + + var created_at: String? + var short_play_id: String? + var coins: Int? + var image_url: String? + var name: String? + var coin_type: Int? + var short_play_video_id: String? + var episode: String? +} diff --git a/Veloria/Class/Wallet/Model/VPGiveCoinRecordModel.swift b/Veloria/Class/Wallet/Model/VPGiveCoinRecordModel.swift new file mode 100644 index 0000000..beb7cb8 --- /dev/null +++ b/Veloria/Class/Wallet/Model/VPGiveCoinRecordModel.swift @@ -0,0 +1,20 @@ +// +// VPGiveCoinRecordModel.swift +// Veloria +// +// Created by 湖南秦九 on 2025/6/5. +// + +import UIKit +import SmartCodable + +class VPGiveCoinRecordModel: VPModel, SmartCodable { + + var id: String? + var type: String? + var coins: Int? + var left_coins: String? + var created_at: String? + var diff_datetime: String? + var expired_time: TimeInterval? +} diff --git a/Veloria/Class/Wallet/Model/VPPayTemplateItem.swift b/Veloria/Class/Wallet/Model/VPPayTemplateItem.swift index bba26ea..843782e 100644 --- a/Veloria/Class/Wallet/Model/VPPayTemplateItem.swift +++ b/Veloria/Class/Wallet/Model/VPPayTemplateItem.swift @@ -44,23 +44,24 @@ class VPPayTemplateItem: VPModel, SmartCodable { ///coins sub_vip var buy_type: VPWalletAPI.BuyType? - var sort: String? - var title: String? - var brief: String? - var sp_description: String? - var vip_type: String? var vip_type_key: VipTypeKey? + var sort: String? + var sp_description: String? + var brief: String? + var title: String? + + var ios_template_id: String? - ///货币符号 - var currency: String? - ///平台 - var platform: String? ///角标 var corner_marker: String? + ///平台 + var platform: String? + ///货币符号 + var currency: String? static func mappingForKey() -> [SmartKeyTransformer]? { diff --git a/Veloria/Class/Wallet/Model/VPRechargeRecordModel.swift b/Veloria/Class/Wallet/Model/VPRechargeRecordModel.swift new file mode 100644 index 0000000..7eeae01 --- /dev/null +++ b/Veloria/Class/Wallet/Model/VPRechargeRecordModel.swift @@ -0,0 +1,17 @@ +// +// VPRechargeRecordModel.swift +// Veloria +// +// Created by 湖南秦九 on 2025/6/5. +// + +import UIKit +import SmartCodable + +class VPRechargeRecordModel: VPModel, SmartCodable { + + var type: String? + var created_at: String? + var value: String? + +} diff --git a/Veloria/Class/Wallet/View/VPCoinRecordCell.swift b/Veloria/Class/Wallet/View/VPCoinRecordCell.swift index 483c651..99c43da 100644 --- a/Veloria/Class/Wallet/View/VPCoinRecordCell.swift +++ b/Veloria/Class/Wallet/View/VPCoinRecordCell.swift @@ -7,14 +7,47 @@ import UIKit -class VPCoinRecordCell: VPTableViewCell { +class VPCoinRecordCell: VPWalletBaseCell { + var model: VPRechargeRecordModel? { + didSet { + coinCountLabel.text = "+\(model?.value ?? "0")" + timeLabel.text = model?.created_at + } + } + private lazy var titleLabel: UILabel = { + let label = UILabel() + label.font = .fontRegular(ofSize: 14) + label.textColor = .colorFFFFFF(alpha: 0.9) + label.text = "Recharge Coins".localized + return label + }() + + private lazy var coinCountLabel: UILabel = { + let label = UILabel() + label.font = .fontMedium(ofSize: 15) + label.textColor = .color05CEA0() + return label + }() + + private lazy var coinIconImageView: UIImageView = { + let imageView = UIImageView(image: UIImage(named: "coin_icon_07")) + return imageView + }() + + private lazy var timeLabel: UILabel = { + let label = UILabel() + label.font = .fontRegular(ofSize: 11) + label.textColor = .colorFFFFFF(alpha: 0.6) + return label + }() + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { super.init(style: style, reuseIdentifier: reuseIdentifier) - contentView.backgroundColor = .colorFFFFFF(alpha: 0.1) + vp_setupUI() } @MainActor required init?(coder: NSCoder) { @@ -22,3 +55,36 @@ class VPCoinRecordCell: VPTableViewCell { } } + +extension VPCoinRecordCell { + + private func vp_setupUI() { + + contentView.addSubview(titleLabel) + contentView.addSubview(coinCountLabel) + contentView.addSubview(coinIconImageView) + contentView.addSubview(timeLabel) + + + titleLabel.snp.makeConstraints { make in + make.left.equalToSuperview().offset(12) + make.top.equalToSuperview().offset(11) + } + + coinCountLabel.snp.makeConstraints { make in + make.left.equalTo(titleLabel) + make.centerY.equalTo(coinIconImageView) + } + + coinIconImageView.snp.makeConstraints { make in + make.left.equalTo(coinCountLabel.snp.right).offset(2) + make.bottom.equalToSuperview().offset(-18) + } + + timeLabel.snp.makeConstraints { make in + make.centerY.equalTo(coinIconImageView) + make.right.equalToSuperview().offset(-10) + } + } + +} diff --git a/Veloria/Class/Wallet/View/VPConsumptionRecordsCell.swift b/Veloria/Class/Wallet/View/VPConsumptionRecordsCell.swift new file mode 100644 index 0000000..bd4c207 --- /dev/null +++ b/Veloria/Class/Wallet/View/VPConsumptionRecordsCell.swift @@ -0,0 +1,107 @@ +// +// VPConsumptionRecordsCell.swift +// Veloria +// +// Created by 湖南秦九 on 2025/6/5. +// + +import UIKit + +class VPConsumptionRecordsCell: VPWalletBaseCell { + + var model: VPConsumptionRecordsModel? { + didSet { + timeLabel.text = model?.created_at + let episode = String(format: "EP.%@".localized, "\(model?.episode ?? "0")") + "\(model?.name ?? "")" + subtitleLabel.text = episode + coinCountLabel.text = "-\(model?.coins ?? 0)" + } + } + + + + private lazy var titleLabel: UILabel = { + let label = UILabel() + label.font = .fontMedium(ofSize: 14) + label.textColor = .colorFFFFFF(alpha: 0.9) + label.text = "Purchase Single Episode".localized + return label + }() + + private lazy var coinCountLabel: UILabel = { + let label = UILabel() + label.font = .fontMedium(ofSize: 15) + label.textColor = .color05CEA0() + return label + }() + + private lazy var coinIconImageView: UIImageView = { + let imageView = UIImageView(image: UIImage(named: "coin_icon_07")) + return imageView + }() + + private lazy var subtitleLabel: UILabel = { + let label = UILabel() + label.font = .fontRegular(ofSize: 12) + label.textColor = .colorFFFFFF(alpha: 0.6) + return label + }() + + private lazy var timeLabel: UILabel = { + let label = UILabel() + label.font = .fontRegular(ofSize: 11) + label.textColor = .colorFFFFFF(alpha: 0.6) + label.setContentHuggingPriority(.required, for: .horizontal) + label.setContentCompressionResistancePriority(.required, for: .horizontal) + return label + }() + + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + super.init(style: style, reuseIdentifier: reuseIdentifier) + + vp_setupUI() + } + + @MainActor required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + +} + +extension VPConsumptionRecordsCell { + private func vp_setupUI() { + contentView.addSubview(titleLabel) + contentView.addSubview(coinCountLabel) + contentView.addSubview(coinIconImageView) + contentView.addSubview(subtitleLabel) + contentView.addSubview(timeLabel) + + + titleLabel.snp.makeConstraints { make in + make.left.equalToSuperview().offset(11) + make.centerY.equalTo(coinIconImageView) + } + + coinCountLabel.snp.makeConstraints { make in + make.centerY.equalTo(coinIconImageView) + make.right.equalTo(coinIconImageView.snp.left).offset(-2) + } + + coinIconImageView.snp.makeConstraints { make in + make.right.equalToSuperview().offset(-11) + make.top.equalToSuperview().offset(18) + } + + subtitleLabel.snp.makeConstraints { make in + make.left.equalTo(titleLabel) + make.bottom.equalToSuperview().offset(-15) + make.right.lessThanOrEqualTo(timeLabel.snp.left).offset(-10) + } + + timeLabel.snp.makeConstraints { make in + make.right.equalToSuperview().offset(-11) + make.centerY.equalTo(subtitleLabel) + } + + } +} diff --git a/Veloria/Class/Wallet/View/VPGiveCoinRecordsCell.swift b/Veloria/Class/Wallet/View/VPGiveCoinRecordsCell.swift new file mode 100644 index 0000000..077d053 --- /dev/null +++ b/Veloria/Class/Wallet/View/VPGiveCoinRecordsCell.swift @@ -0,0 +1,113 @@ +// +// VPGiveCoinRecordsCell.swift +// Veloria +// +// Created by 湖南秦九 on 2025/6/5. +// + +import UIKit + +class VPGiveCoinRecordsCell: VPWalletBaseCell { + + var model: VPGiveCoinRecordModel? { + didSet { + titleLabel.text = model?.type + timeLabel.text = model?.created_at + coinCountLabel.text = "+\(model?.coins ?? 0)" + + let expireDate = Date(timeIntervalSince1970: model?.expired_time ?? 0) + let nowDate = Date() + let days = nowDate.differenceDay(date: expireDate) + + if days > 0 { + expiresLabel.text = String(format: "Expires in %@ days".localized, "\(days)") + } else { + expiresLabel.text = "Expired".localized + } + } + } + + + private lazy var titleLabel: UILabel = { + let label = UILabel() + label.font = .fontMedium(ofSize: 14) + label.textColor = .colorFFFFFF(alpha: 0.9) + return label + }() + + private lazy var expiresLabel: UILabel = { + let label = UILabel() + label.font = .fontRegular(ofSize: 12) + label.textColor = .colorFFFFFF(alpha: 0.6) + return label + }() + + private lazy var coinCountLabel: UILabel = { + let label = UILabel() + label.font = .fontMedium(ofSize: 15) + label.textColor = .color05CEA0() + return label + }() + + private lazy var coinIconImageView: UIImageView = { + let imageView = UIImageView(image: UIImage(named: "coin_icon_07")) + return imageView + }() + + private lazy var timeLabel: UILabel = { + let label = UILabel() + label.font = .fontRegular(ofSize: 11) + label.textColor = .colorFFFFFF(alpha: 0.6) + label.setContentHuggingPriority(.required, for: .horizontal) + label.setContentCompressionResistancePriority(.required, for: .horizontal) + return label + }() + + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + super.init(style: style, reuseIdentifier: reuseIdentifier) + vp_setupUI() + } + + @MainActor required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } +} + +extension VPGiveCoinRecordsCell { + + private func vp_setupUI() { + contentView.addSubview(titleLabel) + contentView.addSubview(expiresLabel) + contentView.addSubview(coinCountLabel) + contentView.addSubview(coinIconImageView) + contentView.addSubview(timeLabel) + + titleLabel.snp.makeConstraints { make in + make.left.equalToSuperview().offset(11) + make.centerY.equalTo(coinIconImageView) + } + + coinCountLabel.snp.makeConstraints { make in + make.right.equalTo(coinIconImageView.snp.left).offset(-2) + make.centerY.equalTo(coinIconImageView) + } + + coinIconImageView.snp.makeConstraints { make in + make.right.equalToSuperview().offset(-11) + make.top.equalToSuperview().offset(18) + } + + expiresLabel.snp.makeConstraints { make in + make.left.equalToSuperview().offset(11) + make.bottom.equalToSuperview().offset(-15) + } + + timeLabel.snp.makeConstraints { make in + make.right.equalToSuperview().offset(-11) + make.centerY.equalTo(expiresLabel) + } + + + } + +} diff --git a/Veloria/Class/Wallet/View/VPVIPRecordCell.swift b/Veloria/Class/Wallet/View/VPVIPRecordCell.swift index 796df08..c5c8fa2 100644 --- a/Veloria/Class/Wallet/View/VPVIPRecordCell.swift +++ b/Veloria/Class/Wallet/View/VPVIPRecordCell.swift @@ -7,12 +7,60 @@ import UIKit -class VPVIPRecordCell: VPTableViewCell { +class VPVIPRecordCell: VPWalletBaseCell { + + var model: VPRechargeRecordModel? { + didSet { + dayLabel.text = model?.value + timeLabel.text = model?.created_at + } + } + + + private lazy var titleLabel: UILabel = { + let label = UILabel() + label.font = .fontRegular(ofSize: 14) + label.textColor = .colorFFFFFF(alpha: 0.9) + label.text = "Purchase VIP".localized + return label + }() + + private lazy var dayLabel: UILabel = { + let label = UILabel() + label.font = .fontMedium(ofSize: 15) + label.textColor = .color05CEA0() + return label + }() + + private lazy var timeLabel: UILabel = { + let label = UILabel() + label.font = .fontRegular(ofSize: 11) + label.textColor = .colorFFFFFF(alpha: 0.6) + return label + }() override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { super.init(style: style, reuseIdentifier: reuseIdentifier) - contentView.backgroundColor = .colorFFFFFF(alpha: 0.1) + contentView.addSubview(titleLabel) + contentView.addSubview(dayLabel) + contentView.addSubview(timeLabel) + + + titleLabel.snp.makeConstraints { make in + make.left.equalToSuperview().offset(12) + make.top.equalToSuperview().offset(11) + } + + dayLabel.snp.makeConstraints { make in + make.left.equalTo(titleLabel) + make.bottom.equalToSuperview().offset(-14) + } + + timeLabel.snp.makeConstraints { make in + make.centerY.equalTo(dayLabel) + make.right.equalToSuperview().offset(-10) + } } @MainActor required init?(coder: NSCoder) { diff --git a/Veloria/Class/Wallet/View/VPWalletBaseCell.swift b/Veloria/Class/Wallet/View/VPWalletBaseCell.swift new file mode 100644 index 0000000..84b418f --- /dev/null +++ b/Veloria/Class/Wallet/View/VPWalletBaseCell.swift @@ -0,0 +1,32 @@ +// +// VPWalletBaseCell.swift +// Veloria +// +// Created by 湖南秦九 on 2025/6/5. +// + +import UIKit + +class VPWalletBaseCell: VPTableViewCell { + + var isRadius = false { + didSet { + if isRadius { + contentView.addRadius(topLeft: 0, topRight: 0, bottomLeft: 8, bottomRight: 8) + } else { + contentView.addRadius(topLeft: 0, topRight: 0, bottomLeft: 0, bottomRight: 0) + } + } + } + + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + super.init(style: style, reuseIdentifier: reuseIdentifier) + + contentView.backgroundColor = .colorFFFFFF(alpha: 0.1) + } + + @MainActor required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + +} diff --git a/Veloria/Source/en.lproj/Localizable.strings b/Veloria/Source/en.lproj/Localizable.strings index 0f0d85e..e8be9ea 100644 --- a/Veloria/Source/en.lproj/Localizable.strings +++ b/Veloria/Source/en.lproj/Localizable.strings @@ -78,7 +78,12 @@ "Delete Forever" = "Delete Forever"; "Cancel" = "Cancel"; "Log Out" = "Log Out"; - +"Recharge Coins" = "Recharge Coins"; +"Purchase VIP" = "Purchase VIP"; +"Purchase Single Episode" = "Purchase Single Episode"; +"Check in" = "Check in"; +"Expires in %@ days" = "Expires in 30 days"; +"Expired" = "Expired"; "kHomeTitleText" = "10,000+ addictive shorts await!"; "kSearchPlaceholderText1" = "Search dramas"; diff --git a/资料/授权文件.zip b/资料/授权文件.zip deleted file mode 100644 index 750a6c5..0000000 Binary files a/资料/授权文件.zip and /dev/null differ