Commit 410aa91d authored by pete谢兆麟's avatar pete谢兆麟

工作经验UI

parent 90769f6e
......@@ -17,6 +17,7 @@
040AE97E2CE7464000310241 /* YHWorkExperiencePositionListTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 040AE97D2CE7464000310241 /* YHWorkExperiencePositionListTableViewCell.swift */; };
040AE9802CE8340000310241 /* YHWorkExperiencePositionReasonTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 040AE97F2CE8340000310241 /* YHWorkExperiencePositionReasonTableViewCell.swift */; };
040AE9822CE8810200310241 /* YHWorkExperienceSelectView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 040AE9812CE8810200310241 /* YHWorkExperienceSelectView.swift */; };
040AE9842CE893CC00310241 /* YHWorkExperiencePositionItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 040AE9832CE893CC00310241 /* YHWorkExperiencePositionItemView.swift */; };
04129E862CD0C8490072F87B /* YHAliYunLogManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04129E852CD0C8490072F87B /* YHAliYunLogManager.swift */; };
041390692C1081FA0098CB8A /* YHFileListEmptyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041390682C1081FA0098CB8A /* YHFileListEmptyView.swift */; };
0414708B2C88627B00B7B688 /* YHButlerServiceManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0414708A2C88627B00B7B688 /* YHButlerServiceManager.swift */; };
......@@ -1018,6 +1019,7 @@
040AE97D2CE7464000310241 /* YHWorkExperiencePositionListTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHWorkExperiencePositionListTableViewCell.swift; sourceTree = "<group>"; };
040AE97F2CE8340000310241 /* YHWorkExperiencePositionReasonTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHWorkExperiencePositionReasonTableViewCell.swift; sourceTree = "<group>"; };
040AE9812CE8810200310241 /* YHWorkExperienceSelectView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHWorkExperienceSelectView.swift; sourceTree = "<group>"; };
040AE9832CE893CC00310241 /* YHWorkExperiencePositionItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHWorkExperiencePositionItemView.swift; sourceTree = "<group>"; };
04129E852CD0C8490072F87B /* YHAliYunLogManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAliYunLogManager.swift; sourceTree = "<group>"; };
041390682C1081FA0098CB8A /* YHFileListEmptyView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFileListEmptyView.swift; sourceTree = "<group>"; };
0414708A2C88627B00B7B688 /* YHButlerServiceManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHButlerServiceManager.swift; sourceTree = "<group>"; };
......@@ -2933,6 +2935,7 @@
040AE97D2CE7464000310241 /* YHWorkExperiencePositionListTableViewCell.swift */,
040AE97F2CE8340000310241 /* YHWorkExperiencePositionReasonTableViewCell.swift */,
040AE9812CE8810200310241 /* YHWorkExperienceSelectView.swift */,
040AE9832CE893CC00310241 /* YHWorkExperiencePositionItemView.swift */,
);
path = V;
sourceTree = "<group>";
......@@ -5671,6 +5674,7 @@
04CCEDF92CA0FD5F0026EA70 /* YHHKImmigrationRecordsSummaryModel.swift in Sources */,
0430E6882C771B06000511E2 /* YHAdopterItemView.swift in Sources */,
045EEEB32B9F171A0022A143 /* YHWorkFileSyncTableViewCell.swift in Sources */,
040AE9842CE893CC00310241 /* YHWorkExperiencePositionItemView.swift in Sources */,
045EEEF12B9F171A0022A143 /* YHChildInfoContainerVC.swift in Sources */,
04CA2BFD2CB7C36D00F36DE7 /* YHResignUploadDocListCell.swift in Sources */,
045EEF0B2B9F171A0022A143 /* YHBasicInfoFillViewController.swift in Sources */,
......
//
// YHWorkExperiencePositionItemView.swift
// galaxy
//
// Created by EDY on 2024/11/16.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHWorkExperiencePositionItemView: UIView {
typealias ItemBlock = (_ model: YHWorkItemListModel) -> ()
var clickBlock: ItemBlock?
var deleteBlock: ItemBlock?
var titleLabel: UILabel!
var subTitleLabel: UILabel!
var explainLabel: UILabel!
var nextStepImageView: UIImageView!
var deleteButton: UIButton!
var centerButton: UIButton!
var showPrompt: Bool = false {
didSet {
if showPrompt {
if dataSource?.vacant_num != 0 {
subTitleLabel.text = "有" + "\(dataSource?.vacant_num ?? 0)" + "项未填写"
subTitleLabel.textColor = UIColor.failColor
} else {
subTitleLabel.textColor = UIColor.labelTextColor2
}
} else {
subTitleLabel.textColor = UIColor.labelTextColor2
}
}
}
var dataSource: YHWorkItemListModel? {
didSet {
updateAllViews()
}
}
override init(frame: CGRect) {
super.init(frame: frame)
backgroundColor = .white
setUpView()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setUpView() {
titleLabel = {
let label = UILabel()
label.font = UIFont.PFSC_B(ofSize: 14)
label.textAlignment = .left
label.numberOfLines = 2
label.textColor = UIColor.mainTextColor
return label
}()
addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalToSuperview()
make.top.equalTo(16)
make.width.equalTo(143)
}
explainLabel = {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 14)
label.textAlignment = .right
label.textColor = UIColor.labelTextColor2
return label
}()
addSubview(explainLabel)
explainLabel.snp.makeConstraints { make in
make.right.equalTo(-24)
make.left.equalTo(titleLabel.snp.right)
make.height.equalTo(20)
make.top.equalTo(16)
}
nextStepImageView = {
let imageView = UIImageView()
imageView.image = UIImage(named: "form_right_arrow")
return imageView
}()
addSubview(nextStepImageView)
nextStepImageView.snp.makeConstraints { make in
make.right.equalToSuperview()
make.centerY.equalTo(explainLabel.snp.centerY)
make.height.width.equalTo(20)
}
centerButton = {
let button = UIButton(type: .custom)
button.addTarget(self, action: #selector(centerClick), for: .touchUpInside)
return button
}()
addSubview(centerButton)
centerButton.snp.makeConstraints { make in
make.right.top.bottom.equalToSuperview()
make.left.equalTo(112)
}
deleteButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = UIFont.PFSC_R(ofSize: 14)
button.contentHorizontalAlignment = .center
button.setTitle("删除", for: .normal)
button.contentHorizontalAlignment = .right
button.setTitleColor(UIColor.failColor, for: .normal)
button.addTarget(self, action: #selector(deleteClick), for: .touchUpInside)
button.isHidden = true
return button
}()
addSubview(deleteButton)
deleteButton.snp.makeConstraints { make in
make.right.equalToSuperview()
make.height.equalTo(20)
make.width.equalTo(35)
make.centerY.equalTo(titleLabel.snp.centerY)
}
}
func updateAllViews() {
guard let dataSource = dataSource else { return }
titleLabel.text = dataSource.company_name
if dataSource.vacant_num != 0 {
explainLabel.text = "有" + "\(dataSource.vacant_num ?? 0)" + "项未填写"
} else {
explainLabel.text = (dataSource.entry_time ?? "") + " ~ " + (dataSource.departure_time ?? "")
}
if dataSource.company_name?.count == 0 {
titleLabel.text = "工作经验\(tag - 4000 + 1)"
}
}
@objc func centerClick() {
if let block = clickBlock {
block(self.dataSource ?? YHWorkItemListModel())
}
}
@objc func deleteClick() {
if let block = deleteBlock {
block(self.dataSource ?? YHWorkItemListModel())
}
}
func isShowDelete(_ index: Int, isShow: Bool) {
if isShow {
explainLabel.isHidden = true
nextStepImageView.isHidden = true
deleteButton.isHidden = false
} else {
explainLabel.isHidden = false
nextStepImageView.isHidden = false
deleteButton.isHidden = true
}
}
}
......@@ -196,7 +196,7 @@ class YHWorkExperiencePositionTableViewCell: UITableViewCell {
make.right.equalTo(-18)
}
total = total + 1
let itemView = YHWorkItemView()
let itemView = YHWorkExperiencePositionItemView()
itemView.clickBlock = {[weak self] model in
guard let self = self else { return }
if let block = self.clickBlock {
......
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