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,12 +115,23 @@ class YHChildPrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol { ...@@ -113,12 +115,23 @@ class YHChildPrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol {
// 港澳通信证 // 港澳通信证
var isHiddenHK = true var isHiddenHK = true
if child.nationality.contains("中国") { // 中国国籍 if child.nationality.contains("中国") { // 中国国籍
if child.isLiveTother() { // 与主申请人同住
if let mainApplicantInfo = mainApplicantInfo {
let isLiveInChina = mainApplicantInfo.applicant_address.country.contains("中国".local)
if isLiveInChina || (!isLiveInChina && !mainApplicantInfo.isOverSeasOver1Year()) {
// 中国国籍&居住国内、中国国籍&居住国外不满一年 需展示“港澳通行证”询问框
isHiddenHK = false
}
}
} else { // 不与主申请人同住
let isLiveInChina = child.address.country.contains("中国".local) let isLiveInChina = child.address.country.contains("中国".local)
if isLiveInChina || (!isLiveInChina && !child.isOverSeasOver1Year()) { if isLiveInChina || (!isLiveInChina && !child.isOverSeasOver1Year()) {
// 中国国籍&居住国内、中国国籍&居住国外不满一年 需展示“港澳通行证”询问框 // 中国国籍&居住国内、中国国籍&居住国外不满一年 需展示“港澳通行证”询问框
isHiddenHK = false isHiddenHK = false
} }
} }
}
if !isHiddenHK { if !isHiddenHK {
let title3 = YHFormTitleItem(type: .hkAndMacaoPassport) let title3 = YHFormTitleItem(type: .hkAndMacaoPassport)
......
...@@ -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,12 +119,23 @@ class YHSpousePrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol { ...@@ -117,12 +119,23 @@ class YHSpousePrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol {
// 港澳通信证 // 港澳通信证
var isHiddenHK = true var isHiddenHK = true
if spouse.nationality.contains("中国") { // 中国国籍 if spouse.nationality.contains("中国") { // 中国国籍
if spouse.isLiveTother() { // 与主申请人同住
if let mainApplicantInfo = mainApplicantInfo {
let isLiveInChina = mainApplicantInfo.applicant_address.country.contains("中国".local)
if isLiveInChina || (!isLiveInChina && !mainApplicantInfo.isOverSeasOver1Year()) {
// 中国国籍&居住国内、中国国籍&居住国外不满一年 需展示“港澳通行证”询问框
isHiddenHK = false
}
}
} else { // 不与主申请人同住
let isLiveInChina = spouse.address.country.contains("中国".local) let isLiveInChina = spouse.address.country.contains("中国".local)
if isLiveInChina || (!isLiveInChina && !spouse.isOverSeasOver1Year()) { if isLiveInChina || (!isLiveInChina && !spouse.isOverSeasOver1Year()) {
// 中国国籍&居住国内、中国国籍&居住国外不满一年 需展示“港澳通行证”询问框 // 中国国籍&居住国内、中国国籍&居住国外不满一年 需展示“港澳通行证”询问框
isHiddenHK = false isHiddenHK = false
} }
} }
}
if !isHiddenHK { if !isHiddenHK {
let title3 = YHFormTitleItem(type: .hkAndMacaoPassport) let title3 = YHFormTitleItem(type: .hkAndMacaoPassport)
......
...@@ -594,6 +594,7 @@ extension YHFamilyMemberInfoListVC : UITableViewDelegate, UITableViewDataSource ...@@ -594,6 +594,7 @@ 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.mainApplicantInfo = self.familyMemberInfo?.applicant
vc.orderId = orderId vc.orderId = orderId
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
return return
...@@ -612,6 +613,7 @@ extension YHFamilyMemberInfoListVC : UITableViewDelegate, UITableViewDataSource ...@@ -612,6 +613,7 @@ extension YHFamilyMemberInfoListVC : UITableViewDelegate, UITableViewDataSource
if detailItem.relationType == .child { if detailItem.relationType == .child {
let vc = YHChildInfoContainerVC() let vc = YHChildInfoContainerVC()
vc.child = detailItem vc.child = detailItem
vc.mainApplicantInfo = self.familyMemberInfo?.applicant
vc.orderId = orderId vc.orderId = orderId
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