Commit 7e8670ec authored by Steven杜宇's avatar Steven杜宇

// 默认字段

parent 80c528bf
......@@ -550,7 +550,23 @@ class YHFamilyMemberGroupInfo: SmartCodable {
case brother = "brother"
case child = "child"
}
func checkDefaultValue() -> Self {
_ = father?.checkDefaultValue()
_ = mother?.checkDefaultValue()
_ = spouse?.checkDefaultValue()
if let child = child {
for item in child {
_ = item.checkDefaultValue()
}
}
if let brother = brother {
for item in brother {
_ = item.checkDefaultValue()
}
}
return self
}
required init() {
}
......@@ -888,7 +904,7 @@ class YHFamilyMember: SmartCodable, YHFormItemProtocol {
var nationality: String = ""
var orderId: Int = 0
var relation: String = ""
var hasDegree: String = "0"
var hasDegree: String = ""
var hasDegreeJson: [YHHasDegreeJson] = []
var follow: Int = 1
var statement: Int = 0
......@@ -901,14 +917,14 @@ class YHFamilyMember: SmartCodable, YHFormItemProtocol {
var occupationName: String = ""
var operatorName: String = ""
// 是否办理过香港身份证
var childHasHkId: YHChildStepchildClass = YHChildStepchildClass(has:"N")
var childHasHkId: YHChildStepchildClass = YHChildStepchildClass()
var hkIdentityCard: String?
var sex: Int = 0
var married: String = ""
var nows: Int = 0
var address: YHAddress = YHAddress()
// 是否前一次婚姻子女
var childStepchild: YHChildStepchildClass = YHChildStepchildClass(has:"N")
var childStepchild: YHChildStepchildClass = YHChildStepchildClass()
// // 目前是否在港
var childInHk: YHChildStepchildClass = YHChildStepchildClass(has:"N")
var countryIdentity: YHChildStepchildClass = YHChildStepchildClass()
......@@ -926,6 +942,22 @@ class YHFamilyMember: SmartCodable, YHFormItemProtocol {
var isInHk: Int = 0
var isLiveOverseaYear: Int = 0
var surname: String = ""
func checkDefaultValue() -> Self {
if hasDegree.isEmpty {
hasDegree = "0"
}
if childHasHkId.has.isEmpty {
childHasHkId.has = "N"
}
if childStepchild.has.isEmpty {
childStepchild.has = "N"
}
if childInHk.has.isEmpty {
childInHk.has = "N"
}
return self
}
enum CodingKeys: String, CodingKey {
case id = "id"
......
......@@ -32,7 +32,7 @@ class YHFamilyRequestViewModel {
callBackBlock(false,nil)
return
}
familyInfo = resultModel
familyInfo = resultModel.checkDefaultValue()
callBackBlock(true,nil)
} failBlock: { err in
......
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