Commit de0d8a96 authored by Steven杜宇's avatar Steven杜宇

// 高才

parent 79157be7
...@@ -94,6 +94,8 @@ class YHEducationDetailInfo: SmartCodable { ...@@ -94,6 +94,8 @@ class YHEducationDetailInfo: SmartCodable {
// 证件提供确认 0 未选择 1 是 2 否 // 证件提供确认 0 未选择 1 是 2 否
var certConfirm: Int = 0 var certConfirm: Int = 0
var isNeedInputMajor: Bool = false
enum CodingKeys: String, CodingKey { enum CodingKeys: String, CodingKey {
case id = "id" case id = "id"
......
...@@ -179,6 +179,10 @@ class YHSheetPickerView: UIView { ...@@ -179,6 +179,10 @@ class YHSheetPickerView: UIView {
YHSheetPickerViewItem(title:"硕士学位".local, index:2), YHSheetPickerViewItem(title:"硕士学位".local, index:2),
YHSheetPickerViewItem(title:"博士学位".local, index:3) YHSheetPickerViewItem(title:"博士学位".local, index:3)
], ],
.degree2:
[YHSheetPickerViewItem(title:"无学位".local, index:0),
YHSheetPickerViewItem(title:"学士学位".local, index:1),
],
// 学位2 // 学位2
.educationDegree: .educationDegree:
...@@ -317,6 +321,22 @@ class YHSheetPickerView: UIView { ...@@ -317,6 +321,22 @@ class YHSheetPickerView: UIView {
YHSheetPickerViewItem(title:"社会科学".local, index:10), YHSheetPickerViewItem(title:"社会科学".local, index:10),
YHSheetPickerViewItem(title:"其他".local, index:11), YHSheetPickerViewItem(title:"其他".local, index:11),
], ],
.major:
[YHSheetPickerViewItem(title:"艺术与人文学科".local, index:0),
YHSheetPickerViewItem(title:"经济及工商管理".local, index:1),
YHSheetPickerViewItem(title:"教育".local, index:2),
YHSheetPickerViewItem(title:"法学".local, index:3),
YHSheetPickerViewItem(title:"社会科学".local, index:4),
YHSheetPickerViewItem(title:"电脑科学".local, index:5),
YHSheetPickerViewItem(title:"工程学".local, index:6),
YHSheetPickerViewItem(title:"生命科学及医学".local, index:7),
YHSheetPickerViewItem(title:"物理/自然科学".local, index:8),
YHSheetPickerViewItem(title:"心理学".local, index:9),
YHSheetPickerViewItem(title:"其他".local, index:9),
],
] ]
func createUI() { func createUI() {
...@@ -399,6 +419,8 @@ extension YHSheetPickerView { ...@@ -399,6 +419,8 @@ extension YHSheetPickerView {
return "" return ""
case .degree: case .degree:
return "选择学位" return "选择学位"
case .degree2:
return "选择学位"
case .educationDegree: case .educationDegree:
return "选择学位" return "选择学位"
case .marriageText: case .marriageText:
...@@ -427,6 +449,9 @@ extension YHSheetPickerView { ...@@ -427,6 +449,9 @@ extension YHSheetPickerView {
return "选择学位类型" return "选择学位类型"
case .selectAdress: case .selectAdress:
return "选择国家地区" return "选择国家地区"
case .major:
return "选择专业"
} }
} }
......
...@@ -14,7 +14,8 @@ enum YHSheetPickerViewType: Int { ...@@ -14,7 +14,8 @@ enum YHSheetPickerViewType: Int {
case none = 0 case none = 0
// 学位 // 学位
case degree case degree
// 学位2 (包含无学位类型) case degree2
// 学位(包含无学位类型)
case educationDegree case educationDegree
// 学位有无 // 学位有无
case ownDegree case ownDegree
...@@ -42,6 +43,8 @@ enum YHSheetPickerViewType: Int { ...@@ -42,6 +43,8 @@ enum YHSheetPickerViewType: Int {
case degreeCategory case degreeCategory
// 国家地区 // 国家地区
case selectAdress case selectAdress
// 专业
case major
} }
class YHSheetPickerViewItem { class YHSheetPickerViewItem {
......
...@@ -122,9 +122,16 @@ class YHGCEducationDetailVC: YHBaseViewController { ...@@ -122,9 +122,16 @@ class YHGCEducationDetailVC: YHBaseViewController {
item03.value = detailInfo.graduateTime item03.value = detailInfo.graduateTime
let item04 = YHFormDetailItem(type: .educationMajor) let item04 = YHFormDetailItem(type: .educationMajor)
item04.tips = "请选择专业".local if detailInfo.isNeedInputMajor {
item04.placeHolder = "请选择专业".local item04.tips = "请输入专业".local
item04.value = detailInfo.major item04.placeHolder = "请输入专业".local
item04.value = detailInfo.major
} else {
item04.tips = "请选择专业".local
item04.placeHolder = "请选择专业".local
item04.value = detailInfo.major
}
let item01 = YHFormDetailItem(type: .educationStyle) let item01 = YHFormDetailItem(type: .educationStyle)
item01.tips = "请选择授课形式".local item01.tips = "请选择授课形式".local
...@@ -418,7 +425,7 @@ extension YHGCEducationDetailVC : UITableViewDelegate, UITableViewDataSource { ...@@ -418,7 +425,7 @@ extension YHGCEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
} else if detailItem.type == .educationDegree { // 学位 } else if detailItem.type == .educationDegree { // 学位
YHSheetPickerView.show(type:.degree, selectTitle:detailInfo.degree) { YHSheetPickerView.show(type:.degree2, selectTitle:detailInfo.degree) {
[weak self] item in [weak self] item in
guard let self = self else { return } guard let self = self else { return }
detailInfo.degree = item.title detailInfo.degree = item.title
...@@ -471,22 +478,39 @@ extension YHGCEducationDetailVC : UITableViewDelegate, UITableViewDataSource { ...@@ -471,22 +478,39 @@ extension YHGCEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
self.present(vc, animated: true) self.present(vc, animated: true)
} else if detailItem.type == .educationMajor { // 专业 } else if detailItem.type == .educationMajor { // 专业
YHSheetPickerView.show(type:.major, selectTitle: detailInfo.major) {
[weak self] item in
guard let self = self else { return }
if item.title == "其他" {
detailInfo.isNeedInputMajor = true
detailInfo.major = ""
} else {
detailInfo.isNeedInputMajor = false
detailInfo.major = item.title
}
loadInfo()
saveInfoSilent()
}
let vc = YHMajorSearchViewController() // let vc = YHMajorSearchViewController()
vc.orderId = self.orderId // vc.orderId = self.orderId
vc.searchMajorName = detailInfo.major // vc.searchMajorName = detailInfo.major
vc.selectBlock = { // vc.selectBlock = {
[weak self] text in // [weak self] text in
guard let self = self else { return } // guard let self = self else { return }
if let text = text, !text.isEmpty { // if let text = text, !text.isEmpty {
detailInfo.major = text // detailInfo.major = text
} else { // } else {
detailInfo.major = "" // detailInfo.major = ""
} // }
loadInfo() // loadInfo()
saveInfoSilent() // saveInfoSilent()
} // }
self.navigationController?.pushViewController(vc) // self.navigationController?.pushViewController(vc)
} }
} }
} }
...@@ -554,8 +578,14 @@ extension YHGCEducationDetailVC : UITableViewDelegate, UITableViewDataSource { ...@@ -554,8 +578,14 @@ extension YHGCEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
return .selectSheet return .selectSheet
} }
if detailItem.type == .educationMajor if detailItem.type == .educationMajor {
|| detailItem.type == .educationStyle if detailInfo.isNeedInputMajor {
return .inputText
}
return .selectSheet
}
if detailItem.type == .educationStyle
|| detailItem.type == .educationTime || detailItem.type == .educationTime
|| detailItem.type == .graduateTime || detailItem.type == .graduateTime
|| detailItem.type == .educationDegree || detailItem.type == .educationDegree
......
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