Commit ade73cc3 authored by Steven杜宇's avatar Steven杜宇
parents 59be68e1 fd4807c3
......@@ -1228,6 +1228,9 @@
04B00F802D951D0B00F640C5 /* YHMakePlanHeadView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B00F7F2D951D0B00F640C5 /* YHMakePlanHeadView.swift */; };
04B00F822D95497400F640C5 /* YHMakePlanStateHeadView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B00F812D95497400F640C5 /* YHMakePlanStateHeadView.swift */; };
04B00F842D95518C00F640C5 /* YHMakePlanCusttomHeadView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B00F832D95518C00F640C5 /* YHMakePlanCusttomHeadView.swift */; };
04B00F862D966EAB00F640C5 /* YHMakePlanBottomView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B00F852D966EAB00F640C5 /* YHMakePlanBottomView.swift */; };
04B00F882D96964100F640C5 /* YHMakePlanCardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B00F872D96964100F640C5 /* YHMakePlanCardView.swift */; };
04B00F8A2D96969E00F640C5 /* YHMakePlanCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B00F892D96969E00F640C5 /* YHMakePlanCell.swift */; };
04D8FF552D9258AA00703C75 /* YHPlanScoreView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D8FF542D9258AA00703C75 /* YHPlanScoreView.swift */; };
04D8FF572D925A0800703C75 /* YHPlanScoreChart.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D8FF562D925A0800703C75 /* YHPlanScoreChart.swift */; };
04D8FF592D925E6700703C75 /* YHPlanModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D8FF582D925E6700703C75 /* YHPlanModel.swift */; };
......@@ -2513,6 +2516,9 @@
04B00F7F2D951D0B00F640C5 /* YHMakePlanHeadView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMakePlanHeadView.swift; sourceTree = "<group>"; };
04B00F812D95497400F640C5 /* YHMakePlanStateHeadView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMakePlanStateHeadView.swift; sourceTree = "<group>"; };
04B00F832D95518C00F640C5 /* YHMakePlanCusttomHeadView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMakePlanCusttomHeadView.swift; sourceTree = "<group>"; };
04B00F852D966EAB00F640C5 /* YHMakePlanBottomView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMakePlanBottomView.swift; sourceTree = "<group>"; };
04B00F872D96964100F640C5 /* YHMakePlanCardView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMakePlanCardView.swift; sourceTree = "<group>"; };
04B00F892D96969E00F640C5 /* YHMakePlanCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMakePlanCell.swift; sourceTree = "<group>"; };
04D8FF542D9258AA00703C75 /* YHPlanScoreView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPlanScoreView.swift; sourceTree = "<group>"; };
04D8FF562D925A0800703C75 /* YHPlanScoreChart.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPlanScoreChart.swift; sourceTree = "<group>"; };
04D8FF582D925E6700703C75 /* YHPlanModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPlanModel.swift; sourceTree = "<group>"; };
......@@ -6691,6 +6697,9 @@
04B00F7F2D951D0B00F640C5 /* YHMakePlanHeadView.swift */,
04B00F812D95497400F640C5 /* YHMakePlanStateHeadView.swift */,
04B00F832D95518C00F640C5 /* YHMakePlanCusttomHeadView.swift */,
04B00F852D966EAB00F640C5 /* YHMakePlanBottomView.swift */,
04B00F872D96964100F640C5 /* YHMakePlanCardView.swift */,
04B00F892D96969E00F640C5 /* YHMakePlanCell.swift */,
);
path = V;
sourceTree = "<group>";
......@@ -7409,6 +7418,7 @@
045C10B92D12CA5F00BD2DC0 /* YHClipperButton.swift in Sources */,
045C10BA2D12CA5F00BD2DC0 /* YHInvitationNumberItemView.swift in Sources */,
045C10BB2D12CA5F00BD2DC0 /* YHChildInfoContainerVC.swift in Sources */,
04B00F8A2D96969E00F640C5 /* YHMakePlanCell.swift in Sources */,
045C10BC2D12CA5F00BD2DC0 /* YHSignatureWebViewController.swift in Sources */,
04307BA32D1E4CA600ED8E8D /* YHGCInformationFillTipsCell.swift in Sources */,
04D8FF6F2D954D9B00703C75 /* YHPlanPolicyCarouselView.swift in Sources */,
......@@ -7892,6 +7902,7 @@
045C12582D12CA5F00BD2DC0 /* YHMatchResultListViewController.swift in Sources */,
045C12592D12CA5F00BD2DC0 /* YHMyNewSchemeViewController.swift in Sources */,
045C125A2D12CA5F00BD2DC0 /* YHVisaRenewalGuideParagraphCell.swift in Sources */,
04B00F862D966EAB00F640C5 /* YHMakePlanBottomView.swift in Sources */,
045C125B2D12CA5F00BD2DC0 /* YHMyWorkExperienceCell.swift in Sources */,
045C125C2D12CA5F00BD2DC0 /* YHAdopterCardTableViewCell.swift in Sources */,
045C125D2D12CA5F00BD2DC0 /* YHAIRequestManager.swift in Sources */,
......@@ -7991,6 +8002,7 @@
045C12B32D12CA5F00BD2DC0 /* YHFamilyInfoConfirmViewModel.swift in Sources */,
045C12B42D12CA5F00BD2DC0 /* YHLifeDetailViewController.swift in Sources */,
045C12B52D12CA5F00BD2DC0 /* YHIncomeRecordWorkExperienceViewController.swift in Sources */,
04B00F882D96964100F640C5 /* YHMakePlanCardView.swift in Sources */,
045C12B62D12CA5F00BD2DC0 /* YHMyLikeViewModel.swift in Sources */,
045C12B72D12CA5F00BD2DC0 /* YHCertificateUploadSheetView.swift in Sources */,
045C12B82D12CA5F00BD2DC0 /* YHResignHaveAppointedApplicantsInfoCell.swift in Sources */,
......
......@@ -23,11 +23,16 @@ class YHMakePlanViewController: YHBaseViewController {
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.register(YHComprehensiveEvaluationCell.self, forCellReuseIdentifier: YHComprehensiveEvaluationCell.cellReuseIdentifier)
tableView.register(cellWithClass: YHMakePlanCell.self)
tableView.tableHeaderView = YHMakePlanHeadView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 333.fix + 44))
return tableView
}()
lazy var priceView: YHMakePlanBottomView = {
let view = YHMakePlanBottomView()
return view
}()
override func viewDidLoad() {
super.viewDidLoad()
......@@ -37,9 +42,23 @@ class YHMakePlanViewController: YHBaseViewController {
// gk_navBackgroundImage = UIImage(named: "my_scheme_nav")
gk_backImage = UIImage(named: "back_icon_white")
// Create and add to your view
view.addSubview(priceView)
priceView.snp.makeConstraints { make in
make.bottom.left.right.equalToSuperview()
make.height.equalTo(98)
}
// Configure with data
priceView.configure(price: "489800") {
print("Action button tapped!")
// Handle the "去办理" action here
}
self.view.addSubview(tableView)
tableView.snp.makeConstraints { make in
make.top.left.right.bottom.equalToSuperview()
make.top.left.right.equalToSuperview()
make.bottom.equalTo(-98)
}
requestData()
}
......@@ -56,19 +75,20 @@ class YHMakePlanViewController: YHBaseViewController {
extension YHMakePlanViewController: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return items.count
// return items.count
return 4
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHComprehensiveEvaluationCell.cellReuseIdentifier, for: indexPath) as? YHComprehensiveEvaluationCell else {
guard let cell = tableView.dequeueReusableCell(withClass: YHMakePlanCell.self) as? YHMakePlanCell else {
return UITableViewCell()
}
cell.dataSource = [CompanyPackageData(title: "香港身份申请至永居删除", subtitle: "香港高才入境计划申请到永居全流程", companyName: "", priceTag: "", price: "¥20000.00", showCheckmark: true)]
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return UITableView.automaticDimension
return 158 + 16
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
......@@ -90,7 +110,7 @@ extension YHMakePlanViewController: UITableViewDelegate, UITableViewDataSource {
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 12.0
return 0.01
}
}
//
// YHMakePlanBottomView.swift
// galaxy
//
// Created by EDY on 2025/3/28.
// Copyright © 2025 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHMakePlanBottomView: UIView {
// MARK: - UI Elements
private lazy var priceLabel: UILabel = {
let label = UILabel()
label.font = UIFont.systemFont(ofSize: 24, weight: .bold)
label.textColor = .black
label.textAlignment = .left
return label
}()
private lazy var priceButton: UIButton = {
let label = UIButton()
label.setTitle(">", for: .normal)
label.titleLabel?.font = UIFont.systemFont(ofSize: 16, weight: .medium)
label.setTitleColor(UIColor.systemBlue, for: .normal)
label.addTarget(self, action: #selector(handleAction), for: .touchUpInside)
return label
}()
private lazy var actionButton: UIButton = {
let button = UIButton(type: .system)
button.setTitle("去办理 →", for: .normal)
button.titleLabel?.font = UIFont.systemFont(ofSize: 16, weight: .medium)
button.setTitleColor(UIColor.systemBlue, for: .normal)
button.addTarget(self, action: #selector(handleAction), for: .touchUpInside)
return button
}()
// MARK: - Properties
var price: String = "" {
didSet {
priceLabel.text = "\(price)"
}
}
var actionHandler: (() -> Void)?
// MARK: - Initialization
override init(frame: CGRect) {
super.init(frame: frame)
setupUI()
setupConstraints()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
// MARK: - Setup
private func setupUI() {
backgroundColor = .white
addSubview(priceLabel)
addSubview(priceButton)
addSubview(actionButton)
}
private func setupConstraints() {
priceLabel.snp.makeConstraints { make in
make.top.equalToSuperview().offset(20)
make.left.equalToSuperview().offset(16)
make.height.equalTo(28)
}
priceButton.snp.makeConstraints { make in
make.left.equalTo(priceLabel.snp.right)
make.width.height.equalTo(16)
make.centerY.equalTo(priceLabel.snp.centerY)
}
actionButton.snp.makeConstraints { make in
make.top.equalToSuperview().offset(9)
make.right.equalToSuperview().offset(-16)
make.width.equalTo(120)
make.height.equalTo(46)
}
}
// MARK: - Action
@objc private func handleAction() {
actionHandler?()
}
// MARK: - Configuration
func configure(price: String, actionText: String? = nil, actionHandler: (() -> Void)? = nil) {
self.price = price
if let actionText = actionText {
actionButton.setTitle(actionText, for: .normal)
}
self.actionHandler = actionHandler
}
}
//
// YHMakePlanCardView.swift
// galaxy
//
// Created by EDY on 2025/3/28.
// Copyright © 2025 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHMakePlanCardView: UIView {
// MARK: - UI Elements
private lazy var containerView: UIView = {
let view = UIView()
view.backgroundColor = .white
return view
}()
private lazy var titleLabel: UILabel = {
let label = UILabel()
label.font = UIFont.systemFont(ofSize: 16, weight: .semibold)
label.textColor = .darkText
label.numberOfLines = 1
return label
}()
private lazy var subtitleLabel: UILabel = {
let label = UILabel()
label.font = UIFont.systemFont(ofSize: 13, weight: .regular)
label.textColor = .gray
label.numberOfLines = 2
return label
}()
private lazy var companyImageView: UIImageView = {
let view = UIImageView()
view.backgroundColor = UIColor(red: 0.95, green: 0.95, blue: 0.96, alpha: 1.0)
return view
}()
private lazy var storeButton: UIButton = {
let button = UIButton()
button.setTitle("星企航(7年)", for: .normal)
button.titleLabel?.font = UIFont.systemFont(ofSize: 16, weight: .medium)
button.setTitleColor(UIColor.systemBlue, for: .normal)
// button.addTarget(self, action: #selector(handleAction), for: .touchUpInside)
return button
}()
private lazy var priceTagView: UILabel = {
let label = UILabel()
label.font = UIFont.systemFont(ofSize: 14, weight: .medium)
label.textColor = UIColor(red: 0.2, green: 0.4, blue: 0.8, alpha: 1.0)
return label
}()
private lazy var selectButton: UIButton = {
let button = UIButton()
button.backgroundColor = .red
// button.addTarget(self, action: #selector(handleAction), for: .touchUpInside)
return button
}()
// MARK: - Initialization
override init(frame: CGRect) {
super.init(frame: frame)
setupUI()
setupConstraints()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
// MARK: - Setup
private func setupUI() {
addSubview(containerView)
containerView.addSubview(titleLabel)
containerView.addSubview(subtitleLabel)
containerView.addSubview(companyImageView)
containerView.addSubview(priceTagView)
containerView.addSubview(storeButton)
containerView.addSubview(selectButton)
}
private func setupConstraints() {
containerView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
titleLabel.snp.makeConstraints { make in
make.top.equalToSuperview().offset(16)
make.left.equalToSuperview().offset(110)
make.right.equalToSuperview().offset(-16)
}
subtitleLabel.snp.makeConstraints { make in
make.top.equalToSuperview().offset(40)
make.left.equalToSuperview().offset(110)
make.right.equalToSuperview().offset(-16)
}
companyImageView.snp.makeConstraints { make in
make.top.equalTo(18)
make.left.equalTo(16)
make.height.width.equalTo(86)
}
storeButton.snp.makeConstraints { make in
make.top.equalToSuperview().offset(60)
make.left.equalToSuperview().offset(110)
make.width.equalTo(97)
make.height.equalTo(22)
}
priceTagView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(86)
make.left.equalToSuperview().offset(110)
make.right.equalToSuperview().offset(-16)
}
selectButton.snp.makeConstraints { make in
make.right.bottom.equalTo(-18)
make.height.width.equalTo(16)
}
}
// MARK: - Configuration
func configure(with data: CompanyPackageData) {
titleLabel.text = data.title
subtitleLabel.text = data.subtitle
priceTagView.text = data.price
}
}
struct CompanyPackageData {
let title: String
let subtitle: String
let companyName: String
let priceTag: String
let price: String
let showCheckmark: Bool
}
//
// YHMakePlanCell.swift
// galaxy
//
// Created by EDY on 2025/3/28.
// Copyright © 2025 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHMakePlanCell: UITableViewCell {
// typealias InformationBlock = (_ model: YHItemModel) -> Void
var centerView: UIView!
var titleLabel: UILabel!
var mainItemView: UIView!
var country: String = ""
var dataSource: [CompanyPackageData]? {
didSet {
updateAllViews()
}
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
selectionStyle = .none
setupUI()
}
func setupUI() {
contentView.backgroundColor = .clear
backgroundColor = .clear
centerView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius6
return view
}()
contentView.addSubview(centerView)
centerView.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.top.equalTo(7)
make.bottom.equalTo(-7)
}
titleLabel = {
let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 15)
label.textColor = UIColor.mainTextColor
return label
}()
centerView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(16)
make.height.equalTo(20)
make.right.equalTo(-18)
}
mainItemView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius6
return view
}()
centerView.addSubview(mainItemView)
mainItemView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.top.equalTo(36)
}
}
func updateAllViews() {
titleLabel.text = "基础身份续签"
mainItemView.removeSubviews()
var y = 0
for i in 0 ..< (dataSource?.count ?? 0) {
if i != 0 || i != (dataSource?.count ?? 0) - 1 {
let line = UIView()
line.backgroundColor = UIColor.separatorColor
mainItemView.addSubview(line)
line.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(y)
make.height.equalTo(1)
make.right.equalTo(-18)
}
y += 1
}
var h = 121
let itemView = YHMakePlanCardView()
itemView.configure(with: CompanyPackageData(title: "香港身份申请至永居删除", subtitle: "香港高才入境计划申请到永居全流程", companyName: "", priceTag: "", price: "¥20000.00", showCheckmark: true))
mainItemView.addSubview(itemView)
itemView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(y)
make.height.equalTo(h)
}
y += h
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment