Commit 41f9633c authored by Steven杜宇's avatar Steven杜宇

// 高才

parent e5ad4984
...@@ -94,7 +94,9 @@ class YHEducationDetailInfo: SmartCodable { ...@@ -94,7 +94,9 @@ class YHEducationDetailInfo: SmartCodable {
// 证件提供确认 0 未选择 1 是 2 否 // 证件提供确认 0 未选择 1 是 2 否
var certConfirm: Int = 0 var certConfirm: Int = 0
var isNeedInputMajor: Bool = false func isNeedInputMajor() -> Bool {
return major == "其他"
}
enum CodingKeys: String, CodingKey { enum CodingKeys: String, CodingKey {
......
...@@ -182,6 +182,8 @@ enum YHFormDetailItemType:Int { ...@@ -182,6 +182,8 @@ enum YHFormDetailItemType:Int {
case graduateTime case graduateTime
// 专业 // 专业
case educationMajor case educationMajor
// 具体专业
case detailMajor
// 学位 // 学位
case educationDegree case educationDegree
// 学位类型 // 学位类型
...@@ -508,6 +510,8 @@ class YHFormDetailItem : YHFormItemProtocol { ...@@ -508,6 +510,8 @@ class YHFormDetailItem : YHFormItemProtocol {
return "毕业年月".local return "毕业年月".local
case .educationMajor: case .educationMajor:
return "专业".local return "专业".local
case .detailMajor:
return "具体专业".local
case .educationDegree: case .educationDegree:
return "学位".local return "学位".local
case .degreeType: case .degreeType:
......
...@@ -122,16 +122,14 @@ class YHGCEducationDetailVC: YHBaseViewController { ...@@ -122,16 +122,14 @@ class YHGCEducationDetailVC: YHBaseViewController {
item03.value = detailInfo.graduateTime item03.value = detailInfo.graduateTime
let item04 = YHFormDetailItem(type: .educationMajor) let item04 = YHFormDetailItem(type: .educationMajor)
if detailInfo.isNeedInputMajor { item04.tips = "请选择专业".local
item04.tips = "请输入专业".local item04.placeHolder = "请选择专业".local
item04.placeHolder = "请输入专业".local item04.value = detailInfo.major
item04.value = detailInfo.major
let item09 = YHFormDetailItem(type: .detailMajor)
} else { item09.tips = "请输入专业".local
item04.tips = "请选择专业".local item09.placeHolder = "请输入专业".local
item04.placeHolder = "请选择专业".local item09.value = detailInfo.majorOther
item04.value = detailInfo.major
}
let item01 = YHFormDetailItem(type: .educationStyle) let item01 = YHFormDetailItem(type: .educationStyle)
item01.tips = "请选择授课形式".local item01.tips = "请选择授课形式".local
...@@ -141,7 +139,7 @@ class YHGCEducationDetailVC: YHBaseViewController { ...@@ -141,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.degree item05.value = (detailInfo.hasBachelorDegree == 0) ? "无学位" : "学士学位"
// let item02 = YHFormDetailItem(type: .educationTime) // let item02 = YHFormDetailItem(type: .educationTime)
// item02.tips = "请选择年月".local // item02.tips = "请选择年月".local
...@@ -169,12 +167,16 @@ class YHGCEducationDetailVC: YHBaseViewController { ...@@ -169,12 +167,16 @@ class YHGCEducationDetailVC: YHBaseViewController {
item08.tips = "请选择城市".local item08.tips = "请选择城市".local
} }
let arr0:[YHFormItemProtocol] = [title0, item00, item03, item04, item05, item07, item08]
var arr0:[YHFormItemProtocol] = [title0, item00, item03, item04, item05, item07, item08]
if detailInfo.isNeedInputMajor() {
arr0 = [title0, item00, item03, item04, item09, item05, item07, item08]
}
items.append(arr0) items.append(arr0)
let item10 = YHFormDetailItem(type: .cerUpload) // let item10 = YHFormDetailItem(type: .cerUpload)
let arr1:[YHFormItemProtocol] = [item10] // let arr1:[YHFormItemProtocol] = [item10]
items.append(arr1) // items.append(arr1)
self.tableView.reloadData() self.tableView.reloadData()
} }
...@@ -227,7 +229,7 @@ extension YHGCEducationDetailVC : UITableViewDelegate, UITableViewDataSource { ...@@ -227,7 +229,7 @@ extension YHGCEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
textField in textField in
var max = -1 var max = -1
if detailItem.type == .educationMajor { if detailItem.type == .detailMajor {
max = 50 max = 50
} else if detailItem.type == .educationCity { } else if detailItem.type == .educationCity {
max = 100 max = 100
...@@ -252,11 +254,11 @@ extension YHGCEducationDetailVC : UITableViewDelegate, UITableViewDataSource { ...@@ -252,11 +254,11 @@ extension YHGCEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
detailInfo.schoolAddress.foreign = "" detailInfo.schoolAddress.foreign = ""
} }
} else if detailItem.type == .educationMajor { } else if detailItem.type == .detailMajor {
if let text = text, !text.isEmpty { if let text = text, !text.isEmpty {
detailInfo.major = text detailInfo.majorOther = text
} else { } else {
detailInfo.major = "" detailInfo.majorOther = ""
} }
} else if detailItem.type == .universityFullName { } else if detailItem.type == .universityFullName {
if let text = text, !text.isEmpty { if let text = text, !text.isEmpty {
...@@ -428,7 +430,7 @@ extension YHGCEducationDetailVC : UITableViewDelegate, UITableViewDataSource { ...@@ -428,7 +430,7 @@ extension YHGCEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
YHSheetPickerView.show(type:.degree2, 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.hasBachelorDegree = item.index
loadInfo() loadInfo()
saveInfoSilent() saveInfoSilent()
} }
...@@ -482,15 +484,7 @@ extension YHGCEducationDetailVC : UITableViewDelegate, UITableViewDataSource { ...@@ -482,15 +484,7 @@ extension YHGCEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
YHSheetPickerView.show(type:.major, selectTitle: detailInfo.major) { YHSheetPickerView.show(type:.major, selectTitle: detailInfo.major) {
[weak self] item in [weak self] item in
guard let self = self else { return } guard let self = self else { return }
detailInfo.major = item.title
if item.title == "其他" {
detailInfo.isNeedInputMajor = true
detailInfo.major = ""
} else {
detailInfo.isNeedInputMajor = false
detailInfo.major = item.title
}
loadInfo() loadInfo()
saveInfoSilent() saveInfoSilent()
} }
...@@ -578,14 +572,12 @@ extension YHGCEducationDetailVC : UITableViewDelegate, UITableViewDataSource { ...@@ -578,14 +572,12 @@ extension YHGCEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
return .selectSheet return .selectSheet
} }
if detailItem.type == .educationMajor { if detailItem.type == .detailMajor {
if detailInfo.isNeedInputMajor { return .inputText
return .inputText
}
return .selectSheet
} }
if detailItem.type == .educationStyle if detailItem.type == .educationMajor
|| detailItem.type == .educationStyle
|| detailItem.type == .educationTime || detailItem.type == .educationTime
|| detailItem.type == .graduateTime || detailItem.type == .graduateTime
|| detailItem.type == .educationDegree || detailItem.type == .educationDegree
...@@ -602,7 +594,8 @@ extension YHGCEducationDetailVC : UITableViewDelegate, UITableViewDataSource { ...@@ -602,7 +594,8 @@ extension YHGCEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
extension YHGCEducationDetailVC { extension YHGCEducationDetailVC {
func getDetailInfo() { func getDetailInfo() {
self.educationRequest.getEducationDetailInfo(params: ["id": self.detailId]) { self.educationRequest.getEducationDetailInfo(params: ["id": self.detailId,
"order_id": self.orderId]) {
[weak self] success, error in [weak self] success, error in
guard let self = self else { return } guard let self = self else { return }
if success { if success {
...@@ -632,7 +625,6 @@ extension YHGCEducationDetailVC { ...@@ -632,7 +625,6 @@ extension YHGCEducationDetailVC {
if detailInfo.college.isEmpty if detailInfo.college.isEmpty
|| detailInfo.graduateTime.isEmpty || detailInfo.graduateTime.isEmpty
|| detailInfo.major.isEmpty
|| detailInfo.degree.isEmpty || detailInfo.degree.isEmpty
|| detailInfo.schoolAddress.country.isEmpty || detailInfo.schoolAddress.country.isEmpty
{ {
...@@ -643,6 +635,10 @@ extension YHGCEducationDetailVC { ...@@ -643,6 +635,10 @@ extension YHGCEducationDetailVC {
// return false // return false
// } // }
if detailInfo.isNeedInputMajor(), detailInfo.majorOther.isEmpty {
return false
}
if detailInfo.isSchoolInAboard(), detailInfo.schoolAddress.foreign.isEmpty { if detailInfo.isSchoolInAboard(), detailInfo.schoolAddress.foreign.isEmpty {
return false return false
} }
......
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