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

// 学历

parent 579b547e
...@@ -159,7 +159,14 @@ class YHEducationInfoListVC: YHBaseViewController { ...@@ -159,7 +159,14 @@ class YHEducationInfoListVC: YHBaseViewController {
let questions = YHQuestionInfo.getEducationQuestion(eduList: educationInfo) let questions = YHQuestionInfo.getEducationQuestion(eduList: educationInfo)
for questionInfo in questions { for questionInfo in questions {
if questionInfo.key == "qualification" { if questionInfo.key == "qualification" {
questionInfo.answer = educationInfo.isNameSame if educationInfo.isNameSameNew == 1 {
questionInfo.answer = true
} else if educationInfo.isNameSameNew == 2 {
questionInfo.answer = false
} else {
questionInfo.answer = nil
}
arr2.append(questionInfo) arr2.append(questionInfo)
} else if questionInfo.key == "graduate" { } else if questionInfo.key == "graduate" {
...@@ -292,7 +299,7 @@ extension YHEducationInfoListVC : UITableViewDelegate, UITableViewDataSource { ...@@ -292,7 +299,7 @@ extension YHEducationInfoListVC : UITableViewDelegate, UITableViewDataSource {
let selectItem:YHFormChoiceItem = arr[selectIndex] let selectItem:YHFormChoiceItem = arr[selectIndex]
let option = (selectItem.title == "是".local ? true : false) let option = (selectItem.title == "是".local ? true : false)
if detailItem.key == "qualification" { if detailItem.key == "qualification" {
self.educationInfo?.isNameSame = option self.educationInfo?.isNameSameNew = option ? 1 : 2
} else if detailItem.key == "graduate" { } else if detailItem.key == "graduate" {
self.educationInfo?.isSpouseNameSame = option self.educationInfo?.isSpouseNameSame = option
...@@ -561,7 +568,8 @@ extension YHEducationInfoListVC { ...@@ -561,7 +568,8 @@ extension YHEducationInfoListVC {
let params:[String : Any] = [ "order_id": self.orderId, let params:[String : Any] = [ "order_id": self.orderId,
"goNextFlow": isSubmit, "goNextFlow": isSubmit,
"isSpouseNameSame": educationInfo.isSpouseNameSame ?? false, "isSpouseNameSame": educationInfo.isSpouseNameSame ?? false,
"isNameSame": educationInfo.isNameSame ?? false] "isNameSame": educationInfo.isNameSame ?? false,
"isNameSameNew" : educationInfo.isNameSameNew]
self.educationRequest.saveAllEducationInfo(params: params) { self.educationRequest.saveAllEducationInfo(params: params) {
[weak self] success, error in [weak self] success, error in
...@@ -613,7 +621,7 @@ extension YHEducationInfoListVC { ...@@ -613,7 +621,7 @@ extension YHEducationInfoListVC {
} }
// 检查所有问题是否有未答项 // 检查所有问题是否有未答项
if educationInfo.isNameSame == nil { if educationInfo.isNameSameNew != 1 && educationInfo.isNameSameNew != 2 {
return false return false
} }
return true return true
......
...@@ -17,6 +17,7 @@ class YHEducationListInfo: SmartCodable { ...@@ -17,6 +17,7 @@ class YHEducationListInfo: SmartCodable {
var isSpouseNameSame:Bool? var isSpouseNameSame:Bool?
// 1=已婚,2=未婚,3=离婚,4=分居,5=丧偶,6=事实婚姻,7=鳏寡 // 1=已婚,2=未婚,3=离婚,4=分居,5=丧偶,6=事实婚姻,7=鳏寡
var married: Int = 0 var married: Int = 0
var isNameSameNew: Int = 0
func isMarried() ->Bool { func isMarried() ->Bool {
return married != 2 return married != 2
...@@ -27,6 +28,8 @@ class YHEducationListInfo: SmartCodable { ...@@ -27,6 +28,8 @@ class YHEducationListInfo: SmartCodable {
case eduList = "edu_list" case eduList = "edu_list"
case quaList = "qua_list" case quaList = "qua_list"
case isNameSame = "is_name_same" case isNameSame = "is_name_same"
case isNameSameNew = "is_name_same_new"
case isSpouseNameSame = "is_spouse_name_same" case isSpouseNameSame = "is_spouse_name_same"
case married = "married" case married = "married"
} }
......
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