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

// 学历

parent 10cc1cf6
......@@ -21,7 +21,6 @@ class YHEducationDetailVC: YHBaseViewController {
var isNeedShowError = false
let educationRequest:YHEducationRequestViewModel = YHEducationRequestViewModel()
var detailInfo: YHEducationDetailInfo = YHEducationDetailInfo()
var isCerConfirm: Bool? = nil
var items:[[YHFormItemProtocol]] = []
......@@ -109,30 +108,38 @@ class YHEducationDetailVC: YHBaseViewController {
let item00 = YHFormDetailItem(type: .universityFullName)
if detailInfo.degree.contains("学士学位") {
item00.tips = "请输入学校全称".local
item00.placeHolder = "请输入学校全称,例:清华,需填全称“清华大学”".local
} else {
item00.tips = "请选择学校".local
item00.placeHolder = "请选择学校"
}
item00.value = detailInfo.college
let item01 = YHFormDetailItem(type: .educationStyle)
item01.tips = "请选择授课形式".local
item01.placeHolder = "请选择授课形式"
item01.value = detailInfo.teachingFormat
let item02 = YHFormDetailItem(type: .educationTime)
item02.tips = "请选择年月".local
item02.placeHolder = "请选择年月".local
item02.value = detailInfo.admissionTime
let item03 = YHFormDetailItem(type: .graduateTime)
item03.tips = "请选择年月".local
item03.placeHolder = "请选择年月".local
item03.value = detailInfo.graduateTime
let item04 = YHFormDetailItem(type: .educationMajor)
item04.tips = "请选择专业".local
item04.placeHolder = "请选择专业".local
item04.value = detailInfo.major
let item05 = YHFormDetailItem(type: .educationDegree)
item05.tips = "请选择学位".local
item05.placeHolder = "请选择学位".local
item05.value = detailInfo.degree
let item06 = YHFormDetailItem(type: .degreeType)
......@@ -140,7 +147,8 @@ class YHEducationDetailVC: YHBaseViewController {
item06.value = detailInfo.degreeType
let item07 = YHFormDetailItem(type: .educationCountry)
item07.tips = "请输入国家及地区".local
item07.tips = "请选择国家及地区".local
item07.placeHolder = "请选择国家及地区".local
item07.value = detailInfo.schoolAddress.country
let item08 = YHFormDetailItem(type: .educationCity)
......@@ -281,9 +289,14 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
var isSelectTrue = false
var isSelectFalse = false
if let isCerConfirm = isCerConfirm {
isSelectTrue = isCerConfirm
isSelectFalse = !isCerConfirm
var isCerConfirm = detailInfo.certConfirm
if isCerConfirm == 1 {
isSelectTrue = true
isSelectFalse = false
} else if isCerConfirm == 2 {
isSelectFalse = true
isSelectTrue = false
}
let answers = [YHFormChoiceItem(title: "是".local, isSelect: isSelectTrue),
YHFormChoiceItem(title: "否".local, isSelect: isSelectFalse)]
......@@ -294,7 +307,7 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
let selectItem:YHFormChoiceItem = arr[selectIndex]
let option = (selectItem.title == "是".local ? true : false)
self.isCerConfirm = option
detailInfo.certConfirm = option ? 1 : 2
self.tableView.reloadData()
}
return cell
......@@ -341,7 +354,11 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
let detailItem = item as! YHFormDetailItem
if detailItem.type == .universityFullName { // 选择大学名称
if detailInfo.degree.contains("学士学位") {
// 此时学位是输入
return
}
let vc = YHCollegeSearchViewController()
vc.orderId = self.orderId
vc.searchCollegeName = detailInfo.college
......@@ -426,13 +443,6 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
} else if detailItem.type == .educationDegree { // 学位
if detailItem.type == .universityFullName { // 学校全称
if detailInfo.degree.contains("学士学位") {
// 此时学位是输入
return
}
}
YHSheetPickerView.show(type:.degree, selectTitle:detailInfo.degree) {
[weak self] item in
guard let self = self else { return }
......@@ -626,6 +636,10 @@ extension YHEducationDetailVC {
return false
}
if detailInfo.certConfirm == 0 { // 证件提供确认
return false
}
// if detailInfo.isSchoolInAboard(), detailInfo.schoolAddress.foreign.isEmpty {
// return false
// }
......
......@@ -89,8 +89,13 @@ class YHEducationDetailInfo: SmartCodable {
var degreeType: String = ""
var schoolAddress: YHCollegeAddress = YHCollegeAddress()
var isAboardSchool: Bool = false
var majorOther: String = ""
var hasBachelorDegree: Int = 0
// 证件提供确认 0 未选择 1 是 2 否
var certConfirm: Int = 0
enum CodingKeys: String, CodingKey {
case id = "id"
case college = "college"
case teachingFormat = "teaching_format"
......@@ -101,6 +106,9 @@ class YHEducationDetailInfo: SmartCodable {
case degreeType = "degree_type"
case schoolAddress = "school_address"
case isAboardSchool = "is_aboard_school"
case majorOther = "major_other"
case hasBachelorDegree = "has_bachelor_degree"
case certConfirm = "cert_confirm"
}
required init() {
......
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