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

// 证件

parent 10cbac0d
...@@ -100,7 +100,7 @@ class YHCertificateInfoController: YHBaseViewController, YHFamilyMemberProtol { ...@@ -100,7 +100,7 @@ class YHCertificateInfoController: YHBaseViewController, YHFamilyMemberProtol {
if familyMember.nationality.contains("中国") { // 中国国籍 if familyMember.nationality.contains("中国") { // 中国国籍
let isLiveInChina = familyMember.address.country.contains("中国".local) let isLiveInChina = familyMember.address.country.contains("中国".local)
if isLiveInChina { // 居住国内 if isLiveInChina { // 居住国内
if !familyMember.certificates.hkMacaoPass.number.isEmpty { // 没办理过港澳通行证 if familyMember.isHandled == 0 { // 没办理过港澳通行证
// 证件信息:港澳通行证非必填(无身份证、护照) // 证件信息:港澳通行证非必填(无身份证、护照)
showHK = true showHK = true
isHKMust = false isHKMust = false
...@@ -113,7 +113,7 @@ class YHCertificateInfoController: YHBaseViewController, YHFamilyMemberProtol { ...@@ -113,7 +113,7 @@ class YHCertificateInfoController: YHBaseViewController, YHFamilyMemberProtol {
} else { // 居住国外 } else { // 居住国外
if !familyMember.isOverSeasOver1Year() { // 居住国外不满一年 if !familyMember.isOverSeasOver1Year() { // 居住国外不满一年
if !familyMember.certificates.hkMacaoPass.number.isEmpty { // 没办理过港澳通行证 if familyMember.isHandled == 0 { // 没办理过港澳通行证
// 证件信息:港澳通行证非必填(无身份证、护照) // 证件信息:港澳通行证非必填(无身份证、护照)
showHK = true showHK = true
isHKMust = false isHKMust = false
......
...@@ -78,20 +78,29 @@ extension YHCertificateUploadVC: UITableViewDelegate, UITableViewDataSource { ...@@ -78,20 +78,29 @@ extension YHCertificateUploadVC: UITableViewDelegate, UITableViewDataSource {
} }
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withClass: YHIdentityCardCell.self) let cell = tableView.dequeueReusableCell(withClass: YHIdentityCardCell.self)
cell.type = YHCardType(rawValue: indexPath.row) ?? .identity let dataSource = viewModel.getIDCardDataSource(false)
if indexPath.row < dataSource.count {
if dataSource[indexPath.row].models?.first?.id == .id5 {
cell.type = .identity
}
if dataSource[indexPath.row].models?.first?.id == .id6 {
cell.type = .passport
}
if dataSource[indexPath.row].models?.first?.id == .id7 {
cell.type = .other
}
cell.viewModel = viewModel cell.viewModel = viewModel
cell.backSurfaceDeleteButton.isHidden = true cell.backSurfaceDeleteButton.isHidden = true
cell.frontDeleteButton.isHidden = true cell.frontDeleteButton.isHidden = true
cell.informationBlock = {[weak self] type, image, isLeft in
guard let self = self else { return }
} }
return cell return cell
} }
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return UITableView.automaticDimension return 217
} }
} }
...@@ -637,7 +637,7 @@ class YHFamilyMember: SmartCodable, YHFormItemProtocol { ...@@ -637,7 +637,7 @@ class YHFamilyMember: SmartCodable, YHFormItemProtocol {
var birthPlaceAboard: Int = 0 var birthPlaceAboard: Int = 0
// 是否与主申请人同住 1:是 0:否 // 是否与主申请人同住 1:是 0:否
var nows: Int = 0 var nows: Int = 0
// 是否要办理港澳通行证 1:是 0:否 // 是否办理过港澳通行证 1:是 0:否
var isHandled: Int = 0 var isHandled: Int = 0
// notFillNumber = -1 表示还没开始填写任意数据项 // notFillNumber = -1 表示还没开始填写任意数据项
var notFillNumber: Int = -1 var notFillNumber: Int = -1
......
...@@ -20,11 +20,22 @@ class YHFamilyMemberViewModel : YHBaseViewModel{ ...@@ -20,11 +20,22 @@ class YHFamilyMemberViewModel : YHBaseViewModel{
let section = YHSectionItemModel(title: "中国身份证(选填)", models: [item]) let section = YHSectionItemModel(title: "中国身份证(选填)", models: [item])
let item1 = YHItemModel(id: .id6, isNeed: true, title: "港澳通行证(选填)", isUserKeyBoard: false, prompts: "请输入", message: nil, isShowPrompts: isShowPrompt) let item1 = YHItemModel(id: .id6, isNeed: true, title: "港澳通行证(选填)", isUserKeyBoard: false, prompts: "请输入", message: nil, isShowPrompts: isShowPrompt)
let section1 = YHSectionItemModel(title: "中国身份证(选填)", models: [item1]) let section1 = YHSectionItemModel(title: "中国身份证(选填)", models: [item1])
if mainModel.isNeedHandleHKPassPort() { let item2 = YHItemModel(id: .id7, isNeed: true, title: "护照(选填)", isUserKeyBoard: false, prompts: "请输入", message: nil, isShowPrompts: isShowPrompt)
let section2 = YHSectionItemModel(title: "护照(选填)", models: [item2])
let addressCountry = mainModel.address.country
let nationality = mainModel.nationality
let is_live_oversea_year = mainModel.isOverSeasOver1Year()
if (nationality.contains("中国") && addressCountry.contains("中国")) || (nationality.contains("中国") && !is_live_oversea_year) {
if mainModel.isHandled == 1 {
return [section, section1] return [section, section1]
} else { } else {
return [section] return [section]
} }
} else if nationality.contains("中国") && is_live_oversea_year {
return [section, section2]
} else {
return [section2]
}
} }
func updateModel(_ item: YHItemModel) { func updateModel(_ item: YHItemModel) {
......
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