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

// 父母信息

parent 1f776d04
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
041B52952B5E7037007EBCEB /* YHFormItemAddCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52942B5E7037007EBCEB /* YHFormItemAddCell.swift */; }; 041B52952B5E7037007EBCEB /* YHFormItemAddCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52942B5E7037007EBCEB /* YHFormItemAddCell.swift */; };
041B52982B5E8EA0007EBCEB /* YHFamilyMemberFormVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52972B5E8EA0007EBCEB /* YHFamilyMemberFormVC.swift */; }; 041B52982B5E8EA0007EBCEB /* YHFamilyMemberFormVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52972B5E8EA0007EBCEB /* YHFamilyMemberFormVC.swift */; };
041B52D62B5F899E007EBCEB /* YHSpouseInitialInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52D52B5F899E007EBCEB /* YHSpouseInitialInfoVC.swift */; }; 041B52D62B5F899E007EBCEB /* YHSpouseInitialInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52D52B5F899E007EBCEB /* YHSpouseInitialInfoVC.swift */; };
041B52D92B5F8B07007EBCEB /* YHConsortInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52D82B5F8B07007EBCEB /* YHConsortInfo.swift */; };
041B52DB2B5FDF8E007EBCEB /* YHFamilyInitialInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52DA2B5FDF8E007EBCEB /* YHFamilyInitialInfo.swift */; }; 041B52DB2B5FDF8E007EBCEB /* YHFamilyInitialInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52DA2B5FDF8E007EBCEB /* YHFamilyInitialInfo.swift */; };
041B52DD2B60A889007EBCEB /* YHTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52DC2B60A889007EBCEB /* YHTest.swift */; }; 041B52DD2B60A889007EBCEB /* YHTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52DC2B60A889007EBCEB /* YHTest.swift */; };
042FBBB92B627C0F00F9DE23 /* YHCertificateInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBB82B627C0E00F9DE23 /* YHCertificateInfo.swift */; }; 042FBBB92B627C0F00F9DE23 /* YHCertificateInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBB82B627C0E00F9DE23 /* YHCertificateInfo.swift */; };
...@@ -25,6 +24,7 @@ ...@@ -25,6 +24,7 @@
042FBBBF2B639F0300F9DE23 /* YHSpouseBasicInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBBE2B639F0300F9DE23 /* YHSpouseBasicInfoVC.swift */; }; 042FBBBF2B639F0300F9DE23 /* YHSpouseBasicInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBBE2B639F0300F9DE23 /* YHSpouseBasicInfoVC.swift */; };
042FBBC12B63B21700F9DE23 /* YHFormItemDegreeInfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBC02B63B21700F9DE23 /* YHFormItemDegreeInfoCell.swift */; }; 042FBBC12B63B21700F9DE23 /* YHFormItemDegreeInfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBC02B63B21700F9DE23 /* YHFormItemDegreeInfoCell.swift */; };
042FBBC32B63DA4C00F9DE23 /* YHParentInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBC22B63DA4C00F9DE23 /* YHParentInfoVC.swift */; }; 042FBBC32B63DA4C00F9DE23 /* YHParentInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBC22B63DA4C00F9DE23 /* YHParentInfoVC.swift */; };
042FBBC52B64AE3D00F9DE23 /* YHFormItemOnlyDoubleChoiceCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBC42B64AE3D00F9DE23 /* YHFormItemOnlyDoubleChoiceCell.swift */; };
0468D4202B49320900CFB916 /* YHVerificationCodeLoginController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D41F2B49320900CFB916 /* YHVerificationCodeLoginController.swift */; }; 0468D4202B49320900CFB916 /* YHVerificationCodeLoginController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D41F2B49320900CFB916 /* YHVerificationCodeLoginController.swift */; };
0468D4222B493A5E00CFB916 /* YHPhoneMessageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4212B493A5E00CFB916 /* YHPhoneMessageView.swift */; }; 0468D4222B493A5E00CFB916 /* YHPhoneMessageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4212B493A5E00CFB916 /* YHPhoneMessageView.swift */; };
0468D4242B494BEA00CFB916 /* YHCodeResultViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4232B494BEA00CFB916 /* YHCodeResultViewController.swift */; }; 0468D4242B494BEA00CFB916 /* YHCodeResultViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4232B494BEA00CFB916 /* YHCodeResultViewController.swift */; };
...@@ -178,7 +178,6 @@ ...@@ -178,7 +178,6 @@
041B52942B5E7037007EBCEB /* YHFormItemAddCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormItemAddCell.swift; sourceTree = "<group>"; }; 041B52942B5E7037007EBCEB /* YHFormItemAddCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormItemAddCell.swift; sourceTree = "<group>"; };
041B52972B5E8EA0007EBCEB /* YHFamilyMemberFormVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFamilyMemberFormVC.swift; sourceTree = "<group>"; }; 041B52972B5E8EA0007EBCEB /* YHFamilyMemberFormVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFamilyMemberFormVC.swift; sourceTree = "<group>"; };
041B52D52B5F899E007EBCEB /* YHSpouseInitialInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSpouseInitialInfoVC.swift; sourceTree = "<group>"; }; 041B52D52B5F899E007EBCEB /* YHSpouseInitialInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSpouseInitialInfoVC.swift; sourceTree = "<group>"; };
041B52D82B5F8B07007EBCEB /* YHConsortInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHConsortInfo.swift; sourceTree = "<group>"; };
041B52DA2B5FDF8E007EBCEB /* YHFamilyInitialInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFamilyInitialInfo.swift; sourceTree = "<group>"; }; 041B52DA2B5FDF8E007EBCEB /* YHFamilyInitialInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFamilyInitialInfo.swift; sourceTree = "<group>"; };
041B52DC2B60A889007EBCEB /* YHTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHTest.swift; sourceTree = "<group>"; }; 041B52DC2B60A889007EBCEB /* YHTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHTest.swift; sourceTree = "<group>"; };
042FBBB82B627C0E00F9DE23 /* YHCertificateInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateInfo.swift; sourceTree = "<group>"; }; 042FBBB82B627C0E00F9DE23 /* YHCertificateInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateInfo.swift; sourceTree = "<group>"; };
...@@ -187,6 +186,7 @@ ...@@ -187,6 +186,7 @@
042FBBBE2B639F0300F9DE23 /* YHSpouseBasicInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSpouseBasicInfoVC.swift; sourceTree = "<group>"; }; 042FBBBE2B639F0300F9DE23 /* YHSpouseBasicInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSpouseBasicInfoVC.swift; sourceTree = "<group>"; };
042FBBC02B63B21700F9DE23 /* YHFormItemDegreeInfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormItemDegreeInfoCell.swift; sourceTree = "<group>"; }; 042FBBC02B63B21700F9DE23 /* YHFormItemDegreeInfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormItemDegreeInfoCell.swift; sourceTree = "<group>"; };
042FBBC22B63DA4C00F9DE23 /* YHParentInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHParentInfoVC.swift; sourceTree = "<group>"; }; 042FBBC22B63DA4C00F9DE23 /* YHParentInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHParentInfoVC.swift; sourceTree = "<group>"; };
042FBBC42B64AE3D00F9DE23 /* YHFormItemOnlyDoubleChoiceCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormItemOnlyDoubleChoiceCell.swift; sourceTree = "<group>"; };
0468D41F2B49320900CFB916 /* YHVerificationCodeLoginController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHVerificationCodeLoginController.swift; sourceTree = "<group>"; }; 0468D41F2B49320900CFB916 /* YHVerificationCodeLoginController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHVerificationCodeLoginController.swift; sourceTree = "<group>"; };
0468D4212B493A5E00CFB916 /* YHPhoneMessageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPhoneMessageView.swift; sourceTree = "<group>"; }; 0468D4212B493A5E00CFB916 /* YHPhoneMessageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPhoneMessageView.swift; sourceTree = "<group>"; };
0468D4232B494BEA00CFB916 /* YHCodeResultViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCodeResultViewController.swift; sourceTree = "<group>"; }; 0468D4232B494BEA00CFB916 /* YHCodeResultViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCodeResultViewController.swift; sourceTree = "<group>"; };
...@@ -364,6 +364,7 @@ ...@@ -364,6 +364,7 @@
041B52902B5E67F3007EBCEB /* YHFormItemEnterDetailCell.swift */, 041B52902B5E67F3007EBCEB /* YHFormItemEnterDetailCell.swift */,
042FBBBC2B63519C00F9DE23 /* YHFormItemSelectSheetCell.swift */, 042FBBBC2B63519C00F9DE23 /* YHFormItemSelectSheetCell.swift */,
042FBBC02B63B21700F9DE23 /* YHFormItemDegreeInfoCell.swift */, 042FBBC02B63B21700F9DE23 /* YHFormItemDegreeInfoCell.swift */,
042FBBC42B64AE3D00F9DE23 /* YHFormItemOnlyDoubleChoiceCell.swift */,
); );
path = View; path = View;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -383,7 +384,6 @@ ...@@ -383,7 +384,6 @@
041B52D72B5F8ADA007EBCEB /* M */ = { 041B52D72B5F8ADA007EBCEB /* M */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
041B52D82B5F8B07007EBCEB /* YHConsortInfo.swift */,
041B52DA2B5FDF8E007EBCEB /* YHFamilyInitialInfo.swift */, 041B52DA2B5FDF8E007EBCEB /* YHFamilyInitialInfo.swift */,
042FBBB82B627C0E00F9DE23 /* YHCertificateInfo.swift */, 042FBBB82B627C0E00F9DE23 /* YHCertificateInfo.swift */,
041B52DC2B60A889007EBCEB /* YHTest.swift */, 041B52DC2B60A889007EBCEB /* YHTest.swift */,
...@@ -1081,7 +1081,6 @@ ...@@ -1081,7 +1081,6 @@
A5ACE9332B4564F7002C94D2 /* NetBaseModel.swift in Sources */, A5ACE9332B4564F7002C94D2 /* NetBaseModel.swift in Sources */,
049A48AA2B49536000D0C641 /* YHAboutUsAdvantageCell.swift in Sources */, 049A48AA2B49536000D0C641 /* YHAboutUsAdvantageCell.swift in Sources */,
A5C5B3002B55623800A7C5D1 /* ContentBaseViewController.swift in Sources */, A5C5B3002B55623800A7C5D1 /* ContentBaseViewController.swift in Sources */,
041B52D92B5F8B07007EBCEB /* YHConsortInfo.swift in Sources */,
A5573ED22B317BFF00D98EC0 /* AppDelegate.swift in Sources */, A5573ED22B317BFF00D98EC0 /* AppDelegate.swift in Sources */,
A5ACE9542B4564F7002C94D2 /* YHNavigationController.swift in Sources */, A5ACE9542B4564F7002C94D2 /* YHNavigationController.swift in Sources */,
A5ACE95E2B4571BF002C94D2 /* YHHomeViewController.swift in Sources */, A5ACE95E2B4571BF002C94D2 /* YHHomeViewController.swift in Sources */,
...@@ -1096,6 +1095,7 @@ ...@@ -1096,6 +1095,7 @@
04AF58C42B4FC51C0066011A /* YHLocalizable.swift in Sources */, 04AF58C42B4FC51C0066011A /* YHLocalizable.swift in Sources */,
042FBBBF2B639F0300F9DE23 /* YHSpouseBasicInfoVC.swift in Sources */, 042FBBBF2B639F0300F9DE23 /* YHSpouseBasicInfoVC.swift in Sources */,
A5C5B2E82B4EC95600A7C5D1 /* YHDavidTestCollectionViewCell.swift in Sources */, A5C5B2E82B4EC95600A7C5D1 /* YHDavidTestCollectionViewCell.swift in Sources */,
042FBBC52B64AE3D00F9DE23 /* YHFormItemOnlyDoubleChoiceCell.swift in Sources */,
041B52DB2B5FDF8E007EBCEB /* YHFamilyInitialInfo.swift in Sources */, 041B52DB2B5FDF8E007EBCEB /* YHFamilyInitialInfo.swift in Sources */,
0468D4222B493A5E00CFB916 /* YHPhoneMessageView.swift in Sources */, 0468D4222B493A5E00CFB916 /* YHPhoneMessageView.swift in Sources */,
0468D4362B57752F00CFB916 /* YHUserModel.swift in Sources */, 0468D4362B57752F00CFB916 /* YHUserModel.swift in Sources */,
......
...@@ -33,8 +33,7 @@ class YHParentInfoVC: YHBaseViewController { ...@@ -33,8 +33,7 @@ class YHParentInfoVC: YHBaseViewController {
tableView.register(YHFormItemTitleCell.self, forCellReuseIdentifier: YHFormItemTitleCell.cellReuseIdentifier) tableView.register(YHFormItemTitleCell.self, forCellReuseIdentifier: YHFormItemTitleCell.cellReuseIdentifier)
tableView.register(YHFormItemAddCell.self, forCellReuseIdentifier: YHFormItemAddCell.cellReuseIdentifier) tableView.register(YHFormItemAddCell.self, forCellReuseIdentifier: YHFormItemAddCell.cellReuseIdentifier)
tableView.register(YHFormItemSelectSheetCell.self, forCellReuseIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier) tableView.register(YHFormItemSelectSheetCell.self, forCellReuseIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier)
tableView.register(YHFormItemDegreeInfoCell.self, forCellReuseIdentifier: YHFormItemDegreeInfoCell.cellReuseIdentifier) tableView.register(YHFormItemOnlyDoubleChoiceCell.self, forCellReuseIdentifier: YHFormItemOnlyDoubleChoiceCell.cellReuseIdentifier)
return tableView return tableView
}() }()
...@@ -65,45 +64,51 @@ class YHParentInfoVC: YHBaseViewController { ...@@ -65,45 +64,51 @@ class YHParentInfoVC: YHBaseViewController {
items.removeAll() items.removeAll()
// 基本信息
let title0:YHFormItemProtocol = YHFormTitleItem(type: .basicInfo)
let item00:YHFormItemProtocol = YHFormDetailItem(type: .onlyDoubleChoice)
let arr0:[YHFormItemProtocol] = [title0, item00]
// 父母亲信息 // 父母亲信息
var arr0 = [YHFormItemProtocol]() var arr1 = [YHFormItemProtocol]()
if parentInfo.sex == 1 { // 父亲 if parentInfo.sex == -1 { // 父亲
let title0:YHFormItemProtocol = YHFormTitleItem(type: .fatherInfo) let title1:YHFormItemProtocol = YHFormTitleItem(type: .fatherInfo)
let item00:YHFormItemProtocol = YHFormDetailItem(type: .fatherName) let item10:YHFormItemProtocol = YHFormDetailItem(type: .fatherName)
arr0.append(contentsOf: [title0, item00]) arr1.append(contentsOf: [title1, item10])
} else { // 母亲 } else { // 母亲
let title0:YHFormItemProtocol = YHFormTitleItem(type: .motherInfo) let title1:YHFormItemProtocol = YHFormTitleItem(type: .motherInfo)
let item00:YHFormItemProtocol = YHFormDetailItem(type: .motherName) let item10:YHFormItemProtocol = YHFormDetailItem(type: .motherName)
arr0.append(contentsOf: [title0, item00]) arr1.append(contentsOf: [title1, item10])
} }
let item01:YHFormItemProtocol = YHFormDetailItem(type: .birthday) let item11:YHFormItemProtocol = YHFormDetailItem(type: .birthday)
let item02:YHFormItemProtocol = YHFormDetailItem(type: .birthNation) let item12:YHFormItemProtocol = YHFormDetailItem(type: .birthNation)
let item03:YHFormItemProtocol = YHFormDetailItem(type: .birthCity) let item13:YHFormItemProtocol = YHFormDetailItem(type: .birthCity)
arr0.append(contentsOf: [item01, item02, item03]) arr1.append(contentsOf: [item11, item12, item13])
if parentInfo.deceased != 1 { // 健在 if parentInfo.deceased != 1 { // 健在
let item04:YHFormItemProtocol = YHFormDetailItem(type: .marriageState) let item14:YHFormItemProtocol = YHFormDetailItem(type: .marriageState)
arr0.append(item04) arr1.append(item14)
} }
// 职业信息 // 职业信息
let title1:YHFormItemProtocol = YHFormTitleItem(type: .occupationInfo) let title2:YHFormItemProtocol = YHFormTitleItem(type: .occupationInfo)
let item10:YHFormItemProtocol = YHFormDetailItem(type: .occupation) let item20:YHFormItemProtocol = YHFormDetailItem(type: .occupation)
let arr1:[YHFormItemProtocol] = [title1, item10] let arr2:[YHFormItemProtocol] = [title2, item20]
// 居住信息 // 居住信息
let title2:YHFormItemProtocol = YHFormTitleItem(type: .liveInfo) let title3:YHFormItemProtocol = YHFormTitleItem(type: .liveInfo)
let item20:YHFormItemProtocol = YHFormDetailItem(type: .liveNationOrArea) let item30:YHFormItemProtocol = YHFormDetailItem(type: .liveNationOrArea)
let arr2:[YHFormItemProtocol] = [title2, item20] let arr3:[YHFormItemProtocol] = [title3, item30]
// 香港身份证 // 香港身份证
let title3:YHFormItemProtocol = YHFormTitleItem(type: .hkIdentityCardInfo) let title4:YHFormItemProtocol = YHFormTitleItem(type: .hkIdentityCardInfo)
let item30:YHFormItemProtocol = YHFormDetailItem(type: .isHaveHkIdentityCard) let item40:YHFormItemProtocol = YHFormDetailItem(type: .isHaveHkIdentityCard)
let item31:YHFormItemProtocol = YHFormDetailItem(type: .hkIdentityCardNumber) let item41:YHFormItemProtocol = YHFormDetailItem(type: .hkIdentityCardNumber)
let arr3:[YHFormItemProtocol] = [title3, item30, item31] let arr4:[YHFormItemProtocol] = [title4, item40, item41]
items.append(contentsOf: [arr0, arr1, arr2, arr3]) items.append(contentsOf: [arr0, arr1, arr2, arr3, arr4])
tableView.reloadData() tableView.reloadData()
} }
...@@ -135,6 +140,10 @@ class YHParentInfoVC: YHBaseViewController { ...@@ -135,6 +140,10 @@ class YHParentInfoVC: YHBaseViewController {
{ {
return .twoChoice return .twoChoice
} }
if detailItem.type == .onlyDoubleChoice
{
return .onlyTwoChoice
}
} }
return .defaultType return .defaultType
} }
...@@ -180,7 +189,7 @@ extension YHParentInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -180,7 +189,7 @@ extension YHParentInfoVC : UITableViewDelegate, UITableViewDataSource {
return cell return cell
} }
if cellType == .twoChoice { // 双项选择cell if cellType == .twoChoice { // 问答双项选择cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDoubleChoiceCell let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDoubleChoiceCell
cell.title = item.getTitle() cell.title = item.getTitle()
...@@ -190,6 +199,26 @@ extension YHParentInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -190,6 +199,26 @@ extension YHParentInfoVC : UITableViewDelegate, UITableViewDataSource {
return cell return cell
} }
if cellType == .onlyTwoChoice { // 仅有双项选择cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemOnlyDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemOnlyDoubleChoiceCell
var isDead = 0
if let dead = parentInfo?.deceased, dead == 1 { // 已故
isDead = 1
}
let answers = [YHFormChoiceItem(title: "健在".local, isSelect: isDead != 1),
YHFormChoiceItem(title: "已故".local, isSelect: isDead == 1)]
cell.answerArr = answers
cell.answerBlock = { [weak self]
(arr, selectIndex) in
let selectItem:YHFormChoiceItem = arr[selectIndex]
self?.parentInfo?.deceased = (selectItem.title == "已故" ? 1 : 0)
self?.loadBasicInfo()
}
return cell
}
if cellType == .addItem { // 新增item cell if cellType == .addItem { // 新增item cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemAddCell.cellReuseIdentifier, for: indexPath) as! YHFormItemAddCell let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemAddCell.cellReuseIdentifier, for: indexPath) as! YHFormItemAddCell
cell.title = item.getTitle() cell.title = item.getTitle()
......
...@@ -18,6 +18,7 @@ enum HKFormItemCellType: Int { ...@@ -18,6 +18,7 @@ enum HKFormItemCellType: Int {
case twoChoice = 5 case twoChoice = 5
case addItem = 6 case addItem = 6
case degreeDetailInfo = 7 case degreeDetailInfo = 7
case onlyTwoChoice = 8
} }
......
...@@ -88,7 +88,7 @@ class YHSpouseInitialInfoVC: YHBaseViewController { ...@@ -88,7 +88,7 @@ class YHSpouseInitialInfoVC: YHBaseViewController {
if item0.isAccompany { // 随行才加后面的信息 if item0.isAccompany { // 随行才加后面的信息
// 国籍 // 国籍
let title1 = YHFormTitleItem(type: .country) let title1 = YHFormTitleItem(type: .country)
let item10 = YHFormDetailItem(type: .country) let item10 = YHFormDetailItem(type: .nationOrArea)
item10.country = "中国" item10.country = "中国"
let arr1:[YHFormItemProtocol] = [title1, item10] let arr1:[YHFormItemProtocol] = [title1, item10]
...@@ -102,7 +102,7 @@ class YHSpouseInitialInfoVC: YHBaseViewController { ...@@ -102,7 +102,7 @@ class YHSpouseInitialInfoVC: YHBaseViewController {
let arr2:[YHFormItemProtocol] = [title2, item20, item21, item22, item23] let arr2:[YHFormItemProtocol] = [title2, item20, item21, item22, item23]
// 港澳通信证 // 港澳通信证
let title3 = YHFormTitleItem(type: .getHKPassport) let title3 = YHFormTitleItem(type: .hkAndMacaoPassport)
let item30 = YHFormDetailItem(type: .isHandleHKPassPort) let item30 = YHFormDetailItem(type: .isHandleHKPassPort)
item30.isHandleHkPassport = (spouse.isHandled == 1) item30.isHandleHkPassport = (spouse.isHandled == 1)
let arr3:[YHFormItemProtocol] = [title3, item30] let arr3:[YHFormItemProtocol] = [title3, item30]
...@@ -236,7 +236,7 @@ extension YHSpouseInitialInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -236,7 +236,7 @@ extension YHSpouseInitialInfoVC : UITableViewDelegate, UITableViewDataSource {
} }
return cell return cell
} else if detailItem.type == .country || detailItem.type == .nationOrArea || detailItem.type == .liveCity || detailItem.type == .detailAddress { } else if detailItem.type == .nationOrArea || detailItem.type == .nationOrArea || detailItem.type == .liveCity || detailItem.type == .detailAddress {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemEnterDetailCell.cellReuseIdentifier, for: indexPath) as! YHFormItemEnterDetailCell let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemEnterDetailCell.cellReuseIdentifier, for: indexPath) as! YHFormItemEnterDetailCell
cell.isMust = detailItem.isNeed cell.isMust = detailItem.isNeed
......
//
// YHConsortInfo.swift
// galaxy
//
// Created by edy on 2024/1/23.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHConsortInfo {
}
public enum YHTableItemType : Int32 {
// 是否随行
case accompany = 0
// 国籍
case country = 1
// 居住信息
case address = 2
// 港澳通信证
case hongkongMacaouPassport = 3
}
//表单条目信息
class YHTableItemInfo {
var type:YHTableItemType
var title:String {
return getTitle()
}
init(type: YHTableItemType) {
self.type = type
}
var subTitleItems:[YHTableSubItemInfo]? = Array()
func getTitle()-> String {
switch self.type {
case .accompany:
return "随行".local
case .country:
return "国籍".local
case .address:
return "居住信息".local
case .hongkongMacaouPassport:
return "港澳通信证".local
}
}
func getSubItems()->[YHTableSubItemInfo] {
let item0 = YHTableSubItemInfo(type: .subTitle)
var res = [item0]
switch self.type {
case .accompany:
res.append(YHTableSubItemInfo(type: .subAcompany))
case .country:
res.append(YHTableSubItemInfo(type: .subCountry))
case .address:
let item1 = YHTableSubItemInfo(type: .subIsLiveTogether, isMust: true)
let item2 = YHTableSubItemInfo(type: .subLiveNation, isMust: true)
let item3 = YHTableSubItemInfo(type: .subDetailAddress, isMust: true)
res.append(contentsOf:[item1, item2, item3])
case .hongkongMacaouPassport:
res.append(YHTableSubItemInfo(type: .subHongkongMacaouPassport, isMust: true))
}
return res
}
}
public enum YHTableSubItemType : Int32 {
// 标题
case subTitle = 0
// 是否随行
case subAcompany = 1
// 国籍
case subCountry = 2
/* 居住信息 */
// 是否与主申请人同住
case subIsLiveTogether = 3
// 居住国家/地区
case subLiveNation = 4
// 现居住城市
case subLiveCity = 5
// 详细地址
case subDetailAddress = 6
// 港澳通信证
case subHongkongMacaouPassport = 7
}
class YHTableSubItemInfo {
var type:YHTableSubItemType
// 是否必填
var isMust:Bool
var title:String {
return getTitle()
}
init(type: YHTableSubItemType, isMust:Bool = true) {
self.type = type
self.isMust = isMust
}
func getTitle()-> String {
switch self.type {
case .subTitle:
return "".local
case .subAcompany:
return "是否随行至香港".local
case .subCountry:
return "国家/地区".local
case .subIsLiveTogether:
return "是否与主申请人同住".local
case .subLiveNation:
return "国家/地区".local
case .subLiveCity:
return "现居住城市".local
case .subDetailAddress:
return "现居住地址".local
case .subHongkongMacaouPassport:
return "是否办理".local
}
}
}
...@@ -18,15 +18,23 @@ protocol YHFormItemProtocol { ...@@ -18,15 +18,23 @@ protocol YHFormItemProtocol {
// 表单标题类型 // 表单标题类型
enum YHFormTitleItemType:Int { enum YHFormTitleItemType:Int {
// 配偶
case sponse = 1 case sponse = 1
// 父母
case parent = 2 case parent = 2
// 子女
case child = 3 case child = 3
// 兄弟姐妹
case brother = 4 case brother = 4
// 随行
case accompany = 5 case accompany = 5
// 国籍
case country = 6 case country = 6
// 居住信息
case liveInfo = 7 case liveInfo = 7
case getHKPassport = 8 // 港澳通信证
case hkAndMacaoPassport = 8
// 中国身份证 // 中国身份证
case chinaIdCardInfo = 9 case chinaIdCardInfo = 9
...@@ -46,8 +54,10 @@ enum YHFormTitleItemType:Int { ...@@ -46,8 +54,10 @@ enum YHFormTitleItemType:Int {
// 父亲信息 // 父亲信息
case fatherInfo = 16 case fatherInfo = 16
// 亲信息 // 亲信息
case motherInfo = 17 case motherInfo = 17
// 基本信息
case basicInfo = 18
} }
...@@ -64,7 +74,6 @@ enum YHFormDetailItemType:Int { ...@@ -64,7 +74,6 @@ enum YHFormDetailItemType:Int {
// 是否随行至香港 // 是否随行至香港
case isAccompanyToHK = 1 case isAccompanyToHK = 1
case country = 2
// 是否与主申请人同住 // 是否与主申请人同住
case isLiveTother = 3 case isLiveTother = 3
// 国家/地区 // 国家/地区
...@@ -126,6 +135,8 @@ enum YHFormDetailItemType:Int { ...@@ -126,6 +135,8 @@ enum YHFormDetailItemType:Int {
case marriageState = 30 case marriageState = 30
// 现居住国家/地区 // 现居住国家/地区
case liveNationOrArea = 31 case liveNationOrArea = 31
// 仅有两个按钮 标题数组有外部提供
case onlyDoubleChoice = 32
} }
...@@ -180,7 +191,7 @@ class YHFormTitleItem : YHFormItemProtocol { ...@@ -180,7 +191,7 @@ class YHFormTitleItem : YHFormItemProtocol {
return "国籍".local return "国籍".local
case .liveInfo: case .liveInfo:
return "居住信息".local return "居住信息".local
case .getHKPassport: case .hkAndMacaoPassport:
return "港澳通行证".local return "港澳通行证".local
case .chinaIdCardInfo: case .chinaIdCardInfo:
return "中国身份证".local return "中国身份证".local
...@@ -200,6 +211,8 @@ class YHFormTitleItem : YHFormItemProtocol { ...@@ -200,6 +211,8 @@ class YHFormTitleItem : YHFormItemProtocol {
return "父亲信息".local return "父亲信息".local
case .motherInfo: case .motherInfo:
return "母亲信息".local return "母亲信息".local
case .basicInfo:
return "基本信息".local
} }
} }
...@@ -220,7 +233,7 @@ class YHFormTitleItem : YHFormItemProtocol { ...@@ -220,7 +233,7 @@ class YHFormTitleItem : YHFormItemProtocol {
return "".local return "".local
case .liveInfo: case .liveInfo:
return "".local return "".local
case .getHKPassport: case .hkAndMacaoPassport:
return "".local return "".local
case .chinaIdCardInfo: case .chinaIdCardInfo:
return "".local return "".local
...@@ -240,7 +253,8 @@ class YHFormTitleItem : YHFormItemProtocol { ...@@ -240,7 +253,8 @@ class YHFormTitleItem : YHFormItemProtocol {
return "".local return "".local
case .motherInfo: case .motherInfo:
return "".local return "".local
case .basicInfo:
return "".local
} }
} }
...@@ -270,8 +284,9 @@ class YHFormDetailItem : YHFormItemProtocol { ...@@ -270,8 +284,9 @@ class YHFormDetailItem : YHFormItemProtocol {
// 现居住详细地址 // 现居住详细地址
var liveAddress:String? = "" var liveAddress:String? = ""
init(type: YHFormDetailItemType) { init(type: YHFormDetailItemType, isNeed:Bool = true) {
self.type = type self.type = type
self.isNeed = isNeed
} }
...@@ -280,14 +295,12 @@ class YHFormDetailItem : YHFormItemProtocol { ...@@ -280,14 +295,12 @@ class YHFormDetailItem : YHFormItemProtocol {
switch type { switch type {
case .isAccompanyToHK: case .isAccompanyToHK:
return "是否随行至香港".local return "是否随行至香港".local
case .country:
return String(format: "%@/%@", "国家".local, "地区".local)
case .isLiveTother: case .isLiveTother:
return "是否与主申请人同住".local return "是否与主申请人同住".local
case .nationOrArea: case .nationOrArea:
return String(format: "%@/%@", "国家".local, "地区".local) return String(format: "%@/%@", "国家".local, "地区".local)
case .liveCity: case .liveCity:
return String(format: "%@/%@", "国家".local, "地区".local) return "现居住城市".local
case .detailAddress: case .detailAddress:
return "详细地址".local return "详细地址".local
case .isHandleHKPassPort: case .isHandleHKPassPort:
...@@ -359,6 +372,9 @@ class YHFormDetailItem : YHFormItemProtocol { ...@@ -359,6 +372,9 @@ class YHFormDetailItem : YHFormItemProtocol {
return "婚姻状况".local return "婚姻状况".local
case .liveNationOrArea: case .liveNationOrArea:
return "现居住国家/地区".local return "现居住国家/地区".local
case .onlyDoubleChoice:
return "".local
} }
} }
......
//
// YHFormItemOnlyDoubleChoiceCell.swift
// galaxy
//
// Created by edy on 2024/1/27.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHFormItemOnlyDoubleChoiceCell: UITableViewCell {
static let cellReuseIdentifier = "YHFormItemOnlyDoubleChoiceCell"
let btnWidth = 70.0
let btnHeight = 32.0
let btnTitleSelectColor = UIColor(hex: 0x4487F9)
let btnTitleDefaultColor = UIColor(hex:0x222222)
let btnBgDefaultColor = UIColor(hex:0xF8F9FB)
let btnBgSelectColor = UIColor(hex:0x4487F9, alpha: 0.08)
let answerBaseTag = 9527
var answerBlock:(([YHFormChoiceItem], Int)->Void)?
// 必须传2个item的arr
var answerArr:[YHFormChoiceItem]? {
didSet {
if let answerArr = answerArr, answerArr.count == 2 {
for i in 0...1 {
let answerBtn = self.viewWithTag(answerBaseTag+i) as! UIButton
let item = answerArr[i]
answerBtn.setTitle(item.title, for: .normal)
updateAnswerButton(answerBtn, item.isSelect)
}
} else {
// 重置所有答案状态
for i in 0...1 {
let answerBtn = self.viewWithTag(answerBaseTag+i) as! UIButton
answerBtn.setTitle("", for: .normal)
updateAnswerButton(answerBtn, false)
}
}
}
}
// 更新答案按钮选中状态
func updateAnswerButton(_ btn:UIButton, _ isSelect:Bool) {
btn.layer.borderColor = (isSelect ? btnTitleSelectColor : .clear).cgColor
btn.setTitleColor((isSelect ? btnTitleSelectColor : btnTitleDefaultColor), for: .normal)
btn.backgroundColor = (isSelect ? btnBgSelectColor : btnBgDefaultColor)
}
lazy var answer1Btn: UIButton = {
let btn = UIButton()
btn.setTitle("", for: .normal)
btn.titleLabel?.font = UIFont.PFSCR(ofSize: 14)
btn.setTitleColor(btnTitleDefaultColor, for: .normal)
btn.backgroundColor = btnBgDefaultColor
btn.layer.cornerRadius = btnHeight/2.0
btn.layer.masksToBounds = true
btn.layer.borderWidth = 1
btn.layer.borderColor = UIColor.clear.cgColor
btn.tag = answerBaseTag
btn.addTarget(self, action: #selector(didClickResponseBtn(btn:)), for: .touchUpInside)
return btn
}()
lazy var answer2Btn: UIButton = {
let btn = UIButton()
btn.setTitle("", for: .normal)
btn.titleLabel?.font = UIFont.PFSCR(ofSize: 14)
btn.setTitleColor(btnTitleDefaultColor, for: .normal)
btn.backgroundColor = btnBgDefaultColor
btn.layer.cornerRadius = btnHeight/2.0
btn.layer.masksToBounds = true
btn.layer.borderWidth = 1
btn.layer.borderColor = UIColor.clear.cgColor
btn.tag = answerBaseTag+1
btn.addTarget(self, action: #selector(didClickResponseBtn(btn:)), for: .touchUpInside)
return btn
}()
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
func setupUI() {
self.selectionStyle = .none
contentView.addSubview(answer1Btn)
contentView.addSubview(answer2Btn)
answer1Btn.snp.makeConstraints { make in
make.size.equalTo(CGSize(width: btnWidth, height: btnHeight))
make.left.equalToSuperview().offset(16)
make.centerY.equalToSuperview()
}
answer2Btn.snp.makeConstraints { make in
make.size.equalTo(CGSize(width: btnWidth, height: btnHeight))
make.left.equalTo(answer1Btn.snp.right).offset(10)
make.centerY.equalTo(answer1Btn)
}
}
@objc func didClickResponseBtn(btn: UIButton) {
let selectIndex = btn.tag-answerBaseTag
if let resultArr = answerArr, resultArr.count == 2 {
for i in 0...1 {
let item = resultArr[i]
item.isSelect = (i == selectIndex)
}
answerArr = resultArr
if let answerBlock = answerBlock {
answerBlock(resultArr, selectIndex)
}
}
}
}
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