Commit ff2f301a authored by pete谢兆麟's avatar pete谢兆麟

工作经验主流程UI

parent 400f6cbd
This diff is collapsed.
......@@ -14,8 +14,9 @@ class YHWorkExperienceViewController: YHBaseViewController {
var bottomView: YHBottomNextView!
var tableView: UITableView!
var viewModel: YHWorkExperienceViewModel!
var dataSource: [YHSectionWorkExperienceModel]?
var baseDataSource: [YHSectionWorkExperienceModel]?
var introductionDataSource: [YHWorkItemListModel]?
var fileDataSource: [String]?
override func viewDidLoad() {
super.viewDidLoad()
viewModel = YHWorkExperienceViewModel()
......@@ -31,7 +32,7 @@ class YHWorkExperienceViewController: YHBaseViewController {
func updateDataSource() {
if self.stepView.currentIndex == 0 {
self.dataSource = self.viewModel.getBaseDataSource()
self.baseDataSource = self.viewModel.getBaseDataSource()
}
self.tableView.reloadData()
}
......@@ -66,6 +67,11 @@ class YHWorkExperienceViewController: YHBaseViewController {
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)
......@@ -80,7 +86,7 @@ class YHWorkExperienceViewController: YHBaseViewController {
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 }
......@@ -99,33 +105,77 @@ class YHWorkExperienceViewController: YHBaseViewController {
extension YHWorkExperienceViewController: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return dataSource?.count ?? 0
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 {
let cell = tableView.dequeueReusableCell(withClass: YHWorkExperienceTableViewCell.self)
cell.dataSource = dataSource?[indexPath.row]
cell.workExperienceBlock = {[weak self] model in
guard let self = self else { return }
// self.viewModel.updateModel(model)
self.updateDataSource()
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
}
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
let array = dataSource?[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
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 {
h = h + 52
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)
}
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) {
}
}
//
// 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() {
}
}
......@@ -74,7 +74,7 @@ class YHWorkExperienceTextItemView: UIView {
nextStepImageView = {
let imageView = UIImageView()
imageView.image = UIImage(named: "form_right_arrow")
imageView.image = UIImage(named: "work_experience_alert")
return imageView
}()
addSubview(nextStepImageView)
......
//
// 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) {
}
}
{
"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