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

// 家庭

parent 9c103ca1
...@@ -28,6 +28,15 @@ class YHChildInfoContainerVC: YHBaseViewController, YHSpouseInfoVCProtocol { ...@@ -28,6 +28,15 @@ class YHChildInfoContainerVC: YHBaseViewController, YHSpouseInfoVCProtocol {
basicInfoVC.child = child basicInfoVC.child = child
} }
} }
var mainApplicantInfo: YHMyMainApplicantInfoModel? {
didSet {
if let mainApplicantInfo = mainApplicantInfo {
primaryInfoVC.mainApplicantInfo = mainApplicantInfo
}
}
}
var stepVCs:[YHFaimilyStepItem] = [] var stepVCs:[YHFaimilyStepItem] = []
var _currentStep = 0 var _currentStep = 0
......
...@@ -11,6 +11,8 @@ import UIKit ...@@ -11,6 +11,8 @@ import UIKit
class YHChildPrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol { class YHChildPrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol {
var child:YHFamilyMember? var child:YHFamilyMember?
var mainApplicantInfo: YHMyMainApplicantInfoModel?
weak var delegate:YHSpouseInfoVCProtocol? weak var delegate:YHSpouseInfoVCProtocol?
var isNeedShowError = false var isNeedShowError = false
// 是否随行能编辑 // 是否随行能编辑
...@@ -113,10 +115,21 @@ class YHChildPrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol { ...@@ -113,10 +115,21 @@ class YHChildPrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol {
// 港澳通信证 // 港澳通信证
var isHiddenHK = true var isHiddenHK = true
if child.nationality.contains("中国") { // 中国国籍 if child.nationality.contains("中国") { // 中国国籍
let isLiveInChina = child.address.country.contains("中国".local) if child.isLiveTother() { // 与主申请人同住
if isLiveInChina || (!isLiveInChina && !child.isOverSeasOver1Year()) { if let mainApplicantInfo = mainApplicantInfo {
// 中国国籍&居住国内、中国国籍&居住国外不满一年 需展示“港澳通行证”询问框 let isLiveInChina = mainApplicantInfo.applicant_address.country.contains("中国".local)
isHiddenHK = false if isLiveInChina || (!isLiveInChina && !mainApplicantInfo.isOverSeasOver1Year()) {
// 中国国籍&居住国内、中国国籍&居住国外不满一年 需展示“港澳通行证”询问框
isHiddenHK = false
}
}
} else { // 不与主申请人同住
let isLiveInChina = child.address.country.contains("中国".local)
if isLiveInChina || (!isLiveInChina && !child.isOverSeasOver1Year()) {
// 中国国籍&居住国内、中国国籍&居住国外不满一年 需展示“港澳通行证”询问框
isHiddenHK = false
}
} }
} }
......
...@@ -49,6 +49,15 @@ class YHSpouseInfoContainerVC: YHBaseViewController, YHSpouseInfoVCProtocol { ...@@ -49,6 +49,15 @@ class YHSpouseInfoContainerVC: YHBaseViewController, YHSpouseInfoVCProtocol {
} }
} }
} }
var mainApplicantInfo: YHMyMainApplicantInfoModel? {
didSet {
if let mainApplicantInfo = mainApplicantInfo {
primaryInfoVC.mainApplicantInfo = mainApplicantInfo
}
}
}
var _currentStep = 0 var _currentStep = 0
var currentStep:Int { var currentStep:Int {
......
...@@ -13,6 +13,8 @@ import SwifterSwift ...@@ -13,6 +13,8 @@ import SwifterSwift
class YHSpousePrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol { class YHSpousePrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol {
var spouse:YHFamilyMember? var spouse:YHFamilyMember?
var mainApplicantInfo: YHMyMainApplicantInfoModel?
weak var delegate:YHSpouseInfoVCProtocol? weak var delegate:YHSpouseInfoVCProtocol?
// 是否显示未填写错误提示 // 是否显示未填写错误提示
var isNeedShowError = false var isNeedShowError = false
...@@ -117,10 +119,21 @@ class YHSpousePrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol { ...@@ -117,10 +119,21 @@ class YHSpousePrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol {
// 港澳通信证 // 港澳通信证
var isHiddenHK = true var isHiddenHK = true
if spouse.nationality.contains("中国") { // 中国国籍 if spouse.nationality.contains("中国") { // 中国国籍
let isLiveInChina = spouse.address.country.contains("中国".local) if spouse.isLiveTother() { // 与主申请人同住
if isLiveInChina || (!isLiveInChina && !spouse.isOverSeasOver1Year()) { if let mainApplicantInfo = mainApplicantInfo {
// 中国国籍&居住国内、中国国籍&居住国外不满一年 需展示“港澳通行证”询问框 let isLiveInChina = mainApplicantInfo.applicant_address.country.contains("中国".local)
isHiddenHK = false if isLiveInChina || (!isLiveInChina && !mainApplicantInfo.isOverSeasOver1Year()) {
// 中国国籍&居住国内、中国国籍&居住国外不满一年 需展示“港澳通行证”询问框
isHiddenHK = false
}
}
} else { // 不与主申请人同住
let isLiveInChina = spouse.address.country.contains("中国".local)
if isLiveInChina || (!isLiveInChina && !spouse.isOverSeasOver1Year()) {
// 中国国籍&居住国内、中国国籍&居住国外不满一年 需展示“港澳通行证”询问框
isHiddenHK = false
}
} }
} }
......
...@@ -592,38 +592,40 @@ extension YHFamilyMemberInfoListVC : UITableViewDelegate, UITableViewDataSource ...@@ -592,38 +592,40 @@ extension YHFamilyMemberInfoListVC : UITableViewDelegate, UITableViewDataSource
// 配偶 // 配偶
if detailItem.relationType == .spouse { if detailItem.relationType == .spouse {
let vc = YHSpouseInfoContainerVC() let vc = YHSpouseInfoContainerVC()
vc.spouse = detailItem vc.spouse = detailItem
vc.orderId = orderId vc.mainApplicantInfo = self.familyMemberInfo?.applicant
self.navigationController?.pushViewController(vc) vc.orderId = orderId
return self.navigationController?.pushViewController(vc)
return
} }
// 父母 // 父母
if detailItem.relationType == .father || detailItem.relationType == .mother { if detailItem.relationType == .father || detailItem.relationType == .mother {
let vc = YHParentInfoVC() let vc = YHParentInfoVC()
vc.parentInfo = detailItem vc.parentInfo = detailItem
vc.orderId = orderId vc.orderId = orderId
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
return return
} }
// 子女 // 子女
if detailItem.relationType == .child { if detailItem.relationType == .child {
let vc = YHChildInfoContainerVC() let vc = YHChildInfoContainerVC()
vc.child = detailItem vc.child = detailItem
vc.orderId = orderId vc.mainApplicantInfo = self.familyMemberInfo?.applicant
self.navigationController?.pushViewController(vc) vc.orderId = orderId
return self.navigationController?.pushViewController(vc)
return
} }
// 兄弟姐妹 // 兄弟姐妹
if detailItem.relationType == .brother { if detailItem.relationType == .brother {
let vc = YHBrotherInfoVC() let vc = YHBrotherInfoVC()
vc.orderId = orderId vc.orderId = orderId
vc.brotherInfo = detailItem vc.brotherInfo = detailItem
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
return return
} }
} }
......
...@@ -539,6 +539,7 @@ class YHFormDetailItem : YHFormItemProtocol { ...@@ -539,6 +539,7 @@ class YHFormDetailItem : YHFormItemProtocol {
/* ***** ***** ***** ***** ***** ***** ***** ***** */ /* ***** ***** ***** ***** ***** ***** ***** ***** */
// MARK: - 家庭成员 YHData // MARK: - 家庭成员 YHData
class YHFamilyMemberGroupInfo: SmartCodable { class YHFamilyMemberGroupInfo: SmartCodable {
...@@ -547,6 +548,7 @@ class YHFamilyMemberGroupInfo: SmartCodable { ...@@ -547,6 +548,7 @@ class YHFamilyMemberGroupInfo: SmartCodable {
var spouse: YHFamilyMember? var spouse: YHFamilyMember?
var child: [YHFamilyMember]? var child: [YHFamilyMember]?
var brother: [YHFamilyMember]? var brother: [YHFamilyMember]?
var applicant: YHMyMainApplicantInfoModel?
enum CodingKeys: String, CodingKey { enum CodingKeys: String, CodingKey {
case father = "father" case father = "father"
...@@ -554,6 +556,7 @@ class YHFamilyMemberGroupInfo: SmartCodable { ...@@ -554,6 +556,7 @@ class YHFamilyMemberGroupInfo: SmartCodable {
case spouse = "spouse" case spouse = "spouse"
case brother = "brother" case brother = "brother"
case child = "child" case child = "child"
case applicant = "applicant"
} }
func checkDefaultValue() -> Self { func checkDefaultValue() -> Self {
...@@ -589,7 +592,23 @@ enum YHFamilyMemberType: Int { ...@@ -589,7 +592,23 @@ enum YHFamilyMemberType: Int {
case brother = 5 case brother = 5
} }
class YHMyMainApplicantInfoModel: SmartCodable {
var applicant_address: YHAddress = YHAddress()
var address_aboard: Int = 0
// 是否在海外居住满1年及以上 1:是 2:否
var is_live_oversea_year: Int = 2
// 是否在海外居住满1年及以上
func isOverSeasOver1Year() -> Bool {
return self.is_live_oversea_year == 1
}
required init() {
}
}
class YHFamilyMember: SmartCodable, YHFormItemProtocol { class YHFamilyMember: SmartCodable, YHFormItemProtocol {
......
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