Commit 775eb79d authored by Steven杜宇's avatar Steven杜宇

配偶信息填写

parent b7249c62
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
import UIKit import UIKit
enum YHFamilyMemberEditType:Int { enum YHFormTitleItemEditType:Int {
case none = 1 case none = 1
case canEdit = 2 case canEdit = 2
case canCancel = 3 case canCancel = 3
...@@ -17,8 +17,8 @@ enum YHFamilyMemberEditType:Int { ...@@ -17,8 +17,8 @@ enum YHFamilyMemberEditType:Int {
class YHFamilyMemberFormVC: YHBaseViewController { class YHFamilyMemberFormVC: YHBaseViewController {
var familyMemberInfo: YHFamilyMemberInfo? var familyMemberInfo: YHFamilyMemberInfo?
var isChildsEditMode: YHFamilyMemberEditType = .none var isChildsEditMode: YHFormTitleItemEditType = .none
var isBrothersEditMode: YHFamilyMemberEditType = .none var isBrothersEditMode: YHFormTitleItemEditType = .none
var items:[[YHFormItemProtocol]] = [] var items:[[YHFormItemProtocol]] = []
...@@ -623,8 +623,12 @@ extension YHFamilyMemberFormVC : UITableViewDelegate, UITableViewDataSource { ...@@ -623,8 +623,12 @@ extension YHFamilyMemberFormVC : UITableViewDelegate, UITableViewDataSource {
} }
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let vc = YHSpouseFormVC()
self.navigationController?.pushViewController(vc) if let spouse = familyMemberInfo?.spouse {
let vc = YHSpouseFormVC()
vc.spouse = spouse
self.navigationController?.pushViewController(vc)
}
} }
func createCorner(cell:UITableViewCell, arr:Array<Any>, indexPath:IndexPath) { func createCorner(cell:UITableViewCell, arr:Array<Any>, indexPath:IndexPath) {
......
...@@ -10,7 +10,8 @@ import UIKit ...@@ -10,7 +10,8 @@ import UIKit
class YHSpouseFormVC: YHBaseViewController { class YHSpouseFormVC: YHBaseViewController {
var sponseInfo:YHSpouse? var spouse:YHSpouse?
lazy var items:[[YHFormItemProtocol]] = [[YHFormItemProtocol]]() lazy var items:[[YHFormItemProtocol]] = [[YHFormItemProtocol]]()
lazy var tableView: UITableView = { lazy var tableView: UITableView = {
...@@ -66,12 +67,39 @@ class YHSpouseFormVC: YHBaseViewController { ...@@ -66,12 +67,39 @@ class YHSpouseFormVC: YHBaseViewController {
} }
func loadSponseInfo() { func loadSponseInfo() {
guard let spouse = spouse else { return }
// 随行
let title0 = YHFormTitleItem(type: .accompany)
let item0 = YHFormDetailItem(type: .accompany)
item0.isAccompany = (spouse.follow == 1)
let arr0:[YHFormItemProtocol] = [title0, item0]
items.append(arr0)
let arr0:[YHFormItemProtocol] = [YHFormTitleItem(type: .accompany), YHFormDetailItem(type: .accompany)] if item0.isAccompany { // 随行才加后面的信息
let arr1:[YHFormItemProtocol] = [YHFormTitleItem(type: .country), YHFormDetailItem(type: .country)] // 国籍
let arr2:[YHFormItemProtocol] = [YHFormTitleItem(type: .liveInfo),YHFormDetailItem(type: .isLiveTother),YHFormDetailItem(type: .liveContry),YHFormDetailItem(type: .liveCity),YHFormDetailItem(type: .detailAddress)] let title1 = YHFormTitleItem(type: .country)
let arr3:[YHFormItemProtocol] = [YHFormTitleItem(type: .hkPassport), YHFormDetailItem(type: .hkPassport)] let item10 = YHFormDetailItem(type: .country)
items.append(contentsOf:[arr0, arr1, arr2, arr3]) item10.country = "中国"
let arr1:[YHFormItemProtocol] = [title1, item10]
// 居住信息
let title2 = YHFormTitleItem(type: .liveInfo)
let item20 = YHFormDetailItem(type: .isLiveTother)
let item21 = YHFormDetailItem(type: .liveContry)
let item22 = YHFormDetailItem(type: .liveCity)
let item23 = YHFormDetailItem(type: .detailAddress)
let arr2:[YHFormItemProtocol] = [title2, item20, item21, item22, item23]
// 港澳通信证
let title3 = YHFormTitleItem(type: .hkPassport)
let item30 = YHFormDetailItem(type: .hkPassport)
let arr3:[YHFormItemProtocol] = [title3, item30]
items.append(contentsOf:[arr1, arr2, arr3])
}
tableView.reloadData() tableView.reloadData()
} }
......
...@@ -136,7 +136,7 @@ class YHFormDetailItem : YHFormItemProtocol { ...@@ -136,7 +136,7 @@ class YHFormDetailItem : YHFormItemProtocol {
// 港澳通信证 // 港澳通信证
var isHongKongMacouPassport:Bool = false var isHongKongMacouPassport:Bool = false
// 国籍 // 国籍
var nation:String? = "" var country:String? = ""
/** 居住信息 **/ /** 居住信息 **/
// 是否与主申请人同住 // 是否与主申请人同住
......
...@@ -14,7 +14,7 @@ class YHFormTitleCell: UITableViewCell { ...@@ -14,7 +14,7 @@ class YHFormTitleCell: UITableViewCell {
let editTag = 9527 let editTag = 9527
let cancelTag = 9528 let cancelTag = 9528
var rightClickBlock:((YHFamilyMemberEditType)->Void)? var rightClickBlock:((YHFormTitleItemEditType)->Void)?
lazy var titleLabel: UILabel = { lazy var titleLabel: UILabel = {
...@@ -111,7 +111,7 @@ class YHFormTitleCell: UITableViewCell { ...@@ -111,7 +111,7 @@ class YHFormTitleCell: UITableViewCell {
} }
} }
func showEditType(type: YHFamilyMemberEditType) { func showEditType(type: YHFormTitleItemEditType) {
switch type { switch type {
case .none: case .none:
cancelButton.isHidden = true cancelButton.isHidden = true
......
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