Commit e5c70b7d authored by David黄金龙's avatar David黄金龙

Merge commit 'ff2f301a' into davidhuang

* commit 'ff2f301a':
  工作经验主流程UI
  工作经验基本信息

# Conflicts:
#	galaxy/galaxy.xcodeproj/project.pbxproj
parents d7fcf091 ff2f301a
This diff is collapsed.
......@@ -9,7 +9,6 @@
import UIKit
class YHWorkExperienceListViewController: YHBaseViewController {
var bottomView: UIView!
var bottomButton: UIButton!
var tableView: UITableView!
......@@ -84,12 +83,11 @@ class YHWorkExperienceListViewController: YHBaseViewController {
make.height.equalTo(48)
make.left.equalTo(16)
}
}
@objc func submit() {
let vc = YHWorkExperienceViewController()
self.navigationController?.pushViewController(vc, animated: true)
}
}
......
//
// YHWorkExperienceViewController.swift
// galaxy
//
// Created by EDY on 2024/2/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHWorkExperienceViewController: YHBaseViewController {
var stepView: YHStepView!
var bottomView: YHBottomNextView!
var tableView: UITableView!
var viewModel: YHWorkExperienceViewModel!
var baseDataSource: [YHSectionWorkExperienceModel]?
var introductionDataSource: [YHWorkItemListModel]?
var fileDataSource: [String]?
override func viewDidLoad() {
super.viewDidLoad()
viewModel = YHWorkExperienceViewModel()
gk_navTitle = "工作经验信息填写"
setView()
getData()
// Do any additional setup after loading the view.
}
func getData() {
updateDataSource()
}
func updateDataSource() {
if self.stepView.currentIndex == 0 {
self.baseDataSource = self.viewModel.getBaseDataSource()
}
self.tableView.reloadData()
}
func setView() {
stepView = {
let step = YHStepView()
step.dataSource = ["基本信息", "工作职责", "工作亮点", "项目介绍", "简历/工作总结"]
step.contentSize = CGSize(width: KScreenWidth * 1.2, height: 104)
step.showsHorizontalScrollIndicator = false
step.showsVerticalScrollIndicator = false
step.block = { [weak self] (index) in
guard let self = self else { return }
self.updateDataSource()
}
return step
}()
view.addSubview(stepView)
stepView.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.left.right.equalTo(view)
make.height.equalTo(104)
}
tableView = {
let tableView = UITableView(frame:.zero, style:.plain)
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
}
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.register(cellWithClass: YHWorkExperienceTableViewCell.self)
tableView.register(cellWithClass: YHWorkResponsibilitiesTableViewCell.self)
tableView.register(cellWithClass: YHWorkHighlightsTableViewCell.self)
tableView.register(cellWithClass: YHWorkIntroductionTableViewCell.self)
tableView.register(cellWithClass: YHWorkMessageSelectTableViewCell.self)
tableView.register(cellWithClass: YHWorkFileSyncTableViewCell.self)
return tableView
}()
view.addSubview(tableView)
tableView.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar + YHStepView.height)
make.bottom.equalTo(-k_Height_safeAreaInsetsBottom() - 64)
make.left.right.bottom.equalTo(view)
}
bottomView = {
let bottom = YHBottomNextView()
bottom.nextblock = { [weak self] in
guard let self = self else { return }
self.stepView.currentIndex = self.stepView.currentIndex + 1
self.updateDataSource()
}
bottom.saveBlock = { [weak self] in
guard let self = self else { return }
}
return bottom
}()
view.addSubview(bottomView)
bottomView.snp.makeConstraints { make in
make.left.right.bottom.equalTo(view)
make.height.equalTo(k_Height_safeAreaInsetsBottom() + 64)
}
}
}
extension YHWorkExperienceViewController: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if stepView.currentIndex == 1 || stepView.currentIndex == 2 || stepView.currentIndex == 3 {
return 1
}
if stepView.currentIndex == 4 {
return 2
}
return baseDataSource?.count ?? 0
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if stepView.currentIndex == 1 {
let cell = tableView.dequeueReusableCell(withClass: YHWorkResponsibilitiesTableViewCell.self)
return cell
} else if stepView.currentIndex == 2 {
let cell = tableView.dequeueReusableCell(withClass: YHWorkHighlightsTableViewCell.self)
return cell
} else if stepView.currentIndex == 3 {
let cell = tableView.dequeueReusableCell(withClass: YHWorkIntroductionTableViewCell.self)
cell.addIntroductionBlock = {[weak self] in
guard let self = self else { return }
let vc = YHWorkIntroductionViewController()
self.navigationController?.pushViewController(vc, animated: true)
}
return cell
} else if stepView.currentIndex == 4 {
if indexPath.row == 0 {
let cell = tableView.dequeueReusableCell(withClass: YHWorkMessageSelectTableViewCell.self)
return cell
} else {
let cell = tableView.dequeueReusableCell(withClass: YHWorkFileSyncTableViewCell.self)
return cell
}
} else {
let cell = tableView.dequeueReusableCell(withClass: YHWorkExperienceTableViewCell.self)
cell.dataSource = baseDataSource?[indexPath.row]
cell.workExperienceBlock = {[weak self] model in
guard let self = self else { return }
// self.viewModel.updateModel(model)
self.updateDataSource()
}
return cell
}
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if stepView.currentIndex == 1 || stepView.currentIndex == 2 {
return KScreenHeight - k_Height_NavigationtBarAndStatuBar - YHStepView.height - k_Height_safeAreaInsetsBottom() - 64
} else if stepView.currentIndex == 3 {
let number = introductionDataSource?.count ?? 0
return CGFloat(76 * number + 161)
} else if stepView.currentIndex == 4 {
if indexPath.row == 0 {
return 166
} else {
let count = fileDataSource?.count ?? 0
return CGFloat(52 * count + 138)
}
} else {
let array = baseDataSource?[indexPath.row].models ?? []
var h = 0
for i in 0..<array.count {
let data = array[i]
if data.id == .id3 || data.id == .id4 || data.id == .id18 {
h = h + 132
} else if data.id == .id13 {
h = h + 72
} else {
h = h + 52
}
}
return CGFloat(h + 52 + 14)
}
}
}
//
// YHWorkIntroductionViewController.swift
// galaxy
//
// Created by EDY on 2024/2/20.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHWorkIntroductionViewController: YHBaseViewController {
var nameTextField: UITextField!
var startTextField: UITextField!
var endTextField: UITextField!
var messageTextField: UITextView!
var promptsLabel: UILabel!
var actionView: YHWorkActionView!
var bottomView: UIView!
var bottomButton: UIButton!
override func viewDidLoad() {
super.viewDidLoad()
gk_navTitle = "工作经验信息填写"
setView()
getData()
// Do any additional setup after loading the view.
}
func getData() {
}
func setView() {
view.backgroundColor = .white
let array = ["项目名称", "项目时间", "项目业绩/亮点"]
for i in 0..<array.count {
let label = UILabel()
label.textColor = UIColor(hex: 0x222222)
label.font = kFont(size: 14)
label.text = array[i]
view.addSubview(label)
label.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(CGFloat(51 * i) + k_Height_NavigationtBarAndStatuBar)
make.width.equalTo(100)
make.height.equalTo(51)
}
if i != array.count - 1 {
let line = UIView()
line.backgroundColor = UIColor(hex: 0xf0f0f0)
view.addSubview(line)
line.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(CGFloat(51 * (i + 1)) + k_Height_NavigationtBarAndStatuBar)
make.right.equalTo(-18)
make.height.equalTo(1)
}
}
}
nameTextField = {
let textField = UITextField()
textField.font = kFont(size: 14)
textField.placeholder = "如方便提供,请填写"
return textField
}()
view.addSubview(nameTextField)
nameTextField.snp.makeConstraints { make in
make.right.equalTo(-18)
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.left.equalTo(117)
make.height.equalTo(51)
}
startTextField = {
let textField = UITextField()
textField.font = kFont(size: 14)
textField.placeholder = "开始时间"
textField.isEnabled = false
textField.isUserInteractionEnabled = false
return textField
}()
view.addSubview(startTextField)
startTextField.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar + 52)
make.left.equalTo(117)
make.height.equalTo(51)
make.width.equalTo(80)
}
let startButton = {
let button = UIButton(type: .custom)
button.addTarget(self, action: #selector(startClick), for: .touchUpInside)
return button
}()
view.addSubview(startButton)
startButton.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar + 52)
make.left.equalTo(117)
make.height.equalTo(51)
make.width.equalTo(80)
}
endTextField = {
let textField = UITextField()
textField.font = kFont(size: 14)
textField.placeholder = "结束时间"
textField.isEnabled = false
textField.isUserInteractionEnabled = false
return textField
}()
view.addSubview(endTextField)
endTextField.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar + 52)
make.right.equalTo(-18)
make.height.equalTo(51)
make.width.equalTo(80)
}
let endButton = {
let button = UIButton(type: .custom)
button.addTarget(self, action: #selector(endClick), for: .touchUpInside)
return button
}()
view.addSubview(endButton)
endButton.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar + 52)
make.right.equalTo(-18)
make.height.equalTo(51)
make.width.equalTo(80)
}
let lineView = UIView()
lineView.backgroundColor = UIColor(hex: 0x222222)
view.addSubview(lineView)
lineView.snp.makeConstraints { make in
make.centerY.equalTo(startTextField.snp.centerY)
make.height.equalTo(1)
make.width.equalTo(5)
make.centerX.equalToSuperview().offset(40)
}
messageTextField = {
let textField = UITextView()
textField.backgroundColor = UIColor(hex: 0xf8f9fb)
textField.font = kFont(size: 14)
textField.layer.cornerRadius = 6
textField.delegate = self
return textField
}()
view.addSubview(messageTextField)
messageTextField.snp.makeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(-18)
make.top.equalTo(156 + k_Height_NavigationtBarAndStatuBar)
make.bottom.equalTo(-k_Height_safeAreaInsetsBottom() - 124)
}
promptsLabel = {
let prompts = UILabel()
prompts.font = kFont(size: 14)
prompts.textColor = UIColor(hex: 0xc0c0c0)
prompts.text = "在职期间负责的核心项目,如果负责过多个项目,请分段描述:\n\n例子:\n\n模式1、本人对XX项目展开深入研究,通过对XX方法/方式,研究出XX。此外,她还指出XX问题,反映了XX。XX的研究成果对XX产生了重要性,为XX领域/方面提供参考依据;\n\n模式2、本人在司参与了XX项目,该项目具有XX突出意义。在此项目中,XX是个难点,本人通过XX方法,实现了XX成果。在XX方面,本人通过XX方式,完成了XX工作。本人凭借在XX领域的丰富经验,推动项目在中国/海外市场取得XX成果。"
prompts.numberOfLines = 0
return prompts
}()
view.addSubview(promptsLabel)
promptsLabel.snp.makeConstraints { make in
make.left.equalTo(22)
make.right.equalTo(-22)
make.top.equalTo(161 + k_Height_NavigationtBarAndStatuBar)
}
actionView = {
let view = YHWorkActionView()
return view
}()
view.addSubview(actionView)
actionView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.height.equalTo(44)
make.bottom.equalTo(-k_Height_safeAreaInsetsBottom() - 64)
}
bottomView = {
let bottom = UIView()
bottom.backgroundColor = .white
return bottom
}()
view.addSubview(bottomView)
bottomView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.height.equalTo(k_Height_safeAreaInsetsBottom() + 64)
}
bottomButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor(hex:0x2274ee)
button.titleLabel?.font = kBoldFont(size: 16)
button.contentHorizontalAlignment = .center
button.setTitle("保存", for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.layer.cornerRadius = 6
button.addTarget(self, action: #selector(submit), for: .touchUpInside)
return button
}()
bottomView.addSubview(bottomButton)
bottomButton.snp.makeConstraints { make in
make.right.equalTo(-16)
make.top.equalTo(8)
make.height.equalTo(48)
make.left.equalTo(16)
}
}
@objc func submit() {
let vc = YHWorkExperienceViewController()
self.navigationController?.pushViewController(vc, animated: true)
}
@objc func startClick() {
YHDatePickView.show(type: .yyyymmdd) { date in
self.startTextField.text = date
}
}
@objc func endClick() {
YHDatePickView.show(type: .yyyymmdd) { date in
self.endTextField.text = date
}
}
}
extension YHWorkIntroductionViewController: UITextViewDelegate {
func textViewDidChange(_ textView: UITextView) {
}
}
//
// YHWorkExperienceModel.swift
// galaxy
//
// Created by EDY on 2024/2/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
enum YHWorkExperienceSelectType: Int {
case normal = 0
case unit = 1
case nature = 2
case country = 3
case address = 4
case time = 5
case certificate = 6
case structure = 7
case level = 8
case prove = 9
}
enum YHWorkExperienceID: Int {
case id1 = 0 // 用人单位
case id2 = 1 // 用人单位性质
case id3 = 2 // 用人单位介绍
case id4 = 3 // 用人单位官网
case id5 = 4 // 工作地区国家
case id6 = 5 // 工作城市 国内
case id7 = 6 // 工作城市国外
case id8 = 7 // 职位
case id9 = 8 // 入职年月
case id10 = 9 // 离职年月
case id11 = 10 // 工作证明文件
case id12 = 11 // 职责性质
case id13 = 12 // 是否国际工作经验
case id14 = 13 // 企业人数规模
case id15 = 14 // 行政架构层级
case id16 = 15 // 下属管理人数
case id17 = 16 // 公司营业额/港元
case id18 = 17 // 公司性质/范畴/所属行业
case id19 = 18 // 职位水平类型
case id20 = 19 // 高管证明文件
case id21 = 20 // 高管在职开始时间
case id22 = 21 // 高管在职结束时间
}
struct YHWorkExperienceModel {
var id: YHWorkExperienceID?
var isNeed: Bool?
var title: String?
var isUserKeyBoard: Bool?
var prompts: String?
var message: String?
var leftButtonString: String?
var rightButtonString: String?
var type: YHWorkExperienceSelectType?
var value: [String]?
init(id: YHWorkExperienceID? = nil, isNeed: Bool? = nil, title: String? = nil, isUserKeyBoard: Bool? = nil, prompts: String? = nil, message: String? = nil, leftButtonString: String? = nil, rightButtonString: String? = nil, type: YHWorkExperienceSelectType? = nil, value: [String]? = nil) {
self.id = id
self.isNeed = isNeed
self.title = title
self.isUserKeyBoard = isUserKeyBoard
self.prompts = prompts
self.message = message
self.leftButtonString = leftButtonString
self.rightButtonString = rightButtonString
self.type = type
self.value = value
}
}
struct YHSectionWorkExperienceModel {
var title: String?
var models: [YHWorkExperienceModel]?
init(title: String? = nil, models: [YHWorkExperienceModel]? = nil) {
self.title = title
self.models = models
}
}
//
// YHWorkActionView.swift
// galaxy
//
// Created by EDY on 2024/2/20.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHWorkActionView: UIView {
var photoButton: UIButton!
var wxButton: UIButton!
var exampleButton: UIButton!
override init(frame: CGRect) {
super.init(frame: frame)
backgroundColor = .white
setUpView()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setUpView() {
photoButton = {
let button = UIButton(type: .custom)
button.setBackgroundImage(UIImage(named: "work_experience_photo"), for: .normal)
button.addTarget(self, action: #selector(photoClick), for: .touchUpInside)
return button
}()
addSubview(photoButton)
photoButton.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalTo(16)
make.height.width.equalTo(21)
}
wxButton = {
let button = UIButton(type: .custom)
button.setBackgroundImage(UIImage(named: "work_experience_wx"), for: .normal)
button.addTarget(self, action: #selector(wxClick), for: .touchUpInside)
return button
}()
addSubview(wxButton)
wxButton.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalTo(49)
make.height.width.equalTo(21)
}
exampleButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = kFont(size: 13)
button.contentHorizontalAlignment = .center
button.setTitle("参考示例", for: .normal)
button.setTitleColor( UIColor(hex:0x2f7ef6), for: .normal)
button.setImage(UIImage(named: "work_experience_example"), for: .normal)
button.imageEdgeInsets = UIEdgeInsets(top: 2, left: 0, bottom: 2, right: 58)
button.addTarget(self, action: #selector(exampleClick), for: .touchUpInside)
return button
}()
addSubview(exampleButton)
exampleButton.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.right.equalTo(-18)
make.height.equalTo(20)
make.width.equalTo(74)
}
}
@objc func photoClick() {
}
@objc func wxClick() {
}
@objc func exampleClick() {
}
}
//
// YHWorkExperienceTableViewCell.swift
// galaxy
//
// Created by EDY on 2024/2/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHWorkExperienceTableViewCell: UITableViewCell {
typealias WorkExperienceBlock = (_ model: YHWorkExperienceModel) -> ()
var workExperienceBlock: WorkExperienceBlock?
var centerView: UIView!
var titleLabel: UILabel!
var mainItemView: UIView!
var dataSource: YHSectionWorkExperienceModel?{
didSet {
updateAllViews()
}
}
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
}
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() {
backgroundColor = UIColor(hex: 0xe9e9e9)
centerView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = 12
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 = kFont(size: 17)
label.textColor = UIColor(hex:0x222222)
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 = 12
return view
}()
centerView.addSubview(mainItemView)
mainItemView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.top.equalTo(52)
}
}
func updateAllViews() {
titleLabel.text = dataSource?.title
mainItemView.removeSubviews()
var y = 0
for i in 0 ..< (dataSource?.models?.count ?? 0) {
let line = UIView()
line.backgroundColor = UIColor(hex: 0xf0f0f0)
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 = y + 1
let data = dataSource?.models?[i]
if data?.id == .id3 || data?.id == .id4 || data?.id == .id18 {
let itemView = YHWorkExperienceTextItemView()
itemView.dataSource = data
itemView.block = {[weak self] model in
guard let self = self else { return }
if let block = self.workExperienceBlock {
block(model)
}
}
mainItemView.addSubview(itemView)
itemView.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(y)
make.height.equalTo(131)
make.right.equalTo(-18)
}
y = y + 131
} else {
var h = 51
if data?.id == .id13 {
h = 71
}
let itemView = YHWorkExperienceItemView()
itemView.dataSource = data
itemView.block = {[weak self] model in
guard let self = self else { return }
if let block = self.workExperienceBlock {
block(model)
}
}
mainItemView.addSubview(itemView)
itemView.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(y)
make.height.equalTo(h)
make.right.equalTo(-18)
}
y = y + h
}
}
}
}
//
// YHWorkExperienceTextItemView.swift
// galaxy
//
// Created by EDY on 2024/2/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHWorkExperienceTextItemView: UIView {
typealias ItemBlock = (_ model: YHWorkExperienceModel) -> ()
var block: ItemBlock?
var titleLabel: UILabel!
var messageTextField: UITextView!
var promptsLabel: UILabel!
var nextStepImageView: UIImageView!
var dataSource: YHWorkExperienceModel? {
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.numberOfLines = 0
return label
}()
addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalToSuperview()
make.top.equalTo(16)
make.height.equalTo(20)
}
messageTextField = {
let textField = UITextView()
textField.backgroundColor = UIColor(hex: 0xf8f9fb)
textField.layer.cornerRadius = 4
textField.delegate = self
return textField
}()
addSubview(messageTextField)
messageTextField.snp.makeConstraints { make in
make.right.left.equalToSuperview()
make.top.equalTo(52)
make.bottom.equalTo(-16)
}
promptsLabel = {
let textField = UILabel()
textField.font = kFont(size: 14)
textField.textColor = UIColor(hex: 0xc0c0c0)
return textField
}()
addSubview(promptsLabel)
promptsLabel.snp.makeConstraints { make in
make.right.left.equalTo(12)
make.top.equalTo(64)
make.height.equalTo(20)
}
nextStepImageView = {
let imageView = UIImageView()
imageView.image = UIImage(named: "work_experience_alert")
return imageView
}()
addSubview(nextStepImageView)
nextStepImageView.snp.makeConstraints { make in
make.left.equalTo(titleLabel.snp.right)
make.centerY.equalTo(titleLabel.snp.centerY)
make.height.width.equalTo(16)
}
}
func updateAllViews() {
guard let dataSource = dataSource else { return }
if dataSource.isNeed ?? false {
let str = "*" + (dataSource.title ?? "")
let attributes: [NSAttributedString.Key: Any] = [
.font: UIFont.PFSC_R(ofSize: 14),
.foregroundColor: UIColor(hex:0x222222)
]
let questionAttrStr = NSMutableAttributedString(string: str, attributes: attributes)
let starRange = NSRange(location: 0, length: 1)
questionAttrStr.addAttribute(NSAttributedString.Key.foregroundColor, value: UIColor(hex:0xFF3A3A), range: starRange)
titleLabel.attributedText = questionAttrStr
} else {
let str = dataSource.title ?? ""
let attributes: [NSAttributedString.Key: Any] = [
.font: kFont(size: 14),
.foregroundColor: UIColor(hex:0x222222)
]
let questionAttrStr = NSMutableAttributedString(string: str, attributes: attributes)
titleLabel.attributedText = questionAttrStr
}
promptsLabel.text = dataSource.prompts
messageTextField.text = dataSource.message
}
}
extension YHWorkExperienceTextItemView: UITextViewDelegate {
func textViewDidChange(_ textView: UITextView) {
dataSource?.message = textView.text
if let block = block {
block(dataSource ?? YHWorkExperienceModel())
}
}
}
//
// YHWorkFileItemView.swift
// galaxy
//
// Created by EDY on 2024/2/20.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHWorkFileItemView: UIView {
typealias ItemBlock = (_ model: YHItemModel) -> ()
var block: ItemBlock?
var titleLabel: UILabel!
var deleteButton: UIButton!
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 = kBoldFont(size: 14)
label.textAlignment = .left
label.textColor = UIColor(hex:0x222222)
return label
}()
addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalToSuperview()
make.top.equalTo(16)
make.width.equalTo(200)
make.height.equalTo(20)
}
deleteButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = kFont(size: 14)
button.contentHorizontalAlignment = .center
button.setTitle("删除", for: .normal)
button.setTitleColor( UIColor(hex:0xf81d22), for: .normal)
button.addTarget(self, action: #selector(deleteClick), for: .touchUpInside)
button.isHidden = true
return button
}()
addSubview(deleteButton)
deleteButton.snp.makeConstraints { make in
make.right.equalTo(-24)
make.height.equalTo(20)
make.width.equalTo(28)
make.centerY.equalTo(titleLabel.snp.centerY)
}
}
func updateAllViews() {
guard let dataSource = dataSource else { return }
titleLabel.text = dataSource.title
}
@objc func deleteClick() {
}
}
//
// YHWorkFileSyncTableViewCell.swift
// galaxy
//
// Created by EDY on 2024/2/20.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHWorkFileSyncTableViewCell: UITableViewCell {
typealias ExperienceListBlock = (_ model: YHItemModel) -> ()
typealias AddIntroductionBlock = () -> ()
var experienceListBlock: ExperienceListBlock?
var addIntroductionBlock: AddIntroductionBlock?
var centerView: UIView!
var titleLabel: UILabel!
var mainItemView: UIView!
var bottomView: YHWorkItemAddView!
var dataSource: [YHWorkItemListModel]?{
didSet {
updateAllViews()
}
}
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
}
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() {
backgroundColor = UIColor(hex: 0xe9e9e9)
centerView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = 12
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()
let str = "*" + "上传文件"
let attributes: [NSAttributedString.Key: Any] = [
.font: UIFont.PFSC_R(ofSize: 17),
.foregroundColor: UIColor(hex:0x222222)
]
let questionAttrStr = NSMutableAttributedString(string: str, attributes: attributes)
let starRange = NSRange(location: 0, length: 1)
questionAttrStr.addAttribute(NSAttributedString.Key.foregroundColor, value: UIColor(hex:0xFF3A3A), range: starRange)
label.attributedText = questionAttrStr
return label
}()
centerView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(16)
make.height.equalTo(24)
make.right.equalTo(-18)
}
mainItemView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = 12
return view
}()
centerView.addSubview(mainItemView)
mainItemView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.bottom.equalTo(-65)
make.top.equalTo(85)
}
bottomView = {
let view = YHWorkItemAddView()
view.addBtn.setTitle("上传".local, for: .normal)
view.clickBlock = {[weak self] in
guard let self = self else { return }
if let block = self.addIntroductionBlock {
block()
}
}
return view
}()
centerView.addSubview(bottomView)
bottomView.snp.makeConstraints { make in
make.right.bottom.equalTo(-18)
make.left.equalTo(18)
make.height.equalTo(45)
}
}
func updateAllViews() {
mainItemView.removeSubviews()
for i in 0 ..< (dataSource?.count ?? 0) {
let line = UIView()
line.backgroundColor = UIColor(hex: 0xf0f0f0)
mainItemView.addSubview(line)
line.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(52 * i)
make.height.equalTo(1)
make.right.equalTo(-18)
}
let itemView = YHWorkFileItemView()
itemView.dataSource = dataSource?[i]
itemView.block = {[weak self] model in
guard let self = self else { return }
if let block = self.experienceListBlock {
block(model)
}
}
mainItemView.addSubview(itemView)
itemView.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(52 * i + 1)
make.height.equalTo(51)
make.right.equalTo(-18)
}
}
}
@objc func cannal() {
}
@objc func more() {
}
}
//
// YHWorkHighlightsTableViewCell.swift
// galaxy
//
// Created by EDY on 2024/2/20.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHWorkHighlightsTableViewCell: UITableViewCell {
var centerView: UIView!
var titleLabel: UILabel!
var subTitleLabel: UILabel!
var lineView: UIView!
var messageTextField: UITextView!
var promptsLabel: UILabel!
var detailLabel: UILabel!
var detailSwitch: UISwitch!
var bottomView: YHWorkActionView!
var dataSource: YHSectionWorkExperienceModel?{//模型待定
didSet {
updateAllViews()
}
}
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
}
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() {
backgroundColor = UIColor(hex: 0xe9e9e9)
centerView = {
let view = UIView()
view.backgroundColor = .white
return view
}()
contentView.addSubview(centerView)
centerView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.top.equalTo(14)
}
titleLabel = {
let label = UILabel()
let str = "*" + "工作亮点"
let attributes: [NSAttributedString.Key: Any] = [
.font: UIFont.PFSC_R(ofSize: 17),
.foregroundColor: UIColor(hex:0x222222)
]
let questionAttrStr = NSMutableAttributedString(string: str, attributes: attributes)
let starRange = NSRange(location: 0, length: 1)
questionAttrStr.addAttribute(NSAttributedString.Key.foregroundColor, value: UIColor(hex:0xFF3A3A), range: starRange)
label.attributedText = questionAttrStr
return label
}()
centerView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(16)
make.height.equalTo(24)
make.right.equalTo(-18)
}
subTitleLabel = {
let label = UILabel()
label.text = "温馨提示:如下模板仅供思路参考,工作内容请按您的实际填写,后期文案会基于该内容进行文书材料撰写,望悉知"
label.textColor = UIColor(hex: 0x2f7ef6)
label.font = kFont(size: 12)
label.numberOfLines = 0
return label
}()
centerView.addSubview(subTitleLabel)
subTitleLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(52)
make.height.equalTo(40)
make.right.equalTo(-18)
}
lineView = {
let line = UIView()
line.backgroundColor = UIColor(hex: 0xf0f0f0)
return line
}()
centerView.addSubview(lineView)
lineView.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(110)
make.height.equalTo(1)
make.right.equalTo(-18)
}
messageTextField = {
let textField = UITextView()
textField.font = kFont(size: 14)
textField.delegate = self
return textField
}()
centerView.addSubview(messageTextField)
messageTextField.snp.makeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(-18)
make.top.equalTo(111)
make.bottom.equalTo(-44)
}
promptsLabel = {
let prompts = UILabel()
prompts.font = kFont(size: 14)
prompts.textColor = UIColor(hex: 0xc0c0c0)
prompts.text = "示例:打破常规,超越同行或其他同事的优秀业绩;或有开创性且突破公司期望的杰出贡献,且给公司带来价值和收益。\n\n请举例2-3个工作亮点:\n\na. 是什么:某项目背景或工作目标或难点\nb.为什么:为什么出现这个项目工作/难点,旨在体现分析过程,为您后面提出解决方案做铺垫\nc.怎么处理:您是怎么把这件事做好的?用了什么技术/方法?有何突出/创新之处?\nd.有什么价值:为公司、客户或您本身带来了哪些价值?客户或您本身带来了哪些价值?\n最好用实际数据证明,比如销售业绩增加了多少,或者利润增加了多少,客户群体增加了多少等。"
prompts.numberOfLines = 0
return prompts
}()
centerView.addSubview(promptsLabel)
promptsLabel.snp.makeConstraints { make in
make.left.equalTo(22)
make.right.equalTo(-22)
make.top.equalTo(116)
}
detailLabel = {
let label = UILabel()
label.text = "项目详细介绍"
label.textColor = UIColor(hex: 0x222222)
label.font = kFont(size: 14)
return label
}()
centerView.addSubview(detailLabel)
detailLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.bottom.equalTo(-62)
make.height.equalTo(20)
make.width.equalTo(100)
}
detailSwitch = {
let switchView = UISwitch()
switchView.onTintColor = UIColor(hex: 0x4d9ff8)
switchView.addTarget(self, action: #selector(switchViewChange), for: .valueChanged)
return switchView
}()
centerView.addSubview(detailSwitch)
detailSwitch.snp.makeConstraints { make in
make.right.equalTo(-18)
make.centerY.equalTo(detailLabel.snp.centerY)
make.height.equalTo(24)
make.width.equalTo(45)
}
bottomView = {
let view = YHWorkActionView()
return view
}()
centerView.addSubview(bottomView)
bottomView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.height.equalTo(44)
}
detailSwitch.transform = CGAffineTransform(scaleX: 0.77, y: 0.77)
}
func updateAllViews() {
}
@objc func switchViewChange() {
}
}
extension YHWorkHighlightsTableViewCell: UITextViewDelegate {
func textViewDidChange(_ textView: UITextView) {
}
}
//
// YHWorkIntroductionItemView.swift
// galaxy
//
// Created by EDY on 2024/2/20.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHWorkIntroductionItemView: UIView {
typealias ItemBlock = (_ model: YHItemModel) -> ()
var block: ItemBlock?
var titleLabel: UILabel!
var subTitleLabel: UILabel!
var nextStepImageView: UIImageView!
var deleteButton: UIButton!
var centerButton: UIButton!
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 = kBoldFont(size: 14)
label.textAlignment = .left
label.textColor = UIColor(hex:0x222222)
return label
}()
addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalToSuperview()
make.top.equalTo(16)
make.width.equalTo(200)
make.height.equalTo(20)
}
subTitleLabel = {
let label = UILabel()
label.font = kBoldFont(size: 12)
label.textAlignment = .left
label.textColor = UIColor(hex:0x888f98)
return label
}()
addSubview(subTitleLabel)
subTitleLabel.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.height.equalTo(20)
make.top.equalTo(40)
}
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.equalToSuperview()
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 = kFont(size: 14)
button.contentHorizontalAlignment = .center
button.setTitle("删除", for: .normal)
button.setTitleColor( UIColor(hex:0xf81d22), for: .normal)
button.addTarget(self, action: #selector(centerClick), for: .touchUpInside)
button.isHidden = true
return button
}()
addSubview(deleteButton)
deleteButton.snp.makeConstraints { make in
make.right.equalTo(-24)
make.height.equalTo(20)
make.width.equalTo(28)
make.centerY.equalTo(titleLabel.snp.centerY)
}
}
func updateAllViews() {
guard let dataSource = dataSource else { return }
titleLabel.text = dataSource.title
subTitleLabel.text = dataSource.subTitle
if dataSource.isShowDelete ?? false {
deleteButton.isHidden = false
} else {
deleteButton.isHidden = true
}
}
@objc func centerClick() {
}
}
//
// YHWorkIntroductionTableViewCell.swift
// galaxy
//
// Created by EDY on 2024/2/20.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHWorkIntroductionTableViewCell: UITableViewCell {
typealias ExperienceListBlock = (_ model: YHItemModel) -> ()
typealias AddIntroductionBlock = () -> ()
var experienceListBlock: ExperienceListBlock?
var addIntroductionBlock: AddIntroductionBlock?
var centerView: UIView!
var titleLabel: UILabel!
var subTitleLabel: UILabel!
var cannalButton: UIButton!
var moreButton: UIButton!
var mainItemView: UIView!
var bottomView: YHWorkItemAddView!
var dataSource: [YHWorkItemListModel]?{
didSet {
updateAllViews()
}
}
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
}
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() {
backgroundColor = UIColor(hex: 0xe9e9e9)
centerView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = 12
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 = kFont(size: 16)
label.text = "项目介绍(选填)"
label.textColor = UIColor(hex:0x222222)
return label
}()
centerView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalTo(20)
make.top.equalTo(23)
make.height.equalTo(24)
make.right.equalTo(-20)
}
cannalButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = kBoldFont(size: 14)
button.contentHorizontalAlignment = .center
button.setTitle("取消操作", for: .normal)
button.setTitleColor( UIColor(hex:0x2f7ef6), for: .normal)
button.addTarget(self, action: #selector(cannal), for: .touchUpInside)
button.isHidden = true
return button
}()
centerView.addSubview(cannalButton)
cannalButton.snp.makeConstraints { make in
make.right.equalTo(-18)
make.top.equalTo(24)
make.height.equalTo(20)
make.width.equalTo(60)
}
moreButton = {
let button = UIButton(type: .custom)
button.setBackgroundImage(UIImage(named: "work_more"), for: .normal)
button.addTarget(self, action: #selector(more), for: .touchUpInside)
return button
}()
centerView.addSubview(moreButton)
moreButton.snp.makeConstraints { make in
make.right.equalTo(-18)
make.top.equalTo(24)
make.height.equalTo(24)
make.width.equalTo(24)
}
mainItemView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = 12
return view
}()
centerView.addSubview(mainItemView)
mainItemView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.bottom.equalTo(-65)
make.top.equalTo(85)
}
bottomView = {
let view = YHWorkItemAddView()
view.addBtn.setTitle("新增项目".local, for: .normal)
view.clickBlock = {[weak self] in
guard let self = self else { return }
if let block = self.addIntroductionBlock {
block()
}
}
return view
}()
centerView.addSubview(bottomView)
bottomView.snp.makeConstraints { make in
make.right.bottom.equalTo(-18)
make.left.equalTo(18)
make.height.equalTo(45)
}
}
func updateAllViews() {
mainItemView.removeSubviews()
for i in 0 ..< (dataSource?.count ?? 0) {
let line = UIView()
line.backgroundColor = UIColor(hex: 0xf0f0f0)
mainItemView.addSubview(line)
line.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(76 * i)
make.height.equalTo(1)
make.right.equalTo(-18)
}
let itemView = YHWorkIntroductionItemView()
itemView.dataSource = dataSource?[i]
itemView.block = {[weak self] model in
guard let self = self else { return }
if let block = self.experienceListBlock {
block(model)
}
}
mainItemView.addSubview(itemView)
itemView.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(76 * i + 1)
make.height.equalTo(75)
make.right.equalTo(-18)
}
}
}
@objc func cannal() {
}
@objc func more() {
}
}
//
// YHWorkMessageSelectTableViewCell.swift
// galaxy
//
// Created by EDY on 2024/2/20.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHWorkMessageSelectTableViewCell: UITableViewCell {
var centerView: UIView!
var titleLabel: UILabel!
var lineView: UIView!
var subTitleLabel: UILabel!
var leftButton: UIButton!
var rightButton: UIButton!
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
}
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() {
backgroundColor = UIColor(hex: 0xe9e9e9)
centerView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = 12
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 = kFont(size: 17)
label.text = "信息选择"
label.textColor = UIColor(hex:0x222222)
return label
}()
centerView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(16)
make.height.equalTo(24)
make.right.equalTo(-18)
}
lineView = {
let line = UIView()
line.backgroundColor = UIColor(hex: 0xf0f0f0)
return line
}()
centerView.addSubview(lineView)
lineView.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(52)
make.height.equalTo(1)
make.right.equalTo(-18)
}
subTitleLabel = {
let label = UILabel()
let str = "*" + "是否与上份工作的“简历/工作总结”一致"
let attributes: [NSAttributedString.Key: Any] = [
.font: UIFont.PFSC_R(ofSize: 14),
.foregroundColor: UIColor(hex:0x4e4e4e)
]
let questionAttrStr = NSMutableAttributedString(string: str, attributes: attributes)
let starRange = NSRange(location: 0, length: 1)
questionAttrStr.addAttribute(NSAttributedString.Key.foregroundColor, value: UIColor(hex:0xFF3A3A), range: starRange)
label.attributedText = questionAttrStr
return label
}()
centerView.addSubview(subTitleLabel)
subTitleLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(68)
make.height.equalTo(20)
make.right.equalTo(-18)
}
rightButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor(hex: 0x2f7ef6).withAlphaComponent(0.08)
button.setTitleColor(UIColor(hex: 0x2f7ef6), for: .selected)
button.setTitleColor(UIColor(hex: 0x222222), for: .normal)
button.setTitle("是", for: .normal)
button.titleLabel?.font = kFont(size: 13)
button.layer.cornerRadius = 16
button.layer.borderWidth = 1
button.layer.borderColor = UIColor(hex: 0x2f7ef6).cgColor
button.isSelected = true
button.addTarget(self, action: #selector(rightClick), for: .touchUpInside)
return button
}()
centerView.addSubview(rightButton)
rightButton.snp.makeConstraints { make in
make.left.equalTo(18)
make.bottom.equalTo(-16)
make.height.equalTo(32)
make.width.equalTo(69)
}
leftButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor(hex: 0xf8f9fb)
button.setTitleColor(UIColor(hex: 0x2f7ef6), for: .selected)
button.setTitleColor(UIColor(hex: 0x222222), for: .normal)
button.setTitle("否", for: .normal)
button.titleLabel?.font = kFont(size: 13)
button.layer.cornerRadius = 16
button.addTarget(self, action: #selector(leftClick), for: .touchUpInside)
return button
}()
centerView.addSubview(leftButton)
leftButton.snp.makeConstraints { make in
make.left.equalTo(rightButton.snp.right).offset(8)
make.bottom.equalTo(-16)
make.height.equalTo(32)
make.width.equalTo(69)
}
}
func buttonState(isLeft: Bool) {
if isLeft {
leftButton.isSelected = true
rightButton.isSelected = false
leftButton.layer.borderWidth = 1
leftButton.layer.borderColor = UIColor(hex: 0x2f7ef6).cgColor
leftButton.backgroundColor = UIColor(hex: 0x2f7ef6).withAlphaComponent(0.08)
rightButton.backgroundColor = UIColor(hex: 0xf8f9fb)
rightButton.layer.borderWidth = 0
} else {
rightButton.isSelected = true
leftButton.isSelected = false
rightButton.layer.borderWidth = 1
rightButton.layer.borderColor = UIColor(hex: 0x2f7ef6).cgColor
rightButton.backgroundColor = UIColor(hex: 0x2f7ef6).withAlphaComponent(0.08)
leftButton.backgroundColor = UIColor(hex: 0xf8f9fb)
leftButton.layer.borderWidth = 0
}
}
@objc func rightClick() {
rightButton.isSelected = true
leftButton.isSelected = false
rightButton.layer.borderWidth = 1
rightButton.layer.borderColor = UIColor(hex: 0x2f7ef6).cgColor
rightButton.backgroundColor = UIColor(hex: 0x2f7ef6).withAlphaComponent(0.08)
leftButton.backgroundColor = UIColor(hex: 0xf8f9fb)
leftButton.layer.borderWidth = 0
}
@objc func leftClick() {
leftButton.isSelected = true
rightButton.isSelected = false
leftButton.layer.borderWidth = 1
leftButton.layer.borderColor = UIColor(hex: 0x2f7ef6).cgColor
leftButton.backgroundColor = UIColor(hex: 0x2f7ef6).withAlphaComponent(0.08)
rightButton.backgroundColor = UIColor(hex: 0xf8f9fb)
rightButton.layer.borderWidth = 0
}
}
//
// YHJob responsibilities YHWorkResponsibilitiesTableViewCell.swift
// galaxy
//
// Created by EDY on 2024/2/20.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHWorkResponsibilitiesTableViewCell: UITableViewCell {
var centerView: UIView!
var titleLabel: UILabel!
var subTitleLabel: UILabel!
var lineView: UIView!
var messageTextField: UITextView!
var promptsLabel: UILabel!
var bottomView: YHWorkActionView!
var dataSource: YHSectionWorkExperienceModel?{//模型待定
didSet {
updateAllViews()
}
}
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
}
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() {
backgroundColor = UIColor(hex: 0xe9e9e9)
centerView = {
let view = UIView()
view.backgroundColor = .white
return view
}()
contentView.addSubview(centerView)
centerView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.top.equalTo(14)
}
titleLabel = {
let label = UILabel()
let str = "*" + "工作职责"
let attributes: [NSAttributedString.Key: Any] = [
.font: UIFont.PFSC_R(ofSize: 17),
.foregroundColor: UIColor(hex:0x222222)
]
let questionAttrStr = NSMutableAttributedString(string: str, attributes: attributes)
let starRange = NSRange(location: 0, length: 1)
questionAttrStr.addAttribute(NSAttributedString.Key.foregroundColor, value: UIColor(hex:0xFF3A3A), range: starRange)
label.attributedText = questionAttrStr
return label
}()
centerView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(16)
make.height.equalTo(24)
make.right.equalTo(-18)
}
subTitleLabel = {
let label = UILabel()
label.text = "温馨提示:如下模板仅供思路参考,工作内容请按您的实际填写,后期文案会基于该内容进行文书材料撰写,望悉知"
label.textColor = UIColor(hex: 0x2f7ef6)
label.font = kFont(size: 12)
label.numberOfLines = 0
return label
}()
centerView.addSubview(subTitleLabel)
subTitleLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(52)
make.height.equalTo(40)
make.right.equalTo(-18)
}
lineView = {
let line = UIView()
line.backgroundColor = UIColor(hex: 0xf0f0f0)
return line
}()
centerView.addSubview(lineView)
lineView.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(110)
make.height.equalTo(1)
make.right.equalTo(-18)
}
messageTextField = {
let textField = UITextView()
textField.font = kFont(size: 14)
textField.delegate = self
return textField
}()
centerView.addSubview(messageTextField)
messageTextField.snp.makeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(-18)
make.top.equalTo(111)
make.bottom.equalTo(-44)
}
promptsLabel = {
let prompts = UILabel()
prompts.font = kFont(size: 14)
prompts.textColor = UIColor(hex: 0xc0c0c0)
prompts.text = "示例:在职期间负责的核心工作职责,建议不要超过3点。如果就职过多个职位,请分段描述:\n\n例子:\n\n模式1、在司担任某某岗位,任职期间,主要负责xxxx工作;在此期间,组建了xxx。实现了xxx;\n\n模式2、在担任xxx岗位期间,主要负责xxxx工作,具体的工作职责包括如下:\n\n2.1)xxxxxxxx;\n2.2)xxxxxxxx;\n2.3)xxxxxxxx;"
prompts.numberOfLines = 0
return prompts
}()
centerView.addSubview(promptsLabel)
promptsLabel.snp.makeConstraints { make in
make.left.equalTo(22)
make.right.equalTo(-22)
make.top.equalTo(116)
}
bottomView = {
let view = YHWorkActionView()
return view
}()
centerView.addSubview(bottomView)
bottomView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.height.equalTo(44)
}
}
func updateAllViews() {
}
}
extension YHWorkResponsibilitiesTableViewCell: UITextViewDelegate {
func textViewDidChange(_ textView: UITextView) {
}
}
//
// YHWorkExperienceViewModel.swift
// galaxy
//
// Created by EDY on 2024/2/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHWorkExperienceViewModel: YHBaseViewModel {
var mainModel: YHMainInformationModel = YHMainInformationModel()
override init() {
super.init()
}
func getBaseDataSource() -> [YHSectionWorkExperienceModel] {
let item = YHWorkExperienceModel(id: .id1, isNeed: true, title: "用人单位", isUserKeyBoard: false, prompts: "请输入", message: "", type: .unit)
let item1 = YHWorkExperienceModel(id: .id2, isNeed: true, title: "用人单位性质", isUserKeyBoard: false, prompts: "请输入", message: "", type: .nature)
let item2 = YHWorkExperienceModel(id: .id3, isNeed: false, title: "用人单位介绍", isUserKeyBoard: true, prompts: "如方便提供,请填写", message: "")
let item3 = YHWorkExperienceModel(id: .id4, isNeed: false, title: "用人单位官网", isUserKeyBoard: true, prompts: "如有,请输入官网链接", message: "")
let item4 = YHWorkExperienceModel(id: .id5, isNeed: true, title: "出生国家/地区", isUserKeyBoard: false, prompts: nil, message: "", type: .country)
var string = ""
if let array = mainModel.birth_place?.area {
for item in array {
string = string + item
}
}
let item5 = YHWorkExperienceModel(id: .id6, isNeed: true, title: "出生城市", isUserKeyBoard: false, prompts: "请选择", message: "", type: .address)
let item55 = YHWorkExperienceModel(id: .id7, isNeed: true, title: "出生城市", isUserKeyBoard: true, prompts: "请输入", message: "")
let item6 = YHWorkExperienceModel(id: .id8, isNeed: true, title: "职位", isUserKeyBoard: true, prompts: "请输入", message: "")
let item7 = YHWorkExperienceModel(id: .id9, isNeed: true, title: "入职年月", isUserKeyBoard: false, prompts: "请选择", message: "", type: .time)
let item8 = YHWorkExperienceModel(id: .id10, isNeed: true, title: "离职年月", isUserKeyBoard: false, prompts: "请选择", message: "", type: .time)
let item9 = YHWorkExperienceModel(id: .id11, isNeed: true, title: "工作证明文件", isUserKeyBoard: false, prompts: "请选择", message: "", type: .certificate)
let item10 = YHWorkExperienceModel(id: .id12, isNeed: false, title: "职责性质", isUserKeyBoard: false, prompts: "请选择", message: "")
let item11 = YHWorkExperienceModel(id: .id13, isNeed: false, title: "相关工作经验是否属于国际工作经验", isUserKeyBoard: false, prompts: "", message: "\(mainModel.has_hk_id ?? 0)", leftButtonString: "是", rightButtonString: "否")
let section = YHSectionWorkExperienceModel(title: "企业信息", models: [item, item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11])
let item12 = YHWorkExperienceModel(id: .id14, isNeed: true, title: "企业人数规模", isUserKeyBoard: true, prompts: "请输入", message: "")
let item13 = YHWorkExperienceModel(id: .id15, isNeed: false, title: "行政架构层级", isUserKeyBoard: false, prompts: "请输入", message: "", type: .structure)
let item14 = YHWorkExperienceModel(id: .id16, isNeed: true, title: "下属管理人数", isUserKeyBoard: true, prompts: "请输入", message: "")
let item15 = YHWorkExperienceModel(id: .id17, isNeed: false, title: "公司营业额/港元 (近一年)", isUserKeyBoard: true, prompts: "请输入具体数字", message: "")
let item16 = YHWorkExperienceModel(id: .id18, isNeed: false, title: "公司业务性质/范畴/所属行业", isUserKeyBoard: true, prompts: "请输入,100字内", message: "")
let item17 = YHWorkExperienceModel(id: .id19, isNeed: true, title: "职位水平类别", isUserKeyBoard: false, prompts: "请选择", message: "", type: .level)
let item18 = YHWorkExperienceModel(id: .id20, isNeed: true, title: "高管证明文件", isUserKeyBoard: false, prompts: "请选择", message: "", type: .prove)
let item19 = YHWorkExperienceModel(id: .id21, isNeed: true, title: "高管在职开始时间", isUserKeyBoard: false, prompts: "请选择", message: "", type: .time)
let item20 = YHWorkExperienceModel(id: .id22, isNeed: true, title: "高管在职结束时间", isUserKeyBoard: false, prompts: "请选择", message: "", type: .time)
let section1 = YHSectionWorkExperienceModel(title: "企业规模", models: [item12, item13, item14, item15, item16, item17, item18, item19, item20])
return [section, section1]
}
func updateModel(_ item: YHItemModel) {
guard let type = item.id else { return }
switch type {
case .id1:
mainModel.nationality = item.message
case .id2:
mainModel.address?.country = item.message
case .id3:
mainModel.address?.area = item.value
case .id4:
mainModel.address?.details = item.message
case .id5:
mainModel.has_hk_id = item.value?.first?.int
case .id6:
printLog("1")
case .id7:
printLog("1")
case .id8:
mainModel.certificates?.cn_identity_card?.number = item.message
case .id9:
mainModel.certificates?.cn_identity_card?.issue_at = item.message
case .id10:
mainModel.certificates?.cn_identity_card?.issue_date_start_at = item.message
case .id11:
mainModel.certificates?.cn_identity_card?.issue_date_end_at = item.message
case .id12:
mainModel.certificates?.hk_macao_pass?.number = item.message
case .id13:
mainModel.certificates?.hk_macao_pass?.issue_at = item.message
case .id14:
mainModel.certificates?.hk_macao_pass?.issue_date_start_at = item.message
case .id15:
mainModel.certificates?.hk_macao_pass?.issue_date_end_at = item.message
case .id16:
mainModel.certificates?.passport?.passport_type = item.value?.first
case .id17:
mainModel.certificates?.passport?.number = item.message
case .id18:
mainModel.certificates?.passport?.issue_at = item.message
case .id19:
mainModel.certificates?.passport?.issue_date_start_at = item.message
case .id20:
mainModel.certificates?.passport?.issue_date_end_at = item.message
case .id21:
mainModel.username = item.message
case .id22:
mainModel.used_name = item.message
case .id23:
mainModel.surname = item.message
case .id24:
mainModel.birthday = item.message
case .id25:
mainModel.birth_place_aboard = item.value?.first?.int
case .id26:
mainModel.birth_place?.area = item.value
case .id27:
mainModel.sex = item.value?.first
case .id28:
mainModel.married = item.value?.first
case .id29:
mainModel.mobile = item.message
case .id30:
mainModel.email = item.message
case .id31:
mainModel.has_hk_id = item.value?.first?.int
case .id32:
mainModel.address?.foreign = item.message
case .id33:
mainModel.is_live_oversea_year = item.value?.first?.int
case .id34:
mainModel.birth_place?.foreign = item.message
}
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "work_experience_alert@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "work_experience_alert@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "work_experience_example@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "work_experience_example@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "work_experience_photo@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "work_experience_photo@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "work_experience_wx@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "work_experience_wx@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