diff --git a/Veloria.xcodeproj/project.pbxproj b/Veloria.xcodeproj/project.pbxproj index 8fbb835..5aa82d2 100644 --- a/Veloria.xcodeproj/project.pbxproj +++ b/Veloria.xcodeproj/project.pbxproj @@ -163,6 +163,14 @@ BFF5AFC42DE84F9C0044227A /* Aa厚底黑.ttf in Resources */ = {isa = PBXBuildFile; fileRef = BFF5AFC32DE84F9C0044227A /* Aa厚底黑.ttf */; }; BFF5AFC62DE863C00044227A /* VPGradientButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFF5AFC52DE863C00044227A /* VPGradientButton.swift */; }; BFF5AFC82DE9473B0044227A /* VPCoinsBuyCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFF5AFC72DE9473B0044227A /* VPCoinsBuyCell.swift */; }; + BFF5AFCA2DE97B7A0044227A /* VPWalletViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFF5AFC92DE97B7A0044227A /* VPWalletViewController.swift */; }; + BFF5AFCC2DE98C7F0044227A /* VPOrderRecordsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFF5AFCB2DE98C7F0044227A /* VPOrderRecordsViewController.swift */; }; + BFF5AFCE2DE99C730044227A /* VPCoinRecordViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFF5AFCD2DE99C730044227A /* VPCoinRecordViewController.swift */; }; + BFF5AFD02DE9A0370044227A /* VPCoinRecordCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFF5AFCF2DE9A0370044227A /* VPCoinRecordCell.swift */; }; + BFF5AFD22DE9A58A0044227A /* VPVIPRecordViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFF5AFD12DE9A58A0044227A /* VPVIPRecordViewController.swift */; }; + BFF5AFD42DE9A5FB0044227A /* VPVIPRecordCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFF5AFD32DE9A5FB0044227A /* VPVIPRecordCell.swift */; }; + BFF5AFD62DE9A8D70044227A /* VPWalletHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFF5AFD52DE9A8D70044227A /* VPWalletHeaderView.swift */; }; + BFF5AFD82DE9B8010044227A /* VPWalletHeaderItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFF5AFD72DE9B8010044227A /* VPWalletHeaderItemView.swift */; }; F939C04AD4003BA127F15C28 /* Pods_Veloria.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 34F57E87E765BF8D72A43DCA /* Pods_Veloria.framework */; }; /* End PBXBuildFile section */ @@ -332,6 +340,14 @@ BFF5AFC32DE84F9C0044227A /* Aa厚底黑.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Aa厚底黑.ttf"; sourceTree = ""; }; BFF5AFC52DE863C00044227A /* VPGradientButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPGradientButton.swift; sourceTree = ""; }; BFF5AFC72DE9473B0044227A /* VPCoinsBuyCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPCoinsBuyCell.swift; sourceTree = ""; }; + BFF5AFC92DE97B7A0044227A /* VPWalletViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPWalletViewController.swift; sourceTree = ""; }; + BFF5AFCB2DE98C7F0044227A /* VPOrderRecordsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPOrderRecordsViewController.swift; sourceTree = ""; }; + BFF5AFCD2DE99C730044227A /* VPCoinRecordViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPCoinRecordViewController.swift; sourceTree = ""; }; + BFF5AFCF2DE9A0370044227A /* VPCoinRecordCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPCoinRecordCell.swift; sourceTree = ""; }; + BFF5AFD12DE9A58A0044227A /* VPVIPRecordViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPVIPRecordViewController.swift; sourceTree = ""; }; + BFF5AFD32DE9A5FB0044227A /* VPVIPRecordCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPVIPRecordCell.swift; sourceTree = ""; }; + BFF5AFD52DE9A8D70044227A /* VPWalletHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPWalletHeaderView.swift; sourceTree = ""; }; + BFF5AFD72DE9B8010044227A /* VPWalletHeaderItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPWalletHeaderItemView.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 */ @@ -968,6 +984,10 @@ BFF5AFAD2DE717BB0044227A /* VPVipPageViewController.swift */, BFF5AFAF2DE7F9A80044227A /* VPVipViewController.swift */, BFF5AFB32DE7FF4E0044227A /* VPCoinsViewController.swift */, + BFF5AFC92DE97B7A0044227A /* VPWalletViewController.swift */, + BFF5AFCB2DE98C7F0044227A /* VPOrderRecordsViewController.swift */, + BFF5AFCD2DE99C730044227A /* VPCoinRecordViewController.swift */, + BFF5AFD12DE9A58A0044227A /* VPVIPRecordViewController.swift */, ); path = Controller; sourceTree = ""; @@ -978,6 +998,10 @@ BFF5AFB52DE803A30044227A /* VPVipPrivilegeItemView.swift */, BFF5AFB72DE832580044227A /* VPVipBuyCell.swift */, BFF5AFC72DE9473B0044227A /* VPCoinsBuyCell.swift */, + BFF5AFD52DE9A8D70044227A /* VPWalletHeaderView.swift */, + BFF5AFD72DE9B8010044227A /* VPWalletHeaderItemView.swift */, + BFF5AFCF2DE9A0370044227A /* VPCoinRecordCell.swift */, + BFF5AFD32DE9A5FB0044227A /* VPVIPRecordCell.swift */, ); path = View; sourceTree = ""; @@ -1156,6 +1180,7 @@ BF0FA73B2DDED1C700C9E5F2 /* VPHomeListCell.swift in Sources */, BF0FA79F2DE1A29A00C9E5F2 /* VPCollectListCell.swift in Sources */, BF0FA7592DDF1C2800C9E5F2 /* VPPlayerProgressView.swift in Sources */, + BFF5AFCA2DE97B7A0044227A /* VPWalletViewController.swift in Sources */, BF0FA71B2DDC7FF200C9E5F2 /* VPImageView.swift in Sources */, BF0FA7522DDF134700C9E5F2 /* VPVideoPlayerControlView.swift in Sources */, BF0FA7852DE1561D00C9E5F2 /* VPSearchRecommendedCell.swift in Sources */, @@ -1181,9 +1206,12 @@ BF5E75BE2DE54B2800DE9DFE /* VPAboutUsHeaderView.swift in Sources */, BFF5AFB22DE7FC130044227A /* CGMutablePath+VPAdd.swift in Sources */, BF0FA73D2DDED2D000C9E5F2 /* VPVideoAPI.swift in Sources */, + BFF5AFD42DE9A5FB0044227A /* VPVIPRecordCell.swift in Sources */, + BFF5AFD62DE9A8D70044227A /* VPWalletHeaderView.swift in Sources */, BF0FA6EE2DDC5F8700C9E5F2 /* JXUUID.m in Sources */, BF5E75B12DE4656600DE9DFE /* VPCampaignWebViewController.swift in Sources */, BF5E75BC2DE546AD00DE9DFE /* VPAboutUsCell.swift in Sources */, + BFF5AFD02DE9A0370044227A /* VPCoinRecordCell.swift in Sources */, BF0FA7BA2DE451B900C9E5F2 /* UINavigationBar+VPAdd.swift in Sources */, BF0FA77D2DE078D400C9E5F2 /* VPSearchRecommendedView.swift in Sources */, BFF5AFBA2DE837310044227A /* VPWalletAPI.swift in Sources */, @@ -1192,11 +1220,13 @@ BF0FA7052DDC67AC00C9E5F2 /* VPHomeViewModel.swift in Sources */, BF0FA6EF2DDC5F8700C9E5F2 /* PDKeyChain.m in Sources */, BF0FA75F2DDFFDB000C9E5F2 /* VPDetailPlayerViewController.swift in Sources */, + BFF5AFCE2DE99C730044227A /* VPCoinRecordViewController.swift in Sources */, BF0FA7732DE0671200C9E5F2 /* VPRateSelectedCell.swift in Sources */, 1B056E4D2DDAC7C1007EE38D /* VPTabBarController.swift in Sources */, BF5E75C02DE5566200DE9DFE /* VPHomePageControlView.swift in Sources */, BFF5AFC22DE837FC0044227A /* VPPayTemplateItem.swift in Sources */, BF0FA6DA2DDC5CB600C9E5F2 /* VPLoginManager.swift in Sources */, + BFF5AFD82DE9B8010044227A /* VPWalletHeaderItemView.swift in Sources */, BF0FA74A2DDF04E200C9E5F2 /* VPPlayerProtocol.swift in Sources */, BFF5AFC82DE9473B0044227A /* VPCoinsBuyCell.swift in Sources */, BF0FA72C2DDD7B7300C9E5F2 /* VPHomeRankingContentCell.swift in Sources */, @@ -1235,6 +1265,7 @@ BF0FA7892DE161F200C9E5F2 /* VPSearchResultView.swift in Sources */, 1B056E792DDB365A007EE38D /* VPTabBarItemSelectedView.swift in Sources */, 1B056E722DDB022F007EE38D /* VPTabBarItem.swift in Sources */, + BFF5AFCC2DE98C7F0044227A /* VPOrderRecordsViewController.swift in Sources */, 1B056E412DDAC30A007EE38D /* VPModel.swift in Sources */, BF0FA70A2DDC69C800C9E5F2 /* VPTableViewCell.swift in Sources */, BF0FA7A12DE1AA5100C9E5F2 /* VPTableView.swift in Sources */, @@ -1248,6 +1279,7 @@ BF0FA7162DDC78FF00C9E5F2 /* ZKCycleScrollViewFlowLayout.swift in Sources */, BF0FA7172DDC78FF00C9E5F2 /* ZKCycleScrollView.swift in Sources */, BF0FA7612DDFFE7100C9E5F2 /* VPVideoDetailModel.swift in Sources */, + BFF5AFD22DE9A58A0044227A /* VPVIPRecordViewController.swift in Sources */, BF5E75B82DE46F7100DE9DFE /* VPNetworkReachabilityManager.swift in Sources */, BF0FA6D52DDC5B5D00C9E5F2 /* VPApi.swift in Sources */, BF0FA7C12DE45D5D00C9E5F2 /* VPUserInfo.swift in Sources */, diff --git a/Veloria/Base/Controller/VPViewController.swift b/Veloria/Base/Controller/VPViewController.swift index 288f1d5..e26d667 100644 --- a/Veloria/Base/Controller/VPViewController.swift +++ b/Veloria/Base/Controller/VPViewController.swift @@ -65,7 +65,7 @@ class VPViewController: UIViewController { } -extension VPViewController { +extension UIViewController { func configNavigationBack(_ imageName: String = "arrow_left_icon_01") { let image = UIImage(named: imageName) diff --git a/Veloria/Class/Me/View/VPMeToolCell.swift b/Veloria/Class/Me/View/VPMeToolCell.swift index 66b40bd..6409b5b 100644 --- a/Veloria/Class/Me/View/VPMeToolCell.swift +++ b/Veloria/Class/Me/View/VPMeToolCell.swift @@ -20,11 +20,13 @@ class VPMeToolCell: VPTableViewCell { private lazy var walletButton: UIButton = { let button = self.createButton(icon: UIImage(named: "wallet_icon_01"), title: "Wallet".localized) + button.addTarget(self, action: #selector(handleWalletButton), for: .touchUpInside) return button }() private lazy var storeButton: UIButton = { let button = self.createButton(icon: UIImage(named: "store_icon_01"), title: "Store".localized) + button.addTarget(self, action: #selector(handleStoreButton), for: .touchUpInside) return button }() @@ -62,6 +64,20 @@ class VPMeToolCell: VPTableViewCell { } +extension VPMeToolCell { + + @objc private func handleWalletButton() { + let vc = VPWalletViewController() + self.viewController?.navigationController?.pushViewController(vc, animated: true) + } + + @objc private func handleStoreButton() { + let vc = VPVipPageViewController() + self.viewController?.navigationController?.pushViewController(vc, animated: true) + } + +} + extension VPMeToolCell { private func vp_setupUI() { diff --git a/Veloria/Class/Wallet/Controller/VPCoinRecordViewController.swift b/Veloria/Class/Wallet/Controller/VPCoinRecordViewController.swift new file mode 100644 index 0000000..0fab73f --- /dev/null +++ b/Veloria/Class/Wallet/Controller/VPCoinRecordViewController.swift @@ -0,0 +1,90 @@ +// +// VPCoinRecordViewController.swift +// Veloria +// +// Created by 湖南秦九 on 2025/5/30. +// + +import UIKit + +class VPCoinRecordViewController: VPViewController { + + + 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.contentInset = .init(top: 0, left: 0, bottom: UIScreen.tabbarSafeBottomMargin + 10, right: 0) + tableView.showsVerticalScrollIndicator = false + tableView.register(VPCoinRecordCell.self, forCellReuseIdentifier: "cell") + return tableView + }() + + override func viewDidLoad() { + super.viewDidLoad() + + self.bgImageView.isHidden = true + self.view.backgroundColor = .clear + + vp_setupUI() + } + + +} + +extension VPCoinRecordViewController { + + private func vp_setupUI() { + view.addSubview(lineView) + view.addSubview(tableView) + + 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 VPCoinRecordViewController: UITableViewDelegate, UITableViewDataSource { + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! VPCoinRecordCell + return cell + } + + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return 20 + } + +// func scrollViewDidScroll(_ scrollView: UIScrollView) { +// if scrollView.contentOffset.y < 0 { +// scrollView.contentOffset = .init(x: 0, y: 0) +// } +// } + +} + +//MARK: -------------- WMZPageProtocol -------------- +extension VPCoinRecordViewController: WMZPageProtocol { + func getMyScrollView() -> UIScrollView { + self.tableView + } +} + diff --git a/Veloria/Class/Wallet/Controller/VPOrderRecordsViewController.swift b/Veloria/Class/Wallet/Controller/VPOrderRecordsViewController.swift new file mode 100644 index 0000000..683fdcf --- /dev/null +++ b/Veloria/Class/Wallet/Controller/VPOrderRecordsViewController.swift @@ -0,0 +1,105 @@ +// +// VPOrderRecordsViewController.swift +// Veloria +// +// Created by 湖南秦九 on 2025/5/30. +// + +import UIKit + +class VPOrderRecordsViewController: WMZPageController { + + private lazy var viewControllers: [VPViewController] = { + let vc1 = VPCoinRecordViewController() + let vc2 = VPVIPRecordViewController() + return [vc1, vc2] + }() + + private lazy var pageParam: WMZPageParam = { + let param = WMZPageParam() + param.wTitleArr = [ + "Coin Record".localized, + "VIP Record".localized + ] + param.wViewController = { [weak self] index in + return self?.viewControllers[index] + } + param.wTopSuspension = true + param.wMenuTitleWidth = floor((UIScreen.width - 30) / 2) + param.wMenuHeight = 35 + param.wMenuTitleUIFont = .fontRegular(ofSize: 14) + param.wMenuTitleSelectUIFont = .fontMedium(ofSize: 15) + param.wMenuTitleColor = .colorFFFFFF(alpha: 0.3) + param.wMenuTitleSelectColor = .colorFFFFFF() + param.wMenuBgColor = .clear + param.wBgColor = .clear + param.wMenuInsets = .init(top: 0, left: 15, bottom: 0, right: 15) + param.wMenuTitleOffset = 0 + + param.wMenuAnimal = PageTitleMenuLine + + param.wMenuIndicatorColor = .colorFFFFFF() + param.wMenuIndicatorRadio = 1 + param.wMenuIndicatorHeight = 2 + param.wMenuIndicatorTitleRelativeWidth = 0 + param.wMenuIndicatorY = 1 + + param.wScrollCanTransfer = false + + param.wCustomNaviBarY = { _ in + return 0 + } + param.wCustomTabbarY = { _ in + return 0 + } + param.wCustomDataViewTopOffset = 0 + + return param + }() + + private lazy var menuBgView: UIView = { + let view = UIView() + view.backgroundColor = .colorFFFFFF(alpha: 0.1) + view.isUserInteractionEnabled = false + return view + }() + + override func viewDidLoad() { + super.viewDidLoad() + self.view.backgroundColor = .clear + self.param = self.pageParam + + downSc?.backgroundColor = .clear + + self.pageView.backgroundColor = .clear + + + vp_setupUI() + } + + override func viewDidLayoutSubviews() { + super.viewDidLayoutSubviews() + self.view.sendSubviewToBack(menuBgView) + } + +} + +extension VPOrderRecordsViewController { + + private func vp_setupUI() { + +// self.pageView.upSc.addSubview(menuBgView) +// self.pageView.upSc.sendSubviewToBack(menuBgView) + self.view.addSubview(menuBgView) + self.view.sendSubviewToBack(menuBgView) + + + menuBgView.snp.makeConstraints { make in + make.left.equalToSuperview().offset(15) + make.centerX.equalToSuperview() + make.top.equalToSuperview() + make.height.equalTo(pageParam.wMenuHeight) + } + } + +} diff --git a/Veloria/Class/Wallet/Controller/VPVIPRecordViewController.swift b/Veloria/Class/Wallet/Controller/VPVIPRecordViewController.swift new file mode 100644 index 0000000..ca06279 --- /dev/null +++ b/Veloria/Class/Wallet/Controller/VPVIPRecordViewController.swift @@ -0,0 +1,86 @@ +// +// VPVIPRecordViewController.swift +// Veloria +// +// Created by 湖南秦九 on 2025/5/30. +// + +import UIKit + +class VPVIPRecordViewController: VPViewController { + + 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.contentInset = .init(top: 0, left: 0, bottom: UIScreen.tabbarSafeBottomMargin + 10, right: 0) + tableView.showsVerticalScrollIndicator = false + tableView.register(VPVIPRecordCell.self, forCellReuseIdentifier: "cell") + return tableView + }() + + override func viewDidLoad() { + super.viewDidLoad() + self.bgImageView.isHidden = true + self.view.backgroundColor = .clear + + vp_setupUI() + } + +} + +extension VPVIPRecordViewController { + + private func vp_setupUI() { + view.addSubview(lineView) + view.addSubview(tableView) + + 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 VPVIPRecordViewController: UITableViewDelegate, UITableViewDataSource { + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! VPVIPRecordCell + return cell + } + + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return 10 + } + +// func scrollViewDidScroll(_ scrollView: UIScrollView) { +// if scrollView.contentOffset.y < 0 { +// scrollView.contentOffset = .init(x: 0, y: 0) +// } +// } + +} + +//MARK: -------------- WMZPageProtocol -------------- +extension VPVIPRecordViewController: WMZPageProtocol { + func getMyScrollView() -> UIScrollView { + self.tableView + } +} diff --git a/Veloria/Class/Wallet/Controller/VPWalletViewController.swift b/Veloria/Class/Wallet/Controller/VPWalletViewController.swift new file mode 100644 index 0000000..5213ec0 --- /dev/null +++ b/Veloria/Class/Wallet/Controller/VPWalletViewController.swift @@ -0,0 +1,154 @@ +// +// VPWalletViewController.swift +// Veloria +// +// Created by 湖南秦九 on 2025/5/30. +// + +import UIKit + +class VPWalletViewController: WMZPageController { + + + + private lazy var viewControllers: [UIViewController] = { + let vc1 = VPOrderRecordsViewController() + let vc2 = VPViewController() + let vc3 = VPViewController() + return [vc1, vc2, vc3] + }() + + private lazy var pageParam: WMZPageParam = { + let param = WMZPageParam() + param.wTitleArr = [ + [ + WMZPageBTNKey.keyName : "Order\nRecords".localized, + WMZPageBTNKey.keyImage : UIImage(named: "order_icon_01")!, + WMZPageBTNKey.keySelectImage : UIImage(named: "order_icon_01_selected")!, + WMZPageBTNKey.keyImageOffset : 6 + ], + [ + WMZPageBTNKey.keyName : "Consumption\nRecords".localized, + WMZPageBTNKey.keyImage : UIImage(named: "coin_icon_05")!, + WMZPageBTNKey.keySelectImage : UIImage(named: "coin_icon_05_selected")!, + WMZPageBTNKey.keyImageOffset : 6 + ], + [ + WMZPageBTNKey.keyName : "Reward\nCoins".localized, + WMZPageBTNKey.keyImage : UIImage(named: "coin_icon_06")!, + WMZPageBTNKey.keySelectImage : UIImage(named: "coin_icon_06_selected")!, + WMZPageBTNKey.keyImageOffset : 6 + ], + ] + param.wViewController = { [weak self] index in + return self?.viewControllers[index] + } + param.wTopSuspension = true + //顶部可下拉 + param.wBounces = true + + param.wMenuTitleWidth = floor((UIScreen.width - 30 - 40) / 3) + param.wMenuHeight = 126 + param.wMenuTitleUIFont = .fontRegular(ofSize: 12) + param.wMenuTitleSelectUIFont = .fontRegular(ofSize: 12) + param.wMenuTitleColor = .colorFFFFFF(alpha: 0.6) + param.wMenuTitleSelectColor = .colorFFFFFF() + param.wMenuBgColor = .clear + param.wBgColor = .clear + param.wMenuInsets = .init(top: 0, left: 15, bottom: 0, right: 15) + param.wMenuTitleOffset = 20 + param.wScrollCanTransfer = false + + param.wMenuHeadView = { [weak self] in + return self?.headerView + } + + param.wCustomNaviBarY = { _ in + return UIScreen.navBarHeight + } + param.wCustomTabbarY = { _ in + return 0 + } + param.wCustomDataViewTopOffset = 0 + + return param + }() + +// private lazy var pageView: WMZPageView = { +// let y = UIScreen.navBarHeight +// let view = WMZPageView(frame: .init(x: 0, y: y, width: UIScreen.width, height: UIScreen.height - y), param: pageParam, parentReponder: self) +// +// view.backgroundColor = .clear +// view.downSc?.backgroundColor = .clear +// view.downSc?.isScrollEnabled = true +// +// return view +// }() + + private(set) lazy var bgImageView: UIImageView = { + let imageView = UIImageView(image: UIImage(named: "bg_image_01")) + return imageView + }() + + private lazy var menuBgView: UIView = { + let view = UIView() + view.backgroundColor = .colorFFFFFF(alpha: 0.1) + view.addRadius(topLeft: 8, topRight: 8, bottomLeft: 0, bottomRight: 0) + return view + }() + + private lazy var headerView: VPWalletHeaderView = { + let view = VPWalletHeaderView(frame: .init(x: 0, y: 0, width: UIScreen.width, height: 175)) + view.userInfo = VPLoginManager.manager.userInfo + return view + }() + + override func viewDidLoad() { + super.viewDidLoad() + self.title = "My Wallet".localized + self.param = self.pageParam + view.backgroundColor = .clear + downSc?.backgroundColor = .clear + + configNavigationBack() + vp_setupUI() + } + + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + navigationController?.setNavigationBarHidden(false, animated: true) + setNavigationNormalStyle() + } + + override func viewWillLayoutSubviews() { + super.viewWillLayoutSubviews() + + if menuBgView.superview == nil, self.pageView.upSc != nil { + self.pageView.upSc.addSubview(menuBgView) + self.pageView.upSc.sendSubviewToBack(menuBgView) + + menuBgView.snp.makeConstraints { make in + make.left.equalToSuperview().offset(15) + make.centerX.equalToSuperview() + make.top.equalToSuperview() + make.height.equalTo(pageParam.wMenuHeight) + } + } + view.sendSubviewToBack(bgImageView) + } + +} + +extension VPWalletViewController { + + private func vp_setupUI() { + + view.addSubview(bgImageView) + view.sendSubviewToBack(bgImageView) + + bgImageView.snp.makeConstraints { make in + make.edges.equalToSuperview() + } + } + +} diff --git a/Veloria/Class/Wallet/View/VPCoinRecordCell.swift b/Veloria/Class/Wallet/View/VPCoinRecordCell.swift new file mode 100644 index 0000000..483c651 --- /dev/null +++ b/Veloria/Class/Wallet/View/VPCoinRecordCell.swift @@ -0,0 +1,24 @@ +// +// VPCoinRecordCell.swift +// Veloria +// +// Created by 湖南秦九 on 2025/5/30. +// + +import UIKit + +class VPCoinRecordCell: VPTableViewCell { + + + + 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/Class/Wallet/View/VPVIPRecordCell.swift b/Veloria/Class/Wallet/View/VPVIPRecordCell.swift new file mode 100644 index 0000000..796df08 --- /dev/null +++ b/Veloria/Class/Wallet/View/VPVIPRecordCell.swift @@ -0,0 +1,22 @@ +// +// VPVIPRecordCell.swift +// Veloria +// +// Created by 湖南秦九 on 2025/5/30. +// + +import UIKit + +class VPVIPRecordCell: VPTableViewCell { + + 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/Class/Wallet/View/VPWalletHeaderItemView.swift b/Veloria/Class/Wallet/View/VPWalletHeaderItemView.swift new file mode 100644 index 0000000..c9590bf --- /dev/null +++ b/Veloria/Class/Wallet/View/VPWalletHeaderItemView.swift @@ -0,0 +1,73 @@ +// +// VPWalletHeaderItemView.swift +// Veloria +// +// Created by 湖南秦九 on 2025/5/30. +// + +import UIKit + +class VPWalletHeaderItemView: UIView { + + var title: String? { + didSet { + titleLabel.text = title + } + } + + var count: Int = 0 { + didSet { + coinCountLabel.text = "\(count)" + } + } + + + private lazy var coinCountLabel: UILabel = { + let label = UILabel() + label.font = .fontBold(ofSize: 18) + label.textColor = .colorFFFFFF() + return label + }() + + private lazy var titleLabel: UILabel = { + let label = UILabel() + label.font = .fontRegular(ofSize: 12) + label.textColor = .colorFFFFFF(alpha: 0.8) + return label + }() + + override init(frame: CGRect) { + super.init(frame: frame) + + vp_setupUI() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + +} + +extension VPWalletHeaderItemView { + + private func vp_setupUI() { + addSubview(coinCountLabel) + addSubview(titleLabel) + + + titleLabel.snp.makeConstraints { make in +// make.left.equalTo(coinCountLabel) + make.centerX.equalToSuperview() + make.top.equalToSuperview() + } + + coinCountLabel.snp.makeConstraints { make in + make.centerX.equalToSuperview() + make.bottom.equalToSuperview() + make.top.equalTo(titleLabel.snp.bottom).offset(5) + } + + } + + +} diff --git a/Veloria/Class/Wallet/View/VPWalletHeaderView.swift b/Veloria/Class/Wallet/View/VPWalletHeaderView.swift new file mode 100644 index 0000000..5afbbdc --- /dev/null +++ b/Veloria/Class/Wallet/View/VPWalletHeaderView.swift @@ -0,0 +1,147 @@ +// +// VPWalletHeaderView.swift +// Veloria +// +// Created by 湖南秦九 on 2025/5/30. +// + +import UIKit + +class VPWalletHeaderView: UIView { + + var userInfo: VPUserInfo? { + didSet { + avatarImageView.vp_setImage(url: userInfo?.avator, placeholder: UIImage(named: "avatar_placeholder_icon_01")) + + coinCountLabel.text = "\(userInfo?.totalCoin ?? 0)" + rechargeCoinView.count = userInfo?.coin_left_total ?? 0 + sendCoinView.count = userInfo?.send_coin_left_total ?? 0 +// coinCountLabel.text = "1234567890" + } + } + + private lazy var bgView: UIView = { + let view = UIView() + view.backgroundColor = .colorFFFFFF(alpha: 0.1) + view.layer.cornerRadius = 8 + view.layer.masksToBounds = true + return view + }() + + private lazy var avatarImageView: VPImageView = { + let imageView = VPImageView() + imageView.layer.cornerRadius = 34 + imageView.layer.masksToBounds = true + imageView.layer.borderWidth = 1 + imageView.layer.borderColor = UIColor.colorFFFFFF().cgColor + return imageView + }() + + private lazy var titleLabel: UILabel = { + let label = UILabel() + label.font = .fontRegular(ofSize: 12) + label.textColor = .colorFFFFFF(alpha: 0.8) + label.text = "Total Coins".localized + return label + }() + + private lazy var coinIconImageView: UIImageView = { + let imageView = UIImageView(image: UIImage(named: "coin_icon_03")) + return imageView + }() + + private lazy var coinCountLabel: UILabel = { + let label = UILabel() + label.font = .fontBold(ofSize: 20) + label.textColor = .colorFFFFFF() + return label + }() + + private lazy var rechargeCoinView: VPWalletHeaderItemView = { + let view = VPWalletHeaderItemView() + view.title = "Recharge".localized + return view + }() + + private lazy var sendCoinView: VPWalletHeaderItemView = { + let view = VPWalletHeaderItemView() + view.title = "Donate".localized + return view + }() + + private lazy var lineView: UIView = { + let view = UIView() + view.backgroundColor = .colorFFFFFF(alpha: 0.3) + return view + }() + + override init(frame: CGRect) { + super.init(frame: frame) + vp_setupUI() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } +} + +extension VPWalletHeaderView { + + private func vp_setupUI() { + addSubview(bgView) + addSubview(avatarImageView) + bgView.addSubview(titleLabel) + bgView.addSubview(coinIconImageView) + bgView.addSubview(coinCountLabel) + bgView.addSubview(rechargeCoinView) + bgView.addSubview(sendCoinView) + bgView.addSubview(lineView) + + bgView.snp.makeConstraints { make in + make.left.equalToSuperview().offset(15) + make.centerX.equalToSuperview() + make.bottom.equalToSuperview().offset(-20) + make.height.equalTo(130) + } + + avatarImageView.snp.makeConstraints { make in + make.right.equalToSuperview().offset(-35) + make.top.equalToSuperview() + make.width.height.equalTo(68) + } + + titleLabel.snp.makeConstraints { make in + make.left.equalToSuperview().offset(20) + make.top.equalToSuperview().offset(14) + } + + coinIconImageView.snp.makeConstraints { make in + make.left.equalToSuperview().offset(20) + make.top.equalToSuperview().offset(37) + } + + coinCountLabel.snp.makeConstraints { make in + make.centerY.equalTo(coinIconImageView) + make.left.equalTo(coinIconImageView.snp.right).offset(7) + } + + rechargeCoinView.snp.makeConstraints { make in + make.left.equalToSuperview() + make.bottom.equalToSuperview().offset(-13) + } + + sendCoinView.snp.makeConstraints { make in + make.left.equalTo(rechargeCoinView.snp.right).offset(1) + make.top.width.equalTo(rechargeCoinView) + make.right.equalToSuperview() + } + + lineView.snp.makeConstraints { make in + make.centerX.equalToSuperview() + make.centerY.equalTo(rechargeCoinView) + make.width.equalTo(0.5) + make.height.equalTo(27) + } + } + +} diff --git a/Veloria/Source/Assets.xcassets/icon/coin_icon_05.imageset/Consumption Records@2x.png b/Veloria/Source/Assets.xcassets/icon/coin_icon_05.imageset/Consumption Records@2x.png new file mode 100644 index 0000000..f634b15 Binary files /dev/null and b/Veloria/Source/Assets.xcassets/icon/coin_icon_05.imageset/Consumption Records@2x.png differ diff --git a/Veloria/Source/Assets.xcassets/icon/coin_icon_05.imageset/Consumption Records@3x.png b/Veloria/Source/Assets.xcassets/icon/coin_icon_05.imageset/Consumption Records@3x.png new file mode 100644 index 0000000..697f0df Binary files /dev/null and b/Veloria/Source/Assets.xcassets/icon/coin_icon_05.imageset/Consumption Records@3x.png differ diff --git a/Veloria/Source/Assets.xcassets/icon/coin_icon_05.imageset/Contents.json b/Veloria/Source/Assets.xcassets/icon/coin_icon_05.imageset/Contents.json new file mode 100644 index 0000000..e4ac269 --- /dev/null +++ b/Veloria/Source/Assets.xcassets/icon/coin_icon_05.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Consumption Records@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Consumption Records@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Veloria/Source/Assets.xcassets/icon/coin_icon_05_selected.imageset/Consumption Records@2x.png b/Veloria/Source/Assets.xcassets/icon/coin_icon_05_selected.imageset/Consumption Records@2x.png new file mode 100644 index 0000000..d558c5c Binary files /dev/null and b/Veloria/Source/Assets.xcassets/icon/coin_icon_05_selected.imageset/Consumption Records@2x.png differ diff --git a/Veloria/Source/Assets.xcassets/icon/coin_icon_05_selected.imageset/Consumption Records@3x.png b/Veloria/Source/Assets.xcassets/icon/coin_icon_05_selected.imageset/Consumption Records@3x.png new file mode 100644 index 0000000..66b0201 Binary files /dev/null and b/Veloria/Source/Assets.xcassets/icon/coin_icon_05_selected.imageset/Consumption Records@3x.png differ diff --git a/Veloria/Source/Assets.xcassets/icon/coin_icon_05_selected.imageset/Contents.json b/Veloria/Source/Assets.xcassets/icon/coin_icon_05_selected.imageset/Contents.json new file mode 100644 index 0000000..e4ac269 --- /dev/null +++ b/Veloria/Source/Assets.xcassets/icon/coin_icon_05_selected.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Consumption Records@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Consumption Records@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Veloria/Source/Assets.xcassets/icon/coin_icon_06.imageset/Contents.json b/Veloria/Source/Assets.xcassets/icon/coin_icon_06.imageset/Contents.json new file mode 100644 index 0000000..2b5d771 --- /dev/null +++ b/Veloria/Source/Assets.xcassets/icon/coin_icon_06.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Reward Coins@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Reward Coins@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Veloria/Source/Assets.xcassets/icon/coin_icon_06.imageset/Reward Coins@2x.png b/Veloria/Source/Assets.xcassets/icon/coin_icon_06.imageset/Reward Coins@2x.png new file mode 100644 index 0000000..dc57fd1 Binary files /dev/null and b/Veloria/Source/Assets.xcassets/icon/coin_icon_06.imageset/Reward Coins@2x.png differ diff --git a/Veloria/Source/Assets.xcassets/icon/coin_icon_06.imageset/Reward Coins@3x.png b/Veloria/Source/Assets.xcassets/icon/coin_icon_06.imageset/Reward Coins@3x.png new file mode 100644 index 0000000..045f611 Binary files /dev/null and b/Veloria/Source/Assets.xcassets/icon/coin_icon_06.imageset/Reward Coins@3x.png differ diff --git a/Veloria/Source/Assets.xcassets/icon/coin_icon_06_selected.imageset/Contents.json b/Veloria/Source/Assets.xcassets/icon/coin_icon_06_selected.imageset/Contents.json new file mode 100644 index 0000000..2b5d771 --- /dev/null +++ b/Veloria/Source/Assets.xcassets/icon/coin_icon_06_selected.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Reward Coins@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Reward Coins@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Veloria/Source/Assets.xcassets/icon/coin_icon_06_selected.imageset/Reward Coins@2x.png b/Veloria/Source/Assets.xcassets/icon/coin_icon_06_selected.imageset/Reward Coins@2x.png new file mode 100644 index 0000000..f6f22c0 Binary files /dev/null and b/Veloria/Source/Assets.xcassets/icon/coin_icon_06_selected.imageset/Reward Coins@2x.png differ diff --git a/Veloria/Source/Assets.xcassets/icon/coin_icon_06_selected.imageset/Reward Coins@3x.png b/Veloria/Source/Assets.xcassets/icon/coin_icon_06_selected.imageset/Reward Coins@3x.png new file mode 100644 index 0000000..e0f4ac2 Binary files /dev/null and b/Veloria/Source/Assets.xcassets/icon/coin_icon_06_selected.imageset/Reward Coins@3x.png differ diff --git a/Veloria/Source/Assets.xcassets/icon/order_icon_01.imageset/Contents.json b/Veloria/Source/Assets.xcassets/icon/order_icon_01.imageset/Contents.json new file mode 100644 index 0000000..370445a --- /dev/null +++ b/Veloria/Source/Assets.xcassets/icon/order_icon_01.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Order Records@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Order Records@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Veloria/Source/Assets.xcassets/icon/order_icon_01.imageset/Order Records@2x.png b/Veloria/Source/Assets.xcassets/icon/order_icon_01.imageset/Order Records@2x.png new file mode 100644 index 0000000..8915638 Binary files /dev/null and b/Veloria/Source/Assets.xcassets/icon/order_icon_01.imageset/Order Records@2x.png differ diff --git a/Veloria/Source/Assets.xcassets/icon/order_icon_01.imageset/Order Records@3x.png b/Veloria/Source/Assets.xcassets/icon/order_icon_01.imageset/Order Records@3x.png new file mode 100644 index 0000000..fe0c5ee Binary files /dev/null and b/Veloria/Source/Assets.xcassets/icon/order_icon_01.imageset/Order Records@3x.png differ diff --git a/Veloria/Source/Assets.xcassets/icon/order_icon_01_selected.imageset/Contents.json b/Veloria/Source/Assets.xcassets/icon/order_icon_01_selected.imageset/Contents.json new file mode 100644 index 0000000..bf55e2d --- /dev/null +++ b/Veloria/Source/Assets.xcassets/icon/order_icon_01_selected.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Order Records.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Order Records@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Veloria/Source/Assets.xcassets/icon/order_icon_01_selected.imageset/Order Records.png b/Veloria/Source/Assets.xcassets/icon/order_icon_01_selected.imageset/Order Records.png new file mode 100644 index 0000000..4949da0 Binary files /dev/null and b/Veloria/Source/Assets.xcassets/icon/order_icon_01_selected.imageset/Order Records.png differ diff --git a/Veloria/Source/Assets.xcassets/icon/order_icon_01_selected.imageset/Order Records@3x.png b/Veloria/Source/Assets.xcassets/icon/order_icon_01_selected.imageset/Order Records@3x.png new file mode 100644 index 0000000..8a4e233 Binary files /dev/null and b/Veloria/Source/Assets.xcassets/icon/order_icon_01_selected.imageset/Order Records@3x.png differ diff --git a/Veloria/Source/en.lproj/Localizable.strings b/Veloria/Source/en.lproj/Localizable.strings index 7106391..b81ed32 100644 --- a/Veloria/Source/en.lproj/Localizable.strings +++ b/Veloria/Source/en.lproj/Localizable.strings @@ -55,6 +55,14 @@ "Extra %@" = "Extra %@"; "Get More Coins" = "Get More Coins"; "Coins: %@" = "Coins: %@"; +"My Wallet" = "My Wallet"; +"Order\nRecords" = "Order\nRecords"; +"Consumption\nRecords" = "Consumption\nRecords"; +"Reward\nCoins" = "Reward\nCoins"; +"Coin Record" = "Coin Record"; +"VIP Record" = "VIP Record"; +"Total Coins" = "Total Coins"; +"Recharge" = "Recharge"; "kHomeTitleText" = "10,000+ addictive shorts await!";