Commit 4a7f2882 authored by Steven杜宇's avatar Steven杜宇

// 学位

parent 4276e665
......@@ -44,7 +44,9 @@ class YHEducationInfo: SmartCodable {
var admissionTime: String?
var graduateTime: String?
var vacantNum: Int = 0
var majorOther: String?
var hasBachelorDegree: Int = 0
enum CodingKeys: String, CodingKey {
case id = "id"
case college = "college"
......@@ -53,11 +55,30 @@ class YHEducationInfo: SmartCodable {
case admissionTime = "admission_time"
case graduateTime = "graduate_time"
case vacantNum = "vacant_num"
case majorOther = "major_other"
case hasBachelorDegree = "has_bachelor_degree"
}
required init() {
}
func getDegree() -> String {
if hasBachelorDegree == 1 {
return "学士学位"
}
if hasBachelorDegree == 2 {
return "无学位"
}
return ""
}
func getRealMajor() -> String? {
if let major = major, major == "其他" {
return majorOther
}
return major
}
}
class YHQualificationInfo: SmartCodable {
......@@ -98,6 +119,16 @@ class YHEducationDetailInfo: SmartCodable {
return major == "其他"
}
func getDegree() -> String {
if hasBachelorDegree == 1 {
return "学士学位"
}
if hasBachelorDegree == 2 {
return "无学位"
}
return ""
}
enum CodingKeys: String, CodingKey {
case id = "id"
......
......@@ -180,7 +180,7 @@ class YHSheetPickerView: UIView {
YHSheetPickerViewItem(title:"博士学位".local, index:3)
],
.degree2:
[YHSheetPickerViewItem(title:"无学位".local, index:0),
[YHSheetPickerViewItem(title:"无学位".local, index:2),
YHSheetPickerViewItem(title:"学士学位".local, index:1),
],
......
......@@ -139,7 +139,7 @@ class YHGCEducationDetailVC: YHBaseViewController {
let item05 = YHFormDetailItem(type: .educationDegree)
item05.tips = "请选择学位".local
item05.placeHolder = "请选择学位".local
item05.value = (detailInfo.hasBachelorDegree == 0) ? "无学位" : "学士学位"
item05.value = detailInfo.getDegree()
// let item02 = YHFormDetailItem(type: .educationTime)
// item02.tips = "请选择年月".local
......@@ -625,7 +625,6 @@ extension YHGCEducationDetailVC {
if detailInfo.college.isEmpty
|| detailInfo.graduateTime.isEmpty
|| detailInfo.degree.isEmpty
|| detailInfo.schoolAddress.country.isEmpty
{
return false
......@@ -635,6 +634,10 @@ extension YHGCEducationDetailVC {
// return false
// }
if detailInfo.getDegree().isEmpty {
return false
}
if detailInfo.isNeedInputMajor(), detailInfo.majorOther.isEmpty {
return false
}
......
......@@ -336,13 +336,14 @@ extension YHGCEducationInfoListVC : UITableViewDelegate, UITableViewDataSource {
let cell = tableView.dequeueReusableCell(withIdentifier: YHEducationInfoCell.cellReuseIdentifier, for: indexPath) as! YHEducationInfoCell
cell.titleLabel.text = eduInfo.college
cell.subTitleLabel.text = ""
if let major = eduInfo.major, let degree = eduInfo.degree {
let degree = eduInfo.getDegree()
if let major = eduInfo.getRealMajor(), !degree.isEmpty {
cell.subTitleLabel.text = String("\(degree)-\(major)")
}
cell.timeLabel.text = ""
if let admissionTime = eduInfo.admissionTime, let graduateTime = eduInfo.graduateTime {
cell.timeLabel.text = String("\(admissionTime) ~ \(graduateTime)")
}
// if let admissionTime = eduInfo.admissionTime, let graduateTime = eduInfo.graduateTime {
// cell.timeLabel.text = String("\(admissionTime) ~ \(graduateTime)")
// }
cell.isShowDeleteBtn = (isDegreeEditMode == .canCancel)
cell.deleteBlock = {
var title = "确定删除该学历吗?"
......
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