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

// 学位

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