Commit 363a2872 authored by David黄金龙's avatar David黄金龙

Merge commit 'cb7fd7f1' into davidhuang

* commit 'cb7fd7f1':
  // 配偶信息
  // 配偶信息填写
  // 添加信息cell
parents 0a4de425 cb7fd7f1
...@@ -13,6 +13,10 @@ ...@@ -13,6 +13,10 @@
041B528F2B5E620E007EBCEB /* YHSingleLineInputCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B528E2B5E620E007EBCEB /* YHSingleLineInputCell.swift */; }; 041B528F2B5E620E007EBCEB /* YHSingleLineInputCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B528E2B5E620E007EBCEB /* YHSingleLineInputCell.swift */; };
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 */; };
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 */; };
...@@ -152,6 +156,10 @@ ...@@ -152,6 +156,10 @@
041B528E2B5E620E007EBCEB /* YHSingleLineInputCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSingleLineInputCell.swift; sourceTree = "<group>"; }; 041B528E2B5E620E007EBCEB /* YHSingleLineInputCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSingleLineInputCell.swift; sourceTree = "<group>"; };
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>"; };
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>"; };
...@@ -300,6 +308,8 @@ ...@@ -300,6 +308,8 @@
041B52882B5E13EB007EBCEB /* FamilyMember */ = { 041B52882B5E13EB007EBCEB /* FamilyMember */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
041B52D72B5F8ADA007EBCEB /* M */,
041B52962B5E8E3B007EBCEB /* C */,
041B52892B5E14EB007EBCEB /* View */, 041B52892B5E14EB007EBCEB /* View */,
); );
path = FamilyMember; path = FamilyMember;
...@@ -313,10 +323,28 @@ ...@@ -313,10 +323,28 @@
041B528E2B5E620E007EBCEB /* YHSingleLineInputCell.swift */, 041B528E2B5E620E007EBCEB /* YHSingleLineInputCell.swift */,
041B52902B5E67F3007EBCEB /* YHSingleLineSelectCell.swift */, 041B52902B5E67F3007EBCEB /* YHSingleLineSelectCell.swift */,
041B52922B5E6CBA007EBCEB /* YHFormTitleCell.swift */, 041B52922B5E6CBA007EBCEB /* YHFormTitleCell.swift */,
041B52942B5E7037007EBCEB /* YHFormAddInfoCell.swift */,
); );
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 = (
...@@ -956,10 +984,12 @@ ...@@ -956,10 +984,12 @@
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 */,
041B52932B5E6CBA007EBCEB /* YHFormTitleCell.swift in Sources */, 041B52932B5E6CBA007EBCEB /* YHFormTitleCell.swift in Sources */,
041B52952B5E7037007EBCEB /* YHFormAddInfoCell.swift in Sources */,
A5ACE93D2B4564F7002C94D2 /* UIButton+Extension.swift in Sources */, A5ACE93D2B4564F7002C94D2 /* UIButton+Extension.swift in Sources */,
041B528D2B5E58FA007EBCEB /* YHDoubleChoiceFormCell.swift in Sources */, 041B528D2B5E58FA007EBCEB /* YHDoubleChoiceFormCell.swift in Sources */,
A5ACE9292B4564F7002C94D2 /* YHSmsCodeInputView.swift in Sources */, A5ACE9292B4564F7002C94D2 /* YHSmsCodeInputView.swift in Sources */,
...@@ -1008,6 +1038,7 @@ ...@@ -1008,6 +1038,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 */,
...@@ -1024,6 +1055,7 @@ ...@@ -1024,6 +1055,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 */,
A5C382CF2B5F9A9100C5E65C /* YHServiceCenterMainViewModel.swift in Sources */, A5C382CF2B5F9A9100C5E65C /* YHServiceCenterMainViewModel.swift in Sources */,
A5C5B2EA2B4ECA4D00A7C5D1 /* YHDavidModel0.swift in Sources */, A5C5B2EA2B4ECA4D00A7C5D1 /* YHDavidModel0.swift in Sources */,
A5ACE9572B4564F7002C94D2 /* YHBasicContentView.swift in Sources */, A5ACE9572B4564F7002C94D2 /* YHBasicContentView.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() {
let 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]
return item.getSubItems().count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.section >= items.count { return UITableViewCell() }
let item:YHTableItemInfo = items[indexPath.section]
if indexPath.row >= item.getSubItems().count { return UITableViewCell() }
let subItem:YHTableSubItemInfo = item.getSubItems()[indexPath.row]
switch subItem.type {
case .subTitle:
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormTitleCell.cellReuseIdentifier, for: indexPath) as! YHFormTitleCell
createCorner(cell: cell, indexPath: indexPath)
cell.titleLabel.text = item.title
return cell
case .subAcompany:
let cell = tableView.dequeueReusableCell(withIdentifier: YHDoubleChoiceFormCell.cellReuseIdentifier, for: indexPath) as! YHDoubleChoiceFormCell
createCorner(cell: cell, indexPath: indexPath)
cell.question = subItem.title
return cell
case .subCountry:
let cell = tableView.dequeueReusableCell(withIdentifier: YHSingleLineSelectCell.cellReuseIdentifier, for: indexPath) as! YHSingleLineSelectCell
createCorner(cell: cell, indexPath: indexPath)
cell.isMust = subItem.isMust
cell.title = subItem.title
return cell
case .subIsLiveTogether, .subHongkongMacaouPassport:
let cell = tableView.dequeueReusableCell(withIdentifier: YHDoubleChoiceFormCell.cellReuseIdentifier, for: indexPath) as! YHDoubleChoiceFormCell
createCorner(cell: cell, indexPath: indexPath)
cell.question = subItem.title
return cell
case .subLiveNation, .subLiveCity, .subDetailAddress:
let cell = tableView.dequeueReusableCell(withIdentifier: YHSingleLineSelectCell.cellReuseIdentifier, for: indexPath) as! YHSingleLineSelectCell
createCorner(cell: cell, indexPath: indexPath)
cell.isMust = subItem.isMust
cell.title = subItem.title
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 {
if indexPath.section >= items.count { return 0 }
let item:YHTableItemInfo = items[indexPath.section]
if indexPath.row >= item.getSubItems().count { return 0 }
let subItem = item.getSubItems()[indexPath.row]
if subItem.type == .subIsLiveTogether ||
subItem.type == .subAcompany ||
subItem.type == .subHongkongMacaouPassport
{ 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) {
}
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
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 isAccompany:Bool = false
// 港澳通信证
var isHongKongMacouPassport:Bool = false
// 国籍
var nation:String? = ""
/** 居住信息 **/
// 是否与主申请人同住
var isLiveTogether:Bool = false
// 现居住国家
var liveContry:String? = ""
// 现居住城市
var liveCity:String? = ""
// 现居住详细地址
var liveAddress:String? = ""
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
}
}
}
//
// YHFormAddInfoCell.swift
// galaxy
//
// Created by edy on 2024/1/22.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHFormAddInfoCell: UITableViewCell {
static let cellReuseIdentifier = "YHFormAddInfoCell"
let btnTitleColor = UIColor(hexString:"#4388FF")
let btnHeight = 44.0
let cornerRadius = 4.0
lazy var addBtn: UIButton = {
let btn = UIButton.bs_button(title: "新增信息", font: UIFont.PFSCR(ofSize: 14), normalColor: btnTitleColor)
btn.iconInLeft(spacing: 10)
btn.setImage(UIImage(named: "form_add_info"), for: .normal)
btn.addTarget(self, action: #selector(didClickAddBtn), for: .touchUpInside)
return btn
}()
lazy var dotLineLayer:CAShapeLayer = {
let borderLayer = CAShapeLayer()
borderLayer.position = CGPoint(x: addBtn.bounds.midX, y: addBtn.bounds.midY);
borderLayer.path = UIBezierPath(roundedRect: borderLayer.bounds, cornerRadius: addBtn.layer.cornerRadius).cgPath
borderLayer.lineWidth = 1
//[数组第一个数字表示单个虚线长度,第二个数字表示间隔]
borderLayer.lineDashPattern = [3,1] as [NSNumber]?
//前边是虚线的长度,后边是虚线之间空隙的长度
borderLayer.lineDashPhase = 0.1
//实线边框
borderLayer.fillColor = UIColor.clear.cgColor
borderLayer.strokeColor = btnTitleColor.cgColor
return borderLayer
}()
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(addBtn)
addBtn.layer.addSublayer(dotLineLayer)
addBtn.snp.makeConstraints { make in
make.left.top.equalToSuperview().offset(18)
make.right.bottom.equalToSuperview().offset(-18)
make.height.equalTo(btnHeight)
}
}
override func layoutSubviews() {
super.layoutSubviews()
print(addBtn.bounds)
dotLineLayer.path = UIBezierPath(roundedRect: addBtn.bounds, cornerRadius: cornerRadius).cgPath
}
@objc func didClickAddBtn() {
}
}
...@@ -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)
}
} }
} }
...@@ -127,6 +127,11 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource { ...@@ -127,6 +127,11 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
if (indexPath.row >= items.count) { return } if (indexPath.row >= items.count) { return }
let vvc = YHFamilyMemberFormVC()
self.navigationController?.pushViewController(vvc)
return
let item: PersonalModuleItem = items[indexPath.row]; let item: PersonalModuleItem = items[indexPath.row];
if item.title == "关于我们" { if item.title == "关于我们" {
......
...@@ -37,4 +37,36 @@ extension UIView { ...@@ -37,4 +37,36 @@ extension UIView {
UIGraphicsEndImageContext() UIGraphicsEndImageContext()
return image return image
} }
// 画虚线
func drawBorderDottedLine(width:CGFloat,length:CGFloat,space:CGFloat,cornerRadius:CGFloat,color:UIColor) {
self.layer.cornerRadius = cornerRadius
let borderLayer = CAShapeLayer()
borderLayer.bounds = self.bounds
borderLayer.position = CGPoint(x: self.bounds.midX, y: self.bounds.midY);
borderLayer.path = UIBezierPath(roundedRect: borderLayer.bounds, cornerRadius: cornerRadius).cgPath
borderLayer.lineWidth = width
//虚线边框---小边框的长度
borderLayer.lineDashPattern = [length,space] as [NSNumber]?
//前边是虚线的长度,后边是虚线之间空隙的长度
borderLayer.lineDashPhase = 0.1
//实线边框
borderLayer.fillColor = UIColor.clear.cgColor
borderLayer.strokeColor = color.cgColor
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;
}
} }
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "PlusOutlined.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
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