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

Merge branch 'develop' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS into develop

parents a365156f c6943933
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
0411CF142D1C0B0700644D35 /* YHGCSignatureAddModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0411CF132D1C0B0700644D35 /* YHGCSignatureAddModel.swift */; }; 0411CF142D1C0B0700644D35 /* YHGCSignatureAddModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0411CF132D1C0B0700644D35 /* YHGCSignatureAddModel.swift */; };
0411CF162D1C0D0C00644D35 /* YHGCSignatureAddTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0411CF152D1C0D0C00644D35 /* YHGCSignatureAddTableViewCell.swift */; }; 0411CF162D1C0D0C00644D35 /* YHGCSignatureAddTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0411CF152D1C0D0C00644D35 /* YHGCSignatureAddTableViewCell.swift */; };
0411CF182D1D502D00644D35 /* YHlifeCollectionReusableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0411CF172D1D502D00644D35 /* YHlifeCollectionReusableView.swift */; }; 0411CF182D1D502D00644D35 /* YHlifeCollectionReusableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0411CF172D1D502D00644D35 /* YHlifeCollectionReusableView.swift */; };
0411CF1A2D22960900644D35 /* YHGCWorkExperienceListReasonTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0411CF192D22960900644D35 /* YHGCWorkExperienceListReasonTableViewCell.swift */; };
04307B662D1942F500ED8E8D /* YHDynamicSheetPickerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B652D1942F500ED8E8D /* YHDynamicSheetPickerView.swift */; }; 04307B662D1942F500ED8E8D /* YHDynamicSheetPickerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B652D1942F500ED8E8D /* YHDynamicSheetPickerView.swift */; };
04307B682D19911800ED8E8D /* YHIncomeInfoEditCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B672D19911800ED8E8D /* YHIncomeInfoEditCell.swift */; }; 04307B682D19911800ED8E8D /* YHIncomeInfoEditCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B672D19911800ED8E8D /* YHIncomeInfoEditCell.swift */; };
04307B6A2D1A4C6500ED8E8D /* YHIncomeInfoSelectCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B692D1A4C6500ED8E8D /* YHIncomeInfoSelectCell.swift */; }; 04307B6A2D1A4C6500ED8E8D /* YHIncomeInfoSelectCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B692D1A4C6500ED8E8D /* YHIncomeInfoSelectCell.swift */; };
...@@ -1248,6 +1249,7 @@ ...@@ -1248,6 +1249,7 @@
0411CF132D1C0B0700644D35 /* YHGCSignatureAddModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCSignatureAddModel.swift; sourceTree = "<group>"; }; 0411CF132D1C0B0700644D35 /* YHGCSignatureAddModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCSignatureAddModel.swift; sourceTree = "<group>"; };
0411CF152D1C0D0C00644D35 /* YHGCSignatureAddTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCSignatureAddTableViewCell.swift; sourceTree = "<group>"; }; 0411CF152D1C0D0C00644D35 /* YHGCSignatureAddTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCSignatureAddTableViewCell.swift; sourceTree = "<group>"; };
0411CF172D1D502D00644D35 /* YHlifeCollectionReusableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHlifeCollectionReusableView.swift; sourceTree = "<group>"; }; 0411CF172D1D502D00644D35 /* YHlifeCollectionReusableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHlifeCollectionReusableView.swift; sourceTree = "<group>"; };
0411CF192D22960900644D35 /* YHGCWorkExperienceListReasonTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCWorkExperienceListReasonTableViewCell.swift; sourceTree = "<group>"; };
04307B652D1942F500ED8E8D /* YHDynamicSheetPickerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHDynamicSheetPickerView.swift; sourceTree = "<group>"; }; 04307B652D1942F500ED8E8D /* YHDynamicSheetPickerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHDynamicSheetPickerView.swift; sourceTree = "<group>"; };
04307B672D19911800ED8E8D /* YHIncomeInfoEditCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHIncomeInfoEditCell.swift; sourceTree = "<group>"; }; 04307B672D19911800ED8E8D /* YHIncomeInfoEditCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHIncomeInfoEditCell.swift; sourceTree = "<group>"; };
04307B692D1A4C6500ED8E8D /* YHIncomeInfoSelectCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHIncomeInfoSelectCell.swift; sourceTree = "<group>"; }; 04307B692D1A4C6500ED8E8D /* YHIncomeInfoSelectCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHIncomeInfoSelectCell.swift; sourceTree = "<group>"; };
...@@ -2501,6 +2503,7 @@ ...@@ -2501,6 +2503,7 @@
children = ( children = (
0411CEEC2D15154A00644D35 /* YHGCWorkListHasWorkExperienceTableViewCell.swift */, 0411CEEC2D15154A00644D35 /* YHGCWorkListHasWorkExperienceTableViewCell.swift */,
0411CEEE2D151E5F00644D35 /* YHGCWorkListHasDocTableViewCell.swift */, 0411CEEE2D151E5F00644D35 /* YHGCWorkListHasDocTableViewCell.swift */,
0411CF192D22960900644D35 /* YHGCWorkExperienceListReasonTableViewCell.swift */,
); );
path = V; path = V;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -7652,6 +7655,7 @@ ...@@ -7652,6 +7655,7 @@
045C12B82D12CA5F00BD2DC0 /* YHResignHaveAppointedApplicantsInfoCell.swift in Sources */, 045C12B82D12CA5F00BD2DC0 /* YHResignHaveAppointedApplicantsInfoCell.swift in Sources */,
045C12B92D12CA5F00BD2DC0 /* YHPrinciplePhotoListCell.swift in Sources */, 045C12B92D12CA5F00BD2DC0 /* YHPrinciplePhotoListCell.swift in Sources */,
045C12BA2D12CA5F00BD2DC0 /* YHChangeHeadModel.swift in Sources */, 045C12BA2D12CA5F00BD2DC0 /* YHChangeHeadModel.swift in Sources */,
0411CF1A2D22960900644D35 /* YHGCWorkExperienceListReasonTableViewCell.swift in Sources */,
045C12BB2D12CA5F00BD2DC0 /* YHResignDocumentStatus.swift in Sources */, 045C12BB2D12CA5F00BD2DC0 /* YHResignDocumentStatus.swift in Sources */,
045C12BC2D12CA5F00BD2DC0 /* YHEditSchoolViewController.swift in Sources */, 045C12BC2D12CA5F00BD2DC0 /* YHEditSchoolViewController.swift in Sources */,
045C12BD2D12CA5F00BD2DC0 /* YHMySchemeModel.swift in Sources */, 045C12BD2D12CA5F00BD2DC0 /* YHMySchemeModel.swift in Sources */,
......
...@@ -282,9 +282,11 @@ class YHWorkExperienceItemView: UIView { ...@@ -282,9 +282,11 @@ class YHWorkExperienceItemView: UIView {
nextStepImageView.isHidden = true nextStepImageView.isHidden = true
messageTextField.isHidden = true messageTextField.isHidden = true
if dataSource.message == "0" { if dataSource.message == "0" {
buttonState(isLeft: false) buttonState(isLeft: 1)
} else if dataSource.message == "1"{
buttonState(isLeft: 0)
} else { } else {
buttonState(isLeft: true) buttonState(isLeft: 2)
} }
} else { } else {
leftButton.isHidden = true leftButton.isHidden = true
...@@ -342,8 +344,8 @@ class YHWorkExperienceItemView: UIView { ...@@ -342,8 +344,8 @@ class YHWorkExperienceItemView: UIView {
} }
} }
func buttonState(isLeft: Bool) { func buttonState(isLeft: Int) {
if isLeft { if isLeft == 0 {
leftButton.isSelected = true leftButton.isSelected = true
rightButton.isSelected = false rightButton.isSelected = false
leftButton.layer.borderWidth = 1 leftButton.layer.borderWidth = 1
...@@ -351,7 +353,7 @@ class YHWorkExperienceItemView: UIView { ...@@ -351,7 +353,7 @@ class YHWorkExperienceItemView: UIView {
leftButton.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.08) leftButton.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.08)
rightButton.backgroundColor = UIColor.contentBkgColor rightButton.backgroundColor = UIColor.contentBkgColor
rightButton.layer.borderWidth = 0 rightButton.layer.borderWidth = 0
} else { } else if isLeft == 1 {
rightButton.isSelected = true rightButton.isSelected = true
leftButton.isSelected = false leftButton.isSelected = false
rightButton.layer.borderWidth = 1 rightButton.layer.borderWidth = 1
...@@ -359,6 +361,14 @@ class YHWorkExperienceItemView: UIView { ...@@ -359,6 +361,14 @@ class YHWorkExperienceItemView: UIView {
rightButton.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.08) rightButton.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.08)
leftButton.backgroundColor = UIColor.contentBkgColor leftButton.backgroundColor = UIColor.contentBkgColor
leftButton.layer.borderWidth = 0 leftButton.layer.borderWidth = 0
} else {
rightButton.isSelected = false
leftButton.isSelected = false
rightButton.layer.borderWidth = 0
rightButton.layer.borderColor = UIColor.brandMainColor.cgColor
rightButton.backgroundColor = UIColor.contentBkgColor
leftButton.backgroundColor = UIColor.contentBkgColor
leftButton.layer.borderWidth = 0
} }
} }
......
...@@ -64,6 +64,7 @@ class YHGCWorkExperienceListViewController: YHBaseViewController { ...@@ -64,6 +64,7 @@ class YHGCWorkExperienceListViewController: YHBaseViewController {
tableView.register(cellWithClass: YHWorkExperienceListTableViewCell.self) tableView.register(cellWithClass: YHWorkExperienceListTableViewCell.self)
tableView.register(cellWithClass: YHGCWorkListHasWorkExperienceTableViewCell.self) tableView.register(cellWithClass: YHGCWorkListHasWorkExperienceTableViewCell.self)
tableView.register(cellWithClass: YHGCWorkListHasDocTableViewCell.self) tableView.register(cellWithClass: YHGCWorkListHasDocTableViewCell.self)
tableView.register(cellWithClass: YHGCWorkExperienceListReasonTableViewCell.self)
return tableView return tableView
}() }()
view.addSubview(tableView) view.addSubview(tableView)
...@@ -122,7 +123,7 @@ class YHGCWorkExperienceListViewController: YHBaseViewController { ...@@ -122,7 +123,7 @@ class YHGCWorkExperienceListViewController: YHBaseViewController {
func showDeleteAlert(_ model: YHWorkItemListModel) { func showDeleteAlert(_ model: YHWorkItemListModel) {
YHCommonAlertView.show("", "您确定要删除这份工作经验吗?", "取消", "确认") { YHCommonAlertView.show("", "您确定要删除这份工作经验吗?", "取消", "确认") {
self.viewModel?.requestDeleteWorkExperience(self.orderId, "\(model.id ?? 0)", callBackBlock: {[weak self] success, error in self.viewModel?.requestDeleteWorkExperience(model.id ?? 0, "\(self.orderId)", callBackBlock: {[weak self] success, error in
guard let self = self else { return } guard let self = self else { return }
self.getData() self.getData()
}) })
...@@ -140,7 +141,7 @@ extension YHGCWorkExperienceListViewController: UITableViewDelegate, UITableView ...@@ -140,7 +141,7 @@ extension YHGCWorkExperienceListViewController: UITableViewDelegate, UITableView
// count = count + 1 // count = count + 1
// } // }
// return count // return count
return 3 return 4
} }
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
...@@ -155,6 +156,11 @@ extension YHGCWorkExperienceListViewController: UITableViewDelegate, UITableView ...@@ -155,6 +156,11 @@ extension YHGCWorkExperienceListViewController: UITableViewDelegate, UITableView
return cell return cell
} else if indexPath.row == 1 { } else if indexPath.row == 1 {
let cell = tableView.dequeueReusableCell(withClass: YHWorkExperienceListTableViewCell.self) let cell = tableView.dequeueReusableCell(withClass: YHWorkExperienceListTableViewCell.self)
if self.viewModel.mainModel.has_work_experience == 1 {
cell.isHidden = false
} else {
cell.isHidden = true
}
cell.showPrompt = showPrompt cell.showPrompt = showPrompt
cell.dataSource = dataSource cell.dataSource = dataSource
if isMore { if isMore {
...@@ -192,6 +198,19 @@ extension YHGCWorkExperienceListViewController: UITableViewDelegate, UITableView ...@@ -192,6 +198,19 @@ extension YHGCWorkExperienceListViewController: UITableViewDelegate, UITableView
cell.contentView.backgroundColor = .clear cell.contentView.backgroundColor = .clear
return cell return cell
} else if indexPath.row == 2 { } else if indexPath.row == 2 {
let cell = tableView.dequeueReusableCell(withClass: YHGCWorkExperienceListReasonTableViewCell.self)
if viewModel.mainModel.has_work_time_overlap == 1 {
cell.isHidden = false
} else {
cell.isHidden = true
}
cell.model = viewModel?.mainModel
cell.clickBlock = { [weak self] value in
guard let self = self else { return }
self.viewModel?.mainModel.work_time_overlap_remark = value
}
return cell
} else if indexPath.row == 3 {
let cell = tableView.dequeueReusableCell(withClass: YHGCWorkListHasDocTableViewCell.self) let cell = tableView.dequeueReusableCell(withClass: YHGCWorkListHasDocTableViewCell.self)
cell.companyList = self.viewModel.mainModel.list ?? [] cell.companyList = self.viewModel.mainModel.list ?? []
cell.url = self.viewModel.mainModel.consent_template_url cell.url = self.viewModel.mainModel.consent_template_url
...@@ -223,6 +242,14 @@ extension YHGCWorkExperienceListViewController: UITableViewDelegate, UITableView ...@@ -223,6 +242,14 @@ extension YHGCWorkExperienceListViewController: UITableViewDelegate, UITableView
} }
if indexPath.row == 2 { if indexPath.row == 2 {
if viewModel.mainModel.has_work_time_overlap == 1 {
return UITableView.automaticDimension
} else {
return 0
}
}
if indexPath.row == 3 {
let array = docData.models ?? [] let array = docData.models ?? []
var h = 0 var h = 0
for i in 0..<array.count { for i in 0..<array.count {
...@@ -237,35 +264,41 @@ extension YHGCWorkExperienceListViewController: UITableViewDelegate, UITableView ...@@ -237,35 +264,41 @@ extension YHGCWorkExperienceListViewController: UITableViewDelegate, UITableView
return CGFloat(h + 52 + 96 + 14) return CGFloat(h + 52 + 96 + 14)
} }
_ = dataSource?.count ?? 0 if self.viewModel.mainModel.has_work_experience == 1 {
var height = 23 + 154 _ = dataSource?.count ?? 0
if let data = dataSource { var height = 23 + 154
for item in data { if let data = dataSource {
if item.company_name == "" { for item in data {
height = height + 76 if item.company_name == "" {
} else {
let text = item.company_name // 要显示的文本内容
let font = UIFont.PFSC_B(ofSize: 14) // 字体大小
let maxWidth = 143.0 // 最大宽度限制
// 创建NSAttributedString对象并设置属性
let attributes = [NSAttributedString.Key.font : font] as [NSAttributedString.Key : Any]
_ = NSMutableAttributedString(string: text ?? "", attributes: attributes)
// 根据指定的最大宽度和字体大小计算文本的高度
let size = (text! as NSString).boundingRect(with: CGSize(width: maxWidth, height: .greatestFiniteMagnitude), options: .usesLineFragmentOrigin, attributes: attributes, context: nil).size
if size.height > 20 {
height = height + 96
} else {
height = height + 76 height = height + 76
} else {
let text = item.company_name // 要显示的文本内容
let font = UIFont.PFSC_B(ofSize: 14) // 字体大小
let maxWidth = 143.0 // 最大宽度限制
// 创建NSAttributedString对象并设置属性
let attributes = [NSAttributedString.Key.font : font] as [NSAttributedString.Key : Any]
_ = NSMutableAttributedString(string: text ?? "", attributes: attributes)
// 根据指定的最大宽度和字体大小计算文本的高度
let size = (text! as NSString).boundingRect(with: CGSize(width: maxWidth, height: .greatestFiniteMagnitude), options: .usesLineFragmentOrigin, attributes: attributes, context: nil).size
if size.height > 20 {
height = height + 96
} else {
height = height + 76
}
}
if showPrompt && item.vacant_num != 0 {
height = height + 20
} }
}
if showPrompt && item.vacant_num != 0 {
height = height + 20
} }
} }
return CGFloat(height)
} else {
return 0
} }
return CGFloat(height)
} }
} }
//
// YHGCWorkExperienceListReasonTableViewCell.swift
// galaxy
//
// Created by EDY on 2024/12/30.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHGCWorkExperienceListReasonTableViewCell: UITableViewCell {
typealias ExperienceListBlock = (_ value: String) -> ()
var clickBlock: ExperienceListBlock?
var centerView: UIView!
var titleLabel: UILabel!
var lineView: UIView!
var messageLabel: UILabel!
var messageView: UIView!
var messageTextField: UITextView!
var promptsLabel: UILabel!
var messageNumberLabel: UILabel!
var model: YHGCWorkModel? {
didSet {
if model?.has_work_time_overlap == 1 {
messageLabel.isHidden = false
messageView.isHidden = false
messageTextField.isHidden = false
promptsLabel.isHidden = false
messageNumberLabel.isHidden = false
messageLabel.snp.remakeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(-18)
make.top.equalTo(68)
}
messageView.snp.remakeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(-18)
make.top.equalTo(112)
make.height.equalTo(160)
}
messageTextField.snp.remakeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(-18)
make.top.equalTo(112)
make.height.equalTo(128)
}
promptsLabel.snp.remakeConstraints { make in
make.left.equalTo(22)
make.right.equalTo(-22)
make.top.equalTo(116)
}
messageNumberLabel.snp.remakeConstraints { make in
make.right.equalTo(-30)
make.top.equalTo(240)
make.height.equalTo(20)
make.bottom.equalTo(-28)
}
}
messageTextField.text = model?.work_time_overlap_remark
if messageTextField.text.count != 0 {
promptsLabel.isHidden = true
messageNumberLabel.text = "\(messageTextField.text.count)/1000"
}
self.setNeedsLayout()
self.layoutIfNeeded()
}
}
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 = .clear
centerView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius6
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 = UIFont.PFSC_M(ofSize: 17)
label.text = "工作时间说明"
label.textColor = UIColor.mainTextColor
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)
}
lineView = {
let view = UIView()
view.backgroundColor = UIColor.separatorColor
return view
}()
centerView.addSubview(lineView)
lineView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(52)
make.height.equalTo(1)
}
messageLabel = {
let label = UILabel()
label.numberOfLines = 0
let a: ASAttributedString = .init("*", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.failColor))
let aa: ASAttributedString = .init(" 检测到您的", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor(hex:0x8893a2)))
let aaa: ASAttributedString = .init("工作时间有重叠", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.failColor))
let aaaa: ASAttributedString = .init(" 。请确认是否正确填报,若填报无误请在此处说明工作时间重叠的原因~", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor(hex:0x8893a2)))
label.attributed.text = a + aa + aaa + aaaa
return label
}()
centerView.addSubview(messageLabel)
messageLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(-18)
make.top.equalTo(68)
}
messageView = {
let view = UIView()
view.backgroundColor = UIColor.contentBkgColor
view.layer.cornerRadius = 1
return view
}()
centerView.addSubview(messageView)
messageView.snp.makeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(-18)
make.top.equalTo(112)
make.height.equalTo(160)
}
messageTextField = {
let textField = UITextView()
textField.font = UIFont.PFSC_R(ofSize: 14)
textField.backgroundColor = .clear
textField.delegate = self
return textField
}()
centerView.addSubview(messageTextField)
messageTextField.snp.makeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(-18)
make.top.equalTo(112)
make.height.equalTo(128)
}
promptsLabel = {
let prompts = UILabel()
prompts.font = UIFont.PFSC_R(ofSize: 14)
prompts.textColor = UIColor(hex: 0xc0c0c0)
prompts.text = "如:工作时间灵活,可自由安排"
prompts.numberOfLines = 0
prompts.backgroundColor = .clear
return prompts
}()
centerView.addSubview(promptsLabel)
promptsLabel.snp.makeConstraints { make in
make.left.equalTo(22)
make.right.equalTo(-22)
make.top.equalTo(116)
}
messageNumberLabel = {
let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 14)
label.text = "0/1000"
label.textAlignment = .right
label.textColor = UIColor(hex: 0xd5dae1)
return label
}()
centerView.addSubview(messageNumberLabel)
messageNumberLabel.snp.makeConstraints { make in
make.right.equalTo(-30)
make.top.equalTo(240)
make.height.equalTo(20)
}
}
}
extension YHGCWorkExperienceListReasonTableViewCell: UITextViewDelegate {
func textViewDidChange(_ textView: UITextView) {
let number = textView.text.count
if textView.text.count != 0 {
promptsLabel.isHidden = true
messageNumberLabel.text = "\(number)/1000"
} else {
promptsLabel.isHidden = false
messageNumberLabel.text = "\(number)/1000"
}
if let block = clickBlock {
block(textView.text)
}
}
func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool {
let newLength = (textView.text as NSString).length + text.count - range.length
return newLength <= 1000
}
}
...@@ -50,6 +50,11 @@ class YHGCWorkItemListViewModel: YHBaseViewModel { ...@@ -50,6 +50,11 @@ class YHGCWorkItemListViewModel: YHBaseViewModel {
company = item.company_name ?? "" company = item.company_name ?? ""
} }
} }
if company == "" && array.count == 1 {
let item = array.first
company = item?.company_name ?? ""
mainModel.consent_work_id = item?.id ?? 0
}
let item2 = YHWorkExperienceModel(id: .id4, isNeed: true, title: "可提供的在职公司", isUserKeyBoard: false, prompts: "请选择", message: company, type: .myCompany, isShowPrompts: isShowPrompt, alertMessage:"请选择") let item2 = YHWorkExperienceModel(id: .id4, isNeed: true, title: "可提供的在职公司", isUserKeyBoard: false, prompts: "请选择", message: company, type: .myCompany, isShowPrompts: isShowPrompt, alertMessage:"请选择")
if has_company_consent == 2 { if has_company_consent == 2 {
let section = YHSectionWorkExperienceModel(title: "赴港同意书提供", models: [item]) let section = YHSectionWorkExperienceModel(title: "赴港同意书提供", models: [item])
......
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