diff --git a/Veloria.xcodeproj/project.pbxproj b/Veloria.xcodeproj/project.pbxproj index b60b857..c5cfb54 100644 --- a/Veloria.xcodeproj/project.pbxproj +++ b/Veloria.xcodeproj/project.pbxproj @@ -148,6 +148,7 @@ BF5E75DB2DE5B8B700DE9DFE /* VPMarqueeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF5E75DA2DE5B8B700DE9DFE /* VPMarqueeView.swift */; }; BF692AB52E0644B500A5C2DA /* VPRevolutionSelectedView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF692AB42E0644B500A5C2DA /* VPRevolutionSelectedView.swift */; }; BF692AB72E06450C00A5C2DA /* VPRevolutionSelectedCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF692AB62E06450C00A5C2DA /* VPRevolutionSelectedCell.swift */; }; + BF692AB92E065B2100A5C2DA /* VPVipAlertItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF692AB82E065B2100A5C2DA /* VPVipAlertItemView.swift */; }; BFA21D982E01477200B3573D /* VPStoreViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFA21D972E01477200B3573D /* VPStoreViewController.swift */; }; BFA21D9A2E01497F00B3573D /* VPStoreVipBuyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFA21D992E01497F00B3573D /* VPStoreVipBuyView.swift */; }; BFA21D9C2E01628F00B3573D /* VPStoreCoinsBuyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFA21D9B2E01628F00B3573D /* VPStoreCoinsBuyView.swift */; }; @@ -422,6 +423,7 @@ BF5E75DA2DE5B8B700DE9DFE /* VPMarqueeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPMarqueeView.swift; sourceTree = ""; }; BF692AB42E0644B500A5C2DA /* VPRevolutionSelectedView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPRevolutionSelectedView.swift; sourceTree = ""; }; BF692AB62E06450C00A5C2DA /* VPRevolutionSelectedCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPRevolutionSelectedCell.swift; sourceTree = ""; }; + BF692AB82E065B2100A5C2DA /* VPVipAlertItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPVipAlertItemView.swift; sourceTree = ""; }; BFA21D972E01477200B3573D /* VPStoreViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPStoreViewController.swift; sourceTree = ""; }; BFA21D992E01497F00B3573D /* VPStoreVipBuyView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPStoreVipBuyView.swift; sourceTree = ""; }; BFA21D9B2E01628F00B3573D /* VPStoreCoinsBuyView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPStoreCoinsBuyView.swift; sourceTree = ""; }; @@ -1129,6 +1131,7 @@ BFF5B2312DEFF1220044227A /* VPDeleteAccountDetailView.swift */, BFF5B2332DEFF2030044227A /* VPDeleteAccountTipView.swift */, BFCCE1112DF9638B00EDE165 /* VPVipAlertView.swift */, + BF692AB82E065B2100A5C2DA /* VPVipAlertItemView.swift */, BFCCE1152DFAB66F00EDE165 /* VPLanguageCell.swift */, ); path = View; @@ -1546,6 +1549,7 @@ 1B056E6C2DDADAA1007EE38D /* VPTabBar.swift in Sources */, BF0FA72E2DDD7DD400C9E5F2 /* VPHomeRankingCell.swift in Sources */, BF0FA7792DE075FF00C9E5F2 /* VPSearchHomeView.swift in Sources */, + BF692AB92E065B2100A5C2DA /* VPVipAlertItemView.swift in Sources */, BF0FA7302DDEBB1600C9E5F2 /* UIButton+VPAdd.swift in Sources */, BF0FA74C2DDF060200C9E5F2 /* VPVideoPlayerViewController.swift in Sources */, BF0FA79B2DE1984B00C9E5F2 /* VPCollectListViewController.swift in Sources */, diff --git a/Veloria/Base/WebView/VPWebViewController.swift b/Veloria/Base/WebView/VPWebViewController.swift index 453e143..684f543 100644 --- a/Veloria/Base/WebView/VPWebViewController.swift +++ b/Veloria/Base/WebView/VPWebViewController.swift @@ -27,6 +27,16 @@ class VPWebViewController: VPViewController { webView.delegate = self return webView }() + + private lazy var emptyView: VPEmptyView = { + let view = VPEmptyView.createNoNetworkEmptyView { [weak self] in + guard let self = self else { return } + if let url = self.urlStr { + self.load(urlString: url) + } + } + return view + }() override func viewDidLoad() { super.viewDidLoad() @@ -79,6 +89,8 @@ extension VPWebViewController { extension VPWebViewController: VPWebViewDelegate { func webView(_ webView: VPWebView, shouldStartLoadWith navigationAction: WKNavigationAction) -> Bool { + emptyView.removeFromSuperview() + self.webView.isHidden = false return true } @@ -92,13 +104,27 @@ extension VPWebViewController: VPWebViewDelegate { } } + func webViewDidFinishLoad(_ webView: VPWebView) { + emptyView.isHidden = true + self.webView.isHidden = false + VPHUD.dismiss() + } + func webView(_ webView: VPWebView, didFailLoadWithError error: any Error) { VPHUD.dismiss() vpLog(message: error) - } - - func webViewDidFinishLoad(_ webView: VPWebView) { - VPHUD.dismiss() + + if VPNetworkReachabilityManager.manager.isReachable != true { + if emptyView.superview == nil { + view.addSubview(emptyView) + emptyView.snp.makeConstraints { make in + make.left.equalToSuperview() + make.centerX.equalToSuperview() + make.centerY.equalToSuperview().offset(-100) + } + self.webView.isHidden = true + } + } } func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) { diff --git a/Veloria/Class/Me/Controller/VPMeViewController.swift b/Veloria/Class/Me/Controller/VPMeViewController.swift index 99448e2..fd319b0 100644 --- a/Veloria/Class/Me/Controller/VPMeViewController.swift +++ b/Veloria/Class/Me/Controller/VPMeViewController.swift @@ -100,10 +100,10 @@ extension VPMeViewController { guard self.isDidAppear else { return } guard self.vipAlertView == nil else { return } guard !HWPanModalContentView.doesExis() else { return } - guard let item = model?.list_sub_vip?.first else { return } + guard let list = model?.list_sub_vip, list.count > 0 else { return } let alert = VPVipAlertView().show() - alert.model = item + alert.dataArr = list self.vipAlertView = alert } } diff --git a/Veloria/Class/Me/View/VPVipAlertItemView.swift b/Veloria/Class/Me/View/VPVipAlertItemView.swift new file mode 100644 index 0000000..4300dd8 --- /dev/null +++ b/Veloria/Class/Me/View/VPVipAlertItemView.swift @@ -0,0 +1,232 @@ +// +// VPVipAlertItemView.swift +// Veloria +// +// Created by 湖南秦九 on 2025/6/21. +// + +import UIKit + +class VPVipAlertItemView: UIControl { + + var item: VPPayTemplateItem? { + didSet { + unitLabel.text = item?.currency + moneyLabel.text = item?.price + durationLabel.text = "/\(item?.vip_type_key?.getText() ?? "")" + + if let coin = item?.send_coins, coin > 0 { + extraBgView.isHidden = false + + let text = "veloria_extra".localized + " \(coin)" +// let text = String(format: "Extra %@".localized, "\(coin)") + extraLabel.text = "+" + text + } else { + extraBgView.isHidden = true + } + + if let hot = item?.corner_marker, hot.count > 0 { + hotView.isHidden = false + } else { + hotView.isHidden = true + } + + var colors: [CGColor] = [] + switch item?.vip_type_key { + case .week: + vipBgView.image = UIImage(named: "vip_alert_bg_week") + colors = [UIColor.color647DA7().cgColor, UIColor.color414867().cgColor] + extraBgView.colors = [UIColor.colorDAFDFF().cgColor, UIColor.colorDAFDFF(alpha: 0).cgColor] + extraLabel.textColor = .color416767() + + case .month: + vipBgView.image = UIImage(named: "vip_alert_bg_month") + colors = [UIColor.color64A3A7().cgColor, UIColor.color416767().cgColor] + extraBgView.colors = [UIColor.colorD6E5F9().cgColor, UIColor.colorD6E5F9(alpha: 0).cgColor] + extraLabel.textColor = .color303962() + + case .quarter: + vipBgView.image = UIImage(named: "vip_alert_bg_quarter") + colors = [UIColor.color7869FF().cgColor, UIColor.color9F45FF().cgColor] + extraBgView.colors = [UIColor.colorCABCFF().cgColor, UIColor.colorCABCFF(alpha: 0).cgColor] + extraLabel.textColor = .color5F1EB9() + + case .year: + vipBgView.image = UIImage(named: "vip_alert_bg_year") + colors = [UIColor.color9C7565().cgColor, UIColor.color573D31().cgColor] + extraBgView.colors = [UIColor.colorFFE6CE().cgColor, UIColor.colorFFE6CE(alpha: 0).cgColor] + extraLabel.textColor = .color573D31() + + default: break + } + + unitLabel.gradientLayer.colors = colors + moneyLabel.gradientLayer.colors = colors + durationLabel.gradientLayer.colors = colors + + updateLayout() + + } + } + + override var isSelected: Bool { + didSet { + selectedImageView.isHidden = !isSelected + } + } + + override var intrinsicContentSize: CGSize { + return .init(width: UIScreen.width, height: 54) + } + + private lazy var vipBgView: UIImageView = { + let imageView = UIImageView() + return imageView + }() + + private lazy var hotView: UIView = { + let view = UIButton(type: .custom) + view.isUserInteractionEnabled = false + view.setBackgroundImage(UIImage(named: "hot_bg_icon_01"), for: .normal) +// view.setTitle("HOT", for: .normal) +// view.setTitleColor(.colorFFFFFF(), for: .normal) +// view.titleLabel?.font = .fontRegular(ofSize: 11) + return view + }() + + private lazy var unitLabel: VPGradientLabel = { + let label = VPGradientLabel() + label.font = .fontRegular(ofSize: 14) + label.gradientLayer.colors = [UIColor.color64A3A7().cgColor, UIColor.color416767().cgColor] + return label + }() + + private lazy var moneyLabel: VPGradientLabel = { + let label = VPGradientLabel() + label.font = .fontAaHouDiHei(ofSize: 22) + label.gradientLayer.colors = [UIColor.color64A3A7().cgColor, UIColor.color416767().cgColor] + return label + }() + + private lazy var durationLabel: VPGradientLabel = { + let label = VPGradientLabel() + label.font = .fontRegular(ofSize: 12) + label.gradientLayer.colors = [UIColor.color64A3A7().cgColor, UIColor.color416767().cgColor] + return label + }() + + private lazy var extraBgView: VPGradientView = { + let view = VPGradientView() + view.colors = [UIColor.colorDAFDFF().cgColor, UIColor.colorDAFDFF(alpha: 0).cgColor] + view.locations = [0, 1] + view.startPoint = .init(x: 0, y: 0.5) + view.endPoint = .init(x: 1, y: 0.5) + view.layer.cornerRadius = 4 + view.layer.masksToBounds = true + return view + }() + + private lazy var extraLabel: UILabel = { + let label = UILabel() + label.font = .fontRegular(ofSize: 10) + label.textColor = .color416767() + return label + }() + + private lazy var extraIconView: UIImageView = { + let imageView = UIImageView(image: UIImage(named: "coin_icon_08")) + return imageView + }() + + private lazy var selectedImageView: UIImageView = { + let imageView = UIImageView(image: UIImage(named: "selected_icon_03")) + return imageView + }() + + override init(frame: CGRect) { + super.init(frame: frame) + + vp_setupUI() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + + private func updateLayout() { + if let coin = item?.send_coins, coin > 0 { + unitLabel.snp.updateConstraints { make in + make.top.equalToSuperview().offset(12) + } + } else { + unitLabel.snp.updateConstraints { make in + make.top.equalToSuperview().offset(22) + } + } + + } +} + +extension VPVipAlertItemView { + + private func vp_setupUI() { + addSubview(vipBgView) + vipBgView.addSubview(hotView) + vipBgView.addSubview(unitLabel) + vipBgView.addSubview(moneyLabel) + vipBgView.addSubview(durationLabel) + vipBgView.addSubview(extraBgView) + extraBgView.addSubview(extraLabel) + extraBgView.addSubview(extraIconView) + vipBgView.addSubview(selectedImageView) + + vipBgView.snp.makeConstraints { make in + make.edges.equalToSuperview() + } + + hotView.snp.makeConstraints { make in + make.top.equalToSuperview().offset(4) + make.right.equalToSuperview().offset(-4) + } + + unitLabel.snp.makeConstraints { make in + make.left.equalToSuperview().offset(16) + make.top.equalToSuperview().offset(10) + } + + moneyLabel.snp.makeConstraints { make in + make.left.equalTo(unitLabel.snp.right) + make.bottom.equalTo(unitLabel).offset(4) + } + + durationLabel.snp.makeConstraints { make in + make.bottom.equalTo(moneyLabel).offset(-5) + make.left.equalTo(moneyLabel.snp.right) + } + + extraBgView.snp.makeConstraints { make in + make.left.equalToSuperview().offset(16) + make.bottom.equalToSuperview().offset(-5) + make.height.equalTo(17) +// make.width.equalTo(86) + } + + extraLabel.snp.makeConstraints { make in + make.left.equalToSuperview().offset(6) + make.centerY.equalToSuperview() + } + + extraIconView.snp.makeConstraints { make in + make.centerY.equalToSuperview() + make.left.equalTo(extraLabel.snp.right).offset(3) + make.right.equalToSuperview().offset(-6) + } + + selectedImageView.snp.makeConstraints { make in + make.right.equalToSuperview() + make.bottom.equalToSuperview() + } + } + +} diff --git a/Veloria/Class/Me/View/VPVipAlertView.swift b/Veloria/Class/Me/View/VPVipAlertView.swift index ca226f7..381544e 100644 --- a/Veloria/Class/Me/View/VPVipAlertView.swift +++ b/Veloria/Class/Me/View/VPVipAlertView.swift @@ -37,26 +37,26 @@ class VPVipAlertView: VPBaseAlertView { } - var model: VPPayTemplateItem? { + + var dataArr: [VPPayTemplateItem] = [] { didSet { - unitLabel.text = model?.currency - moneyLabel.text = model?.price - durationLabel.text = "/\(model?.vip_type_key?.getText() ?? "")" + stackView.removeAllArrangedSubview() - if let coin = model?.send_coins, coin > 0 { - extraBgView.isHidden = false - - let text = "veloria_extra".localized + " \(coin)" -// let text = String(format: "Extra %@".localized, "\(coin)") - extraLabel.text = "+" + text - } else { - extraBgView.isHidden = true + dataArr.forEach { + let view = VPVipAlertItemView() + view.isSelected = false + view.item = $0 + view.addTarget(self, action: #selector(handleItemView), for: .touchUpInside) + stackView.addArrangedSubview(view) } } } + private var currentItem: VPPayTemplateItem? + private lazy var bgView: UIView = { let view = UIImageView(image: UIImage(named: "vpi_alert_bg_image")) + view.isUserInteractionEnabled = true return view }() @@ -72,16 +72,6 @@ class VPVipAlertView: VPBaseAlertView { return button }() - private lazy var unlockButton: UIButton = { - let button = UIButton(type: .custom) - button.setBackgroundImage(UIImage(named: "vip_unlock_button"), for: .normal) - button.setTitle("veloria_vip_splash_onclick".localized, for: .normal) - button.setTitleColor(.color005D48(), for: .normal) - button.titleLabel?.font = .fontMedium(ofSize: 14) - button.addTarget(self, action: #selector(hadnleUnlockButton), for: .touchUpInside) - return button - }() - private lazy var titleLabel: UILabel = { let label = UILabel() label.font = .fontBold(ofSize: 16) @@ -100,65 +90,13 @@ class VPVipAlertView: VPBaseAlertView { return label }() - private lazy var vipBgView: UIImageView = { - let imageView = UIImageView(image: UIImage(named: "vip_alert_bg_week")) - return imageView - }() - - private lazy var hotView: UIView = { - let view = UIButton(type: .custom) - view.isUserInteractionEnabled = false - view.setBackgroundImage(UIImage(named: "hot_bg_icon_01"), for: .normal) - view.setTitle("HOT", for: .normal) - view.setTitleColor(.colorFFFFFF(), for: .normal) - view.titleLabel?.font = .fontRegular(ofSize: 11) + private lazy var stackView: UIStackView = { + let view = UIStackView() + view.axis = .vertical + view.spacing = 10 return view }() - private lazy var unitLabel: VPGradientLabel = { - let label = VPGradientLabel() - label.font = .fontRegular(ofSize: 14) - label.gradientLayer.colors = [UIColor.color64A3A7().cgColor, UIColor.color416767().cgColor] - return label - }() - - private lazy var moneyLabel: VPGradientLabel = { - let label = VPGradientLabel() - label.font = .fontAaHouDiHei(ofSize: 22) - label.gradientLayer.colors = [UIColor.color64A3A7().cgColor, UIColor.color416767().cgColor] - return label - }() - - private lazy var durationLabel: VPGradientLabel = { - let label = VPGradientLabel() - label.font = .fontRegular(ofSize: 12) - label.gradientLayer.colors = [UIColor.color64A3A7().cgColor, UIColor.color416767().cgColor] - return label - }() - - private lazy var extraBgView: UIView = { - let view = VPGradientView() - view.colors = [UIColor.colorDAFDFF().cgColor, UIColor.colorDAFDFF(alpha: 0).cgColor] - view.locations = [0, 1] - view.startPoint = .init(x: 0, y: 0.5) - view.endPoint = .init(x: 1, y: 0.5) - view.layer.cornerRadius = 4 - view.layer.masksToBounds = true - return view - }() - - private lazy var extraLabel: UILabel = { - let label = UILabel() - label.font = .fontRegular(ofSize: 10) - label.textColor = .color416767() - return label - }() - - private lazy var extraIconView: UIImageView = { - let imageView = UIImageView(image: UIImage(named: "coin_icon_08")) - return imageView - }() - override init(frame: CGRect) { super.init(frame: frame) @@ -195,6 +133,29 @@ extension VPVipAlertView { // } } + + @objc private func handleItemView(sender: VPVipAlertItemView) { + guard let item = sender.item else { return } + if sender.item != currentItem { + currentItem = item + self.stackView.arrangedSubviews.forEach { + let view = $0 as? VPVipAlertItemView + if view?.item == item { + view?.isSelected = true + } else { + view?.isSelected = false + } + } + } + + VPIAPManager.manager.start(model: item) { [weak self] finish in + if finish { + self?.dismiss() + VPLoginManager.manager.updateUserInfo(completer: nil) + } + } + } + } extension VPVipAlertView { @@ -202,23 +163,15 @@ extension VPVipAlertView { private func vp_setupUI() { contentView.addSubview(bgView) contentView.addSubview(bgIconImageView) - contentView.addSubview(unlockButton) contentView.addSubview(closeButton) bgView.addSubview(titleLabel) bgView.addSubview(textLabel) - bgView.addSubview(vipBgView) - vipBgView.addSubview(hotView) - vipBgView.addSubview(unitLabel) - vipBgView.addSubview(moneyLabel) - vipBgView.addSubview(durationLabel) - vipBgView.addSubview(extraBgView) - extraBgView.addSubview(extraLabel) - extraBgView.addSubview(extraIconView) + bgView.addSubview(stackView) + bgView.snp.makeConstraints { make in make.top.left.right.equalToSuperview() make.width.equalTo(274) -// make.height.equalTo(330) } bgIconImageView.snp.makeConstraints { make in @@ -226,14 +179,9 @@ extension VPVipAlertView { make.top.equalToSuperview().offset(-136) } - unlockButton.snp.makeConstraints { make in - make.centerX.equalToSuperview() - make.top.equalTo(bgView.snp.bottom).offset(8) - } - closeButton.snp.makeConstraints { make in make.centerX.equalToSuperview() - make.top.equalTo(unlockButton.snp.bottom).offset(20) + make.top.equalTo(bgView.snp.bottom).offset(20) make.bottom.equalToSuperview() } @@ -248,49 +196,14 @@ extension VPVipAlertView { make.right.lessThanOrEqualToSuperview().offset(-20) } - vipBgView.snp.makeConstraints { make in - make.top.equalTo(textLabel.snp.bottom).offset(15) + stackView.snp.makeConstraints { make in + make.left.equalToSuperview().offset(16) make.centerX.equalToSuperview() - make.bottom.equalToSuperview().offset(-22) + make.top.equalTo(textLabel.snp.bottom).offset(12) + make.bottom.equalToSuperview().offset(-20) } - hotView.snp.makeConstraints { make in - make.top.equalToSuperview() - make.right.equalToSuperview() - } - unitLabel.snp.makeConstraints { make in - make.left.equalToSuperview().offset(16) - make.top.equalToSuperview().offset(16) - } - - moneyLabel.snp.makeConstraints { make in - make.left.equalTo(unitLabel.snp.right) - make.bottom.equalTo(unitLabel).offset(4) - } - - durationLabel.snp.makeConstraints { make in - make.bottom.equalTo(moneyLabel).offset(-5) - make.left.equalTo(moneyLabel.snp.right) - } - - extraBgView.snp.makeConstraints { make in - make.left.equalToSuperview().offset(16) - make.bottom.equalToSuperview().offset(-9) - make.height.equalTo(21) -// make.width.equalTo(86) - } - - extraLabel.snp.makeConstraints { make in - make.left.equalToSuperview().offset(11) - make.centerY.equalToSuperview() - } - - extraIconView.snp.makeConstraints { make in - make.centerY.equalToSuperview() - make.left.equalTo(extraLabel.snp.right).offset(3) - make.right.equalToSuperview().offset(-7) - } } diff --git a/Veloria/Class/Rewards/Controller/VPRewardsViewController.swift b/Veloria/Class/Rewards/Controller/VPRewardsViewController.swift index bcb9547..72861b2 100644 --- a/Veloria/Class/Rewards/Controller/VPRewardsViewController.swift +++ b/Veloria/Class/Rewards/Controller/VPRewardsViewController.swift @@ -10,15 +10,7 @@ import WebKit class VPRewardsViewController: VPCampaignWebViewController { - private lazy var emptyView: VPEmptyView = { - let view = VPEmptyView.createNoNetworkEmptyView { [weak self] in - guard let self = self else { return } - if let url = self.urlStr { - self.load(urlString: url) - } - } - return view - }() + override func viewDidLoad() { self.urlStr = kVPRewardsWebUrl @@ -37,27 +29,17 @@ class VPRewardsViewController: VPCampaignWebViewController { override func webView(_ webView: VPWebView, shouldStartLoadWith navigationAction: WKNavigationAction) -> Bool { let result = super.webView(webView, shouldStartLoadWith: navigationAction) - emptyView.removeFromSuperview() return result } override func webViewDidFinishLoad(_ webView: VPWebView) { super.webViewDidFinishLoad(webView) - emptyView.isHidden = true + } override func webView(_ webView: VPWebView, didFailLoadWithError error: any Error) { super.webView(webView, didFailLoadWithError: error) - if VPNetworkReachabilityManager.manager.isReachable != true { - if emptyView.superview == nil { - view.addSubview(emptyView) - emptyView.snp.makeConstraints { make in - make.left.equalToSuperview() - make.centerX.equalToSuperview() - make.centerY.equalToSuperview().offset(-100) - } - } - } + } } diff --git a/Veloria/Class/Wallet/Controller/VPWalletViewController.swift b/Veloria/Class/Wallet/Controller/VPWalletViewController.swift index f3364fa..b1c108f 100644 --- a/Veloria/Class/Wallet/Controller/VPWalletViewController.swift +++ b/Veloria/Class/Wallet/Controller/VPWalletViewController.swift @@ -74,16 +74,6 @@ class VPWalletViewController: WMZPageController { 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")) diff --git a/Veloria/Class/Wallet/View/VPConsumptionRecordsCell.swift b/Veloria/Class/Wallet/View/VPConsumptionRecordsCell.swift index 2574a2c..397ded3 100644 --- a/Veloria/Class/Wallet/View/VPConsumptionRecordsCell.swift +++ b/Veloria/Class/Wallet/View/VPConsumptionRecordsCell.swift @@ -32,11 +32,15 @@ class VPConsumptionRecordsCell: VPWalletBaseCell { let label = UILabel() label.font = .fontMedium(ofSize: 15) label.textColor = .color05CEA0() + label.setContentHuggingPriority(.required, for: .horizontal) + label.setContentCompressionResistancePriority(.required, for: .horizontal) return label }() private lazy var coinIconImageView: UIImageView = { let imageView = UIImageView(image: UIImage(named: "coin_icon_07")) + imageView.setContentHuggingPriority(.required, for: .horizontal) + imageView.setContentCompressionResistancePriority(.required, for: .horizontal) return imageView }() @@ -80,6 +84,7 @@ extension VPConsumptionRecordsCell { titleLabel.snp.makeConstraints { make in make.left.equalToSuperview().offset(11) make.centerY.equalTo(coinIconImageView) + make.right.lessThanOrEqualTo(coinCountLabel.snp.left).offset(-10) } coinCountLabel.snp.makeConstraints { make in diff --git a/Veloria/Class/Wallet/View/VPGiveCoinRecordsCell.swift b/Veloria/Class/Wallet/View/VPGiveCoinRecordsCell.swift index 3a65808..abd94d3 100644 --- a/Veloria/Class/Wallet/View/VPGiveCoinRecordsCell.swift +++ b/Veloria/Class/Wallet/View/VPGiveCoinRecordsCell.swift @@ -46,11 +46,15 @@ class VPGiveCoinRecordsCell: VPWalletBaseCell { let label = UILabel() label.font = .fontMedium(ofSize: 15) label.textColor = .color05CEA0() + label.setContentHuggingPriority(.required, for: .horizontal) + label.setContentCompressionResistancePriority(.required, for: .horizontal) return label }() private lazy var coinIconImageView: UIImageView = { let imageView = UIImageView(image: UIImage(named: "coin_icon_07")) + imageView.setContentHuggingPriority(.required, for: .horizontal) + imageView.setContentCompressionResistancePriority(.required, for: .horizontal) return imageView }() @@ -84,6 +88,7 @@ extension VPGiveCoinRecordsCell { titleLabel.snp.makeConstraints { make in make.left.equalToSuperview().offset(11) + make.right.lessThanOrEqualTo(self.coinCountLabel.snp.left).offset(-10) make.centerY.equalTo(coinIconImageView) } diff --git a/Veloria/Source/Assets.xcassets/icon/hot_bg_icon_01.imageset/Contents.json b/Veloria/Source/Assets.xcassets/icon/hot_bg_icon_01.imageset/Contents.json index 8d4a42c..5472a49 100644 --- a/Veloria/Source/Assets.xcassets/icon/hot_bg_icon_01.imageset/Contents.json +++ b/Veloria/Source/Assets.xcassets/icon/hot_bg_icon_01.imageset/Contents.json @@ -5,12 +5,12 @@ "scale" : "1x" }, { - "filename" : "Rectangle 29@2x.png", + "filename" : "hot@2x.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "Rectangle 29@3x.png", + "filename" : "hot@3x.png", "idiom" : "universal", "scale" : "3x" } diff --git a/Veloria/Source/Assets.xcassets/icon/hot_bg_icon_01.imageset/Rectangle 29@2x.png b/Veloria/Source/Assets.xcassets/icon/hot_bg_icon_01.imageset/Rectangle 29@2x.png deleted file mode 100644 index 29151f9..0000000 Binary files a/Veloria/Source/Assets.xcassets/icon/hot_bg_icon_01.imageset/Rectangle 29@2x.png and /dev/null differ diff --git a/Veloria/Source/Assets.xcassets/icon/hot_bg_icon_01.imageset/Rectangle 29@3x.png b/Veloria/Source/Assets.xcassets/icon/hot_bg_icon_01.imageset/Rectangle 29@3x.png deleted file mode 100644 index 98558c9..0000000 Binary files a/Veloria/Source/Assets.xcassets/icon/hot_bg_icon_01.imageset/Rectangle 29@3x.png and /dev/null differ diff --git a/Veloria/Source/Assets.xcassets/icon/hot_bg_icon_01.imageset/hot@2x.png b/Veloria/Source/Assets.xcassets/icon/hot_bg_icon_01.imageset/hot@2x.png new file mode 100644 index 0000000..4a72932 Binary files /dev/null and b/Veloria/Source/Assets.xcassets/icon/hot_bg_icon_01.imageset/hot@2x.png differ diff --git a/Veloria/Source/Assets.xcassets/icon/hot_bg_icon_01.imageset/hot@3x.png b/Veloria/Source/Assets.xcassets/icon/hot_bg_icon_01.imageset/hot@3x.png new file mode 100644 index 0000000..948ec22 Binary files /dev/null and b/Veloria/Source/Assets.xcassets/icon/hot_bg_icon_01.imageset/hot@3x.png differ diff --git a/Veloria/Source/Assets.xcassets/icon/selected_icon_03.imageset/Component 63@2x.png b/Veloria/Source/Assets.xcassets/icon/selected_icon_03.imageset/Component 63@2x.png new file mode 100644 index 0000000..34c7fc1 Binary files /dev/null and b/Veloria/Source/Assets.xcassets/icon/selected_icon_03.imageset/Component 63@2x.png differ diff --git a/Veloria/Source/Assets.xcassets/icon/selected_icon_03.imageset/Component 63@3x.png b/Veloria/Source/Assets.xcassets/icon/selected_icon_03.imageset/Component 63@3x.png new file mode 100644 index 0000000..dcf2a8d Binary files /dev/null and b/Veloria/Source/Assets.xcassets/icon/selected_icon_03.imageset/Component 63@3x.png differ diff --git a/Veloria/Source/Assets.xcassets/icon/selected_icon_03.imageset/Contents.json b/Veloria/Source/Assets.xcassets/icon/selected_icon_03.imageset/Contents.json new file mode 100644 index 0000000..1f53eaf --- /dev/null +++ b/Veloria/Source/Assets.xcassets/icon/selected_icon_03.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Component 63@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Component 63@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Veloria/Source/Assets.xcassets/icon/vip_unlock_button.imageset/按钮@2x.png b/Veloria/Source/Assets.xcassets/icon/vip_unlock_button.imageset/按钮@2x.png deleted file mode 100644 index 7683c3f..0000000 Binary files a/Veloria/Source/Assets.xcassets/icon/vip_unlock_button.imageset/按钮@2x.png and /dev/null differ diff --git a/Veloria/Source/Assets.xcassets/icon/vip_unlock_button.imageset/按钮@3x.png b/Veloria/Source/Assets.xcassets/icon/vip_unlock_button.imageset/按钮@3x.png deleted file mode 100644 index c580778..0000000 Binary files a/Veloria/Source/Assets.xcassets/icon/vip_unlock_button.imageset/按钮@3x.png and /dev/null differ diff --git a/Veloria/Source/Assets.xcassets/icon/vip_unlock_button.imageset/Contents.json b/Veloria/Source/Assets.xcassets/image/vip_alert_bg_month.imageset/Contents.json similarity index 76% rename from Veloria/Source/Assets.xcassets/icon/vip_unlock_button.imageset/Contents.json rename to Veloria/Source/Assets.xcassets/image/vip_alert_bg_month.imageset/Contents.json index 379ba42..074ff6f 100644 --- a/Veloria/Source/Assets.xcassets/icon/vip_unlock_button.imageset/Contents.json +++ b/Veloria/Source/Assets.xcassets/image/vip_alert_bg_month.imageset/Contents.json @@ -5,12 +5,12 @@ "scale" : "1x" }, { - "filename" : "按钮@2x.png", + "filename" : "月会员bg@2x.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "按钮@3x.png", + "filename" : "月会员bg@3x.png", "idiom" : "universal", "scale" : "3x" } diff --git a/Veloria/Source/Assets.xcassets/image/vip_alert_bg_month.imageset/月会员bg@2x.png b/Veloria/Source/Assets.xcassets/image/vip_alert_bg_month.imageset/月会员bg@2x.png new file mode 100644 index 0000000..3dbfed7 Binary files /dev/null and b/Veloria/Source/Assets.xcassets/image/vip_alert_bg_month.imageset/月会员bg@2x.png differ diff --git a/Veloria/Source/Assets.xcassets/image/vip_alert_bg_month.imageset/月会员bg@3x.png b/Veloria/Source/Assets.xcassets/image/vip_alert_bg_month.imageset/月会员bg@3x.png new file mode 100644 index 0000000..b645950 Binary files /dev/null and b/Veloria/Source/Assets.xcassets/image/vip_alert_bg_month.imageset/月会员bg@3x.png differ diff --git a/Veloria/Source/Assets.xcassets/image/vip_alert_bg_quarter.imageset/Contents.json b/Veloria/Source/Assets.xcassets/image/vip_alert_bg_quarter.imageset/Contents.json new file mode 100644 index 0000000..edf0a73 --- /dev/null +++ b/Veloria/Source/Assets.xcassets/image/vip_alert_bg_quarter.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "季会员bg@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "季会员bg@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Veloria/Source/Assets.xcassets/image/vip_alert_bg_quarter.imageset/季会员bg@2x.png b/Veloria/Source/Assets.xcassets/image/vip_alert_bg_quarter.imageset/季会员bg@2x.png new file mode 100644 index 0000000..13dad66 Binary files /dev/null and b/Veloria/Source/Assets.xcassets/image/vip_alert_bg_quarter.imageset/季会员bg@2x.png differ diff --git a/Veloria/Source/Assets.xcassets/image/vip_alert_bg_quarter.imageset/季会员bg@3x.png b/Veloria/Source/Assets.xcassets/image/vip_alert_bg_quarter.imageset/季会员bg@3x.png new file mode 100644 index 0000000..07b220a Binary files /dev/null and b/Veloria/Source/Assets.xcassets/image/vip_alert_bg_quarter.imageset/季会员bg@3x.png differ diff --git a/Veloria/Source/Assets.xcassets/image/vip_alert_bg_week.imageset/Contents.json b/Veloria/Source/Assets.xcassets/image/vip_alert_bg_week.imageset/Contents.json index 9f9964f..6c3738d 100644 --- a/Veloria/Source/Assets.xcassets/image/vip_alert_bg_week.imageset/Contents.json +++ b/Veloria/Source/Assets.xcassets/image/vip_alert_bg_week.imageset/Contents.json @@ -5,12 +5,12 @@ "scale" : "1x" }, { - "filename" : "会员卡片bg@2x.png", + "filename" : "周会员bg@2x.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "会员卡片bg@3x.png", + "filename" : "周会员bg@3x.png", "idiom" : "universal", "scale" : "3x" } diff --git a/Veloria/Source/Assets.xcassets/image/vip_alert_bg_week.imageset/会员卡片bg@2x.png b/Veloria/Source/Assets.xcassets/image/vip_alert_bg_week.imageset/会员卡片bg@2x.png deleted file mode 100644 index e66e508..0000000 Binary files a/Veloria/Source/Assets.xcassets/image/vip_alert_bg_week.imageset/会员卡片bg@2x.png and /dev/null differ diff --git a/Veloria/Source/Assets.xcassets/image/vip_alert_bg_week.imageset/会员卡片bg@3x.png b/Veloria/Source/Assets.xcassets/image/vip_alert_bg_week.imageset/会员卡片bg@3x.png deleted file mode 100644 index ca5a498..0000000 Binary files a/Veloria/Source/Assets.xcassets/image/vip_alert_bg_week.imageset/会员卡片bg@3x.png and /dev/null differ diff --git a/Veloria/Source/Assets.xcassets/image/vip_alert_bg_week.imageset/周会员bg@2x.png b/Veloria/Source/Assets.xcassets/image/vip_alert_bg_week.imageset/周会员bg@2x.png new file mode 100644 index 0000000..740fb96 Binary files /dev/null and b/Veloria/Source/Assets.xcassets/image/vip_alert_bg_week.imageset/周会员bg@2x.png differ diff --git a/Veloria/Source/Assets.xcassets/image/vip_alert_bg_week.imageset/周会员bg@3x.png b/Veloria/Source/Assets.xcassets/image/vip_alert_bg_week.imageset/周会员bg@3x.png new file mode 100644 index 0000000..5047798 Binary files /dev/null and b/Veloria/Source/Assets.xcassets/image/vip_alert_bg_week.imageset/周会员bg@3x.png differ diff --git a/Veloria/Source/Assets.xcassets/image/vip_alert_bg_year.imageset/Contents.json b/Veloria/Source/Assets.xcassets/image/vip_alert_bg_year.imageset/Contents.json new file mode 100644 index 0000000..5ed65d0 --- /dev/null +++ b/Veloria/Source/Assets.xcassets/image/vip_alert_bg_year.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "年会员bg@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "年会员bg@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Veloria/Source/Assets.xcassets/image/vip_alert_bg_year.imageset/年会员bg@2x.png b/Veloria/Source/Assets.xcassets/image/vip_alert_bg_year.imageset/年会员bg@2x.png new file mode 100644 index 0000000..24f5572 Binary files /dev/null and b/Veloria/Source/Assets.xcassets/image/vip_alert_bg_year.imageset/年会员bg@2x.png differ diff --git a/Veloria/Source/Assets.xcassets/image/vip_alert_bg_year.imageset/年会员bg@3x.png b/Veloria/Source/Assets.xcassets/image/vip_alert_bg_year.imageset/年会员bg@3x.png new file mode 100644 index 0000000..1ec0f4f Binary files /dev/null and b/Veloria/Source/Assets.xcassets/image/vip_alert_bg_year.imageset/年会员bg@3x.png differ