Commit 6d71746f authored by Steven杜宇's avatar Steven杜宇

// 家庭成员

parent 2f1277ef
...@@ -100,7 +100,7 @@ class YHChildBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol { ...@@ -100,7 +100,7 @@ class YHChildBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol {
item07.tips = "请输入出生城市".local item07.tips = "请输入出生城市".local
} else { } else {
item07.value = child.birthPlace.area?.joined(separator: ",") item07.value = child.birthPlace.area.joined(separator: ",")
item07.placeHolder = "请选择出生城市".local item07.placeHolder = "请选择出生城市".local
item07.tips = "请选择出生城市".local item07.tips = "请选择出生城市".local
} }
...@@ -279,7 +279,7 @@ extension YHChildBasicInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -279,7 +279,7 @@ extension YHChildBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
self.child?.surname = text ?? "" self.child?.surname = text ?? ""
} else if detailItem.type == .birthCity { } else if detailItem.type == .birthCity {
self.child?.birthPlace.foreign = text self.child?.birthPlace.foreign = text ?? ""
} else if detailItem.type == .occupationName { } else if detailItem.type == .occupationName {
self.child?.occupationName = text ?? "" self.child?.occupationName = text ?? ""
......
...@@ -83,37 +83,35 @@ class YHChildPrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol { ...@@ -83,37 +83,35 @@ class YHChildPrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol {
if !child.isLiveTother() { // 不同住 才需填写国家/地区 if !child.isLiveTother() { // 不同住 才需填写国家/地区
let item21 = YHFormDetailItem(type: .nationOrArea) let item21 = YHFormDetailItem(type: .nationOrArea)
item21.value = child.address?.country item21.value = child.address.country
item21.placeHolder = "请选择".local item21.placeHolder = "请选择".local
arr2.append(item21) arr2.append(item21)
// 国家/地区已填写 才显示现居住城市和详细地址两行 // 国家/地区已填写 才显示现居住城市和详细地址两行
if let address = child.address { if !child.address.country.isEmpty {
if let country = address.country, !country.isEmpty {
// 居住信息中选择中国才会显示现居住城市 // 居住信息中选择中国才会显示现居住城市
let isLiveInChina = country.contains("中国".local) let isLiveInChina = child.address.country.contains("中国".local)
if isLiveInChina { if isLiveInChina {
let item22 = YHFormDetailItem(type: .liveCity) let item22 = YHFormDetailItem(type: .liveCity)
if let area = address.area { if !child.address.area.isEmpty {
item22.value = area.joined(separator: "/") item22.value = child.address.area.joined(separator: "/")
}
item22.placeHolder = "请选择城市".local
arr2.append(item22)
}
let item23 = YHFormDetailItem(type: .detailAddress)
item23.value = address.details
item23.placeHolder = (isLiveInChina ? "请填写小区、楼栋、单元室等".local : "请填写国外居住地".local)
arr2.append(item23)
if !isLiveInChina {// 在国外
// 是否在海外居住满1年及以上
let item24 = YHFormDetailItem(type: .isLiveOverSeasMore1Year)
item24.value = String(child.isOverSeasOver1Year())
arr2.append(item24)
} }
item22.placeHolder = "请选择城市".local
arr2.append(item22)
}
let item23 = YHFormDetailItem(type: .detailAddress)
item23.value = child.address.details
item23.placeHolder = (isLiveInChina ? "请填写小区、楼栋、单元室等".local : "请填写国外居住地".local)
arr2.append(item23)
if !isLiveInChina {// 在国外
// 是否在海外居住满1年及以上
let item24 = YHFormDetailItem(type: .isLiveOverSeasMore1Year)
item24.value = String(child.isOverSeasOver1Year())
arr2.append(item24)
} }
} }
} }
...@@ -254,9 +252,9 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -254,9 +252,9 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
} else if detailItem.type == .isLiveTother { // 是否与主申请人同住 } else if detailItem.type == .isLiveTother { // 是否与主申请人同住
self.child?.setLiveTother(option) self.child?.setLiveTother(option)
if option { if option {
self.child?.address?.country = nil self.child?.address.country = ""
self.child?.address?.details = nil self.child?.address.details = ""
self.child?.address?.area = nil self.child?.address.area = []
} }
} else if detailItem.type == .isLiveOverSeasMore1Year { // 是否在海外居住满1年及以上 } else if detailItem.type == .isLiveOverSeasMore1Year { // 是否在海外居住满1年及以上
self.child?.setOverSearsOver1Year(option) self.child?.setOverSearsOver1Year(option)
...@@ -289,7 +287,7 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -289,7 +287,7 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
[weak self] (text, isEditEnd) in [weak self] (text, isEditEnd) in
guard let self = self else { return } guard let self = self else { return }
if detailItem.type == .detailAddress { if detailItem.type == .detailAddress {
self.child?.address?.details = text self.child?.address.details = text ?? ""
} }
if isEditEnd { if isEditEnd {
...@@ -384,7 +382,7 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -384,7 +382,7 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
self.child?.nationality = country self.child?.nationality = country
} else if title.type == .liveInfo { } else if title.type == .liveInfo {
self.child?.address?.country = country self.child?.address.country = country
} }
self.loadChildInfo() self.loadChildInfo()
...@@ -398,7 +396,7 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -398,7 +396,7 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
[weak self] (string1, string2, string3, string4) in [weak self] (string1, string2, string3, string4) in
guard let self = self else { return } guard let self = self else { return }
print("\(string1)\n\(string2)\n\(string3)\n\(string4)") print("\(string1)\n\(string2)\n\(string3)\n\(string4)")
self.child?.address?.area = [string2, string3, string4] self.child?.address.area = [string2, string3, string4]
self.loadChildInfo() self.loadChildInfo()
} }
self.present(vc, animated: true) self.present(vc, animated: true)
...@@ -450,13 +448,13 @@ extension YHChildPrimaryInfoVC { ...@@ -450,13 +448,13 @@ extension YHChildPrimaryInfoVC {
if isEmptyString(child.nationality) { if isEmptyString(child.nationality) {
return false return false
} }
if isEmptyString(child.address?.country) { if isEmptyString(child.address.country) {
return false return false
} }
if isEmptyString(child.address?.details) { if isEmptyString(child.address.details) {
return false return false
} }
if child.isBirthOverSeas(), isEmptyArray(child.address?.area) { if child.isBirthOverSeas(), isEmptyArray(child.address.area) {
return false return false
} }
return true return true
......
...@@ -113,7 +113,7 @@ class YHSpouseBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol { ...@@ -113,7 +113,7 @@ class YHSpouseBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol {
item05.tips = "请输入出生城市".local item05.tips = "请输入出生城市".local
} else { } else {
item05.value = spouse.birthPlace.area?.joined(separator: ",") item05.value = spouse.birthPlace.area.joined(separator: ",")
item05.placeHolder = "请选择".local item05.placeHolder = "请选择".local
item05.tips = "请选择出生城市".local item05.tips = "请选择出生城市".local
...@@ -386,7 +386,7 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -386,7 +386,7 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
} else if detailItem.type == .befourMarryFirstName { } else if detailItem.type == .befourMarryFirstName {
self.spouse?.surname = text ?? "" self.spouse?.surname = text ?? ""
} else if detailItem.type == .birthCity { } else if detailItem.type == .birthCity {
self.spouse?.birthPlace.foreign = text self.spouse?.birthPlace.foreign = text ?? ""
} else if detailItem.type == .occupationName { } else if detailItem.type == .occupationName {
self.spouse?.occupationName = text ?? "" self.spouse?.occupationName = text ?? ""
} else if detailItem.type == .hkIdentityCardNumber { } else if detailItem.type == .hkIdentityCardNumber {
......
...@@ -79,40 +79,38 @@ class YHSpousePrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol { ...@@ -79,40 +79,38 @@ class YHSpousePrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol {
if !spouse.isLiveTother() { // 不同住 才需填写国家/地区 if !spouse.isLiveTother() { // 不同住 才需填写国家/地区
let item21 = YHFormDetailItem(type: .nationOrArea) let item21 = YHFormDetailItem(type: .nationOrArea)
item21.value = spouse.address?.country item21.value = spouse.address.country
item21.placeHolder = "请选择".local item21.placeHolder = "请选择".local
item21.tips = "请选择国家/地区".local item21.tips = "请选择国家/地区".local
arr2.append(item21) arr2.append(item21)
// 国家/地区已填写 才显示现居住城市和详细地址两行 // 国家/地区已填写 才显示现居住城市和详细地址两行
if let address = spouse.address { if !spouse.address.country.isEmpty {
if let country = address.country, !country.isEmpty {
// 居住信息中选择中国才会显示现居住城市
// 居住信息中选择中国才会显示现居住城市 let isLiveInChina = spouse.address.country.contains("中国".local)
let isLiveInChina = country.contains("中国".local) if isLiveInChina {
if isLiveInChina { let item22 = YHFormDetailItem(type: .liveCity)
let item22 = YHFormDetailItem(type: .liveCity) if !spouse.address.area.isEmpty {
if let area = address.area { item22.value = spouse.address.area.joined(separator: "/")
item22.value = area.joined(separator: "/")
}
item22.placeHolder = "请选择城市".local
item22.tips = "请请选择城市".local
arr2.append(item22)
}
let item23 = YHFormDetailItem(type: .detailAddress)
item23.value = address.details
item23.placeHolder = (isLiveInChina ? "请填写小区、楼栋、单元室等".local : "请填写国外居住地".local)
item23.tips = (isLiveInChina ? "请填写小区、楼栋、单元室等".local : "请填写国外居住地".local)
arr2.append(item23)
if !isLiveInChina {// 在国外
// 是否在海外居住满1年及以上
let item24 = YHFormDetailItem(type: .isLiveOverSeasMore1Year)
item24.value = String(spouse.isOverSeasOver1Year())
arr2.append(item24)
} }
item22.placeHolder = "请选择城市".local
item22.tips = "请请选择城市".local
arr2.append(item22)
}
let item23 = YHFormDetailItem(type: .detailAddress)
item23.value = spouse.address.details
item23.placeHolder = (isLiveInChina ? "请填写小区、楼栋、单元室等".local : "请填写国外居住地".local)
item23.tips = (isLiveInChina ? "请填写小区、楼栋、单元室等".local : "请填写国外居住地".local)
arr2.append(item23)
if !isLiveInChina {// 在国外
// 是否在海外居住满1年及以上
let item24 = YHFormDetailItem(type: .isLiveOverSeasMore1Year)
item24.value = String(spouse.isOverSeasOver1Year())
arr2.append(item24)
} }
} }
} }
...@@ -210,9 +208,9 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -210,9 +208,9 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
} else if detailItem.type == .isLiveTother { // 是否与主申请人同住 } else if detailItem.type == .isLiveTother { // 是否与主申请人同住
self.spouse?.setLiveTother(option) self.spouse?.setLiveTother(option)
if option { if option {
self.spouse?.address?.country = nil self.spouse?.address.country = ""
self.spouse?.address?.details = nil self.spouse?.address.details = ""
self.spouse?.address?.area = nil self.spouse?.address.area = []
} }
self.loadSponseInfo() self.loadSponseInfo()
...@@ -248,7 +246,7 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -248,7 +246,7 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
cell.textChange = { cell.textChange = {
[weak self] (text, isEditEnd) in [weak self] (text, isEditEnd) in
guard let self = self else { return } guard let self = self else { return }
self.spouse?.address?.details = text self.spouse?.address.details = text ?? ""
if isEditEnd { if isEditEnd {
self.loadSponseInfo() self.loadSponseInfo()
if let delegate = delegate { if let delegate = delegate {
...@@ -338,7 +336,7 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -338,7 +336,7 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
self.spouse?.nationality = country self.spouse?.nationality = country
} else if title.type == .liveInfo { } else if title.type == .liveInfo {
self.spouse?.address?.country = country self.spouse?.address.country = country
} }
self.loadSponseInfo() self.loadSponseInfo()
...@@ -352,7 +350,7 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -352,7 +350,7 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
[weak self] (string1, string2, string3, string4) in [weak self] (string1, string2, string3, string4) in
guard let self = self else { return } guard let self = self else { return }
print("\(string1)\n\(string2)\n\(string3)\n\(string4)") print("\(string1)\n\(string2)\n\(string3)\n\(string4)")
self.spouse?.address?.area = [string2, string3, string4] self.spouse?.address.area = [string2, string3, string4]
self.loadSponseInfo() self.loadSponseInfo()
} }
self.present(vc, animated: true) self.present(vc, animated: true)
...@@ -389,13 +387,13 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -389,13 +387,13 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
if isEmptyString(spouse.nationality) { if isEmptyString(spouse.nationality) {
return false return false
} }
if isEmptyString(spouse.address?.country) { if isEmptyString(spouse.address.country) {
return false return false
} }
if isEmptyString(spouse.address?.details) { if isEmptyString(spouse.address.details) {
return false return false
} }
if spouse.isBirthOverSeas(), isEmptyArray(spouse.address?.area) { if spouse.isBirthOverSeas(), isEmptyArray(spouse.address.area) {
return false return false
} }
return true return true
......
...@@ -101,7 +101,7 @@ class YHBrotherInfoVC: YHBaseViewController { ...@@ -101,7 +101,7 @@ class YHBrotherInfoVC: YHBaseViewController {
item13.value = brotherInfo.birthPlace.foreign item13.value = brotherInfo.birthPlace.foreign
item13.placeHolder = "请输入".local item13.placeHolder = "请输入".local
} else { } else {
item13.value = brotherInfo.birthPlace.area?.joined(separator: ",") item13.value = brotherInfo.birthPlace.area.joined(separator: ",")
item13.placeHolder = "请选择".local item13.placeHolder = "请选择".local
} }
...@@ -240,13 +240,13 @@ extension YHBrotherInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -240,13 +240,13 @@ extension YHBrotherInfoVC : UITableViewDelegate, UITableViewDataSource {
self.brotherInfo?.subsetName = text ?? "" self.brotherInfo?.subsetName = text ?? ""
} else if detailItem.type == .birthCity { } else if detailItem.type == .birthCity {
self.brotherInfo?.birthPlace.foreign = text self.brotherInfo?.birthPlace.foreign = text ?? ""
} else if detailItem.type == .occupationName { } else if detailItem.type == .occupationName {
self.brotherInfo?.occupationName = text ?? "" self.brotherInfo?.occupationName = text ?? ""
} else if detailItem.type == .hkIdentityCardNumber { } else if detailItem.type == .hkIdentityCardNumber {
self.brotherInfo?.hkIdentityCard = text self.brotherInfo?.hkIdentityCard = text ?? ""
} }
if isEditEnd { if isEditEnd {
......
...@@ -129,7 +129,7 @@ class YHParentInfoVC: YHBaseViewController { ...@@ -129,7 +129,7 @@ class YHParentInfoVC: YHBaseViewController {
item13.placeHolder = "请输入".local item13.placeHolder = "请输入".local
item13.tips = "请输入城市".local item13.tips = "请输入城市".local
} else { } else {
item13.value = parentInfo.birthPlace.area?.joined(separator: ",") item13.value = parentInfo.birthPlace.area.joined(separator: ",")
item13.placeHolder = "请选择".local item13.placeHolder = "请选择".local
item13.tips = "请选择城市".local item13.tips = "请选择城市".local
...@@ -300,7 +300,7 @@ extension YHParentInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -300,7 +300,7 @@ extension YHParentInfoVC : UITableViewDelegate, UITableViewDataSource {
self.parentInfo?.subsetName = text ?? "" self.parentInfo?.subsetName = text ?? ""
} else if detailItem.type == .birthCity { } else if detailItem.type == .birthCity {
self.parentInfo?.birthPlace.foreign = text self.parentInfo?.birthPlace.foreign = text ?? ""
} else if detailItem.type == .occupationName { } else if detailItem.type == .occupationName {
self.parentInfo?.occupationName = text ?? "" self.parentInfo?.occupationName = text ?? ""
......
...@@ -902,7 +902,7 @@ class YHFamilyMember: SmartCodable, YHFormItemProtocol { ...@@ -902,7 +902,7 @@ class YHFamilyMember: SmartCodable, YHFormItemProtocol {
var sex: Int = 0 var sex: Int = 0
var married: String = "" var married: String = ""
var nows: Int = 0 var nows: Int = 0
var address: YHAddress? var address: YHAddress = YHAddress()
var childStepchild: YHChildStepchildClass = YHChildStepchildClass() var childStepchild: YHChildStepchildClass = YHChildStepchildClass()
var childInHk: YHChildStepchildClass = YHChildStepchildClass() var childInHk: YHChildStepchildClass = YHChildStepchildClass()
var countryIdentity: YHChildStepchildClass = YHChildStepchildClass() var countryIdentity: YHChildStepchildClass = YHChildStepchildClass()
...@@ -1168,10 +1168,10 @@ class YHFamilyMember: SmartCodable, YHFormItemProtocol { ...@@ -1168,10 +1168,10 @@ class YHFamilyMember: SmartCodable, YHFormItemProtocol {
// MARK: - 居住地址信息 YHAddress // MARK: - 居住地址信息 YHAddress
class YHAddress: SmartCodable { class YHAddress: SmartCodable {
var area: [String]? var area: [String] = []
var country: String? var country: String = ""
var details: String? var details: String = ""
var foreign: String? var foreign: String = ""
enum CodingKeys: String, CodingKey { enum CodingKeys: String, CodingKey {
case area = "area" case area = "area"
......
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