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

// 预览

parent d327dcb2
...@@ -1188,7 +1188,35 @@ private extension YHPreviewViewModel { ...@@ -1188,7 +1188,35 @@ private extension YHPreviewViewModel {
arrDataForFamilyInfo = arrDataForParents arrDataForFamilyInfo = arrDataForParents
} }
private func installDataForSpouseOp(model : YHFamilyMember) { func isNeedHiddenHKPassportInfo(familyMember: YHFamilyMember, applicant: YHMyMainApplicantInfoModel?) -> Bool {
// 港澳通信证
var isHiddenHK = true
// 国籍
let nationality = familyMember.nationality
// 居住国家
var liveCountry = familyMember.address.country
// 居住海外是否满一年
var isLiveOverseaYear = familyMember.isOverSeasOver1Year()
if familyMember.isLiveTother(), let mainApplicantInfo = applicant {
// 与主申请人同住需要用主申请人居住信息判断
liveCountry = mainApplicantInfo.applicant_address.country
isLiveOverseaYear = mainApplicantInfo.isOverSeasOver1Year()
}
if nationality.contains("中国") { // 中国国籍
let isLiveInChina = liveCountry.contains("中国".local)
if isLiveInChina || (!isLiveInChina && !isLiveOverseaYear) {
// 中国国籍&居住国内、中国国籍&居住国外不满一年 需展示“港澳通行证”询问框
isHiddenHK = false
}
}
return isHiddenHK
}
private func installDataForSpouseOp(model : YHFamilyMember, mainApplicant: YHMyMainApplicantInfoModel?) {
var arrTemp : [YHPreviewInfoSessionModel] = [] var arrTemp : [YHPreviewInfoSessionModel] = []
do { do {
...@@ -1196,10 +1224,20 @@ private extension YHPreviewViewModel { ...@@ -1196,10 +1224,20 @@ private extension YHPreviewViewModel {
do { do {
//随行信息 - 是 //随行信息 - 是
var arr = [YHPreviewQuestionAndAnswerModel]()
let tmp0 = YHPreviewQuestionAndAnswerModel(question: "是否随行至香港:", answer: "是") let tmp0 = YHPreviewQuestionAndAnswerModel(question: "是否随行至香港:", answer: "是")
arr.append(tmp0)
let tmp1 = YHPreviewQuestionAndAnswerModel(question: "国家/国籍:", answer: model.nationality) let tmp1 = YHPreviewQuestionAndAnswerModel(question: "国家/国籍:", answer: model.nationality)
let tmp2 = YHPreviewQuestionAndAnswerModel(question: "港澳通行证:", answer: model.isHandled == 1 ? "已办理" : "未办理") arr.append(tmp1)
let arr = [tmp0,tmp1,tmp2]
if !isNeedHiddenHKPassportInfo(familyMember: model, applicant: mainApplicant) {
let tmp2 = YHPreviewQuestionAndAnswerModel(question: "港澳通行证:", answer: model.isHandled == 1 ? "已办理" : "未办理")
arr.append(tmp2)
}
let model1 = YHPreviewInfoSessionModel(cellType: .countryInfoType, cellTitle: "随行信息", cellData0: arr) let model1 = YHPreviewInfoSessionModel(cellType: .countryInfoType, cellTitle: "随行信息", cellData0: arr)
arrTemp.append(model1) arrTemp.append(model1)
} }
...@@ -1263,6 +1301,11 @@ private extension YHPreviewViewModel { ...@@ -1263,6 +1301,11 @@ private extension YHPreviewViewModel {
arr.append(tmp13) arr.append(tmp13)
let isHKIdCardHandled = model.isHaveHKIdentityCard()
let isHKIdCardHandledString = isHKIdCardHandled ? "是" : "否"
let tmp14 = YHPreviewQuestionAndAnswerModel(question: "是否办理过香港身份证:", answer: isHKIdCardHandledString)
arr.append(tmp14)
if let tmp = model.hkIdentityCard,tmp.isEmpty == false { if let tmp = model.hkIdentityCard,tmp.isEmpty == false {
let tmp17 = YHPreviewQuestionAndAnswerModel(question: "香港身份证号码:", answer: tmp) let tmp17 = YHPreviewQuestionAndAnswerModel(question: "香港身份证号码:", answer: tmp)
arr.append(tmp17) arr.append(tmp17)
...@@ -1299,6 +1342,12 @@ private extension YHPreviewViewModel { ...@@ -1299,6 +1342,12 @@ private extension YHPreviewViewModel {
var arr = [tmp0,tmp1,tmp2,tmp3,tmp4] var arr = [tmp0,tmp1,tmp2,tmp3,tmp4]
let isHKIdCardHandled = model.isHaveHKIdentityCard()
let isHKIdCardHandledString = isHKIdCardHandled ? "是" : "否"
let tmp5 = YHPreviewQuestionAndAnswerModel(question: "是否办理过香港身份证:", answer: isHKIdCardHandledString)
arr.append(tmp5)
if let card = model.hkIdentityCard,card.isEmpty == false { if let card = model.hkIdentityCard,card.isEmpty == false {
let tmp6 = YHPreviewQuestionAndAnswerModel(question: "香港身份证号码:", answer: model.hkIdentityCard ?? "--") let tmp6 = YHPreviewQuestionAndAnswerModel(question: "香港身份证号码:", answer: model.hkIdentityCard ?? "--")
arr.append(tmp6) arr.append(tmp6)
...@@ -1399,20 +1448,31 @@ private extension YHPreviewViewModel { ...@@ -1399,20 +1448,31 @@ private extension YHPreviewViewModel {
return return
} }
arrDataForSpouse.removeAll() arrDataForSpouse.removeAll()
installDataForSpouseOp(model: model) installDataForSpouseOp(model: model, mainApplicant: familyInfoPreviewModel?.applicant)
} }
private func installDataForChildOp(model : YHFamilyMember,childIndex : Int, totalChild : Int = 0) { private func installDataForChildOp(model : YHFamilyMember, mainApplicant:YHMyMainApplicantInfoModel?, childIndex : Int, totalChild : Int = 0) {
var arrTemp : [YHPreviewInfoSessionModel] = [] var arrTemp : [YHPreviewInfoSessionModel] = []
do { do {
if model.follow == 1 { if model.follow == 1 {
do { do {
//随行信息 - 是 //随行信息 - 是
var arr = [YHPreviewQuestionAndAnswerModel]()
let tmp00 = YHPreviewQuestionAndAnswerModel(question: "主申请人或现配偶是否拥有孩子护养权:", answer:model.custody == 1 ? "是" : "否") let tmp00 = YHPreviewQuestionAndAnswerModel(question: "主申请人或现配偶是否拥有孩子护养权:", answer:model.custody == 1 ? "是" : "否")
arr.append(tmp00)
let tmp0 = YHPreviewQuestionAndAnswerModel(question: "该子女是否随行至香港:", answer: "是") let tmp0 = YHPreviewQuestionAndAnswerModel(question: "该子女是否随行至香港:", answer: "是")
arr.append(tmp0)
let tmp1 = YHPreviewQuestionAndAnswerModel(question: "国家/国籍:", answer: model.nationality) let tmp1 = YHPreviewQuestionAndAnswerModel(question: "国家/国籍:", answer: model.nationality)
let tmp2 = YHPreviewQuestionAndAnswerModel(question: "港澳通行证:", answer: model.isHandled == 1 ? "已办理" : "未办理") arr.append(tmp1)
let arr = [tmp00,tmp0,tmp1,tmp2]
if !isNeedHiddenHKPassportInfo(familyMember: model, applicant: mainApplicant) {
let tmp2 = YHPreviewQuestionAndAnswerModel(question: "港澳通行证:", answer: model.isHandled == 1 ? "已办理" : "未办理")
arr.append(tmp2)
}
var title = "" var title = ""
if totalChild > 1 { if totalChild > 1 {
...@@ -1516,20 +1576,16 @@ private extension YHPreviewViewModel { ...@@ -1516,20 +1576,16 @@ private extension YHPreviewViewModel {
arr.append(contentsOf: [tmp14,tmp15]) arr.append(contentsOf: [tmp14,tmp15])
} }
let isHKIdCardHandled = model.isHaveHKIdentityCard()
let isHKIdCardHandledString = isHKIdCardHandled ? "是" : "否"
let tmp16 = YHPreviewQuestionAndAnswerModel(question: "是否办理过香港身份证:", answer: isHKIdCardHandledString)
arr.append(tmp16)
if let tmp = model.hkIdentityCard, tmp.isEmpty == false {
if let tmp = model.hkIdentityCard,tmp.isEmpty == false {
let tmp16 = YHPreviewQuestionAndAnswerModel(question: "是否办理过香港身份证:", answer: "是")
arr.append(tmp16)
let tmp17 = YHPreviewQuestionAndAnswerModel(question: "香港身份证号码:", answer: tmp) let tmp17 = YHPreviewQuestionAndAnswerModel(question: "香港身份证号码:", answer: tmp)
arr.append(tmp17) arr.append(tmp17)
} else {
let tmp16 = YHPreviewQuestionAndAnswerModel(question: "是否办理过香港身份证:", answer: "否")
arr.append(tmp16)
} }
var title = "" var title = ""
if totalChild > 1 { if totalChild > 1 {
title = String(childIndex + 1) title = String(childIndex + 1)
...@@ -1586,14 +1642,14 @@ private extension YHPreviewViewModel { ...@@ -1586,14 +1642,14 @@ private extension YHPreviewViewModel {
arr.append(tmp5) arr.append(tmp5)
} }
let isHKIdCardHandled = model.isHaveHKIdentityCard()
let isHKIdCardHandledString = isHKIdCardHandled ? "是" : "否"
let tmp5 = YHPreviewQuestionAndAnswerModel(question: "是否办理过香港身份证:", answer: isHKIdCardHandledString)
arr.append(tmp5)
if let card = model.hkIdentityCard,card.isEmpty == false { if let card = model.hkIdentityCard,card.isEmpty == false {
let tmp5 = YHPreviewQuestionAndAnswerModel(question: "是否办理过香港身份证:", answer: "是")
let tmp6 = YHPreviewQuestionAndAnswerModel(question: "香港身份证号码:", answer: model.hkIdentityCard ?? "--") let tmp6 = YHPreviewQuestionAndAnswerModel(question: "香港身份证号码:", answer: model.hkIdentityCard ?? "--")
arr.append(tmp5)
arr.append(tmp6) arr.append(tmp6)
} else {
let tmp5 = YHPreviewQuestionAndAnswerModel(question: "是否办理过香港身份证:", answer: "否")
arr.append(tmp5)
} }
...@@ -1730,7 +1786,7 @@ private extension YHPreviewViewModel { ...@@ -1730,7 +1786,7 @@ private extension YHPreviewViewModel {
} }
arrDataForChildren.removeAll() arrDataForChildren.removeAll()
for(index,model) in model1.enumerated() { for(index,model) in model1.enumerated() {
installDataForChildOp(model: model, childIndex:index,totalChild: model1.count) installDataForChildOp(model: model, mainApplicant: familyInfoPreviewModel?.applicant, childIndex:index,totalChild: model1.count)
} }
} }
......
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