Commit 15fc65d2 authored by Alex朱枝文's avatar Alex朱枝文

高才申请类别

parent ab5d188a
...@@ -594,6 +594,10 @@ ...@@ -594,6 +594,10 @@
04B360F52C646844001EB053 /* YHPrincipleApprovedMailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B360F42C646844001EB053 /* YHPrincipleApprovedMailViewController.swift */; }; 04B360F52C646844001EB053 /* YHPrincipleApprovedMailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B360F42C646844001EB053 /* YHPrincipleApprovedMailViewController.swift */; };
04B360F72C646B4F001EB053 /* YHPrincipleEnvelopeModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B360F62C646B4F001EB053 /* YHPrincipleEnvelopeModel.swift */; }; 04B360F72C646B4F001EB053 /* YHPrincipleEnvelopeModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B360F62C646B4F001EB053 /* YHPrincipleEnvelopeModel.swift */; };
04B401802CDB4B3C005C61A9 /* YHTalentProgramEvaluationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B4017F2CDB4B3B005C61A9 /* YHTalentProgramEvaluationView.swift */; }; 04B401802CDB4B3C005C61A9 /* YHTalentProgramEvaluationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B4017F2CDB4B3B005C61A9 /* YHTalentProgramEvaluationView.swift */; };
04B4018A2CE1D0C6005C61A9 /* YHGCApplicationTypeController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B401892CE1D0C6005C61A9 /* YHGCApplicationTypeController.swift */; };
04B4018C2CE1D236005C61A9 /* YHGCApplicationTypeSelectCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B4018B2CE1D236005C61A9 /* YHGCApplicationTypeSelectCell.swift */; };
04B4018F2CE1E6DB005C61A9 /* YHGCApplicationType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B4018E2CE1E6DB005C61A9 /* YHGCApplicationType.swift */; };
04B401912CE20360005C61A9 /* YHGCApplicationModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B401902CE20360005C61A9 /* YHGCApplicationModel.swift */; };
04B4B8D52C89CE5E00ED82BC /* YHButlerServiceMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B4B8D42C89CE5E00ED82BC /* YHButlerServiceMessage.swift */; }; 04B4B8D52C89CE5E00ED82BC /* YHButlerServiceMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B4B8D42C89CE5E00ED82BC /* YHButlerServiceMessage.swift */; };
04B4B8D72C8AE77C00ED82BC /* YHButlerServiceMessageHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B4B8D62C8AE77C00ED82BC /* YHButlerServiceMessageHandler.swift */; }; 04B4B8D72C8AE77C00ED82BC /* YHButlerServiceMessageHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B4B8D62C8AE77C00ED82BC /* YHButlerServiceMessageHandler.swift */; };
04B4B8DC2C90696E00ED82BC /* YHResignDocumentManagementVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B4B8DB2C90696E00ED82BC /* YHResignDocumentManagementVC.swift */; }; 04B4B8DC2C90696E00ED82BC /* YHResignDocumentManagementVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B4B8DB2C90696E00ED82BC /* YHResignDocumentManagementVC.swift */; };
...@@ -1571,6 +1575,10 @@ ...@@ -1571,6 +1575,10 @@
04B360F42C646844001EB053 /* YHPrincipleApprovedMailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPrincipleApprovedMailViewController.swift; sourceTree = "<group>"; }; 04B360F42C646844001EB053 /* YHPrincipleApprovedMailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPrincipleApprovedMailViewController.swift; sourceTree = "<group>"; };
04B360F62C646B4F001EB053 /* YHPrincipleEnvelopeModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPrincipleEnvelopeModel.swift; sourceTree = "<group>"; }; 04B360F62C646B4F001EB053 /* YHPrincipleEnvelopeModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPrincipleEnvelopeModel.swift; sourceTree = "<group>"; };
04B4017F2CDB4B3B005C61A9 /* YHTalentProgramEvaluationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHTalentProgramEvaluationView.swift; sourceTree = "<group>"; }; 04B4017F2CDB4B3B005C61A9 /* YHTalentProgramEvaluationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHTalentProgramEvaluationView.swift; sourceTree = "<group>"; };
04B401892CE1D0C6005C61A9 /* YHGCApplicationTypeController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCApplicationTypeController.swift; sourceTree = "<group>"; };
04B4018B2CE1D236005C61A9 /* YHGCApplicationTypeSelectCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCApplicationTypeSelectCell.swift; sourceTree = "<group>"; };
04B4018E2CE1E6DB005C61A9 /* YHGCApplicationType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCApplicationType.swift; sourceTree = "<group>"; };
04B401902CE20360005C61A9 /* YHGCApplicationModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCApplicationModel.swift; sourceTree = "<group>"; };
04B4B8D42C89CE5E00ED82BC /* YHButlerServiceMessage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHButlerServiceMessage.swift; sourceTree = "<group>"; }; 04B4B8D42C89CE5E00ED82BC /* YHButlerServiceMessage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHButlerServiceMessage.swift; sourceTree = "<group>"; };
04B4B8D62C8AE77C00ED82BC /* YHButlerServiceMessageHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHButlerServiceMessageHandler.swift; sourceTree = "<group>"; }; 04B4B8D62C8AE77C00ED82BC /* YHButlerServiceMessageHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHButlerServiceMessageHandler.swift; sourceTree = "<group>"; };
04B4B8DB2C90696E00ED82BC /* YHResignDocumentManagementVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignDocumentManagementVC.swift; sourceTree = "<group>"; }; 04B4B8DB2C90696E00ED82BC /* YHResignDocumentManagementVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignDocumentManagementVC.swift; sourceTree = "<group>"; };
...@@ -3553,6 +3561,7 @@ ...@@ -3553,6 +3561,7 @@
047F3DB02CDF36DE001B2A6D /* ServiceProcess(我的信息流程) */ = { 047F3DB02CDF36DE001B2A6D /* ServiceProcess(我的信息流程) */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
04B401862CE1D006005C61A9 /* ApplicationType(申请类别) */,
047F3DB72CDF3B30001B2A6D /* FamilyMember(家庭成员信息表) */, 047F3DB72CDF3B30001B2A6D /* FamilyMember(家庭成员信息表) */,
047F3DB12CDF36F8001B2A6D /* Education&Qualification(学历专业资格填写) */, 047F3DB12CDF36F8001B2A6D /* Education&Qualification(学历专业资格填写) */,
); );
...@@ -3953,6 +3962,41 @@ ...@@ -3953,6 +3962,41 @@
path = Localized; path = Localized;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
04B401862CE1D006005C61A9 /* ApplicationType(申请类别) */ = {
isa = PBXGroup;
children = (
04B4018D2CE1E6BB005C61A9 /* M */,
04B401882CE1D036005C61A9 /* V */,
04B401872CE1D02F005C61A9 /* C */,
);
path = "ApplicationType(申请类别)";
sourceTree = "<group>";
};
04B401872CE1D02F005C61A9 /* C */ = {
isa = PBXGroup;
children = (
04B401892CE1D0C6005C61A9 /* YHGCApplicationTypeController.swift */,
);
path = C;
sourceTree = "<group>";
};
04B401882CE1D036005C61A9 /* V */ = {
isa = PBXGroup;
children = (
04B4018B2CE1D236005C61A9 /* YHGCApplicationTypeSelectCell.swift */,
);
path = V;
sourceTree = "<group>";
};
04B4018D2CE1E6BB005C61A9 /* M */ = {
isa = PBXGroup;
children = (
04B4018E2CE1E6DB005C61A9 /* YHGCApplicationType.swift */,
04B401902CE20360005C61A9 /* YHGCApplicationModel.swift */,
);
path = M;
sourceTree = "<group>";
};
04B4B8D32C89CCE400ED82BC /* M */ = { 04B4B8D32C89CCE400ED82BC /* M */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -5675,6 +5719,7 @@ ...@@ -5675,6 +5719,7 @@
04EC2F812C22888E002907D7 /* YHFriendRequestView.swift in Sources */, 04EC2F812C22888E002907D7 /* YHFriendRequestView.swift in Sources */,
044EE24C2C94396E00A2FE3A /* YHResignCertificatePassportTableViewCell.swift in Sources */, 044EE24C2C94396E00A2FE3A /* YHResignCertificatePassportTableViewCell.swift in Sources */,
04F2435B2C9D140C00DF2C74 /* YHHKRecordsTitleCell.swift in Sources */, 04F2435B2C9D140C00DF2C74 /* YHHKRecordsTitleCell.swift in Sources */,
04B401912CE20360005C61A9 /* YHGCApplicationModel.swift in Sources */,
044F393A2CB7772D007CA277 /* YHVisaRenewalGuideRemarkCell.swift in Sources */, 044F393A2CB7772D007CA277 /* YHVisaRenewalGuideRemarkCell.swift in Sources */,
041892242C91BCF100B9FB94 /* YHResignRoundCellType.swift in Sources */, 041892242C91BCF100B9FB94 /* YHResignRoundCellType.swift in Sources */,
04912F7A2CB7A5F400CC3105 /* YHResignHaveAppointedApplicantsInfoCell.swift in Sources */, 04912F7A2CB7A5F400CC3105 /* YHResignHaveAppointedApplicantsInfoCell.swift in Sources */,
...@@ -5855,6 +5900,7 @@ ...@@ -5855,6 +5900,7 @@
0457920F2CBCE9D000EBD99B /* YHResignUploadTravelCardListTableViewCell.swift in Sources */, 0457920F2CBCE9D000EBD99B /* YHResignUploadTravelCardListTableViewCell.swift in Sources */,
04CA2C032CB7D3C200F36DE7 /* YHFileExplainReasonInputView.swift in Sources */, 04CA2C032CB7D3C200F36DE7 /* YHFileExplainReasonInputView.swift in Sources */,
04213B292C48EF5300797900 /* YHHomeInformationViewController.swift in Sources */, 04213B292C48EF5300797900 /* YHHomeInformationViewController.swift in Sources */,
04B4018F2CE1E6DB005C61A9 /* YHGCApplicationType.swift in Sources */,
A5DF9C692C78BE6000CE48E6 /* YHUploadCertificateDetailModel.swift in Sources */, A5DF9C692C78BE6000CE48E6 /* YHUploadCertificateDetailModel.swift in Sources */,
04F4A52A2CB8D5FA0026D469 /* YHForwardArriveHKAlertView.swift in Sources */, 04F4A52A2CB8D5FA0026D469 /* YHForwardArriveHKAlertView.swift in Sources */,
044EE2442C92F48200A2FE3A /* YHResignCertificateEvisaTableViewCell.swift in Sources */, 044EE2442C92F48200A2FE3A /* YHResignCertificateEvisaTableViewCell.swift in Sources */,
...@@ -5953,6 +5999,7 @@ ...@@ -5953,6 +5999,7 @@
045EEF102B9F171A0022A143 /* YHMainApplicantInformationViewModel.swift in Sources */, 045EEF102B9F171A0022A143 /* YHMainApplicantInformationViewModel.swift in Sources */,
0493B3DC2BA7EFE600AF9393 /* YHCertificateSearchViewController.swift in Sources */, 0493B3DC2BA7EFE600AF9393 /* YHCertificateSearchViewController.swift in Sources */,
A5DF9C632C78733200CE48E6 /* YHHKLegaldaysModel.swift in Sources */, A5DF9C632C78733200CE48E6 /* YHHKLegaldaysModel.swift in Sources */,
04B4018C2CE1D236005C61A9 /* YHGCApplicationTypeSelectCell.swift in Sources */,
0430E65A2C7436CD000511E2 /* YHAdopterNewPeopleViewModel.swift in Sources */, 0430E65A2C7436CD000511E2 /* YHAdopterNewPeopleViewModel.swift in Sources */,
047F3DC02CDF3D69001B2A6D /* YHGCSpouseBasicInfoVC.swift in Sources */, 047F3DC02CDF3D69001B2A6D /* YHGCSpouseBasicInfoVC.swift in Sources */,
04256E1D2C75C74200A37BA4 /* YHAppointHKResultModel.swift in Sources */, 04256E1D2C75C74200A37BA4 /* YHAppointHKResultModel.swift in Sources */,
...@@ -6274,6 +6321,7 @@ ...@@ -6274,6 +6321,7 @@
04256E162C75BD2700A37BA4 /* YHPayMemberSectionItem.swift in Sources */, 04256E162C75BD2700A37BA4 /* YHPayMemberSectionItem.swift in Sources */,
042092B52C9D48FC001184F0 /* YHRealNameHelper.swift in Sources */, 042092B52C9D48FC001184F0 /* YHRealNameHelper.swift in Sources */,
045EEE922B9F171A0022A143 /* YHPreviewInfoNameAndSubNameItemView.swift in Sources */, 045EEE922B9F171A0022A143 /* YHPreviewInfoNameAndSubNameItemView.swift in Sources */,
04B4018A2CE1D0C6005C61A9 /* YHGCApplicationTypeController.swift in Sources */,
04CA2C2D2CBA537C00F36DE7 /* YHLookResignResultPrivateView.swift in Sources */, 04CA2C2D2CBA537C00F36DE7 /* YHLookResignResultPrivateView.swift in Sources */,
0430E6482C731B0A000511E2 /* YHAdopterAddNewTableViewCell.swift in Sources */, 0430E6482C731B0A000511E2 /* YHAdopterAddNewTableViewCell.swift in Sources */,
A5EB6C742C69FB9A0081FB6C /* YHOfficailLetterColledtionCell.swift in Sources */, A5EB6C742C69FB9A0081FB6C /* YHOfficailLetterColledtionCell.swift in Sources */,
......
//
// YHGCApplicationTypeController.swift
// galaxy
//
// Created by alexzzw on 2024/11/11.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHGCApplicationTypeController: YHBaseViewController {
private lazy var datas: [[YHGCApplicationModel]] = {
let typeA = YHGCApplicationModel(type: .typeA, isSelected: false)
let typeB = YHGCApplicationModel(type: .typeB, isSelected: false)
let typeC = YHGCApplicationModel(type: .typeC, isSelected: false)
return [[typeA], [typeB], [typeC]]
}()
private lazy var headerView: UIView = {
let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 104))
let label = UILabel()
label.text = "您好,请选择申请类别"
label.textColor = .mainTextColor
label.font = .PFSC_M(ofSize: 21)
view.addSubview(label)
label.snp.makeConstraints { make in
make.top.equalToSuperview().offset(32)
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-10)
}
return view
}()
private lazy var tableView: UITableView = {
let view = UITableView(frame: .zero, style: .grouped)
view.estimatedSectionHeaderHeight = 0.01
view.estimatedSectionFooterHeight = 20
view.sectionHeaderHeight = 0.01
view.sectionFooterHeight = 20
view.contentInsetAdjustmentBehavior = .never
view.backgroundColor = .clear
view.separatorStyle = .none
view.rowHeight = UITableView.automaticDimension
view.estimatedRowHeight = 148.0
view.dataSource = self
view.delegate = self
view.showsVerticalScrollIndicator = false
view.register(YHGCApplicationTypeSelectCell.self, forCellReuseIdentifier: YHGCApplicationTypeSelectCell.cellReuseIdentifier)
return view
}()
private lazy var bgIcon: UIImageView = {
let view = UIImageView()
view.image = UIImage(named: "gc_application_type_bg")
return view
}()
private lazy var submitButton: UIButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 16)
button.setTitle("提交", for: .normal)
button.setTitle("提交", for: .highlighted)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .highlighted)
button.addTarget(self, action: #selector(clickSubmitButton), for: .touchUpInside)
button.layer.cornerRadius = kCornerRadius3
button.clipsToBounds = true
let isEnable = YHVisaRenewalGuideVC.didShowGuide
button.backgroundColor = isEnable ? .brandMainColor : UIColor(hex: 0xB7C0CC, alpha: 1.0)
button.isEnabled = isEnable
return button
}()
private lazy var bottomView: UIView = {
let view = UIView()
view.backgroundColor = .white
return view
}()
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
}
}
extension YHGCApplicationTypeController {
@objc private func clickSubmitButton() {
//
}
private func setupUI() {
gk_navTitle = "申请类别"
gk_navBarAlpha = 0
gk_navigationBar.backgroundColor = .clear
view.backgroundColor = UIColor.contentBkgColor
view.addSubview(bgIcon)
view.addSubview(tableView)
view.addSubview(bottomView)
bottomView.addSubview(submitButton)
bgIcon.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.height.equalTo(bgIcon).multipliedBy(1)
}
bottomView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.top.equalTo(view.safeAreaLayoutGuide.snp.bottom).offset(-66)
}
submitButton.snp.makeConstraints { make in
make.left.equalToSuperview().offset(kMargin)
make.right.equalToSuperview().offset(-kMargin)
make.top.equalToSuperview().offset(8)
make.height.equalTo(48)
}
tableView.snp.makeConstraints { make in
make.left.equalToSuperview()
make.right.equalToSuperview()
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalTo(bottomView.snp.top)
}
tableView.tableHeaderView = headerView
}
}
extension YHGCApplicationTypeController: UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return datas.count
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
guard datas.count > section else {
return 0
}
return datas[section].count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
guard datas.count > indexPath.section else {
return UITableViewCell()
}
let sectionArr = datas[indexPath.section]
guard sectionArr.count > indexPath.row else {
return UITableViewCell()
}
let model = sectionArr[indexPath.row]
if let cell = tableView.dequeueReusableCell(withIdentifier: YHGCApplicationTypeSelectCell.cellReuseIdentifier) as? YHGCApplicationTypeSelectCell {
cell.setupCellInfo(type: model.type, isCurrentSelected: model.isSelected)
return cell
}
return UITableViewCell()
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 148.0
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
guard datas.count > indexPath.section else {
return
}
let sectionArr = datas[indexPath.section]
guard sectionArr.count > indexPath.row else {
return
}
tableView.deselectRow(at: indexPath, animated: true)
let model = sectionArr[indexPath.row]
model.isSelected.toggle()
datas.flatMap { $0 }.forEach {
if $0.type != model.type, $0.isSelected {
$0.isSelected = false
}
}
tableView.reloadData()
}
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return 0.01
}
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
return 20
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView()
return view
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
let view = UIView()
return view
}
}
//
// YHGCApplicationTypeSelectCell.swift
// galaxy
//
// Created by alexzzw on 2024/11/11.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHGCApplicationTypeSelectCell: UITableViewCell {
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
}
//
// YHGCApplicationModel.swift
// galaxy
//
// Created by alexzzw on 2024/11/11.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import Foundation
class YHGCApplicationModel {
var type: YHGCApplicationType = .typeA
var isSelected: Bool = false
init(type: YHGCApplicationType, isSelected: Bool) {
self.type = type
self.isSelected = isSelected
}
}
//
// YHGCApplicationType.swift
// galaxy
//
// Created by alexzzw on 2024/11/11.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import Foundation
enum YHGCApplicationType: Int {
case typeA
case typeB
case typeC
}
//
// YHGCApplicationTypeSelectCell.swift
// galaxy
//
// Created by alexzzw on 2024/11/11.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHGCApplicationTypeSelectCell: UITableViewCell {
static let cellReuseIdentifier = "YHGCApplicationTypeSelectCell"
private let selectedBorderColor: UIColor = .brandMainColor
var actionBtnEvent: (() -> Void)?
var isCurrentSelected: Bool = false {
didSet {
guard isCurrentSelected != oldValue else {
return
}
selectIconView.image = isCurrentSelected ? UIImage(named: "gc_application_type_selected"): UIImage(named: "gc_application_type_unselected")
subContainerView.lineWidth = isCurrentSelected ? 1 : nil
subContainerView.lineColor = isCurrentSelected ? selectedBorderColor.cgColor : nil
}
}
private lazy var subContainerView: YHBaseCornerRadiusBorderView = {
let view = YHBaseCornerRadiusBorderView(cornerRadius: 6, corner: .allCorners, lineWidth: nil, lineColor: nil)
view.backgroundColor = .white
return view
}()
private lazy var infoTitleLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_B(ofSize: 17)
label.textColor = .mainTextColor
return label
}()
private lazy var infoDetailLabel: UILabel = {
let label = UILabel()
label.textColor = UIColor(hexString: "#6D788A")
label.font = .PFSC_R(ofSize: 13)
label.lineBreakMode = .byCharWrapping
label.numberOfLines = 3
return label
}()
private lazy var iconView: UIImageView = {
let imageView = UIImageView()
return imageView
}()
private lazy var selectIconView: UIImageView = {
let imageView = UIImageView()
imageView.image = UIImage(named: "gc_application_type_unselected")
return imageView
}()
private lazy var actionBtn: UIButton = {
let button = UIButton(type: .custom)
button.setTitle("申请标准", for: .normal)
button.setTitleColor(.mainTextColor, for: .normal)
button.titleLabel?.font = .PFSC_R(ofSize: 14)
button.setImage(UIImage(named: "right_arrow_black_20"), for: .normal)
button.addTarget(self, action: #selector(actionBtnClicked), for: .touchUpInside)
return button
}()
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setupCellInfo(type: YHGCApplicationType, isCurrentSelected: Bool) {
infoTitleLabel.text = type.titleString()
infoDetailLabel.text = type.detailString()
iconView.image = UIImage(named: type.iconString())
self.isCurrentSelected = isCurrentSelected
}
}
extension YHGCApplicationTypeSelectCell {
@objc private func actionBtnClicked() {
actionBtnEvent?()
}
private func setupUI() {
selectionStyle = .none
backgroundColor = .clear
contentView.addSubview(subContainerView)
subContainerView.snp.makeConstraints { make in
make.top.bottom.equalToSuperview()
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20)
}
subContainerView.addSubview(iconView)
subContainerView.addSubview(infoTitleLabel)
subContainerView.addSubview(selectIconView)
subContainerView.addSubview(infoDetailLabel)
subContainerView.addSubview(actionBtn)
iconView.setContentCompressionResistancePriority(.required, for: .horizontal)
infoTitleLabel.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
selectIconView.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal)
infoDetailLabel.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
actionBtn.setContentCompressionResistancePriority(.required, for: .vertical)
infoDetailLabel.setContentCompressionResistancePriority(.defaultLow, for: .vertical)
iconView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(20)
make.left.equalToSuperview().offset(20)
make.width.equalTo(88)
make.height.equalTo(108)
make.bottom.lessThanOrEqualToSuperview().offset(-20)
}
infoTitleLabel.snp.makeConstraints { make in
make.left.equalTo(iconView.snp.right).offset(20)
make.top.equalTo(iconView.snp.top)
}
selectIconView.snp.makeConstraints { make in
make.right.equalToSuperview().offset(-20)
make.top.equalTo(iconView.snp.top)
make.left.greaterThanOrEqualTo(infoTitleLabel.snp.right).offset(20)
}
infoDetailLabel.snp.makeConstraints { make in
make.left.equalTo(infoTitleLabel.snp.left)
make.top.equalTo(infoTitleLabel.snp.bottom).offset(8)
make.right.lessThanOrEqualToSuperview().offset(-20)
}
actionBtn.snp.makeConstraints { make in
make.left.equalTo(infoTitleLabel.snp.left)
make.top.greaterThanOrEqualTo(infoDetailLabel.snp.bottom).offset(0)
make.bottom.equalTo(iconView.snp.bottom)
}
actionBtn.iconInRight(with: 0)
}
}
private extension YHGCApplicationType {
func iconString() -> String {
switch self {
case .typeA:
return "gc_application_type_a"
case .typeB:
return "gc_application_type_b"
case .typeC:
return "gc_application_type_c"
}
}
func titleString() -> String {
switch self {
case .typeA:
return "高才A类申请"
case .typeB:
return "高才B类申请"
case .typeC:
return "高才C类申请"
}
}
func detailString() -> String {
switch self {
case .typeA:
return "近一年度纳税收入250万港元及以上人士"
case .typeB:
return "百强大学毕业,且近5年累积工作经验时长不低于3年人士"
case .typeC:
return "百强大学毕业不足5年,且工作经验时长不足3年人士"
}
}
}
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "gc_application_type_a@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "gc_application_type_a@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "gc_application_type_b@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "gc_application_type_b@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "gc_application_type_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "gc_application_type_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "gc_application_type_bg_a@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "gc_application_type_bg_a@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "gc_application_type_bg_b@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "gc_application_type_bg_b@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "gc_application_type_bg_c@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "gc_application_type_bg_c@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "gc_application_type_c@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "gc_application_type_c@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "gc_application_type_selected@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "gc_application_type_selected@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "gc_application_type_unselected@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "gc_application_type_unselected@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
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