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

// 高才

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