Commit 1e7b52e2 authored by Alex朱枝文's avatar Alex朱枝文

高才收入记录UI调整

parent 575f333d
......@@ -19,6 +19,10 @@
0411CEF52D1548AF00644D35 /* YHGCWorkModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0411CEF42D1548AF00644D35 /* YHGCWorkModel.swift */; };
0411CEF72D15525400644D35 /* YHGCWorkExperienceModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0411CEF62D15525400644D35 /* YHGCWorkExperienceModel.swift */; };
04307B662D1942F500ED8E8D /* YHDynamicSheetPickerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B652D1942F500ED8E8D /* YHDynamicSheetPickerView.swift */; };
04307B682D19911800ED8E8D /* YHIncomeInfoEditCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B672D19911800ED8E8D /* YHIncomeInfoEditCell.swift */; };
04307B6A2D1A4C6500ED8E8D /* YHIncomeInfoSelectCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B692D1A4C6500ED8E8D /* YHIncomeInfoSelectCell.swift */; };
04307B6C2D1A547C00ED8E8D /* YHIncomeDateTillNowCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B6B2D1A547C00ED8E8D /* YHIncomeDateTillNowCell.swift */; };
04307B6E2D1A5F4200ED8E8D /* YHIncomeUploadWorkIDCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B6D2D1A5F4200ED8E8D /* YHIncomeUploadWorkIDCell.swift */; };
045C0F7F2D12CA5F00BD2DC0 /* submit_page_scroll.gif in Resources */ = {isa = PBXBuildFile; fileRef = 045C0F4F2D12CA5E00BD2DC0 /* submit_page_scroll.gif */; };
045C0F802D12CA5F00BD2DC0 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 045C0F762D12CA5E00BD2DC0 /* Localizable.xcstrings */; };
045C0F812D12CA5F00BD2DC0 /* img_0.png in Resources */ = {isa = PBXBuildFile; fileRef = 045C0F5E2D12CA5E00BD2DC0 /* img_0.png */; };
......@@ -1188,6 +1192,10 @@
0411CEF42D1548AF00644D35 /* YHGCWorkModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCWorkModel.swift; sourceTree = "<group>"; };
0411CEF62D15525400644D35 /* YHGCWorkExperienceModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCWorkExperienceModel.swift; sourceTree = "<group>"; };
04307B652D1942F500ED8E8D /* YHDynamicSheetPickerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHDynamicSheetPickerView.swift; sourceTree = "<group>"; };
04307B672D19911800ED8E8D /* YHIncomeInfoEditCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHIncomeInfoEditCell.swift; sourceTree = "<group>"; };
04307B692D1A4C6500ED8E8D /* YHIncomeInfoSelectCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHIncomeInfoSelectCell.swift; sourceTree = "<group>"; };
04307B6B2D1A547C00ED8E8D /* YHIncomeDateTillNowCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHIncomeDateTillNowCell.swift; sourceTree = "<group>"; };
04307B6D2D1A5F4200ED8E8D /* YHIncomeUploadWorkIDCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHIncomeUploadWorkIDCell.swift; sourceTree = "<group>"; };
045C09A12D12C2A800BD2DC0 /* YHGCMineSchemeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCMineSchemeViewController.swift; sourceTree = "<group>"; };
045C0A142D12CA5E00BD2DC0 /* YHBaseViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHBaseViewController.swift; sourceTree = "<group>"; };
045C0A152D12CA5E00BD2DC0 /* YHBaseViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHBaseViewModel.swift; sourceTree = "<group>"; };
......@@ -5968,6 +5976,10 @@
isa = PBXGroup;
children = (
047A96922D16C0900033BB4E /* YHInfoQuestionSelectionCell.swift */,
04307B672D19911800ED8E8D /* YHIncomeInfoEditCell.swift */,
04307B692D1A4C6500ED8E8D /* YHIncomeInfoSelectCell.swift */,
04307B6B2D1A547C00ED8E8D /* YHIncomeDateTillNowCell.swift */,
04307B6D2D1A5F4200ED8E8D /* YHIncomeUploadWorkIDCell.swift */,
);
path = V;
sourceTree = "<group>";
......@@ -7070,6 +7082,7 @@
045C11952D12CA5F00BD2DC0 /* YHFourKingViewController.swift in Sources */,
045C11962D12CA5F00BD2DC0 /* YHActivityTipsItemView.swift in Sources */,
045C11972D12CA5F00BD2DC0 /* YHHUDRotatingImageView.swift in Sources */,
04307B6C2D1A547C00ED8E8D /* YHIncomeDateTillNowCell.swift in Sources */,
045C11982D12CA5F00BD2DC0 /* YHCerAppointViewModel.swift in Sources */,
045C11992D12CA5F00BD2DC0 /* YHPayMembersCell.swift in Sources */,
04AE203D2D13C14900891D24 /* YHGCEducationDetailVC.swift in Sources */,
......@@ -7157,6 +7170,7 @@
045C11E92D12CA5F00BD2DC0 /* YHWorkExperiencePositionModel.swift in Sources */,
045C11EA2D12CA5F00BD2DC0 /* YHMySignatureDetailModel.swift in Sources */,
045C11EB2D12CA5F00BD2DC0 /* YHPlayerControlView.swift in Sources */,
04307B6E2D1A5F4200ED8E8D /* YHIncomeUploadWorkIDCell.swift in Sources */,
045C11EC2D12CA5F00BD2DC0 /* YHMyDocumentsListViewController.swift in Sources */,
045C11ED2D12CA5F00BD2DC0 /* YHCertificateEntryBottomView.swift in Sources */,
045C11EE2D12CA5F00BD2DC0 /* YHAppointItem.swift in Sources */,
......@@ -7250,6 +7264,7 @@
045C12452D12CA5F00BD2DC0 /* YHHUDErrorView.swift in Sources */,
045C12462D12CA5F00BD2DC0 /* YHPrincleViewModel.swift in Sources */,
045C12472D12CA5F00BD2DC0 /* YHUploadCertificateListModel.swift in Sources */,
04307B682D19911800ED8E8D /* YHIncomeInfoEditCell.swift in Sources */,
045C12482D12CA5F00BD2DC0 /* YHResignUploadDetailModel.swift in Sources */,
045C12492D12CA5F00BD2DC0 /* UIApplication+Extension.swift in Sources */,
045C124A2D12CA5F00BD2DC0 /* YHAIChatBannerCollectionCell.swift in Sources */,
......@@ -7279,6 +7294,7 @@
045C12612D12CA5F00BD2DC0 /* YHImageClipperViewController.swift in Sources */,
045C12622D12CA5F00BD2DC0 /* YHMessageSessionCell.swift in Sources */,
045C12632D12CA5F00BD2DC0 /* YHTotalIncomeCell.swift in Sources */,
04307B6A2D1A4C6500ED8E8D /* YHIncomeInfoSelectCell.swift in Sources */,
045C12642D12CA5F00BD2DC0 /* YHPayMemberContentItem.swift in Sources */,
045C12652D12CA5F00BD2DC0 /* YHSheetPickerView.swift in Sources */,
045C12662D12CA5F00BD2DC0 /* YHScorePersonInfoCell.swift in Sources */,
......
......@@ -6,6 +6,7 @@
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import AttributedString
import UIKit
class YHIncomeRecordCompanyTipsCell: YHResignDocumentCell {
......@@ -33,6 +34,10 @@ class YHIncomeRecordCompanyTipsCell: YHResignDocumentCell {
infoDetailLabel.text = detail
}
func setupCellInfo(tipsDetail: ASAttributedString) {
infoDetailLabel.attributed.text = tipsDetail
}
private func setupUI() {
updateCellCorner(.mid)
subContainerView.addSubview(infoDetailLabel)
......
......@@ -33,6 +33,19 @@ class YHIncomeRecordFromCell: YHResignDocumentCell {
return label
}()
private lazy var rightArrowIcon: UIImageView = {
let imageView = UIImageView(image: UIImage(named: "form_right_arrow"))
return imageView
}()
private lazy var infoFailLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_R(ofSize: 12)
label.textColor = .failColor
label.text = "请选择"
return label
}()
private lazy var bottomLineView: UIView = {
let view = UIView()
view.backgroundColor = UIColor(hexString: "#E9ECF0")
......@@ -48,24 +61,79 @@ class YHIncomeRecordFromCell: YHResignDocumentCell {
fatalError("init(coder:) has not been implemented")
}
func setupCellInfo(title: String, detail: String, showBottomLine: Bool = true) {
func setupCellInfo(title: String, detail: String?, showBottomLine: Bool = true, showRightArrow: Bool = false, placeholder: String = "", needShowFailButton: Bool = false) {
infoTitleLabel.text = title
infoDetailLabel.text = detail
if let detail = detail, detail.count > 0 {
infoDetailLabel.text = detail
infoDetailLabel.font = .PFSC_M(ofSize: 14)
infoDetailLabel.textColor = UIColor.mainTextColor
} else {
infoDetailLabel.text = placeholder
infoDetailLabel.font = .PFSC_R(ofSize: 14)
infoDetailLabel.textColor = UIColor(hexString: "#B9C1CC")
}
bottomLineView.isHidden = !showBottomLine
rightArrowIcon.isHidden = !showRightArrow
updateFailLabel(needShowFailButton)
}
}
extension YHIncomeRecordFromCell {
private func updateFailLabel(_ needShowFailButton: Bool) {
if needShowFailButton {
let isRightArrowIconHidden = rightArrowIcon.isHidden
infoDetailLabel.snp.remakeConstraints { make in
make.top.equalToSuperview().offset(16)
make.left.equalToSuperview().offset(147)
if isRightArrowIconHidden {
make.right.lessThanOrEqualToSuperview().offset(-18)
} else {
make.right.lessThanOrEqualTo(rightArrowIcon.snp.left).offset(-18)
}
}
infoFailLabel.snp.remakeConstraints { make in
make.top.equalTo(infoDetailLabel.snp.bottom).offset(6)
make.left.equalTo(dotIcon)
make.right.lessThanOrEqualToSuperview().offset(-18)
make.bottom.equalToSuperview().offset(-16)
}
infoFailLabel.isHidden = false
} else {
let isRightArrowIconHidden = rightArrowIcon.isHidden
infoDetailLabel.snp.remakeConstraints { make in
make.top.equalToSuperview().offset(16)
make.bottom.equalToSuperview().offset(-16)
make.left.equalToSuperview().offset(147)
if isRightArrowIconHidden {
make.right.lessThanOrEqualToSuperview().offset(-18)
} else {
make.right.lessThanOrEqualTo(rightArrowIcon.snp.left).offset(-18)
}
}
infoFailLabel.snp.remakeConstraints { make in
make.left.equalTo(dotIcon)
make.right.lessThanOrEqualToSuperview().offset(-18)
make.bottom.equalToSuperview().offset(-16)
}
infoFailLabel.isHidden = true
}
}
private func setupUI() {
updateCellCorner(.mid)
subContainerView.addSubview(dotIcon)
subContainerView.addSubview(infoTitleLabel)
subContainerView.addSubview(infoDetailLabel)
subContainerView.addSubview(rightArrowIcon)
subContainerView.addSubview(bottomLineView)
subContainerView.addSubview(infoFailLabel)
dotIcon.setContentCompressionResistancePriority(.required, for: .horizontal)
infoTitleLabel.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal)
infoDetailLabel.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
rightArrowIcon.setContentCompressionResistancePriority(.required, for: .horizontal)
dotIcon.snp.makeConstraints { make in
make.centerY.equalToSuperview()
......@@ -78,12 +146,25 @@ extension YHIncomeRecordFromCell {
make.left.equalTo(dotIcon.snp.right).offset(2)
}
rightArrowIcon.snp.makeConstraints { make in
make.centerY.equalTo(infoTitleLabel)
make.right.equalToSuperview().offset(-18)
make.width.height.equalTo(20)
}
infoDetailLabel.snp.makeConstraints { make in
make.top.equalToSuperview().offset(16)
make.bottom.equalToSuperview().offset(-16)
make.left.equalToSuperview().offset(147)
make.right.lessThanOrEqualTo(rightArrowIcon.snp.left).offset(-18)
}
infoFailLabel.snp.makeConstraints { make in
make.left.equalTo(dotIcon)
make.right.lessThanOrEqualToSuperview().offset(-18)
make.bottom.equalToSuperview().offset(-16)
}
infoFailLabel.isHidden = true
bottomLineView.snp.makeConstraints { make in
make.bottom.equalToSuperview()
......
......@@ -19,6 +19,7 @@ class YHGCIncomeRecordViewController: YHBaseViewController {
case consentForHKTravel(_ title: String, _ detail: ASAttributedString, _ question: String)
case questionSelect(_ question: String)
case employmentVerification
case workingHoursStatement(_ placeholder: String, _ detail: ASAttributedString)
}
private lazy var datas: [[TableRow]] = []
......@@ -89,6 +90,7 @@ class YHGCIncomeRecordViewController: YHBaseViewController {
view.register(YHAddIncomeRecordCell.self, forCellReuseIdentifier: YHAddIncomeRecordCell.cellReuseIdentifier)
view.register(YHInfoQuestionSelectionCell.self, forCellReuseIdentifier: YHInfoQuestionSelectionCell.cellReuseIdentifier)
view.register(YHEmploymentVerificationAvailableCell.self, forCellReuseIdentifier: YHEmploymentVerificationAvailableCell.cellReuseIdentifier)
view.register(YHWorkingHoursStatementCell.self, forCellReuseIdentifier: YHWorkingHoursStatementCell.cellReuseIdentifier)
view.keyboardDismissMode = .onDrag
return view
......@@ -134,7 +136,7 @@ extension YHGCIncomeRecordViewController {
}
private func setupUI() {
gk_navTitle = "收入记录信息填写"
gk_navTitle = "收入记录/工作经验填写"
gk_navBarAlpha = 1.0
gk_navBackgroundColor = .white
......@@ -186,7 +188,6 @@ extension YHGCIncomeRecordViewController {
let incomeItem: TableRow = .incomeItem(false, companyModel.company_name, moneyStr, timeStr, companyModel.income_id, index != listCount - 1)
firstSection.append(incomeItem)
}
firstSection.append(.addItem)
if listCount > 0 {
let totalNum = hkdFormatter.string(from: NSNumber(value: money / rate)) ?? "0"
let totalMoney: ASAttributedString = .init(string: "约 ", .font(.PFSC_R(ofSize: 14))) + .init(string: totalNum, .font(UIFont(name: "DINAlternate-Bold", size: 20) ?? UIFont.systemFont(ofSize: 20))) + .init(string: " 港币", .font(.PFSC_R(ofSize: 14)))
......@@ -195,15 +196,20 @@ extension YHGCIncomeRecordViewController {
let incomeItem: TableRow = .incomeItem(false, "收入信息1", "", "待填写", 0, false)
firstSection.append(incomeItem)
}
firstSection.append(.addItem)
let tipsIcon = ASAttributedString.init(.image(UIImage(named: "red_dot_6") ?? UIImage(), .custom(.offset(CGPoint(x: 0, y: 1)), size: .init(width: 6, height: 6))))
let tips: ASAttributedString = tipsIcon + .init(string: " 检测到您的", .font(.PFSC_R(ofSize: 13)), .foreground(UIColor(hexString: "#8993A2") ?? .gray)) + .init(string: "工作时间有重叠", .font(.PFSC_R(ofSize: 13)), .foreground(UIColor.failColor)) + .init(string: "。请确认是否正确填报,若填报无误请在此处说明工作时间重叠的原因~", .font(.PFSC_R(ofSize: 13)), .foreground(UIColor(hexString: "#8993A2") ?? .gray))
let secondSection: [TableRow] = [.workingHoursStatement("如:工作时间灵活,可自由安排", tips)]
let detail: ASAttributedString = .init(string: "备注:赴港同意书为目前在职公司盖章提供,若目前未就职于任何公司,则由档案所在地人才中心盖章提供,", .font(UIFont.PFSC_R(ofSize: 13)), .foreground(UIColor(hexString: "#8993A2") ?? .gray))
let actionStr = ASAttributedString.init(string: "查看示例模板", .font(UIFont.PFSC_R(ofSize: 13)), .foreground(UIColor.brandMainColor), .underline(.init(rawValue: 1)), .action {
//
})
var secondSection: [TableRow] = [.consentForHKTravel("赴港同意书提供", detail + actionStr, "在职公司是否可以提供赴港同意书")]
secondSection.append(.questionSelect("人才中心是否可以提供赴港同意书"))
secondSection.append(.employmentVerification)
datas = [firstSection, secondSection]
var thirdSection: [TableRow] = [.consentForHKTravel("赴港同意书提供", detail + actionStr, "在职公司是否可以提供赴港同意书")]
thirdSection.append(.questionSelect("人才中心是否可以提供赴港同意书"))
thirdSection.append(.employmentVerification)
datas = [firstSection, secondSection, thirdSection]
tableView.reloadData()
}
......@@ -344,6 +350,11 @@ extension YHGCIncomeRecordViewController: UITableViewDelegate, UITableViewDataSo
cell.setupCellInfo(detail: selectedEmployment)
return cell
}
case let .workingHoursStatement(placeholder, tips):
if let cell = tableView.dequeueReusableCell(withIdentifier: YHWorkingHoursStatementCell.cellReuseIdentifier) as? YHWorkingHoursStatementCell {
cell.setupCellInfo(placeholder: placeholder, remark: nil, detail: tips, isShowBottomLine: false)
return cell
}
}
return UITableViewCell()
}
......
//
// YHIncomeDateTillNowCell.swift
// galaxy
//
// Created by alexzzw on 2024/12/24.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHIncomeDateTillNowCell: YHResignDocumentCell {
static let cellReuseIdentifier = "YHIncomeDateTillNowCell"
var tillNowButtonEvent: (() -> Void)?
private lazy var dotIcon: UIImageView = {
let imageView = UIImageView(image: UIImage(named: "red_dot_6"))
return imageView
}()
private lazy var infoTitleLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_R(ofSize: 14)
label.textColor = UIColor.mainTextColor
label.text = "收入来源公司"
return label
}()
private lazy var infoDetailLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_M(ofSize: 14)
label.textColor = UIColor.mainTextColor
label.text = "请选择"
label.numberOfLines = 0
label.lineBreakMode = .byCharWrapping
return label
}()
private lazy var bottomLineView: UIView = {
let view = UIView()
view.backgroundColor = UIColor(hexString: "#E9ECF0")
return view
}()
private lazy var infoFailLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_R(ofSize: 12)
label.textColor = .failColor
label.text = "请选择"
return label
}()
private lazy var tillNowButton: UIButton = {
let button = UIButton(type: .custom)
button.iconInLeft(spacing: 6)
button.setTitle("至今", for: .normal)
button.titleLabel?.font = .PFSC_R(ofSize: 14)
button.setTitleColor(.mainTextColor, for: .normal)
button.setImage(UIImage(named: "income_date_check_btn_0"), for: .normal)
button.setImage(UIImage(named: "income_date_check_btn_1"), for: .selected)
button.addTarget(self, action: #selector(tillNowButtonClicked), 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(title: String, detail: String?, placeholder: String = "请选择", showBottomLine: Bool = true, tillNow: Bool, needShowFailButton: Bool) {
infoTitleLabel.text = title
updateContentState(detail: detail, placeholder: placeholder)
bottomLineView.isHidden = !showBottomLine
infoFailLabel.text = placeholder
updateFailLabel(needShowFailButton)
}
}
extension YHIncomeDateTillNowCell {
@objc private func tillNowButtonClicked() {
tillNowButtonEvent?()
}
private func updateFailLabel(_ needShowFailButton: Bool) {
if needShowFailButton {
infoFailLabel.isHidden = false
infoDetailLabel.snp.remakeConstraints { make in
make.top.equalToSuperview().offset(16)
make.left.equalToSuperview().offset(147)
make.right.lessThanOrEqualTo(tillNowButton.snp.left).offset(-18)
}
infoFailLabel.snp.remakeConstraints { make in
make.top.equalTo(infoDetailLabel.snp.bottom).offset(6)
make.left.equalToSuperview().offset(18)
make.right.lessThanOrEqualToSuperview().offset(-18)
make.bottom.equalToSuperview().offset(-16)
}
} else {
infoFailLabel.isHidden = true
infoDetailLabel.snp.remakeConstraints { make in
make.top.equalToSuperview().offset(16)
make.bottom.equalToSuperview().offset(-16)
make.left.equalToSuperview().offset(147)
make.right.lessThanOrEqualTo(tillNowButton.snp.left).offset(-18)
}
infoFailLabel.snp.remakeConstraints { make in
make.left.equalToSuperview().offset(18)
make.right.lessThanOrEqualToSuperview().offset(-18)
make.bottom.equalToSuperview().offset(-16)
}
}
}
private func updateContentState(detail: String?, placeholder: String) {
if let detail = detail, !detail.isEmpty {
infoDetailLabel.font = .PFSC_M(ofSize: 14)
infoDetailLabel.textColor = UIColor.mainTextColor
infoDetailLabel.text = detail
} else {
infoDetailLabel.text = placeholder
infoDetailLabel.font = .PFSC_R(ofSize: 14)
infoDetailLabel.textColor = UIColor(hexString: "#B9C1CC")
}
}
private func setupUI() {
updateCellCorner(.mid)
subContainerView.addSubview(dotIcon)
subContainerView.addSubview(infoTitleLabel)
subContainerView.addSubview(infoDetailLabel)
subContainerView.addSubview(bottomLineView)
subContainerView.addSubview(infoFailLabel)
subContainerView.addSubview(tillNowButton)
dotIcon.setContentCompressionResistancePriority(.required, for: .horizontal)
infoTitleLabel.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal)
infoDetailLabel.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
tillNowButton.setContentCompressionResistancePriority(.required, for: .horizontal)
dotIcon.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalToSuperview().offset(18)
make.width.height.equalTo(6)
}
infoTitleLabel.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalTo(dotIcon.snp.right).offset(2)
}
tillNowButton.snp.makeConstraints { make in
make.centerY.equalTo(infoTitleLabel)
make.right.equalToSuperview().offset(-18)
make.width.equalTo(50)
make.height.equalTo(30)
}
infoDetailLabel.snp.makeConstraints { make in
make.top.equalToSuperview().offset(16)
make.bottom.equalToSuperview().offset(-16)
make.left.equalToSuperview().offset(147)
make.right.lessThanOrEqualTo(tillNowButton.snp.left).offset(-18)
}
bottomLineView.snp.makeConstraints { make in
make.bottom.equalToSuperview()
make.left.equalToSuperview().offset(18)
make.right.equalToSuperview().offset(-18)
make.height.equalTo(0.5)
}
infoFailLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(18)
make.right.lessThanOrEqualToSuperview().offset(-18)
make.bottom.equalToSuperview().offset(-16)
}
infoFailLabel.isHidden = true
}
}
//
// YHIncomeInfoEditCell.swift
// galaxy
//
// Created by alexzzw on 2024/12/23.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHIncomeInfoEditCell: YHResignDocumentCell {
static let cellReuseIdentifier = "YHIncomeInfoEditCell"
private let maxCount = 100
var didBeginEditing: ((UITextField) -> Void)?
var didEndEditing: ((UITextField) -> Void)?
private lazy var dotIcon: UIImageView = {
let imageView = UIImageView(image: UIImage(named: "red_dot_6"))
return imageView
}()
private lazy var infoTitleLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_R(ofSize: 14)
label.textColor = UIColor.mainTextColor
label.text = "收入来源公司"
return label
}()
private lazy var inputTextField: UITextField = {
let textField = UITextField(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 40))
textField.textColor = .mainTextColor
textField.font = .PFSC_M(ofSize: 14)
textField.borderStyle = .none
textField.delegate = self
textField.keyboardType = .default
return textField
}()
private lazy var bottomLineView: UIView = {
let view = UIView()
view.backgroundColor = UIColor(hexString: "#E9ECF0")
return view
}()
private lazy var infoFailLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_R(ofSize: 12)
label.textColor = .failColor
label.text = "请选择"
return label
}()
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(title: String, detail: String?, placeholder: String = "请输入", showBottomLine: Bool = true, needShowFailButton: Bool) {
infoTitleLabel.text = title
inputTextField.text = detail
inputTextField.attributedPlaceholder = NSAttributedString(
string: placeholder,
attributes: [
.foregroundColor: UIColor(hex: 0xB9C1CC),
.font: UIFont.PFSC_R(ofSize: 14),
]
)
bottomLineView.isHidden = !showBottomLine
updateFailLabel(needShowFailButton)
}
}
extension YHIncomeInfoEditCell {
private func updateFailLabel(_ needShowFailButton: Bool) {
if needShowFailButton {
infoFailLabel.isHidden = false
inputTextField.snp.remakeConstraints { make in
make.top.equalToSuperview().offset(16)
make.left.equalToSuperview().offset(147)
make.right.lessThanOrEqualToSuperview().offset(-18)
}
infoFailLabel.snp.remakeConstraints { make in
make.top.equalTo(inputTextField.snp.bottom).offset(6)
make.left.equalToSuperview().offset(18)
make.right.lessThanOrEqualToSuperview().offset(-18)
make.bottom.equalToSuperview().offset(-16)
}
} else {
infoFailLabel.isHidden = true
inputTextField.snp.remakeConstraints { make in
make.top.equalToSuperview().offset(16)
make.bottom.equalToSuperview().offset(-16)
make.left.equalToSuperview().offset(147)
make.right.lessThanOrEqualToSuperview().offset(-18)
}
infoFailLabel.snp.remakeConstraints { make in
make.left.equalToSuperview().offset(18)
make.right.lessThanOrEqualToSuperview().offset(-18)
make.bottom.equalToSuperview().offset(-16)
}
}
}
private func setupUI() {
updateCellCorner(.mid)
subContainerView.addSubview(dotIcon)
subContainerView.addSubview(infoTitleLabel)
subContainerView.addSubview(inputTextField)
subContainerView.addSubview(bottomLineView)
subContainerView.addSubview(infoFailLabel)
dotIcon.setContentCompressionResistancePriority(.required, for: .horizontal)
infoTitleLabel.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal)
inputTextField.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
dotIcon.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalToSuperview().offset(18)
make.width.height.equalTo(6)
}
infoTitleLabel.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalTo(dotIcon.snp.right).offset(2)
}
inputTextField.snp.makeConstraints { make in
make.top.equalToSuperview().offset(16)
make.bottom.equalToSuperview().offset(-16)
make.left.equalToSuperview().offset(147)
make.right.lessThanOrEqualToSuperview().offset(-18)
}
bottomLineView.snp.makeConstraints { make in
make.bottom.equalToSuperview()
make.left.equalToSuperview().offset(18)
make.right.equalToSuperview().offset(-18)
make.height.equalTo(0.5)
}
infoFailLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(18)
make.right.lessThanOrEqualToSuperview().offset(-18)
make.bottom.equalToSuperview().offset(-16)
}
infoFailLabel.isHidden = true
}
}
extension YHIncomeInfoEditCell: UITextFieldDelegate {
// MARK: - UITextFieldDelegate
func textFieldDidBeginEditing(_ textField: UITextField) {
if textField == inputTextField {
didBeginEditing?(textField)
}
}
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
textField.endEditing(false)
return true
}
func textFieldDidEndEditing(_ textField: UITextField) {
if textField == inputTextField {
didEndEditing?(textField)
}
}
func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
if textField == inputTextField {
/// 输入删除
if string == "" {
return true
}
let count = (textField.text?.utf16.count ?? 0) - range.length + string.utf16.count
if count > maxCount {
return false
}
return true
}
return true
}
}
//
// YHIncomeInfoSelectCell.swift
// galaxy
//
// Created by alexzzw on 2024/12/24.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHIncomeInfoSelectCell: YHResignDocumentCell {
static let cellReuseIdentifier = "YHIncomeInfoSelectCell"
private lazy var dotIcon: UIImageView = {
let imageView = UIImageView(image: UIImage(named: "red_dot_6"))
return imageView
}()
private lazy var infoTitleLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_R(ofSize: 14)
label.textColor = UIColor.mainTextColor
label.text = "收入来源公司"
return label
}()
private lazy var infoDetailLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_M(ofSize: 14)
label.textColor = UIColor.mainTextColor
label.text = "请选择"
label.numberOfLines = 0
label.lineBreakMode = .byCharWrapping
return label
}()
private lazy var bottomLineView: UIView = {
let view = UIView()
view.backgroundColor = UIColor(hexString: "#E9ECF0")
return view
}()
private lazy var infoFailLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_R(ofSize: 12)
label.textColor = .failColor
label.text = "请选择"
return label
}()
private lazy var rightArrowIcon: UIImageView = {
let imageView = UIImageView(image: UIImage(named: "form_right_arrow"))
return imageView
}()
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(title: String, detail: String?, placeholder: String = "请选择", showBottomLine: Bool = true, needShowFailButton: Bool) {
infoTitleLabel.text = title
updateContentState(detail: detail, placeholder: placeholder)
bottomLineView.isHidden = !showBottomLine
infoFailLabel.text = placeholder
updateFailLabel(needShowFailButton)
}
}
extension YHIncomeInfoSelectCell {
private func updateFailLabel(_ needShowFailButton: Bool) {
if needShowFailButton {
infoFailLabel.isHidden = false
infoDetailLabel.snp.remakeConstraints { make in
make.top.equalToSuperview().offset(16)
make.left.equalToSuperview().offset(147)
make.right.lessThanOrEqualTo(rightArrowIcon.snp.left).offset(-18)
}
infoFailLabel.snp.remakeConstraints { make in
make.top.equalTo(infoDetailLabel.snp.bottom).offset(6)
make.left.equalToSuperview().offset(18)
make.right.lessThanOrEqualToSuperview().offset(-18)
make.bottom.equalToSuperview().offset(-16)
}
} else {
infoFailLabel.isHidden = true
infoDetailLabel.snp.remakeConstraints { make in
make.top.equalToSuperview().offset(16)
make.bottom.equalToSuperview().offset(-16)
make.left.equalToSuperview().offset(147)
make.right.lessThanOrEqualTo(rightArrowIcon.snp.left).offset(-18)
}
infoFailLabel.snp.remakeConstraints { make in
make.left.equalToSuperview().offset(18)
make.right.lessThanOrEqualToSuperview().offset(-18)
make.bottom.equalToSuperview().offset(-16)
}
}
}
private func updateContentState(detail: String?, placeholder: String) {
if let detail = detail, !detail.isEmpty {
infoDetailLabel.font = .PFSC_M(ofSize: 14)
infoDetailLabel.textColor = UIColor.mainTextColor
infoDetailLabel.text = detail
} else {
infoDetailLabel.text = placeholder
infoDetailLabel.font = .PFSC_R(ofSize: 14)
infoDetailLabel.textColor = UIColor(hexString: "#B9C1CC")
}
}
private func setupUI() {
updateCellCorner(.mid)
subContainerView.addSubview(dotIcon)
subContainerView.addSubview(infoTitleLabel)
subContainerView.addSubview(infoDetailLabel)
subContainerView.addSubview(bottomLineView)
subContainerView.addSubview(infoFailLabel)
subContainerView.addSubview(rightArrowIcon)
dotIcon.setContentCompressionResistancePriority(.required, for: .horizontal)
infoTitleLabel.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal)
infoDetailLabel.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
rightArrowIcon.setContentCompressionResistancePriority(.required, for: .horizontal)
dotIcon.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalToSuperview().offset(18)
make.width.height.equalTo(6)
}
infoTitleLabel.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalTo(dotIcon.snp.right).offset(2)
}
rightArrowIcon.snp.makeConstraints { make in
make.centerY.equalTo(infoTitleLabel)
make.right.equalToSuperview().offset(-18)
make.width.height.equalTo(20)
}
infoDetailLabel.snp.makeConstraints { make in
make.top.equalToSuperview().offset(16)
make.bottom.equalToSuperview().offset(-16)
make.left.equalToSuperview().offset(147)
make.right.lessThanOrEqualTo(rightArrowIcon.snp.left).offset(-18)
}
bottomLineView.snp.makeConstraints { make in
make.bottom.equalToSuperview()
make.left.equalToSuperview().offset(18)
make.right.equalToSuperview().offset(-18)
make.height.equalTo(0.5)
}
infoFailLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(18)
make.right.lessThanOrEqualToSuperview().offset(-18)
make.bottom.equalToSuperview().offset(-16)
}
infoFailLabel.isHidden = true
}
}
//
// YHIncomeUploadWorkIDCell.swift
// galaxy
//
// Created by alexzzw on 2024/12/24.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHIncomeUploadWorkIDCell: YHResignDocumentCell {
static let cellReuseIdentifier = "YHIncomeUploadWorkIDCell"
private lazy var infoTitleLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_M(ofSize: 14)
label.textColor = UIColor.mainTextColor
label.text = "上传工作证件"
return label
}()
private lazy var infoDetailLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_R(ofSize: 14)
label.textColor = .brandMainColor
label.text = "去上传"
return label
}()
private lazy var rightArrowIcon: UIImageView = {
let imageView = UIImageView(image: UIImage(named: "blue_right_arrow"))
return imageView
}()
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(title: String, detail: String) {
infoTitleLabel.text = title
infoDetailLabel.text = detail
}
private func setupUI() {
updateCellCorner(.bottom)
subContainerView.addSubview(infoTitleLabel)
subContainerView.addSubview(infoDetailLabel)
subContainerView.addSubview(rightArrowIcon)
infoTitleLabel.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal)
infoDetailLabel.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
rightArrowIcon.setContentCompressionResistancePriority(.required, for: .horizontal)
infoTitleLabel.snp.makeConstraints { make in
make.top.equalToSuperview().offset(16)
make.left.equalToSuperview().offset(18)
}
rightArrowIcon.snp.makeConstraints { make in
make.centerY.equalTo(infoTitleLabel)
make.right.equalToSuperview().offset(-18)
make.width.height.equalTo(20)
}
infoDetailLabel.snp.makeConstraints { make in
make.top.equalToSuperview().offset(16)
make.bottom.equalToSuperview().offset(-16)
make.right.equalTo(rightArrowIcon.snp.left)
}
}
}
......@@ -65,6 +65,12 @@ class YHInfoQuestionSelectionCell: YHResignDocumentCell {
return label
}()
private lazy var bottomLineView: UIView = {
let view = UIView()
view.backgroundColor = UIColor(hexString: "#E9ECF0")
return view
}()
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
......@@ -77,6 +83,7 @@ class YHInfoQuestionSelectionCell: YHResignDocumentCell {
func setupCellInfo(question: String, showBottomLine: Bool = false, needShowFailButton: Bool) {
infoQuestionLabel.text = question
updateFailLabel(needShowFailButton)
bottomLineView.isHidden = !showBottomLine
}
}
......@@ -137,6 +144,7 @@ extension YHInfoQuestionSelectionCell {
subContainerView.addSubview(sureButton)
subContainerView.addSubview(cancelButton)
subContainerView.addSubview(infoFailLabel)
subContainerView.addSubview(bottomLineView)
sureButton.setContentCompressionResistancePriority(.required, for: .horizontal)
cancelButton.setContentCompressionResistancePriority(.required, for: .horizontal)
......@@ -170,6 +178,13 @@ extension YHInfoQuestionSelectionCell {
make.centerY.equalTo(infoQuestionLabel)
make.left.greaterThanOrEqualTo(infoQuestionLabel.snp.right).offset(8)
}
bottomLineView.snp.makeConstraints { make in
make.bottom.equalToSuperview()
make.left.equalToSuperview().offset(18)
make.right.equalToSuperview().offset(-18)
make.height.equalTo(0.5)
}
infoFailLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(18)
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "income_date_check_btn_0@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "income_date_check_btn_0@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "income_date_check_btn_1@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "income_date_check_btn_1@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