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

// 高才

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