Commit 3df06285 authored by David黄金龙's avatar David黄金龙

处理 小的展示问题

parent b3ac3f78
......@@ -47,25 +47,18 @@ private extension YHPreviewFamilyMemberViewController {
make.height.equalTo(56)
}
parentButton = createButton()
parentButton.setTitle("父母", for: .normal)
buttonHoldView.addSubview(parentButton)
parentButton.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalToSuperview()
make.height.equalTo(32)
make.width.equalTo(68)
}
spouseButton = createButton()
spouseButton.setTitle("配偶", for: .normal)
buttonHoldView.addSubview(spouseButton)
spouseButton.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalTo(parentButton.snp.right).offset(12)
make.left.equalToSuperview()
make.height.equalTo(32)
make.width.equalTo(68)
}
childrenButton = createButton()
......@@ -79,12 +72,27 @@ private extension YHPreviewFamilyMemberViewController {
}
parentButton = createButton()
parentButton.setTitle("父母", for: .normal)
buttonHoldView.addSubview(parentButton)
parentButton.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalTo(childrenButton.snp.right).offset(12)
make.height.equalTo(32)
make.width.equalTo(68)
}
brotherButton = createButton()
brotherButton.setTitle("兄弟姐妹", for: .normal)
buttonHoldView.addSubview(brotherButton)
brotherButton.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalTo(childrenButton.snp.right).offset(12)
make.left.equalTo(parentButton.snp.right).offset(12)
make.height.equalTo(32)
make.width.equalTo(84)
}
......@@ -113,6 +121,112 @@ private extension YHPreviewFamilyMemberViewController {
}
}
private func layouButtons() {
spouseButton.snp.removeConstraints()
childrenButton.snp.removeConstraints()
parentButton.snp.removeConstraints()
brotherButton.snp.removeConstraints()
var lastTagView : UIView? = nil
//配偶
if previewVM.arrDataForSpouse.isEmpty == false {
spouseButton.isHidden = false
spouseButton.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalToSuperview()
make.height.equalTo(32)
make.width.equalTo(68)
}
lastTagView = spouseButton
} else {
spouseButton.isHidden = true
}
//子女
if previewVM.arrDataForChildren.isEmpty == false {
childrenButton.isHidden = false
if let lastTagView = lastTagView {
childrenButton.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalTo(lastTagView.snp.right).offset(12)
make.height.equalTo(32)
make.width.equalTo(68)
}
} else {
childrenButton.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalToSuperview()
make.height.equalTo(32)
make.width.equalTo(68)
}
}
lastTagView = childrenButton
} else {
childrenButton.isHidden = true
}
//父母
if previewVM.arrDataForParents.isEmpty == false {
parentButton.isHidden = false
if let lastTagView = lastTagView {
parentButton.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalTo(lastTagView.snp.right).offset(12)
make.height.equalTo(32)
make.width.equalTo(68)
}
} else {
parentButton.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalToSuperview()
make.height.equalTo(32)
make.width.equalTo(68)
}
}
lastTagView = parentButton
} else {
parentButton.isHidden = true
}
//兄弟姐妹
if previewVM.arrDataForBrother.isEmpty == false {
brotherButton.isHidden = false
if let lastTagView = lastTagView {
brotherButton.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalTo(lastTagView.snp.right).offset(12)
make.height.equalTo(32)
make.width.equalTo(68)
}
} else {
brotherButton.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalToSuperview()
make.height.equalTo(32)
make.width.equalTo(68)
}
}
lastTagView = brotherButton
} else {
brotherButton.isHidden = true
}
}
func createButton() -> UIButton {
let btn = UIButton(type: .custom)
btn.backgroundColor = UIColor.white
......@@ -163,12 +277,14 @@ private extension YHPreviewFamilyMemberViewController {
} else {
}
self.layouButtons()
self.homeTableView.reloadData()
return
}
} else {
printLog("error : orderID 为空")
}
self.layouButtons()
self.homeTableView.reloadData()
}
}
......
......@@ -17,6 +17,11 @@ class YHPreviewMainApplicantInfoViewController: YHPreviewBaseViewController {
setupUI()
loadData()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
homeTableView.reloadData()
}
}
private extension YHPreviewMainApplicantInfoViewController {
......
......@@ -69,10 +69,17 @@ extension YHPreviewInfoNameAndSubNameItemView {
nameLable.snp.remakeConstraints { make in
make.top.equalToSuperview().offset(18)
make.left.equalToSuperview()
make.width.lessThanOrEqualTo(200)
make.width.lessThanOrEqualTo(240)
make.height.equalTo(20)
}
nameLable.setContentCompressionResistancePriority(.required, for: .horizontal)
} else if title.contains("主申请人或现配偶是否拥有孩子护养权:") {
nameLable.snp.remakeConstraints { make in
make.top.equalToSuperview().offset(18)
make.left.equalToSuperview()
make.width.lessThanOrEqualTo(260)
make.height.equalTo(20)
}
}
}
}
......
......@@ -435,9 +435,9 @@ private extension YHPreviewViewModel {
}
if let card = model.hk_id,card.has.isEmpty == false {
if let card = model.hk_id,card.has.contains("是") {
let tmp5 = YHPreviewQuestionAndAnswerModel(question: "是否办理过香港身份证:", answer: "是")
let tmp6 = YHPreviewQuestionAndAnswerModel(question: "香港身份证号码:", answer: card.number.isEmpty ? "--" : card.number)
let tmp6 = YHPreviewQuestionAndAnswerModel(question: "香港身份证号码:", answer: card.number.defaultStringIfEmpty())
arr.append(tmp5)
arr.append(tmp6)
} else {
......@@ -453,31 +453,23 @@ private extension YHPreviewViewModel {
do {
//中国身份证
var str = model2.cnIdentityCard.number
if str.isEmpty {
str = "无"
}
let tmp0 = YHPreviewQuestionAndAnswerModel(question: "中国身份证号码:", answer: str)
let tmp0 = YHPreviewQuestionAndAnswerModel(question: "中国身份证号码:", answer: str.defaultStringIfEmpty())
str = model2.cnIdentityCard.issueAt
if str.isEmpty {
str = "无"
}
let tmp1 = YHPreviewQuestionAndAnswerModel(question: "签发地:", answer: str)
str = model2.cnIdentityCard.issueAt
if str.isEmpty {
str = "无"
}
let tmp2 = YHPreviewQuestionAndAnswerModel(question: "签发日期:", answer: str)
let tmp1 = YHPreviewQuestionAndAnswerModel(question: "签发地:", answer: str.defaultStringIfEmpty())
str = model2.cnIdentityCard.issueDateStartAt
let tmp2 = YHPreviewQuestionAndAnswerModel(question: "签发日期:", answer: str.defaultStringIfEmpty())
str = model2.cnIdentityCard.issueDateEndAt
if str.isEmpty {
str = ""
str = ""
} else {
if str == "8888-01-01" {
str = "长期"
str = "至今"
}
}
let tmp3 = YHPreviewQuestionAndAnswerModel(question: "届满日期:", answer: str)
let tmp3 = YHPreviewQuestionAndAnswerModel(question: "届满日期:", answer: str.defaultStringIfEmpty())
let model0 = YHPersonInfoCellModel1(cellTitle: "中国身份证", cellData: [tmp0,tmp1,tmp2,tmp3])
......@@ -485,32 +477,23 @@ private extension YHPreviewViewModel {
//港澳通行证
if model.is_handled == 1 {
str = model2.hkMacaoPass.number
if str.isEmpty {
str = "无"
}
let tmp4 = YHPreviewQuestionAndAnswerModel(question: "旅行社证件号码:", answer: str)
let tmp4 = YHPreviewQuestionAndAnswerModel(question: "旅行社证件号码:", answer: str.defaultStringIfEmpty())
str = model2.hkMacaoPass.issueAt
if str.isEmpty {
str = "无"
}
let tmp5 = YHPreviewQuestionAndAnswerModel(question: "签发地:", answer: str)
str = model2.hkMacaoPass.issueDateEndAt
if str.isEmpty {
str = "无"
}
let tmp6 = YHPreviewQuestionAndAnswerModel(question: "签发日期:", answer: str)
let tmp5 = YHPreviewQuestionAndAnswerModel(question: "签发地:", answer: str.defaultStringIfEmpty())
str = model2.hkMacaoPass.issueDateStartAt
let tmp6 = YHPreviewQuestionAndAnswerModel(question: "签发日期:", answer: str.defaultStringIfEmpty())
str = model2.hkMacaoPass.issueDateEndAt
if str.isEmpty {
str = ""
str = ""
} else {
if str == "8888-01-01" {
str = "长期"
str = "至今"
}
}
let tmp7 = YHPreviewQuestionAndAnswerModel(question: "届满日期:", answer: str)
let tmp7 = YHPreviewQuestionAndAnswerModel(question: "届满日期:", answer: str.defaultStringIfEmpty())
let model1 = YHPersonInfoCellModel1(cellTitle: "港澳通行证", cellData: [tmp4,tmp5,tmp6,tmp7])
arr.append(model1)
}
......@@ -528,26 +511,21 @@ private extension YHPreviewViewModel {
let tmp9 = YHPreviewQuestionAndAnswerModel(question: "证件号码:", answer: str)
str = model2.passport.issueAt
if str.isEmpty {
str = "无"
}
let tmp10 = YHPreviewQuestionAndAnswerModel(question: "签发地:", answer: "北京市分局")
let tmp10 = YHPreviewQuestionAndAnswerModel(question: "签发地:", answer: str.defaultStringIfEmpty())
str = model2.passport.issueDateStartAt
if str.isEmpty {
str = "无"
}
let tmp11 = YHPreviewQuestionAndAnswerModel(question: "签发日期:", answer: str)
let tmp11 = YHPreviewQuestionAndAnswerModel(question: "签发日期:", answer: str.defaultStringIfEmpty())
str = model2.passport.issueDateEndAt
if str.isEmpty {
str = ""
str = ""
} else {
if str == "8888-01-01" {
str = "长期"
str = "至今"
}
}
let tmp12 = YHPreviewQuestionAndAnswerModel(question: "届满日期:", answer: str)
let tmp12 = YHPreviewQuestionAndAnswerModel(question: "届满日期:", answer: str.defaultStringIfEmpty())
let model2 = YHPersonInfoCellModel1(cellTitle: "护照及其他旅行证件", cellData: [tmp8,tmp9,tmp10,tmp11,tmp12])
arr.append(model2)
}
......@@ -673,7 +651,7 @@ private extension YHPreviewViewModel {
msg = msg.defaultStringIfEmpty()
}
let remark0 = answer0 == "满足" ? msg : nil
let tmp0 = YHPreviewQuestionAndAnswerModel(question: "1、至少一名直系家庭成员(已婚配偶、父母、兄弟姐妹、子女)是现居于香港的香港永久性居民", answer:answer0,remark: remark0) //需要完善 for test hjl todo???
let tmp0 = YHPreviewQuestionAndAnswerModel(question: "1、至少一名直系家庭成员(已婚配偶、父母、兄弟姐妹、子女)是现居于香港的香港永久性居民", answer:answer0,remark: remark0)
let arr = [tmp0]
let model1 = YHPreviewInfoSessionModel(cellType: .questionAndAnswer, cellTitle: "家庭背景", cellData0: arr)
arrDataForBasicInfo.append(model1)
......@@ -831,11 +809,16 @@ private extension YHPreviewViewModel {
let tmp4 = YHPreviewQuestionAndAnswerModel(question: "职业:", answer: model.occupation)
var arr = [tmp0,tmp1,tmp2,tmp3,tmp11,tmp4]
if model.occupation.contains("在职") {
let tmp5 = YHPreviewQuestionAndAnswerModel(question: "职业名称:", answer: model.occupationName)
arr.append(tmp5)
}
let tmp6 = YHPreviewQuestionAndAnswerModel(question: "现居住国家/地区:", answer: model.liveCountry)
arr.append(tmp6)
var arr = [tmp0,tmp1,tmp2,tmp3,tmp11,tmp4,tmp5,tmp6]
// var arr = [tmp0,tmp1,tmp2,tmp3,tmp11,tmp4,tmp5,tmp6]
if let card = model.hkIdentityCard,card.isEmpty == false {
let tmp5 = YHPreviewQuestionAndAnswerModel(question: "是否办理过香港身份证:", answer: "是")
let tmp6 = YHPreviewQuestionAndAnswerModel(question: "香港身份证号码:", answer: model.hkIdentityCard ?? "--")
......@@ -899,11 +882,16 @@ private extension YHPreviewViewModel {
let tmp11 = YHPreviewQuestionAndAnswerModel(question: "婚姻状况:", answer: model.married)
let tmp4 = YHPreviewQuestionAndAnswerModel(question: "职业:", answer: model.occupation)
var arr = [tmp0,tmp1,tmp2,tmp3,tmp11,tmp4]
if model.occupation.contains("在职") {
let tmp5 = YHPreviewQuestionAndAnswerModel(question: "职业名称:", answer: model.occupationName)
arr.append(tmp5)
}
let tmp6 = YHPreviewQuestionAndAnswerModel(question: "现居住国家/地区:", answer: model.liveCountry)
arr.append(tmp6)
var arr = [tmp0,tmp1,tmp2,tmp3,tmp11,tmp4,tmp5,tmp6]
// var arr = [tmp0,tmp1,tmp2,tmp3,tmp11,tmp4,tmp5,tmp6]
if let card = model.hkIdentityCard,card.isEmpty == false {
let tmp5 = YHPreviewQuestionAndAnswerModel(question: "是否办理过香港身份证:", answer: "是")
let tmp6 = YHPreviewQuestionAndAnswerModel(question: "香港身份证号码:", answer: model.hkIdentityCard ?? "--")
......@@ -1026,13 +1014,20 @@ private extension YHPreviewViewModel {
}
let tmp4 = YHPreviewQuestionAndAnswerModel(question: "出生城市:", answer: city)
let tmp5 = YHPreviewQuestionAndAnswerModel(question: "职业:", answer: model.occupation)
let tmp6 = YHPreviewQuestionAndAnswerModel(question: "职业名称:", answer: model.occupationName)
var arr = [tmp0,tmp1,tmp2,tmp3,tmp4,tmp5]
if model.occupation.contains("在职") {
let tmp5 = YHPreviewQuestionAndAnswerModel(question: "职业名称:", answer: model.occupationName)
arr.append(tmp5)
}
let tmp7 = YHPreviewQuestionAndAnswerModel(question: "是否拥有学位:", answer: model.hasDegree == "1" ? "有学位" : "无学位")
arr.append(tmp7)
var arr = [tmp0,tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7]
// var arr = [tmp0,tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7]
if model.hasDegree == "1" {
for(index,item) in model.hasDegreeJson.enumerated() {
......@@ -1085,7 +1080,7 @@ private extension YHPreviewViewModel {
if model.hkIdentity.isEmpty == false {
let tmp14 = YHPreviewQuestionAndAnswerModel(question: "获准逗留至:", answer: model.childInHk.info)
let tmp15 = YHPreviewQuestionAndAnswerModel(question: "在港身份:", answer: model.hkIdentity == "其他" ? (model.hkIdentityOther.isEmpty ? "其他" : model.hkIdentityOther) : model.hkIdentity)
let tmp15 = YHPreviewQuestionAndAnswerModel(question: "在港身份:", answer: model.hkIdentity == "其他" ? (model.hkIdentityOther.defaultStringIfEmpty(detaultValue: "其他")) : model.hkIdentity)
arr.append(contentsOf: [tmp14,tmp15])
}
......@@ -1101,7 +1096,7 @@ private extension YHPreviewViewModel {
let tmp16 = YHPreviewQuestionAndAnswerModel(question: "是否办理过香港身份证:", answer: "否")
arr.append(tmp16)
}
let model2 = YHPreviewInfoSessionModel(cellType: .countryInfoType, cellTitle: "基本信息", cellData0: arr)
let model2 = YHPreviewInfoSessionModel(cellType: .countryInfoType, cellTitle: "配偶信息", cellData0: arr)
arrTemp.append(model2)
}
}
......@@ -1112,31 +1107,22 @@ private extension YHPreviewViewModel {
do {
//中国身份证
var str = model.certificates.cnIdentityCard.number
if str.isEmpty {
str = "无"
}
let tmp0 = YHPreviewQuestionAndAnswerModel(question: "中国身份证号码:", answer: str)
let tmp0 = YHPreviewQuestionAndAnswerModel(question: "中国身份证号码:", answer: str.defaultStringIfEmpty())
str = model.certificates.cnIdentityCard.issueAt
if str.isEmpty {
str = "无"
}
let tmp1 = YHPreviewQuestionAndAnswerModel(question: "签发地:", answer: str)
str = model.certificates.cnIdentityCard.issueAt
if str.isEmpty {
str = "无"
}
let tmp2 = YHPreviewQuestionAndAnswerModel(question: "签发日期:", answer: str)
let tmp1 = YHPreviewQuestionAndAnswerModel(question: "签发地:", answer: str.defaultStringIfEmpty())
str = model.certificates.cnIdentityCard.issueDateStartAt
let tmp2 = YHPreviewQuestionAndAnswerModel(question: "签发日期:", answer: str.defaultStringIfEmpty())
str = model.certificates.cnIdentityCard.issueDateEndAt
if str.isEmpty {
str = ""
str = ""
} else {
if str == "8888-01-01" {
str = "长期"
str = "至今"
}
}
let tmp3 = YHPreviewQuestionAndAnswerModel(question: "届满日期:", answer: str)
let tmp3 = YHPreviewQuestionAndAnswerModel(question: "届满日期:", answer: str.defaultStringIfEmpty())
let model0 = YHPersonInfoCellModel1(cellTitle: "中国身份证", cellData: [tmp0,tmp1,tmp2,tmp3])
......@@ -1144,32 +1130,23 @@ private extension YHPreviewViewModel {
//港澳通行证
if model.isHandled == 1 {
str = model.certificates.hkMacaoPass.number
if str.isEmpty {
str = "无"
}
let tmp4 = YHPreviewQuestionAndAnswerModel(question: "旅行社证件号码:", answer: str)
let tmp4 = YHPreviewQuestionAndAnswerModel(question: "旅行社证件号码:", answer: str.defaultStringIfEmpty())
str = model.certificates.hkMacaoPass.issueAt
if str.isEmpty {
str = "无"
}
let tmp5 = YHPreviewQuestionAndAnswerModel(question: "签发地:", answer: str)
let tmp5 = YHPreviewQuestionAndAnswerModel(question: "签发地:", answer: str.defaultStringIfEmpty())
str = model.certificates.hkMacaoPass.issueDateEndAt
if str.isEmpty {
str = "无"
}
let tmp6 = YHPreviewQuestionAndAnswerModel(question: "签发日期:", answer: str)
let tmp6 = YHPreviewQuestionAndAnswerModel(question: "签发日期:", answer: str.defaultStringIfEmpty())
str = model.certificates.hkMacaoPass.issueDateStartAt
if str.isEmpty {
str = ""
str = ""
} else {
if str == "8888-01-01" {
str = "长期"
str = "至今"
}
}
let tmp7 = YHPreviewQuestionAndAnswerModel(question: "届满日期:", answer: str)
let tmp7 = YHPreviewQuestionAndAnswerModel(question: "届满日期:", answer: str.defaultStringIfEmpty())
let model1 = YHPersonInfoCellModel1(cellTitle: "港澳通行证", cellData: [tmp4,tmp5,tmp6,tmp7])
arr.append(model1)
}
......@@ -1181,32 +1158,23 @@ private extension YHPreviewViewModel {
let tmp8 = YHPreviewQuestionAndAnswerModel(question: "证件类别:", answer: str)
str = model.certificates.passport.number
if str.isEmpty {
str = "--"
}
let tmp9 = YHPreviewQuestionAndAnswerModel(question: "证件号码:", answer: str)
let tmp9 = YHPreviewQuestionAndAnswerModel(question: "证件号码:", answer: str.defaultStringIfEmpty())
str = model.certificates.passport.issueAt
if str.isEmpty {
str = "无"
}
let tmp10 = YHPreviewQuestionAndAnswerModel(question: "签发地:", answer: "北京市分局")
let tmp10 = YHPreviewQuestionAndAnswerModel(question: "签发地:", answer: str.defaultStringIfEmpty())
str = model.certificates.passport.issueDateStartAt
if str.isEmpty {
str = "无"
}
let tmp11 = YHPreviewQuestionAndAnswerModel(question: "签发日期:", answer: str)
let tmp11 = YHPreviewQuestionAndAnswerModel(question: "签发日期:", answer: str.defaultStringIfEmpty())
str = model.certificates.passport.issueDateEndAt
if str.isEmpty {
str = ""
str = ""
} else {
if str == "8888-01-01" {
str = "长期"
str = "至今"
}
}
let tmp12 = YHPreviewQuestionAndAnswerModel(question: "届满日期:", answer: str)
let tmp12 = YHPreviewQuestionAndAnswerModel(question: "届满日期:", answer: str.defaultStringIfEmpty())
let model2 = YHPersonInfoCellModel1(cellTitle: "护照及其他旅行证件", cellData: [tmp8,tmp9,tmp10,tmp11,tmp12])
arr.append(model2)
}
......@@ -1281,13 +1249,13 @@ private extension YHPreviewViewModel {
city = "国外 " + model.birthPlace.foreign
}
let tmp4 = YHPreviewQuestionAndAnswerModel(question: "出生城市:", answer: city)
let tmp44 = YHPreviewQuestionAndAnswerModel(question: "婚姻状况:", answer: model.married.isEmpty ? "--" : model.married)
let tmp444 = YHPreviewQuestionAndAnswerModel(question: "职业:", answer: model.occupation.isEmpty ? "--" : model.occupation)
let tmp44 = YHPreviewQuestionAndAnswerModel(question: "婚姻状况:", answer: model.married.defaultStringIfEmpty())
let tmp444 = YHPreviewQuestionAndAnswerModel(question: "职业:", answer: model.occupation.defaultStringIfEmpty())
var arr = [tmp0,tmp1,tmp2,tmp22,tmp3,tmp4,tmp44,tmp444]
if model.occupation != "无职业" {
let tmp6 = YHPreviewQuestionAndAnswerModel(question: "职业名称:", answer: model.occupationName.isEmpty ? "--" : model.occupationName)
arr.append(tmp6)
if model.occupation.contains("在职") {
let tmp5 = YHPreviewQuestionAndAnswerModel(question: "职业名称:", answer: model.occupationName)
arr.append(tmp5)
}
if let card = model.hkIdentityCard,card.isEmpty == false {
......@@ -1345,9 +1313,9 @@ private extension YHPreviewViewModel {
let tmp55 = YHPreviewQuestionAndAnswerModel(question: "职业:", answer: model.occupation)
var arr = [tmp0,tmp1,tmp2,tmp22,tmp3,tmp4,tmp5,tmp55]
if model.occupation != "无职业" {
let tmp6 = YHPreviewQuestionAndAnswerModel(question: "职业名称:", answer: model.occupationName.isEmpty ? "--" : model.occupationName)
arr.append(tmp6)
if model.occupation.contains("在职") {
let tmp5 = YHPreviewQuestionAndAnswerModel(question: "职业名称:", answer: model.occupationName)
arr.append(tmp5)
}
let tmp7 = YHPreviewQuestionAndAnswerModel(question: "是否拥有学位:", answer: model.hasDegree == "1" ? "有学位" : "无学位")
......@@ -1408,7 +1376,7 @@ private extension YHPreviewViewModel {
if model.hkIdentity.isEmpty == false {
let tmp14 = YHPreviewQuestionAndAnswerModel(question: "获准逗留至:", answer: model.childInHk.info)
let tmp15 = YHPreviewQuestionAndAnswerModel(question: "在港身份:", answer: model.hkIdentity == "其他" ? (model.hkIdentityOther.isEmpty ? "其他" : model.hkIdentityOther) : model.hkIdentity)
let tmp15 = YHPreviewQuestionAndAnswerModel(question: "在港身份:", answer: model.hkIdentity == "其他" ? (model.hkIdentityOther.defaultStringIfEmpty(detaultValue: "其他")) : model.hkIdentity)
arr.append(contentsOf: [tmp14,tmp15])
}
......@@ -1435,31 +1403,23 @@ private extension YHPreviewViewModel {
do {
//中国身份证
var str = model.certificates.cnIdentityCard.number
if str.isEmpty {
str = "无"
}
let tmp0 = YHPreviewQuestionAndAnswerModel(question: "中国身份证号码:", answer: str)
let tmp0 = YHPreviewQuestionAndAnswerModel(question: "中国身份证号码:", answer: str.defaultStringIfEmpty())
str = model.certificates.cnIdentityCard.issueAt
if str.isEmpty {
str = "无"
}
let tmp1 = YHPreviewQuestionAndAnswerModel(question: "签发地:", answer: str)
str = model.certificates.cnIdentityCard.issueAt
if str.isEmpty {
str = "无"
}
let tmp2 = YHPreviewQuestionAndAnswerModel(question: "签发日期:", answer: str)
let tmp1 = YHPreviewQuestionAndAnswerModel(question: "签发地:", answer: str.defaultStringIfEmpty())
str = model.certificates.cnIdentityCard.issueDateStartAt
let tmp2 = YHPreviewQuestionAndAnswerModel(question: "签发日期:", answer: str.defaultStringIfEmpty())
str = model.certificates.cnIdentityCard.issueDateEndAt
if str.isEmpty {
str = ""
str = ""
} else {
if str == "8888-01-01" {
str = "长期"
str = "至今"
}
}
let tmp3 = YHPreviewQuestionAndAnswerModel(question: "届满日期:", answer: str)
let tmp3 = YHPreviewQuestionAndAnswerModel(question: "届满日期:", answer: str.defaultStringIfEmpty())
let model0 = YHPersonInfoCellModel1(cellTitle: "中国身份证", cellData: [tmp0,tmp1,tmp2,tmp3])
......@@ -1467,32 +1427,23 @@ private extension YHPreviewViewModel {
//港澳通行证
if model.isHandled == 1 {
str = model.certificates.hkMacaoPass.number
if str.isEmpty {
str = "无"
}
let tmp4 = YHPreviewQuestionAndAnswerModel(question: "旅行社证件号码:", answer: str)
let tmp4 = YHPreviewQuestionAndAnswerModel(question: "旅行社证件号码:", answer: str.defaultStringIfEmpty())
str = model.certificates.hkMacaoPass.issueAt
if str.isEmpty {
str = "无"
}
let tmp5 = YHPreviewQuestionAndAnswerModel(question: "签发地:", answer: str)
str = model.certificates.hkMacaoPass.issueDateEndAt
if str.isEmpty {
str = "无"
}
let tmp6 = YHPreviewQuestionAndAnswerModel(question: "签发日期:", answer: str)
str = model.certificates.hkMacaoPass.issueDateStartAt
let tmp6 = YHPreviewQuestionAndAnswerModel(question: "签发日期:", answer: str.defaultStringIfEmpty())
str = model.certificates.hkMacaoPass.issueDateEndAt
if str.isEmpty {
str = ""
str = ""
} else {
if str == "8888-01-01" {
str = "长期"
}
}
let tmp7 = YHPreviewQuestionAndAnswerModel(question: "届满日期:", answer: str)
let tmp7 = YHPreviewQuestionAndAnswerModel(question: "届满日期:", answer: str.defaultStringIfEmpty())
let model1 = YHPersonInfoCellModel1(cellTitle: "港澳通行证", cellData: [tmp4,tmp5,tmp6,tmp7])
arr.append(model1)
}
......@@ -1504,35 +1455,28 @@ private extension YHPreviewViewModel {
let tmp8 = YHPreviewQuestionAndAnswerModel(question: "证件类别:", answer: str)
str = model.certificates.passport.number
if str.isEmpty {
str = "--"
}
let tmp9 = YHPreviewQuestionAndAnswerModel(question: "证件号码:", answer: str)
let tmp9 = YHPreviewQuestionAndAnswerModel(question: "证件号码:", answer: str.defaultStringIfEmpty())
str = model.certificates.passport.issueAt
if str.isEmpty {
str = "无"
}
let tmp10 = YHPreviewQuestionAndAnswerModel(question: "签发地:", answer: "北京市分局")
let tmp10 = YHPreviewQuestionAndAnswerModel(question: "签发地:", answer: str.defaultStringIfEmpty())
str = model.certificates.passport.issueDateStartAt
if str.isEmpty {
str = "无"
}
let tmp11 = YHPreviewQuestionAndAnswerModel(question: "签发日期:", answer: str)
str = model.certificates.passport.issueDateEndAt
if str.isEmpty {
str = ""
str = ""
} else {
if str == "8888-01-01" {
str = "长期"
str = "至今"
}
}
let tmp12 = YHPreviewQuestionAndAnswerModel(question: "届满日期:", answer: str)
let tmp12 = YHPreviewQuestionAndAnswerModel(question: "届满日期:", answer: str.defaultStringIfEmpty())
let model2 = YHPersonInfoCellModel1(cellTitle: "护照及其他旅行证件", cellData: [tmp8,tmp9,tmp10,tmp11,tmp12])
arr.append(model2)
}
let model3 = YHPreviewInfoSessionModel(cellType: .idCardInfoType, cellTitle: "证件信息" + String(childIndex + 1), cellData1: arr)
arrTemp.append(model3)
}
......@@ -1601,12 +1545,11 @@ private extension YHPreviewViewModel {
let tmp4 = YHPreviewQuestionAndAnswerModel(question: "职业:", answer: model.occupation)
var arr = [tmp0,tmp1,tmp2,tmp3,tmp4]
if model.occupation == "在职" {
if model.occupation.contains("在职") {
let tmp5 = YHPreviewQuestionAndAnswerModel(question: "职业名称:", answer: model.occupationName)
arr.append(tmp5)
}
let tmp6 = YHPreviewQuestionAndAnswerModel(question: "现居住国家/地区:", answer: model.liveCountry)
arr.append(tmp6)
......
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