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

// 配偶信息填写

parent 839c9c69
...@@ -14,6 +14,9 @@ ...@@ -14,6 +14,9 @@
041B52912B5E67F3007EBCEB /* YHSingleLineSelectCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52902B5E67F3007EBCEB /* YHSingleLineSelectCell.swift */; }; 041B52912B5E67F3007EBCEB /* YHSingleLineSelectCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52902B5E67F3007EBCEB /* YHSingleLineSelectCell.swift */; };
041B52932B5E6CBA007EBCEB /* YHFormTitleCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52922B5E6CBA007EBCEB /* YHFormTitleCell.swift */; }; 041B52932B5E6CBA007EBCEB /* YHFormTitleCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52922B5E6CBA007EBCEB /* YHFormTitleCell.swift */; };
041B52952B5E7037007EBCEB /* YHFormAddInfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52942B5E7037007EBCEB /* YHFormAddInfoCell.swift */; }; 041B52952B5E7037007EBCEB /* YHFormAddInfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52942B5E7037007EBCEB /* YHFormAddInfoCell.swift */; };
041B52982B5E8EA0007EBCEB /* YHFamilyMemberFormVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52972B5E8EA0007EBCEB /* YHFamilyMemberFormVC.swift */; };
041B52D62B5F899E007EBCEB /* YHConsortFormVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52D52B5F899E007EBCEB /* YHConsortFormVC.swift */; };
041B52D92B5F8B07007EBCEB /* YHConsortInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52D82B5F8B07007EBCEB /* YHConsortInfo.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 */; };
...@@ -150,6 +153,9 @@ ...@@ -150,6 +153,9 @@
041B52902B5E67F3007EBCEB /* YHSingleLineSelectCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSingleLineSelectCell.swift; sourceTree = "<group>"; }; 041B52902B5E67F3007EBCEB /* YHSingleLineSelectCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSingleLineSelectCell.swift; sourceTree = "<group>"; };
041B52922B5E6CBA007EBCEB /* YHFormTitleCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormTitleCell.swift; sourceTree = "<group>"; }; 041B52922B5E6CBA007EBCEB /* YHFormTitleCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormTitleCell.swift; sourceTree = "<group>"; };
041B52942B5E7037007EBCEB /* YHFormAddInfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormAddInfoCell.swift; sourceTree = "<group>"; }; 041B52942B5E7037007EBCEB /* YHFormAddInfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormAddInfoCell.swift; sourceTree = "<group>"; };
041B52972B5E8EA0007EBCEB /* YHFamilyMemberFormVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFamilyMemberFormVC.swift; sourceTree = "<group>"; };
041B52D52B5F899E007EBCEB /* YHConsortFormVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHConsortFormVC.swift; sourceTree = "<group>"; };
041B52D82B5F8B07007EBCEB /* YHConsortInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHConsortInfo.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>"; };
...@@ -294,6 +300,8 @@ ...@@ -294,6 +300,8 @@
041B52882B5E13EB007EBCEB /* FamilyMember */ = { 041B52882B5E13EB007EBCEB /* FamilyMember */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
041B52D72B5F8ADA007EBCEB /* M */,
041B52962B5E8E3B007EBCEB /* C */,
041B52892B5E14EB007EBCEB /* View */, 041B52892B5E14EB007EBCEB /* View */,
); );
path = FamilyMember; path = FamilyMember;
...@@ -312,6 +320,23 @@ ...@@ -312,6 +320,23 @@
path = View; path = View;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
041B52962B5E8E3B007EBCEB /* C */ = {
isa = PBXGroup;
children = (
041B52972B5E8EA0007EBCEB /* YHFamilyMemberFormVC.swift */,
041B52D52B5F899E007EBCEB /* YHConsortFormVC.swift */,
);
path = C;
sourceTree = "<group>";
};
041B52D72B5F8ADA007EBCEB /* M */ = {
isa = PBXGroup;
children = (
041B52D82B5F8B07007EBCEB /* YHConsortInfo.swift */,
);
path = M;
sourceTree = "<group>";
};
0468D4292B55017400CFB916 /* Analytics */ = { 0468D4292B55017400CFB916 /* Analytics */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -938,6 +963,7 @@ ...@@ -938,6 +963,7 @@
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 */,
...@@ -990,6 +1016,7 @@ ...@@ -990,6 +1016,7 @@
A510441A2B495DD0006B60BB /* UIView+Extension.swift in Sources */, A510441A2B495DD0006B60BB /* UIView+Extension.swift in Sources */,
A5ACE93E2B4564F7002C94D2 /* UIImage+Extension.swift in Sources */, A5ACE93E2B4564F7002C94D2 /* UIImage+Extension.swift in Sources */,
A5ACE94C2B4564F7002C94D2 /* BsHUDErrorView.swift in Sources */, A5ACE94C2B4564F7002C94D2 /* BsHUDErrorView.swift in Sources */,
041B52D62B5F899E007EBCEB /* YHConsortFormVC.swift in Sources */,
A5D6AB1B2B46A1CC001C10A5 /* YHHomeModel.swift in Sources */, A5D6AB1B2B46A1CC001C10A5 /* YHHomeModel.swift in Sources */,
A5D6AB1D2B46AAFB001C10A5 /* YHHomePageViewModel.swift in Sources */, A5D6AB1D2B46AAFB001C10A5 /* YHHomePageViewModel.swift in Sources */,
A5ACE9552B4564F7002C94D2 /* YHTabBarViewController.swift in Sources */, A5ACE9552B4564F7002C94D2 /* YHTabBarViewController.swift in Sources */,
...@@ -1005,6 +1032,7 @@ ...@@ -1005,6 +1032,7 @@
041B52872B5657B3007EBCEB /* IMAppKey.swift in Sources */, 041B52872B5657B3007EBCEB /* IMAppKey.swift in Sources */,
0468D42B2B55019900CFB916 /* YHAnalytics.swift in Sources */, 0468D42B2B55019900CFB916 /* YHAnalytics.swift in Sources */,
A5ACE93C2B4564F7002C94D2 /* UIColor+Extension.swift in Sources */, A5ACE93C2B4564F7002C94D2 /* UIColor+Extension.swift in Sources */,
041B52982B5E8EA0007EBCEB /* YHFamilyMemberFormVC.swift in Sources */,
A5C5B2EA2B4ECA4D00A7C5D1 /* YHDavidModel0.swift in Sources */, A5C5B2EA2B4ECA4D00A7C5D1 /* YHDavidModel0.swift in Sources */,
A5ACE9572B4564F7002C94D2 /* YHBasicContentView.swift in Sources */, A5ACE9572B4564F7002C94D2 /* YHBasicContentView.swift in Sources */,
A5C5B3292B57CCBE00A7C5D1 /* YHDavidCell4.swift in Sources */, A5C5B3292B57CCBE00A7C5D1 /* YHDavidCell4.swift in Sources */,
......
//
// YHConsortFormVC.swift
// galaxy
//
// Created by edy on 2024/1/23.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHConsortFormVC: YHBaseViewController {
lazy var items:[YHTableItemInfo] = [YHTableItemInfo]()
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.plain)
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
}
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHDoubleChoiceFormCell.self, forCellReuseIdentifier: YHDoubleChoiceFormCell.cellReuseIdentifier)
tableView.register(YHSingleLineInputCell.self, forCellReuseIdentifier: YHSingleLineInputCell.cellReuseIdentifier)
tableView.register(YHSingleLineSelectCell.self, forCellReuseIdentifier: YHSingleLineSelectCell.cellReuseIdentifier)
tableView.register(YHFormTitleCell.self, forCellReuseIdentifier: YHFormTitleCell.cellReuseIdentifier)
tableView.register(YHFormAddInfoCell.self, forCellReuseIdentifier: YHFormAddInfoCell.cellReuseIdentifier)
return tableView
}()
lazy var submitBtn:UIButton = {
let btn = UIButton.bs_button(title: "提交".local, font: UIFont.PFSCR(ofSize: 14), normalColor: .white)
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.bs_button(title: "保存".local, font: UIFont.PFSCR(ofSize: 14), normalColor: UIColor(hexString:"#222222"))
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() {
super.viewDidLoad()
createUI()
loadData()
}
func loadData() {
var item1 = YHTableItemInfo(type: .accompany)
let item2 = YHTableItemInfo(type: .country)
let item3 = YHTableItemInfo(type: .address)
let item4 = YHTableItemInfo(type: .hongkongMacaouPassport)
items.append(contentsOf: [item1, item2, item3, item4])
tableView.reloadData()
}
func createUI() {
view.addSubview(tableView);
view.addSubview(bottomView)
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
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalTo(bottomView.snp.top)
make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-16)
}
}
@objc func didClickSubmitBtn() {
}
@objc func didClickSaveBtn() {
}
}
extension YHConsortFormVC : 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 item:YHTableItemInfo = items[section]
switch item.type {
case .accompany:
return 2
case .country:
return 2
case .address:
if !item.isAccompany {
return 3
}
return 1
case .hongkongMacaouPassport:
return 1
}
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.section == 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHSingleLineSelectCell.cellReuseIdentifier, for: indexPath) as! YHSingleLineSelectCell
createCorner(cell: cell, indexPath: indexPath)
cell.title = "配偶".local
cell.detailLabel.text = "(如未婚、离婚、丧偶可不填)".local
return cell
} else if indexPath.section == 1 {
if indexPath.row == 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormTitleCell.cellReuseIdentifier, for: indexPath) as! YHFormTitleCell
createCorner(cell: cell, indexPath: indexPath)
cell.titleLabel.text = "子女".local
cell.subTitleLabel.text = "(如无可不填)".local
return cell
} else if indexPath.row == 1 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormAddInfoCell.cellReuseIdentifier, for: indexPath) as! YHFormAddInfoCell
createCorner(cell: cell, indexPath: indexPath)
return cell
}
} else if indexPath.section == 2 {
if indexPath.row == 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormTitleCell.cellReuseIdentifier, for: indexPath) as! YHFormTitleCell
createCorner(cell: cell, indexPath: indexPath)
cell.titleLabel.text = "父母".local
cell.subTitleLabel.text = "(包含已故)".local
return cell
} else {
let cell = tableView.dequeueReusableCell(withIdentifier: YHSingleLineSelectCell.cellReuseIdentifier, for: indexPath) as! YHSingleLineSelectCell
createCorner(cell: cell, indexPath: indexPath)
return cell
}
} else if indexPath.section == 3 {
if indexPath.row == 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormTitleCell.cellReuseIdentifier, for: indexPath) as! YHFormTitleCell
createCorner(cell: cell, indexPath: indexPath)
cell.titleLabel.text = "兄弟姐妹".local
cell.subTitleLabel.text = "(如无可不填)".local
return cell
} else {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormAddInfoCell.cellReuseIdentifier, for: indexPath) as! YHFormAddInfoCell
createCorner(cell: cell, indexPath: indexPath)
return cell
}
}
let cell = tableView.dequeueReusableCell(withIdentifier: "UITableViewCell", for: indexPath)
createCorner(cell: cell, indexPath: indexPath)
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 80.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) {
}
func createCorner(cell:UITableViewCell, indexPath:IndexPath) {
// 设置每块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 == 2) {
let corner = UIRectCorner(rawValue: UIRectCorner.bottomLeft.rawValue | UIRectCorner.bottomRight.rawValue)
cell.createCorner(CGSizeMake(12.0, 12.0), corner)
} else {
cell.layer.mask = nil
}
}
}
//
// YHFamilyMemberFormVC.swift
// galaxy
//
// Created by edy on 2024/1/22.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHFamilyMemberFormVC: YHBaseViewController {
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.plain)
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
}
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHDoubleChoiceFormCell.self, forCellReuseIdentifier: YHDoubleChoiceFormCell.cellReuseIdentifier)
tableView.register(YHSingleLineInputCell.self, forCellReuseIdentifier: YHSingleLineInputCell.cellReuseIdentifier)
tableView.register(YHSingleLineSelectCell.self, forCellReuseIdentifier: YHSingleLineSelectCell.cellReuseIdentifier)
tableView.register(YHFormTitleCell.self, forCellReuseIdentifier: YHFormTitleCell.cellReuseIdentifier)
tableView.register(YHFormAddInfoCell.self, forCellReuseIdentifier: YHFormAddInfoCell.cellReuseIdentifier)
return tableView
}()
lazy var submitBtn:UIButton = {
let btn = UIButton.bs_button(title: "提交".local, font: UIFont.PFSCR(ofSize: 14), normalColor: .white)
btn.backgroundColor = UIColor(hexString:"#4388FF")
btn.layer.cornerRadius = 8.0
btn.addTarget(self, action: #selector(didClickSubmitBtn), for: .touchUpInside)
return btn
}()
lazy var bottomView:UIView = {
let view = UIView()
view.backgroundColor = .white
view.addSubview(submitBtn)
return view
}()
override func viewDidLoad() {
super.viewDidLoad()
self.title = "家庭成员信息填写"
view.backgroundColor = UIColor(hexString:"#F8F8F8")
createUI()
}
func createUI() {
view.addSubview(tableView);
view.addSubview(bottomView)
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())
}
submitBtn.snp.makeConstraints { make in
make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-16)
make.height.equalTo(48)
make.top.equalTo(8)
}
tableView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalTo(bottomView.snp.top)
make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-16)
}
}
@objc func didClickSubmitBtn() {
}
}
extension YHFamilyMemberFormVC : UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return 4
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if section == 1 {
return 2
} else if section == 2 {
return 3
} else if section == 3 {
return 2
}
return 1
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.section == 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHSingleLineSelectCell.cellReuseIdentifier, for: indexPath) as! YHSingleLineSelectCell
createCorner(cell: cell, indexPath: indexPath)
cell.title = "配偶".local
cell.detailLabel.text = "(如未婚、离婚、丧偶可不填)".local
return cell
} else if indexPath.section == 1 {
if indexPath.row == 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormTitleCell.cellReuseIdentifier, for: indexPath) as! YHFormTitleCell
createCorner(cell: cell, indexPath: indexPath)
cell.titleLabel.text = "子女".local
cell.subTitleLabel.text = "(如无可不填)".local
return cell
} else if indexPath.row == 1 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormAddInfoCell.cellReuseIdentifier, for: indexPath) as! YHFormAddInfoCell
createCorner(cell: cell, indexPath: indexPath)
return cell
}
} else if indexPath.section == 2 {
if indexPath.row == 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormTitleCell.cellReuseIdentifier, for: indexPath) as! YHFormTitleCell
createCorner(cell: cell, indexPath: indexPath)
cell.titleLabel.text = "父母".local
cell.subTitleLabel.text = "(包含已故)".local
return cell
} else {
let cell = tableView.dequeueReusableCell(withIdentifier: YHSingleLineSelectCell.cellReuseIdentifier, for: indexPath) as! YHSingleLineSelectCell
createCorner(cell: cell, indexPath: indexPath)
return cell
}
} else if indexPath.section == 3 {
if indexPath.row == 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormTitleCell.cellReuseIdentifier, for: indexPath) as! YHFormTitleCell
createCorner(cell: cell, indexPath: indexPath)
cell.titleLabel.text = "兄弟姐妹".local
cell.subTitleLabel.text = "(如无可不填)".local
return cell
} else {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormAddInfoCell.cellReuseIdentifier, for: indexPath) as! YHFormAddInfoCell
createCorner(cell: cell, indexPath: indexPath)
return cell
}
}
let cell = tableView.dequeueReusableCell(withIdentifier: "UITableViewCell", for: indexPath) as! UITableViewCell
createCorner(cell: cell, indexPath: indexPath)
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 80.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 = YHConsortFormVC()
self.navigationController?.pushViewController(vc)
}
func createCorner(cell:UITableViewCell, indexPath:IndexPath) {
// 设置每块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 == 2) {
let corner = UIRectCorner(rawValue: UIRectCorner.bottomLeft.rawValue | UIRectCorner.bottomRight.rawValue)
cell.createCorner(CGSizeMake(12.0, 12.0), corner)
} else {
cell.layer.mask = nil
}
}
}
//
// 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
init(type: YHTableItemType) {
self.type = type
}
// 是否随行
var isAccompany:Bool = false
// 港澳通信证
var isHongKongMacouPassport:Bool = false
// 国籍
var nation:String? = ""
/** 居住信息 **/
// 是否与主申请人同住
var isLiveTogether:Bool = false
// 现居住国家
var liveContry:String? = ""
// 现居住城市
var liveCity:String? = ""
// 现居住详细地址
var liveAddress:String? = ""
func getTitle(_ type:YHTableItemType)-> String {
switch type {
case .accompany:
return "随行".local
case .country:
return "国籍".local
case .address:
return "居住信息".local
case .hongkongMacaouPassport:
return "港澳通信证".local
default:
return ""
}
}
}
...@@ -30,6 +30,12 @@ class YHFormTitleCell: UITableViewCell { ...@@ -30,6 +30,12 @@ class YHFormTitleCell: UITableViewCell {
return label return label
}() }()
lazy var bottomLineView:UIView = {
let view = UIView()
view.backgroundColor = UIColor(hex: 0xF0F0F0)
return view
}()
required init?(coder: NSCoder) { required init?(coder: NSCoder) {
super.init(coder: coder) super.init(coder: coder)
} }
...@@ -44,6 +50,7 @@ class YHFormTitleCell: UITableViewCell { ...@@ -44,6 +50,7 @@ class YHFormTitleCell: UITableViewCell {
self.selectionStyle = .none self.selectionStyle = .none
contentView.addSubview(titleLabel) contentView.addSubview(titleLabel)
contentView.addSubview(subTitleLabel) contentView.addSubview(subTitleLabel)
contentView.addSubview(bottomLineView)
titleLabel.text = "配偶" titleLabel.text = "配偶"
subTitleLabel.text = " (如未婚、离婚、丧偶可不填)" subTitleLabel.text = " (如未婚、离婚、丧偶可不填)"
...@@ -58,5 +65,10 @@ class YHFormTitleCell: UITableViewCell { ...@@ -58,5 +65,10 @@ class YHFormTitleCell: UITableViewCell {
make.right.equalToSuperview().offset(-16) make.right.equalToSuperview().offset(-16)
make.centerY.equalToSuperview() make.centerY.equalToSuperview()
} }
bottomLineView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.height.equalTo(1.0)
}
} }
} }
...@@ -57,5 +57,16 @@ extension UIView { ...@@ -57,5 +57,16 @@ extension UIView {
borderLayer.strokeColor = color.cgColor borderLayer.strokeColor = color.cgColor
self.layer.addSublayer(borderLayer) self.layer.addSublayer(borderLayer)
} }
// 任意切圆角 eg:UIRectCorner(rawValue: (UIRectCorner.topRight.rawValue) | (UIRectCorner.bottomRight.rawValue)
public func createCorner(_ cornerRadii:CGSize,_ roundingCorners:UIRectCorner) {
let path = UIBezierPath(roundedRect:bounds,byRoundingCorners: roundingCorners,cornerRadii:cornerRadii);
let layer = CAShapeLayer();
layer.frame = bounds;
layer.path = path.cgPath;
self.layer.mask = layer;
}
} }
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