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

工作经验细节修复 真多细节

parent a2963210
......@@ -836,8 +836,8 @@ extension YHWorkExperienceViewController: UITableViewDelegate, UITableViewDataSo
}
cell.newWorkBlock = {[weak self] in
guard let self = self else { return }
if self.viewModel.positionList.count == 5 {
YHHUD.flash(message: "新增职位不能超过5条")
if self.viewModel.positionList.count == 10 {
YHHUD.flash(message: "新增职位不能超过10条")
} else {
let vc = YHWorkExperiencePositionViewViewController()
vc.workID = workId
......@@ -877,7 +877,7 @@ extension YHWorkExperienceViewController: UITableViewDelegate, UITableViewDataSo
var height = 23 + 154
for item in viewModel.positionList {
if item.position_name == "" {
height = height + 76
height = height + 52
} else {
let text = item.position_name // 要显示的文本内容
let font = UIFont.PFSC_B(ofSize: 14) // 字体大小
......@@ -890,13 +890,15 @@ extension YHWorkExperienceViewController: UITableViewDelegate, UITableViewDataSo
// 根据指定的最大宽度和字体大小计算文本的高度
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
height = height + 72
} else {
height = height + 76
height = height + 52
}
}
if isShowPrompt && item.missing_item_num != 0 {
height = height + 20
}
}
return CGFloat(height)
}
}
......
......@@ -229,10 +229,13 @@ class YHWorkExperiencePositionTableViewCell: UITableViewCell {
// 根据指定的最大宽度和字体大小计算文本的高度
let size = (text as NSString).boundingRect(with: CGSize(width: maxWidth, height: .greatestFiniteMagnitude), options: .usesLineFragmentOrigin, attributes: attributes, context: nil).size
if size.height > 20 {
h = 95
h = 71
} else {
h = 75
h = 51
}
}
if showPrompt && model.missing_item_num != 0 {
h = h + 20
}
mainItemView.addSubview(itemView)
itemView.snp.makeConstraints { make in
......
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