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

// 子女基本信息填写

parent 0a611846
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
042FBBC52B64AE3D00F9DE23 /* YHFormItemOnlyDoubleChoiceCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBC42B64AE3D00F9DE23 /* YHFormItemOnlyDoubleChoiceCell.swift */; }; 042FBBC52B64AE3D00F9DE23 /* YHFormItemOnlyDoubleChoiceCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBC42B64AE3D00F9DE23 /* YHFormItemOnlyDoubleChoiceCell.swift */; };
042FBBC72B64CFBF00F9DE23 /* YHChildInitialInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBC62B64CFBF00F9DE23 /* YHChildInitialInfoVC.swift */; }; 042FBBC72B64CFBF00F9DE23 /* YHChildInitialInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBC62B64CFBF00F9DE23 /* YHChildInitialInfoVC.swift */; };
042FBBC92B64DC8900F9DE23 /* YHFormItemExpireDateCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBC82B64DC8900F9DE23 /* YHFormItemExpireDateCell.swift */; }; 042FBBC92B64DC8900F9DE23 /* YHFormItemExpireDateCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBC82B64DC8900F9DE23 /* YHFormItemExpireDateCell.swift */; };
042FBBCB2B65058000F9DE23 /* YHChildBasicInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBCA2B65058000F9DE23 /* YHChildBasicInfoVC.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 */; };
...@@ -191,6 +192,7 @@ ...@@ -191,6 +192,7 @@
042FBBC42B64AE3D00F9DE23 /* YHFormItemOnlyDoubleChoiceCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormItemOnlyDoubleChoiceCell.swift; sourceTree = "<group>"; }; 042FBBC42B64AE3D00F9DE23 /* YHFormItemOnlyDoubleChoiceCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormItemOnlyDoubleChoiceCell.swift; sourceTree = "<group>"; };
042FBBC62B64CFBF00F9DE23 /* YHChildInitialInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHChildInitialInfoVC.swift; sourceTree = "<group>"; }; 042FBBC62B64CFBF00F9DE23 /* YHChildInitialInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHChildInitialInfoVC.swift; sourceTree = "<group>"; };
042FBBC82B64DC8900F9DE23 /* YHFormItemExpireDateCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormItemExpireDateCell.swift; sourceTree = "<group>"; }; 042FBBC82B64DC8900F9DE23 /* YHFormItemExpireDateCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormItemExpireDateCell.swift; sourceTree = "<group>"; };
042FBBCA2B65058000F9DE23 /* YHChildBasicInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHChildBasicInfoVC.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>"; };
...@@ -383,6 +385,7 @@ ...@@ -383,6 +385,7 @@
042FBBBE2B639F0300F9DE23 /* YHSpouseBasicInfoVC.swift */, 042FBBBE2B639F0300F9DE23 /* YHSpouseBasicInfoVC.swift */,
042FBBC22B63DA4C00F9DE23 /* YHParentInfoVC.swift */, 042FBBC22B63DA4C00F9DE23 /* YHParentInfoVC.swift */,
042FBBC62B64CFBF00F9DE23 /* YHChildInitialInfoVC.swift */, 042FBBC62B64CFBF00F9DE23 /* YHChildInitialInfoVC.swift */,
042FBBCA2B65058000F9DE23 /* YHChildBasicInfoVC.swift */,
); );
path = C; path = C;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -1186,6 +1189,7 @@ ...@@ -1186,6 +1189,7 @@
042FBBBB2B62806D00F9DE23 /* YHCertificateViewController.swift in Sources */, 042FBBBB2B62806D00F9DE23 /* YHCertificateViewController.swift in Sources */,
042FBBC72B64CFBF00F9DE23 /* YHChildInitialInfoVC.swift in Sources */, 042FBBC72B64CFBF00F9DE23 /* YHChildInitialInfoVC.swift in Sources */,
A5ACE9562B4564F7002C94D2 /* YHBouncesContentView.swift in Sources */, A5ACE9562B4564F7002C94D2 /* YHBouncesContentView.swift in Sources */,
042FBBCB2B65058000F9DE23 /* YHChildBasicInfoVC.swift in Sources */,
A5ACE9302B4564F7002C94D2 /* Algorithm.swift in Sources */, A5ACE9302B4564F7002C94D2 /* Algorithm.swift in Sources */,
A5C5B32B2B57D17600A7C5D1 /* YHDavidCell5.swift in Sources */, A5C5B32B2B57D17600A7C5D1 /* YHDavidCell5.swift in Sources */,
A5ACE92D2B4564F7002C94D2 /* YHLoginPrivacyView.swift in Sources */, A5ACE92D2B4564F7002C94D2 /* YHLoginPrivacyView.swift in Sources */,
......
//
// YHChildBasicInfoVC.swift
// galaxy
//
// Created by edy on 2024/1/27.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHChildBasicInfoVC: YHBaseViewController {
var child:YHChild?
var cardInfo: YHCNIdentityCard?
var items:[[YHFormItemProtocol]] = [[YHFormItemProtocol]]()
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.plain)
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
}
tableView.showsVerticalScrollIndicator = false
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHFormItemDoubleChoiceCell.self, forCellReuseIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier)
tableView.register(YHFormItemInputTextCell.self, forCellReuseIdentifier: YHFormItemInputTextCell.cellReuseIdentifier)
tableView.register(YHFormItemEnterDetailCell.self, forCellReuseIdentifier: YHFormItemEnterDetailCell.cellReuseIdentifier)
tableView.register(YHFormItemTitleCell.self, forCellReuseIdentifier: YHFormItemTitleCell.cellReuseIdentifier)
tableView.register(YHFormItemAddCell.self, forCellReuseIdentifier: YHFormItemAddCell.cellReuseIdentifier)
tableView.register(YHFormItemSelectSheetCell.self, forCellReuseIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier)
tableView.register(YHFormItemDegreeInfoCell.self, forCellReuseIdentifier: YHFormItemDegreeInfoCell.cellReuseIdentifier)
return tableView
}()
override func viewDidLoad() {
super.viewDidLoad()
gk_navTitle = "子女基本信息填写".local
createUI()
loadBasicInfo()
}
func createUI() {
view.addSubview(tableView);
tableView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalToSuperview().offset(-100)
make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-16)
}
}
func loadBasicInfo() {
// 子女信息
let title0 = YHFormTitleItem(type: .childInfo)
let item00 = YHFormDetailItem(type: .childName)
let item01 = YHFormDetailItem(type: .everName)
let item02 = YHFormDetailItem(type: .befourMarryFirstName)
let item03 = YHFormDetailItem(type: .gender)
let item04 = YHFormDetailItem(type: .marriageState)
let item05 = YHFormDetailItem(type: .birthday)
let item06 = YHFormDetailItem(type: .birthNation)
let item07 = YHFormDetailItem(type: .birthCity)
let arr0:[YHFormItemProtocol] = [title0, item00, item01, item02, item03, item04, item05, item06, item07]
// 职业
let title1 = YHFormTitleItem(type: .occupationInfo)
let item10 = YHFormDetailItem(type: .occupation)
let item11 = YHFormDetailItem(type: .occupationName)
let arr1:[YHFormItemProtocol] = [title1, item10, item11]
// 婚姻
let title2 = YHFormTitleItem(type: .isPreviousMarriageChild)
let item20 = YHFormDetailItem(type: .isPreviousMarriageChild)
let arr2:[YHFormItemProtocol] = [title2, item20]
// 在港信息
let title3 = YHFormTitleItem(type: .inHongKongInfo)
let item30 = YHFormDetailItem(type: .isNowInHK)
let item31 = YHFormDetailItem(type: .stayHKDate)
let item32 = YHFormDetailItem(type: .roleInHK)
let arr3:[YHFormItemProtocol] = [title3, item30, item31, item32]
// 香港身份证
let title4 = YHFormTitleItem(type: .hkIdentityCardInfo)
let item40 = YHFormDetailItem(type: .isHaveHkIdentityCard)
let item41 = YHFormDetailItem(type: .hkIdentityCardNumber)
let arr4:[YHFormItemProtocol] = [title4, item40, item41]
items.append(contentsOf: [arr0, arr1, arr2, arr3, arr4])
tableView.reloadData()
}
func getCellType(_ item: Any) ->HKFormItemCellType {
if item is YHFormTitleItem {
return .title
}
if item is YHFormAddItem {
return .addItem
}
if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem
if detailItem.type == .childName
|| detailItem.type == .everName
|| detailItem.type == .befourMarryFirstName
|| detailItem.type == .occupationName
|| detailItem.type == .hkIdentityCardNumber
{
return .inputText
}
if detailItem.type == .birthday
|| detailItem.type == .birthCity
|| detailItem.type == .occupation
|| detailItem.type == .stayHKDate
|| detailItem.type == .roleInHK
|| detailItem.type == .ownDegree
|| detailItem.type == .gender
|| detailItem.type == .marriageState
{
return .selectSheet
}
if detailItem.type == .birthNation
|| detailItem.type == .isNowInHK
|| detailItem.type == .isHaveHkIdentityCard
|| detailItem.type == .isPreviousMarriageChild
{
return .twoChoice
}
if detailItem.type == .degreeDetailInfo
{
return .degreeDetailInfo
}
}
return .defaultType
}
}
extension YHChildBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return items.count
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if section >= items.count { return 0 }
let arr = items[section]
return arr.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.section >= items.count { return createDefaultCell(indexPath) }
let arr:[YHFormItemProtocol] = items[indexPath.section]
if indexPath.row >= arr.count { return createDefaultCell(indexPath) }
let item:YHFormItemProtocol = arr[indexPath.row]
let cellType = getCellType(item)
if cellType == .title { // 标题
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemTitleCell.cellReuseIdentifier, for: indexPath) as! YHFormItemTitleCell
cell.titleLabel.text = item.getTitle()
return cell
}
if cellType == .inputText { // 输入文字cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemInputTextCell.cellReuseIdentifier, for: indexPath) as! YHFormItemInputTextCell
cell.titleLabel.text = item.getTitle()
return cell
}
if cellType == .selectSheet { // 点击选择列表cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier, for: indexPath) as! YHFormItemSelectSheetCell
cell.title = item.getTitle()
return cell
}
if cellType == .twoChoice { // 双项选择cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDoubleChoiceCell
cell.title = item.getTitle()
let answers = [YHFormChoiceItem(title: "是".local, isSelect: true),
YHFormChoiceItem(title: "否".local, isSelect: false)]
cell.answerArr = answers
return cell
}
if cellType == .addItem { // 新增item cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemAddCell.cellReuseIdentifier, for: indexPath) as! YHFormItemAddCell
cell.title = item.getTitle()
return cell
}
if cellType == .degreeDetailInfo { // 学位cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDegreeInfoCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDegreeInfoCell
cell.title = item.getTitle()
return cell
}
return createDefaultCell(indexPath)
}
func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
if indexPath.section >= items.count { return }
let arr:[YHFormItemProtocol] = items[indexPath.section]
if indexPath.row >= arr.count { return }
createCorner(cell: cell, arr: arr, indexPath: indexPath)
}
func createDefaultCell(_ indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "UITableViewCell", for: indexPath)
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.section >= items.count { return 0.0 }
let arr:[YHFormItemProtocol] = items[indexPath.section]
if indexPath.row >= arr.count { return 0.0 }
let item = arr[indexPath.row]
if item is YHFormTitleItem { // 标题
return 52.0
}
if item is YHFormAddItem {
return 70.0
}
if item is YHFormDetailItem {
return UITableView.automaticDimension
}
return 52.0
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
return 14.0
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let vc = YHParentInfoVC()
self.navigationController?.pushViewController(vc)
}
func createCorner(cell:UITableViewCell, arr:Array<Any>, indexPath:IndexPath) {
// 复用时需清理
cell.layer.mask = nil
// 设置每块section圆角
if (indexPath.row == 0) {
let corner = UIRectCorner(rawValue: UIRectCorner.topLeft.rawValue | UIRectCorner.topRight.rawValue)
cell.createCorner(CGSizeMake(12.0, 12.0), corner)
} else if (indexPath.row == arr.count-1) {
let corner = UIRectCorner(rawValue: UIRectCorner.bottomLeft.rawValue | UIRectCorner.bottomRight.rawValue)
cell.createCorner(CGSizeMake(12.0, 12.0), corner)
} else {
cell.layer.mask = nil
}
}
}
...@@ -308,7 +308,7 @@ extension YHChildInitialInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -308,7 +308,7 @@ extension YHChildInitialInfoVC : UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let vc = YHCertificateViewController() let vc = YHChildBasicInfoVC()
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
} }
......
...@@ -58,6 +58,10 @@ enum YHFormTitleItemType:Int { ...@@ -58,6 +58,10 @@ enum YHFormTitleItemType:Int {
case motherInfo = 17 case motherInfo = 17
// 基本信息 // 基本信息
case basicInfo = 18 case basicInfo = 18
// 子女信息
case childInfo = 19
// 是否前次婚姻子女
case isPreviousMarriageChild = 20
} }
...@@ -139,6 +143,13 @@ enum YHFormDetailItemType:Int { ...@@ -139,6 +143,13 @@ enum YHFormDetailItemType:Int {
case onlyDoubleChoice = 32 case onlyDoubleChoice = 32
// 主申请人和现配偶是否拥有孩子抚养权 // 主申请人和现配偶是否拥有孩子抚养权
case ownCustody = 33 case ownCustody = 33
// 子女姓名
case childName = 34
// 性别
case gender = 35
// 是否为前次婚姻子女
case isPreviousMarriageChild = 36
} }
...@@ -215,6 +226,10 @@ class YHFormTitleItem : YHFormItemProtocol { ...@@ -215,6 +226,10 @@ class YHFormTitleItem : YHFormItemProtocol {
return "母亲信息".local return "母亲信息".local
case .basicInfo: case .basicInfo:
return "基本信息".local return "基本信息".local
case .childInfo:
return "子女信息".local
case .isPreviousMarriageChild:
return "是否前次婚姻子女".local
} }
} }
...@@ -229,6 +244,8 @@ class YHFormTitleItem : YHFormItemProtocol { ...@@ -229,6 +244,8 @@ class YHFormTitleItem : YHFormItemProtocol {
return String(format: "(%@)", "如无可不填".local) return String(format: "(%@)", "如无可不填".local)
case .child: case .child:
return String(format: "(%@)", "如无可不填".local) return String(format: "(%@)", "如无可不填".local)
case .isPreviousMarriageChild:
return "".local
case .accompany: case .accompany:
return "".local return "".local
case .country: case .country:
...@@ -257,6 +274,9 @@ class YHFormTitleItem : YHFormItemProtocol { ...@@ -257,6 +274,9 @@ class YHFormTitleItem : YHFormItemProtocol {
return "".local return "".local
case .basicInfo: case .basicInfo:
return "".local return "".local
case .childInfo:
return "".local
} }
} }
...@@ -376,6 +396,12 @@ class YHFormDetailItem : YHFormItemProtocol { ...@@ -376,6 +396,12 @@ class YHFormDetailItem : YHFormItemProtocol {
return "现居住国家/地区".local return "现居住国家/地区".local
case .ownCustody: case .ownCustody:
return "主申请人和现配偶是否拥有孩子抚养权".local return "主申请人和现配偶是否拥有孩子抚养权".local
case .childName:
return "子女姓名".local
case .gender:
return "性别".local
case .isPreviousMarriageChild:
return "是否前次婚姻子女".local
case .onlyDoubleChoice: case .onlyDoubleChoice:
return "".local return "".local
......
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