Commit 72cc9786 authored by David黄金龙's avatar David黄金龙

Merge commit 'ce414e1a' into davidhuang

* commit 'ce414e1a':
  // 配偶信息列表
  // 证书信息
parents 3d16763f ce414e1a
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
04010B952B6A1DE90093F3BB /* YHSaveAndSubmitView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04010B942B6A1DE90093F3BB /* YHSaveAndSubmitView.swift */; };
041B52872B5657B3007EBCEB /* IMAppKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52862B5657B3007EBCEB /* IMAppKey.swift */; }; 041B52872B5657B3007EBCEB /* IMAppKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52862B5657B3007EBCEB /* IMAppKey.swift */; };
041B528B2B5E15F1007EBCEB /* YHFormItemQuestionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B528A2B5E15F1007EBCEB /* YHFormItemQuestionCell.swift */; }; 041B528B2B5E15F1007EBCEB /* YHFormItemQuestionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B528A2B5E15F1007EBCEB /* YHFormItemQuestionCell.swift */; };
041B528D2B5E58FA007EBCEB /* YHFormItemDoubleChoiceCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B528C2B5E58FA007EBCEB /* YHFormItemDoubleChoiceCell.swift */; }; 041B528D2B5E58FA007EBCEB /* YHFormItemDoubleChoiceCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B528C2B5E58FA007EBCEB /* YHFormItemDoubleChoiceCell.swift */; };
...@@ -64,6 +65,7 @@ ...@@ -64,6 +65,7 @@
049A48A82B49417300D0C641 /* YHAboutUsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 049A48A72B49417300D0C641 /* YHAboutUsViewController.swift */; }; 049A48A82B49417300D0C641 /* YHAboutUsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 049A48A72B49417300D0C641 /* YHAboutUsViewController.swift */; };
049A48AA2B49536000D0C641 /* YHAboutUsAdvantageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 049A48A92B49536000D0C641 /* YHAboutUsAdvantageCell.swift */; }; 049A48AA2B49536000D0C641 /* YHAboutUsAdvantageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 049A48A92B49536000D0C641 /* YHAboutUsAdvantageCell.swift */; };
04AF58C42B4FC51C0066011A /* YHLocalizable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AF58C32B4FC51C0066011A /* YHLocalizable.swift */; }; 04AF58C42B4FC51C0066011A /* YHLocalizable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AF58C32B4FC51C0066011A /* YHLocalizable.swift */; };
04D765732B6A173C0055ECBB /* YHSpouseInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D765722B6A173C0055ECBB /* YHSpouseInfoVC.swift */; };
6203A87EDC96313BBE789D9C /* Pods_galaxy.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 987C69D43AE8D85DC1930DCF /* Pods_galaxy.framework */; }; 6203A87EDC96313BBE789D9C /* Pods_galaxy.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 987C69D43AE8D85DC1930DCF /* Pods_galaxy.framework */; };
A51044182B493675006B60BB /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = A51044172B493675006B60BB /* README.md */; }; A51044182B493675006B60BB /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = A51044172B493675006B60BB /* README.md */; };
A510441A2B495DD0006B60BB /* UIView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A51044192B495DD0006B60BB /* UIView+Extension.swift */; }; A510441A2B495DD0006B60BB /* UIView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A51044192B495DD0006B60BB /* UIView+Extension.swift */; };
...@@ -212,6 +214,7 @@ ...@@ -212,6 +214,7 @@
/* End PBXCopyFilesBuildPhase section */ /* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
04010B942B6A1DE90093F3BB /* YHSaveAndSubmitView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSaveAndSubmitView.swift; sourceTree = "<group>"; };
041B52862B5657B3007EBCEB /* IMAppKey.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IMAppKey.swift; sourceTree = "<group>"; }; 041B52862B5657B3007EBCEB /* IMAppKey.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IMAppKey.swift; sourceTree = "<group>"; };
041B528A2B5E15F1007EBCEB /* YHFormItemQuestionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormItemQuestionCell.swift; sourceTree = "<group>"; }; 041B528A2B5E15F1007EBCEB /* YHFormItemQuestionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormItemQuestionCell.swift; sourceTree = "<group>"; };
041B528C2B5E58FA007EBCEB /* YHFormItemDoubleChoiceCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormItemDoubleChoiceCell.swift; sourceTree = "<group>"; }; 041B528C2B5E58FA007EBCEB /* YHFormItemDoubleChoiceCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormItemDoubleChoiceCell.swift; sourceTree = "<group>"; };
...@@ -269,6 +272,7 @@ ...@@ -269,6 +272,7 @@
049A48A72B49417300D0C641 /* YHAboutUsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAboutUsViewController.swift; sourceTree = "<group>"; }; 049A48A72B49417300D0C641 /* YHAboutUsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAboutUsViewController.swift; sourceTree = "<group>"; };
049A48A92B49536000D0C641 /* YHAboutUsAdvantageCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAboutUsAdvantageCell.swift; sourceTree = "<group>"; }; 049A48A92B49536000D0C641 /* YHAboutUsAdvantageCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAboutUsAdvantageCell.swift; sourceTree = "<group>"; };
04AF58C32B4FC51C0066011A /* YHLocalizable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLocalizable.swift; sourceTree = "<group>"; }; 04AF58C32B4FC51C0066011A /* YHLocalizable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLocalizable.swift; sourceTree = "<group>"; };
04D765722B6A173C0055ECBB /* YHSpouseInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSpouseInfoVC.swift; sourceTree = "<group>"; };
58C2405158A4A6632D0E7460 /* Pods-galaxy.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-galaxy.debug.xcconfig"; path = "Target Support Files/Pods-galaxy/Pods-galaxy.debug.xcconfig"; sourceTree = "<group>"; }; 58C2405158A4A6632D0E7460 /* Pods-galaxy.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-galaxy.debug.xcconfig"; path = "Target Support Files/Pods-galaxy/Pods-galaxy.debug.xcconfig"; sourceTree = "<group>"; };
987C69D43AE8D85DC1930DCF /* Pods_galaxy.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_galaxy.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 987C69D43AE8D85DC1930DCF /* Pods_galaxy.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_galaxy.framework; sourceTree = BUILT_PRODUCTS_DIR; };
A51044172B493675006B60BB /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; }; A51044172B493675006B60BB /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
...@@ -453,6 +457,7 @@ ...@@ -453,6 +457,7 @@
042FBBC02B63B21700F9DE23 /* YHFormItemDegreeInfoCell.swift */, 042FBBC02B63B21700F9DE23 /* YHFormItemDegreeInfoCell.swift */,
042FBBC42B64AE3D00F9DE23 /* YHFormItemOnlyDoubleChoiceCell.swift */, 042FBBC42B64AE3D00F9DE23 /* YHFormItemOnlyDoubleChoiceCell.swift */,
042FBBC82B64DC8900F9DE23 /* YHFormItemExpireDateCell.swift */, 042FBBC82B64DC8900F9DE23 /* YHFormItemExpireDateCell.swift */,
04010B942B6A1DE90093F3BB /* YHSaveAndSubmitView.swift */,
); );
path = View; path = View;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -461,6 +466,7 @@ ...@@ -461,6 +466,7 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
041B52972B5E8EA0007EBCEB /* YHFamilyMemberFormVC.swift */, 041B52972B5E8EA0007EBCEB /* YHFamilyMemberFormVC.swift */,
04D765722B6A173C0055ECBB /* YHSpouseInfoVC.swift */,
041B52D52B5F899E007EBCEB /* YHSpouseInitialInfoVC.swift */, 041B52D52B5F899E007EBCEB /* YHSpouseInitialInfoVC.swift */,
042FBBBA2B62806D00F9DE23 /* YHCertificateViewController.swift */, 042FBBBA2B62806D00F9DE23 /* YHCertificateViewController.swift */,
042FBBBE2B639F0300F9DE23 /* YHSpouseBasicInfoVC.swift */, 042FBBBE2B639F0300F9DE23 /* YHSpouseBasicInfoVC.swift */,
...@@ -1287,6 +1293,7 @@ ...@@ -1287,6 +1293,7 @@
A514E5DC2B60A2B700C93951 /* YHServiceCenterSecondViewController.swift in Sources */, A514E5DC2B60A2B700C93951 /* YHServiceCenterSecondViewController.swift in Sources */,
0468D4202B49320900CFB916 /* YHVerificationCodeLoginController.swift in Sources */, 0468D4202B49320900CFB916 /* YHVerificationCodeLoginController.swift in Sources */,
0468D4532B6782BE00CFB916 /* YHCardExampleView.swift in Sources */, 0468D4532B6782BE00CFB916 /* YHCardExampleView.swift in Sources */,
04010B952B6A1DE90093F3BB /* YHSaveAndSubmitView.swift in Sources */,
A5ACE9362B4564F7002C94D2 /* YHNetworkStatusManager.swift in Sources */, A5ACE9362B4564F7002C94D2 /* YHNetworkStatusManager.swift in Sources */,
A5ACE92C2B4564F7002C94D2 /* YHLoginStyleButton.swift in Sources */, A5ACE92C2B4564F7002C94D2 /* YHLoginStyleButton.swift in Sources */,
042FBBD42B67A2FE00F9DE23 /* YHFormPickerView.swift in Sources */, 042FBBD42B67A2FE00F9DE23 /* YHFormPickerView.swift in Sources */,
...@@ -1379,6 +1386,7 @@ ...@@ -1379,6 +1386,7 @@
A5ACE9392B4564F7002C94D2 /* UIDevice+Extension.swift in Sources */, A5ACE9392B4564F7002C94D2 /* UIDevice+Extension.swift in Sources */,
041B52912B5E67F3007EBCEB /* YHFormItemEnterDetailCell.swift in Sources */, 041B52912B5E67F3007EBCEB /* YHFormItemEnterDetailCell.swift in Sources */,
A5ACE9422B4564F7002C94D2 /* AppDelegate+Extension.swift in Sources */, A5ACE9422B4564F7002C94D2 /* AppDelegate+Extension.swift in Sources */,
04D765732B6A173C0055ECBB /* YHSpouseInfoVC.swift in Sources */,
A5FD63BF2B6250BC00D1D9DA /* YHInformationPerfectCell.swift in Sources */, A5FD63BF2B6250BC00D1D9DA /* YHInformationPerfectCell.swift in Sources */,
A510441A2B495DD0006B60BB /* UIView+Extension.swift in Sources */, A510441A2B495DD0006B60BB /* UIView+Extension.swift in Sources */,
A5ACE93E2B4564F7002C94D2 /* UIImage+Extension.swift in Sources */, A5ACE93E2B4564F7002C94D2 /* UIImage+Extension.swift in Sources */,
......
...@@ -8,12 +8,16 @@ ...@@ -8,12 +8,16 @@
import UIKit import UIKit
import GKNavigationBarSwift import GKNavigationBarSwift
import IQKeyboardManagerSwift
class YHBaseViewController: UIViewController { class YHBaseViewController: UIViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = UIColor(hex:0xf8f8f8) view.backgroundColor = UIColor(hex:0xf8f8f8)
#if DEBUG
IQKeyboardManager.shared.enable = true
#endif
gk_navBackgroundColor = .clear gk_navBackgroundColor = .clear
gk_navLineHidden = true gk_navLineHidden = true
gk_navBarAlpha = 0 gk_navBarAlpha = 0
......
...@@ -10,20 +10,21 @@ import UIKit ...@@ -10,20 +10,21 @@ import UIKit
class YHCertificateViewController: YHBaseViewController { class YHCertificateViewController: YHBaseViewController {
var spouse:YHFamilyMember? var familyMember:YHFamilyMember?
var cardInfo: YHCNIdentityCard? var certificates:YHCertificates = YHCertificates()
var items:[[YHFormItemProtocol]] = [[YHFormItemProtocol]]() var items:[[YHFormItemProtocol]] = [[YHFormItemProtocol]]()
lazy var tableView: UITableView = { lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.plain) let tableView = UITableView(frame:.zero, style:.grouped)
if #available(iOS 11.0, *) { if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never tableView.contentInsetAdjustmentBehavior = .never
} }
tableView.estimatedSectionHeaderHeight = 14.0
tableView.estimatedSectionFooterHeight = 1.0
tableView.showsVerticalScrollIndicator = false tableView.showsVerticalScrollIndicator = false
tableView.backgroundColor = .clear tableView.backgroundColor = .clear
tableView.separatorStyle = .none tableView.separatorStyle = .none
...@@ -51,34 +52,82 @@ class YHCertificateViewController: YHBaseViewController { ...@@ -51,34 +52,82 @@ class YHCertificateViewController: YHBaseViewController {
func createUI() { func createUI() {
view.addSubview(tableView); view.addSubview(tableView);
let topHeight = k_Height_NavigationtBarAndStatuBar+YHStepView.height
let bottomHeight = k_Height_safeAreaInsetsBottom() + YHSaveAndSubmitView.height
tableView.snp.makeConstraints { make in tableView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar) make.top.equalToSuperview().offset(topHeight)
make.bottom.equalToSuperview().offset(-100)
make.left.equalToSuperview().offset(16) make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-16) make.right.equalToSuperview().offset(-16)
make.bottom.equalToSuperview().offset(-bottomHeight)
}
guard let familyMember = familyMember else { return }
if let cer = familyMember.certificatesd {
certificates = cer
} else {
certificates.cnIdentityCard = YHCNIdentityCard()
certificates.passport = YHCNIdentityCard()
if familyMember.isHandled == 1 { // 要办理港澳通行证
certificates.hkMacaoPass = YHCNIdentityCard()
}
} }
loadCertificateInfo()
} }
func loadCertificateInfo() { func loadCertificateInfo() {
items.removeAll()
// 中国身份证 信息必有
let title0 = YHFormTitleItem(type: .chinaIdCardInfo) let title0 = YHFormTitleItem(type: .chinaIdCardInfo)
let item01 = YHFormDetailItem(type: .certificateNumber) let item01 = YHFormDetailItem(type: .chinaIdentityCardNumber)
let item02 = YHFormDetailItem(type: .certificateSignPlace) let item02 = YHFormDetailItem(type: .certificateSignPlace)
let item03 = YHFormDetailItem(type: .certificateSignDate) let item03 = YHFormDetailItem(type: .certificateSignDate)
let item04 = YHFormDetailItem(type: .certificateValidDate) let item04 = YHFormDetailItem(type: .certificateValidDate)
let arr0:[YHFormItemProtocol] = [title0, item01, item02, item03, item04] let arr0:[YHFormItemProtocol] = [title0, item01, item02, item03, item04]
items.append(arr0)
if let cnIdentityCard = certificates.cnIdentityCard {
item01.value = cnIdentityCard.number
item02.value = cnIdentityCard.issueAt
item03.value = cnIdentityCard.issueDateStartAt
item04.value = cnIdentityCard.issueDateEndAt
}
let title1 = YHFormTitleItem(type: .passPortInfo) // 港澳通行证 非必须
let item10 = YHFormDetailItem(type: .cetificateType) if certificates.hkMacaoPass != nil {
let item11 = YHFormDetailItem(type: .certificateNumber) let title1 = YHFormTitleItem(type: .hkAndMacaoPassport)
let item12 = YHFormDetailItem(type: .certificateSignPlace) let item10 = YHFormDetailItem(type: .traverlPassportNumber)
let item13 = YHFormDetailItem(type: .certificateSignDate) let item11 = YHFormDetailItem(type: .certificateSignPlace)
let item14 = YHFormDetailItem(type: .certificateValidDate) let item12 = YHFormDetailItem(type: .certificateSignDate)
let item15 = YHFormDetailItem(type: .certificateSignPlace) let item13 = YHFormDetailItem(type: .certificateValidDate)
let arr1:[YHFormItemProtocol] = [title1, item10, item11, item12, item13]
let arr1:[YHFormItemProtocol] = [title1, item10, item11, item12, item13, item14, item15] items.append(arr1)
if let hkMacaoPass = certificates.hkMacaoPass {
items.append(contentsOf: [arr0, arr1]) item10.value = hkMacaoPass.number
item11.value = hkMacaoPass.issueAt
item12.value = hkMacaoPass.issueDateStartAt
item13.value = hkMacaoPass.issueDateEndAt
}
}
// 护照及其他旅行证件 信息必有
let title2 = YHFormTitleItem(type: .passPortOrTravelInfo)
let item20 = YHFormDetailItem(type: .certificateType)
let item21 = YHFormDetailItem(type: .certificateNumber)
let item22 = YHFormDetailItem(type: .certificateSignPlace)
let item23 = YHFormDetailItem(type: .certificateSignDate)
let item24 = YHFormDetailItem(type: .certificateValidDate)
let arr2:[YHFormItemProtocol] = [title2, item20, item21, item22, item23, item24]
items.append(arr2)
if let passport = certificates.passport {
item20.value = String(passport.passportType)
item21.value = passport.number
item22.value = passport.issueAt
item23.value = passport.issueDateStartAt
item24.value = passport.issueDateEndAt
}
tableView.reloadData() tableView.reloadData()
} }
} }
...@@ -115,10 +164,10 @@ extension YHCertificateViewController : UITableViewDelegate, UITableViewDataSour ...@@ -115,10 +164,10 @@ extension YHCertificateViewController : UITableViewDelegate, UITableViewDataSour
let detailItem = item as! YHFormDetailItem let detailItem = item as! YHFormDetailItem
if detailItem.type == .certificateNumber || detailItem.type == .certificateSignPlace { // 证件号码和签发地需要填写 if detailItem.type == .chinaIdentityCardNumber || detailItem.type == .certificateSignPlace { // 证件号码和签发地需要填写
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemInputTextCell.cellReuseIdentifier, for: indexPath) as! YHFormItemInputTextCell let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemInputTextCell.cellReuseIdentifier, for: indexPath) as! YHFormItemInputTextCell
let titleItem = arr[0] as! YHFormTitleItem let titleItem = arr[0] as! YHFormTitleItem
if detailItem.type == .certificateNumber { if detailItem.type == .chinaIdentityCardNumber {
cell.titleLabel.text = (titleItem.type == .chinaIdCardInfo ? "中国身份证号" : "证件号码") cell.titleLabel.text = (titleItem.type == .chinaIdCardInfo ? "中国身份证号" : "证件号码")
} else { } else {
cell.titleLabel.text = detailItem.getTitle() cell.titleLabel.text = detailItem.getTitle()
...@@ -126,7 +175,7 @@ extension YHCertificateViewController : UITableViewDelegate, UITableViewDataSour ...@@ -126,7 +175,7 @@ extension YHCertificateViewController : UITableViewDelegate, UITableViewDataSour
return cell return cell
} }
if detailItem.type == .cetificateType || detailItem.type == .certificateSignDate { if detailItem.type == .certificateType || detailItem.type == .certificateSignDate {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier, for: indexPath) as! YHFormItemSelectSheetCell let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier, for: indexPath) as! YHFormItemSelectSheetCell
cell.title = detailItem.getTitle() cell.title = detailItem.getTitle()
...@@ -179,17 +228,27 @@ extension YHCertificateViewController : UITableViewDelegate, UITableViewDataSour ...@@ -179,17 +228,27 @@ extension YHCertificateViewController : UITableViewDelegate, UITableViewDataSour
return 52.0 return 52.0
} }
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView() return UIView()
} }
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat { private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
return 1.0
}
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return 14.0 return 14.0
} }
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let vc = YHSpouseBasicInfoVC()
self.navigationController?.pushViewController(vc)
if !(0..<items.count).contains(indexPath.section) { return } if !(0..<items.count).contains(indexPath.section) { return }
let arr:[YHFormItemProtocol] = items[indexPath.section] let arr:[YHFormItemProtocol] = items[indexPath.section]
if !(0..<arr.count).contains(indexPath.row) { return } if !(0..<arr.count).contains(indexPath.row) { return }
...@@ -204,19 +263,21 @@ extension YHCertificateViewController : UITableViewDelegate, UITableViewDataSour ...@@ -204,19 +263,21 @@ extension YHCertificateViewController : UITableViewDelegate, UITableViewDataSour
detailItem.type == .certificateSignDate { // 届满日期 签发日期 detailItem.type == .certificateSignDate { // 届满日期 签发日期
self.view?.endEditing(true) self.view?.endEditing(true)
YHDatePickView.show(type: .yyyymmdd) { date in YHDatePickView.show(type: .yyyymmdd) { [weak self] date in
let dataArr = date.components(separatedBy: YHDatePickView.separator) let dataArr = date.components(separatedBy: YHDatePickView.separator)
print(dataArr) print(dataArr)
if let familyMember = self?.familyMember {
if familyMember.relationType == .child {
}
}
} }
} }
return return
} }
let vc = YHSpouseBasicInfoVC()
self.navigationController?.pushViewController(vc)
} }
func createCorner(cell:UITableViewCell, arr:Array<Any>, indexPath:IndexPath) { func createCorner(cell:UITableViewCell, arr:Array<Any>, indexPath:IndexPath) {
......
...@@ -672,7 +672,7 @@ extension YHFamilyMemberFormVC : UITableViewDelegate, UITableViewDataSource { ...@@ -672,7 +672,7 @@ extension YHFamilyMemberFormVC : UITableViewDelegate, UITableViewDataSource {
// 配偶 // 配偶
if detailItem.relationType == .spouse { if detailItem.relationType == .spouse {
let vc = YHSpouseInitialInfoVC() let vc = YHSpouseInfoVC()
vc.spouse = detailItem vc.spouse = detailItem
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
return return
......
...@@ -32,11 +32,13 @@ class YHSpouseBasicInfoVC: YHBaseViewController { ...@@ -32,11 +32,13 @@ class YHSpouseBasicInfoVC: YHBaseViewController {
lazy var tableView: UITableView = { lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.plain) let tableView = UITableView(frame:.zero, style:.grouped)
if #available(iOS 11.0, *) { if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never tableView.contentInsetAdjustmentBehavior = .never
} }
tableView.estimatedSectionHeaderHeight = 14.0
tableView.estimatedSectionFooterHeight = 1.0
tableView.showsVerticalScrollIndicator = false tableView.showsVerticalScrollIndicator = false
tableView.backgroundColor = .clear tableView.backgroundColor = .clear
tableView.separatorStyle = .none tableView.separatorStyle = .none
...@@ -65,11 +67,13 @@ class YHSpouseBasicInfoVC: YHBaseViewController { ...@@ -65,11 +67,13 @@ class YHSpouseBasicInfoVC: YHBaseViewController {
func createUI() { func createUI() {
view.addSubview(tableView); view.addSubview(tableView);
let topHeight = k_Height_NavigationtBarAndStatuBar+YHStepView.height
let bottomHeight = k_Height_safeAreaInsetsBottom() + YHSaveAndSubmitView.height
tableView.snp.makeConstraints { make in tableView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar) make.top.equalToSuperview().offset(topHeight)
make.bottom.equalToSuperview().offset(-100)
make.left.equalToSuperview().offset(16) make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-16) make.right.equalToSuperview().offset(-16)
make.bottom.equalToSuperview().offset(-bottomHeight)
} }
} }
...@@ -249,12 +253,19 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -249,12 +253,19 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
return 52.0 return 52.0
} }
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView() return UIView()
} }
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat { private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
return 1.0
}
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return 14.0 return 14.0
} }
......
//
// YHSpouseInfoVC.swift
// galaxy
//
// Created by edy on 2024/1/31.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHSpouseInfoVC: YHBaseViewController {
var spouse:YHFamilyMember? {
didSet {
initalInfoVC.spouse = spouse
passportInfoVC.familyMember = spouse
basicInfoVC.spouse = spouse
}
}
var currentIndex = 0 {
didSet {
currentIndex %= 4
stepView.currentIndex = currentIndex
for (i, vc) in self.children.enumerated() {
vc.view.isHidden = (currentIndex != i)
}
}
}
var stepView:YHStepView = {
let step = YHStepView()
step.dataSource = ["初始信息", "证件上传", "基本信息", "证件信息"]
step.block = { (index) in
// guard let self = self else { return }
}
return step
}()
var bottomView: YHSaveAndSubmitView = {
return YHSaveAndSubmitView.createView()
}()
let initalInfoVC = YHSpouseInitialInfoVC()
let uploadVC = UIViewController()
let passportInfoVC = YHCertificateViewController()
let basicInfoVC = YHSpouseBasicInfoVC()
override func viewDidLoad() {
super.viewDidLoad()
createUI()
}
func createUI() {
self.addChild(initalInfoVC)
self.addChild(uploadVC)
self.addChild(passportInfoVC)
self.addChild(basicInfoVC)
self.view.addSubview(basicInfoVC.view)
self.view.addSubview(passportInfoVC.view)
self.view.addSubview(uploadVC.view)
self.view.addSubview(initalInfoVC.view)
currentIndex = 0
view.addSubview(stepView)
view.addSubview(bottomView)
bottomView.submitBlock = {
[weak self] in
guard let self = self else { return }
self.didClickSubmitBtn()
}
bottomView.saveBlock = {
[weak self] in
guard let self = self else { return }
self.didClickSaveBtn()
}
stepView.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.left.right.equalTo(view)
make.height.equalTo(YHStepView.height)
}
bottomView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.bottom.equalToSuperview().offset(-k_Height_safeAreaInsetsBottom())
make.height.equalTo(YHSaveAndSubmitView.height)
}
}
func didClickSubmitBtn() {
currentIndex += 1;
}
func didClickSaveBtn() {
}
}
...@@ -17,11 +17,13 @@ class YHSpouseInitialInfoVC: YHBaseViewController { ...@@ -17,11 +17,13 @@ class YHSpouseInitialInfoVC: YHBaseViewController {
lazy var tableView: UITableView = { lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.plain) let tableView = UITableView(frame:.zero, style:.grouped)
if #available(iOS 11.0, *) { if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never tableView.contentInsetAdjustmentBehavior = .never
} }
tableView.estimatedSectionHeaderHeight = 14.0
tableView.estimatedSectionFooterHeight = 1.0
tableView.showsVerticalScrollIndicator = false tableView.showsVerticalScrollIndicator = false
tableView.backgroundColor = .clear tableView.backgroundColor = .clear
tableView.separatorStyle = .none tableView.separatorStyle = .none
...@@ -36,35 +38,7 @@ class YHSpouseInitialInfoVC: YHBaseViewController { ...@@ -36,35 +38,7 @@ class YHSpouseInitialInfoVC: YHBaseViewController {
return tableView return tableView
}() }()
lazy var submitBtn:UIButton = {
let btn = UIButton()
btn.setTitle("提交".local, for: .normal)
btn.titleLabel?.font = UIFont.PingFangScR(ofSize: 14)
btn.setTitleColor(.white, for: .normal)
btn.backgroundColor = UIColor(hexString:"#4388FF")
btn.layer.cornerRadius = 8.0
btn.addTarget(self, action: #selector(didClickSubmitBtn), for: .touchUpInside)
return btn
}()
lazy var saveBtn:UIButton = {
let btn = UIButton()
btn.setTitle("保存", for: .normal)
btn.titleLabel?.font = UIFont.PingFangScR(ofSize: 14)
btn.setTitleColor(UIColor(hexString:"#222222"), for: .normal)
btn.backgroundColor = UIColor(hexString:"#F8F9FB")
btn.layer.cornerRadius = 8.0
btn.addTarget(self, action: #selector(didClickSaveBtn), for: .touchUpInside)
return btn
}()
lazy var bottomView:UIView = {
let view = UIView()
view.backgroundColor = .white
view.addSubview(submitBtn)
view.addSubview(saveBtn)
return view
}()
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
...@@ -136,44 +110,15 @@ class YHSpouseInitialInfoVC: YHBaseViewController { ...@@ -136,44 +110,15 @@ class YHSpouseInitialInfoVC: YHBaseViewController {
func createUI() { func createUI() {
view.addSubview(tableView); view.addSubview(tableView);
view.addSubview(bottomView) let topHeight = k_Height_NavigationtBarAndStatuBar+YHStepView.height
let bottomHeight = k_Height_safeAreaInsetsBottom() + YHSaveAndSubmitView.height
let submitBtnHeight = 48.0
let gap = 8.0
bottomView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.bottom.equalTo(view)
make.height.equalTo(submitBtnHeight+gap*2+k_Height_safeAreaInsetsBottom())
}
saveBtn.snp.makeConstraints { make in
make.left.equalToSuperview().offset(16)
make.size.equalTo(CGSize(width: 86.0, height: 48.0))
make.top.equalTo(8)
}
submitBtn.snp.makeConstraints { make in
make.left.equalTo(saveBtn.snp.right).offset(10)
make.right.equalToSuperview().offset(-16)
make.height.equalTo(48)
make.centerY.equalTo(saveBtn)
}
tableView.snp.makeConstraints { make in tableView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar) make.top.equalToSuperview().offset(topHeight)
make.bottom.equalTo(bottomView.snp.top)
make.left.equalToSuperview().offset(16) make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-16) make.right.equalToSuperview().offset(-16)
make.bottom.equalToSuperview().offset(-bottomHeight)
} }
} }
@objc func didClickSubmitBtn() {
}
@objc func didClickSaveBtn() {
}
} }
...@@ -306,18 +251,26 @@ extension YHSpouseInitialInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -306,18 +251,26 @@ extension YHSpouseInitialInfoVC : UITableViewDelegate, UITableViewDataSource {
return 52.0 return 52.0
} }
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView() return UIView()
} }
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat { private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
return 1.0
}
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return 14.0 return 14.0
} }
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let vc = YHCertificateViewController() let vc = YHCertificateViewController()
vc.familyMember = spouse
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
} }
......
...@@ -38,8 +38,8 @@ enum YHFormTitleItemType:Int, CaseIterable { ...@@ -38,8 +38,8 @@ enum YHFormTitleItemType:Int, CaseIterable {
// 中国身份证 // 中国身份证
case chinaIdCardInfo case chinaIdCardInfo
// 护照 // 护照及其他旅行证件
case passPortInfo case passPortOrTravelInfo
// 配偶信息 // 配偶信息
case spouseInfo case spouseInfo
...@@ -92,9 +92,13 @@ enum YHFormDetailItemType:Int { ...@@ -92,9 +92,13 @@ enum YHFormDetailItemType:Int {
case isHandleHKPassPort case isHandleHKPassPort
// 证件类别 // 证件类别
case cetificateType case certificateType
// 证件号码 // 证件号码
case certificateNumber case certificateNumber
// 中国身份证号
case chinaIdentityCardNumber
// 旅行证件号码
case traverlPassportNumber
// 签发日期 // 签发日期
case certificateSignDate case certificateSignDate
// 届满日期 // 届满日期
...@@ -187,7 +191,7 @@ class YHFormAddItem : YHFormItemProtocol ...@@ -187,7 +191,7 @@ class YHFormAddItem : YHFormItemProtocol
class YHFormTitleItem : YHFormItemProtocol { class YHFormTitleItem : YHFormItemProtocol {
var type: YHFormTitleItemType var type: YHFormTitleItemType
init(type: YHFormTitleItemType) { init(type: YHFormTitleItemType) {
self.type = type self.type = type
} }
...@@ -212,7 +216,7 @@ class YHFormTitleItem : YHFormItemProtocol { ...@@ -212,7 +216,7 @@ class YHFormTitleItem : YHFormItemProtocol {
return "港澳通行证".local return "港澳通行证".local
case .chinaIdCardInfo: case .chinaIdCardInfo:
return "中国身份证".local return "中国身份证".local
case .passPortInfo: case .passPortOrTravelInfo:
return String(format: "%@(%@)", "护照及其他旅行证件".local, "选填".local) return String(format: "%@(%@)", "护照及其他旅行证件".local, "选填".local)
case .spouseInfo: case .spouseInfo:
return "配偶信息".local return "配偶信息".local
...@@ -262,7 +266,7 @@ class YHFormTitleItem : YHFormItemProtocol { ...@@ -262,7 +266,7 @@ class YHFormTitleItem : YHFormItemProtocol {
return "".local return "".local
case .chinaIdCardInfo: case .chinaIdCardInfo:
return "".local return "".local
case .passPortInfo: case .passPortOrTravelInfo:
return "".local return "".local
case .spouseInfo: case .spouseInfo:
return "".local return "".local
...@@ -297,6 +301,9 @@ class YHFormDetailItem : YHFormItemProtocol { ...@@ -297,6 +301,9 @@ class YHFormDetailItem : YHFormItemProtocol {
// 是否是必填项 // 是否是必填项
var isNeed: Bool = true var isNeed: Bool = true
var value: String?
// 是否随行 // 是否随行
var isAccompany:Bool = false var isAccompany:Bool = false
// 是否办理港澳通信证 // 是否办理港澳通信证
...@@ -336,12 +343,19 @@ class YHFormDetailItem : YHFormItemProtocol { ...@@ -336,12 +343,19 @@ class YHFormDetailItem : YHFormItemProtocol {
case .isHandleHKPassPort: case .isHandleHKPassPort:
return "是否办理".local return "是否办理".local
// 证件类别 // 证件类别
case .cetificateType: case .certificateType:
return "证件类别".local return "证件类别".local
// 证件号码 // 证件号码
case .certificateNumber: case .certificateNumber:
return "证件号码".local
// 证件号码
case .chinaIdentityCardNumber:
return "中国身份证号".local return "中国身份证号".local
// 旅行证件号码
case .traverlPassportNumber:
return "旅行证件号码".local
// 签发日期 // 签发日期
case .certificateSignDate: case .certificateSignDate:
return "签发日期".local return "签发日期".local
...@@ -547,6 +561,7 @@ class YHFamilyMember: SmartCodable, YHFormItemProtocol { ...@@ -547,6 +561,7 @@ class YHFamilyMember: SmartCodable, YHFormItemProtocol {
// mark any // mark any
// var certificates: YHCertificates? // var certificates: YHCertificates?
var certificates: SmartAny? var certificates: SmartAny?
var certificatesd: YHCertificates?
enum CodingKeys: String, CodingKey { enum CodingKeys: String, CodingKey {
case id = "id" case id = "id"
...@@ -687,24 +702,31 @@ class YHSubsetNamePinyin: SmartCodable { ...@@ -687,24 +702,31 @@ class YHSubsetNamePinyin: SmartCodable {
// MARK: - YHCertificates // MARK: - YHCertificates
class YHCertificates: SmartCodable { class YHCertificates: SmartCodable {
required init() {
}
var cnIdentityCard: YHCNIdentityCard? var cnIdentityCard: YHCNIdentityCard?
var passport: YHCNIdentityCard? var passport: YHCNIdentityCard?
var hkMacaoPass: YHCNIdentityCard?
enum CodingKeys: String, CodingKey { enum CodingKeys: String, CodingKey {
case cnIdentityCard = "cnIdentityCard" case cnIdentityCard = "cnIdentityCard"
case passport = "passport" case passport = "passport"
case hkMacaoPass = "hkMacaoPass"
}
required init() {
}
init(cnIdentityCard: YHCNIdentityCard?, passport: YHCNIdentityCard?, hkMacaoPass: YHCNIdentityCard?) {
self.cnIdentityCard = cnIdentityCard
self.passport = passport
self.hkMacaoPass = hkMacaoPass
} }
} }
// MARK: - YHCNIdentityCard // MARK: - YHCNIdentityCard
class YHCNIdentityCard: SmartCodable { class YHCNIdentityCard: SmartCodable {
required init() {
}
var id: Int = 0 var id: Int = 0
var number: String? var number: String?
...@@ -725,6 +747,20 @@ class YHCNIdentityCard: SmartCodable { ...@@ -725,6 +747,20 @@ class YHCNIdentityCard: SmartCodable {
case imgBack = "img_back" case imgBack = "img_back"
case passportType = "passport_type" case passportType = "passport_type"
} }
required init() {
}
init(id:Int, number: String?, issueAt:String?, issueDateStartAt: String?, imgFront: String?, imgBack: String?, passportType: Int) {
self.id = id
self.number = number
self.issueAt = issueAt
self.issueDateStartAt = issueDateStartAt
self.imgFront = imgFront
self.imgBack = imgBack
self.passportType = passportType
}
} }
// MARK: - YHHasDegreeJson // MARK: - YHHasDegreeJson
......
//
// YHSaveAndSubmitView.swift
// galaxy
//
// Created by edy on 2024/1/31.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHSaveAndSubmitView: UIView {
static let submitBtnHeight = 48.0
static let gap = 8.0
static let height = submitBtnHeight+gap*2
var saveBlock:(()->Void)?
var submitBlock:(()->Void)?
lazy var submitBtn:UIButton = {
let btn = UIButton()
btn.setTitle("提交".local, for: .normal)
btn.titleLabel?.font = UIFont.PingFangScR(ofSize: 14)
btn.setTitleColor(.white, for: .normal)
btn.backgroundColor = UIColor(hexString:"#4388FF")
btn.layer.cornerRadius = 8.0
btn.addTarget(self, action: #selector(didClickSubmitBtn), for: .touchUpInside)
return btn
}()
lazy var saveBtn:UIButton = {
let btn = UIButton()
btn.setTitle("保存", for: .normal)
btn.titleLabel?.font = UIFont.PingFangScR(ofSize: 14)
btn.setTitleColor(UIColor(hexString:"#222222"), for: .normal)
btn.backgroundColor = UIColor(hexString:"#F8F9FB")
btn.layer.cornerRadius = 8.0
btn.addTarget(self, action: #selector(didClickSaveBtn), for: .touchUpInside)
return btn
}()
lazy var bottomView:UIView = {
let view = UIView()
view.backgroundColor = .white
view.addSubview(submitBtn)
view.addSubview(saveBtn)
return view
}()
static func createView() -> YHSaveAndSubmitView {
let view = YHSaveAndSubmitView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: Self.height))
return view
}
override init(frame: CGRect) {
super.init(frame: frame)
self.createUI()
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
func createUI() {
self.backgroundColor = .white
self.addSubview(saveBtn)
self.addSubview(submitBtn)
saveBtn.snp.makeConstraints { make in
make.left.equalToSuperview().offset(16)
make.size.equalTo(CGSize(width: 86.0, height: Self.submitBtnHeight))
make.top.equalTo(Self.gap)
}
submitBtn.snp.makeConstraints { make in
make.left.equalTo(saveBtn.snp.right).offset(10)
make.right.equalToSuperview().offset(-16)
make.height.equalTo(Self.submitBtnHeight)
make.centerY.equalTo(saveBtn)
}
}
@objc func didClickSubmitBtn() {
if let submitBlock = submitBlock {
submitBlock()
}
}
@objc func didClickSaveBtn() {
if let saveBlock = saveBlock {
saveBlock()
}
}
}
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
import UIKit import UIKit
class YHStepView: UIScrollView { class YHStepView: UIScrollView {
static let height = 104.0
typealias Block = (Int) -> () typealias Block = (Int) -> ()
var block: Block? var block: Block?
var dataSource: [String]? { var dataSource: [String]? {
......
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