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

// 配偶初始信息

parent d02e3f34
......@@ -92,7 +92,7 @@ class YHChildInitialInfoVC: YHBaseViewController {
if child.isFollow() { // 随行才加后面的信息
// 国籍
let title1 = YHFormTitleItem(type: .country)
let title1 = YHFormTitleItem(type: .nationality)
let item10 = YHFormDetailItem(type: .nationOrArea)
let arr1:[YHFormItemProtocol] = [title1, item10]
......
......@@ -147,6 +147,7 @@ class YHSpouseInfoVC: YHBaseViewController, YHSpouseInfoVCProtocol {
}
}
self.view.bringSubviewToFront(stepView)
self.view.bringSubviewToFront(bottomView)
}
}
......
......@@ -63,7 +63,7 @@ class YHSpouseInitialInfoVC: YHBaseViewController {
if spouse.isFollow() { // 随行才加后面的信息
// 国籍
let title1 = YHFormTitleItem(type: .country)
let title1 = YHFormTitleItem(type: .nationality)
let item10 = YHFormDetailItem(type: .nationOrArea)
item10.value = spouse.nationality
let arr1:[YHFormItemProtocol] = [title1, item10]
......@@ -72,7 +72,7 @@ class YHSpouseInitialInfoVC: YHBaseViewController {
var arr2 = [YHFormItemProtocol]()
let title2 = YHFormTitleItem(type: .liveInfo)
let item20 = YHFormDetailItem(type: .isLiveTother)
item20.value = String(spouse.finishFollow == 1)
item20.value = String(spouse.isLiveTother())
arr2.append(title2)
arr2.append(item20)
......@@ -85,15 +85,29 @@ class YHSpouseInitialInfoVC: YHBaseViewController {
if let address = spouse.address {
if let country = address.country, !country.isEmpty {
let item22 = YHFormDetailItem(type: .liveCity)
if let area = address.area {
item22.value = area.joined(separator: "/")
// 居住信息中选择中国才会显示现居住城市
let isLiveInChina = country.contains("中国".local)
if isLiveInChina {
let item22 = YHFormDetailItem(type: .liveCity)
if let area = address.area {
item22.value = area.joined(separator: "/")
}
arr2.append(item22)
}
let item23 = YHFormDetailItem(type: .detailAddress)
item23.value = address.details
item23.placeHolder = "请填写小区、楼栋、单元室等"
arr2.append(item22)
item23.placeHolder = (isLiveInChina ? "请填写小区、楼栋、单元室等".local : "请填写国外居住地".local)
arr2.append(item23)
if !isLiveInChina {// 在国外
// 是否在海外居住满1年及以上
let item24 = YHFormDetailItem(type: .isLiveOverSeasMore1Year)
item24.value = String(spouse.isOverSeasOver1Year())
arr2.append(item24)
}
}
}
}
......@@ -155,7 +169,7 @@ extension YHSpouseInitialInfoVC : UITableViewDelegate, UITableViewDataSource {
let detailItem = item as! YHFormDetailItem
// 是否随行到香港 / 是否办理港澳通行证 / // 是否与主申请人同住 均用双项按钮cell
if detailItem.type == .isAccompanyToHK || detailItem.type == .isHandleHKPassPort || detailItem.type == .isLiveTother {
if detailItem.type == .isAccompanyToHK || detailItem.type == .isHandleHKPassPort || detailItem.type == .isLiveTother || detailItem.type == .isLiveOverSeasMore1Year {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDoubleChoiceCell
cell.title = detailItem.getTitle()
......@@ -171,29 +185,34 @@ extension YHSpouseInitialInfoVC : UITableViewDelegate, UITableViewDataSource {
[weak self] (arr, selectIndex) in
guard let self = self else { return }
let selectItem:YHFormChoiceItem = arr[selectIndex]
let option = (selectItem.title == "是".local ? true : false)
if detailItem.type == .isAccompanyToHK { // 是否随行
self?.spouse?.setFollow(option)
self?.loadSponseInfo()
if let delegate = self?.delegate {
self.spouse?.setFollow(option)
self.loadSponseInfo()
if let delegate = self.delegate {
delegate.updateStepView?()
}
} else if detailItem.type == .isHandleHKPassPort { // 是否办理港澳通行证
self?.spouse?.setNeedHandleHKPassPort(option)
self?.loadSponseInfo()
self.spouse?.setNeedHandleHKPassPort(option)
self.loadSponseInfo()
} else if detailItem.type == .isLiveTother { // 是否与主申请人同住
self?.spouse?.setLiveTother(option)
self.spouse?.setLiveTother(option)
if option {
self?.spouse?.address?.country = nil
self?.spouse?.address?.details = nil
self?.spouse?.address?.area = nil
self.spouse?.address?.country = nil
self.spouse?.address?.details = nil
self.spouse?.address?.area = nil
}
self?.loadSponseInfo()
self.loadSponseInfo()
} else if detailItem.type == .isLiveOverSeasMore1Year { // 是否在海外居住满1年及以上
self.spouse?.setOverSearsOver1Year(option)
self.loadSponseInfo()
}
}
return cell
......@@ -259,7 +278,8 @@ extension YHSpouseInitialInfoVC : UITableViewDelegate, UITableViewDataSource {
let detailItem = item as! YHFormDetailItem
if detailItem.type == .isLiveTother ||
detailItem.type == .isAccompanyToHK ||
detailItem.type == .isHandleHKPassPort
detailItem.type == .isHandleHKPassPort ||
detailItem.type == .isLiveOverSeasMore1Year
{
return UITableView.automaticDimension
}
......@@ -294,30 +314,34 @@ extension YHSpouseInitialInfoVC : UITableViewDelegate, UITableViewDataSource {
let detailItem = item as! YHFormDetailItem
// 选国籍/现居住城市/详细地址
if detailItem.type == .nationOrArea {
// YHSelectCountryViewController
let vc = YHSelectCountryViewController()
vc.backLocationStringController = {
[weak self] country in
guard let self = self else { return }
let title = arr[0] as! YHFormTitleItem
if title.type == .nationality {
self.spouse?.nationality = country
} else if title.type == .liveInfo {
self.spouse?.address?.country = country
}
self.loadSponseInfo()
}
self.navigationController?.pushViewController(vc)
} else if detailItem.type == .liveCity {
// YHFormPickerView.show(type:.certificate, selectType: .certificate(.passport)) { [weak self] selectType in
// let res = selectType.title
// if let self = self {
// if detailItem.type == .nationOrArea {
// let title = arr[0] as! YHFormTitleItem
// if title.type == .liveInfo {
// self.spouse?.address?.country = res
// } else if title.type == .country {
// self.spouse?.nationality = res
// }
//
// } else if detailItem.type == .liveCity {
// self.spouse?.address?.area = [res, res]
// }
// self.loadSponseInfo()
// }
// }
} else if detailItem.type == .detailAddress {
// self.spouse?.address?.details = res
let vc = YHAddressViewController()
vc.backLocationStringController = {
[weak self] (string1, string2, string3, string4) in
guard let self = self else { return }
print("\(string1)\n\(string2)\n\(string3)\n\(string4)")
self.spouse?.address?.area = [string2, string3, string4]
self.loadSponseInfo()
}
self.present(vc, animated: true)
}
}
}
......
......@@ -30,7 +30,7 @@ enum YHFormTitleItemType:Int, CaseIterable {
// 随行
case accompany
// 国籍
case country
case nationality
// 居住信息
case liveInfo
// 港澳通信证
......@@ -88,6 +88,8 @@ enum YHFormDetailItemType:Int {
case liveCity
// 详细地址
case detailAddress
// 是否在海外居住满1年及以上
case isLiveOverSeasMore1Year
// 是否办理
case isHandleHKPassPort
......@@ -208,7 +210,7 @@ class YHFormTitleItem : YHFormItemProtocol {
return "子女".local
case .accompany:
return "随行".local
case .country:
case .nationality:
return "国籍".local
case .liveInfo:
return "居住信息".local
......@@ -258,7 +260,7 @@ class YHFormTitleItem : YHFormItemProtocol {
return "".local
case .accompany:
return "".local
case .country:
case .nationality:
return "".local
case .liveInfo:
return "".local
......@@ -323,70 +325,50 @@ class YHFormDetailItem : YHFormItemProtocol {
return "现居住城市".local
case .detailAddress:
return "详细地址".local
case .isLiveOverSeasMore1Year:
return "是否在海外居住满1年及以上".local
case .isHandleHKPassPort:
return "是否办理".local
// 证件类别
case .certificateType:
return "证件类别".local
// 证件号码
case .certificateNumber:
return "证件号码".local
// 证件号码
case .chinaIdentityCardNumber:
return "中国身份证号".local
// 旅行证件号码
case .traverlPassportNumber:
return "旅行证件号码".local
// 签发日期
case .certificateSignDate:
return "签发日期".local
// 届满日期
case .certificateValidDate:
return "届满日期".local
case .certificateSignPlace:
return "签发地".local
// 配偶姓名
case .spouseName:
return "配偶姓名".local
// 曾用名
case .everName:
return "曾用名".local
// 婚前姓氏
case .befourMarryFirstName:
return "婚前姓氏".local
// 出生日期
case .birthday:
return "出生日期".local
// 出生国家/地区
case .birthNation:
return "出生国家/地区".local
// 出生城市
case .birthCity:
return "出生城市".local
// 职业
case .occupation:
return "职业".local
// 职业名称
case .occupationName:
return "职业名称".local
// 是否拥有学位
case .ownDegree:
return "是否拥有学位".local
// 目前是否在港
case .isNowInHK:
return "目前是否在港".local
// 获准逗留至
case .stayHKDate:
return "获准逗留至".local
// 在港身份
case .roleInHK:
return "在港身份".local
// 是否办理过(香港身份证)
case .isHaveHkIdentityCard:
return "是否办理过".local
// 香港身份证号码
case .hkIdentityCardNumber:
return "香港身份证号码".local
case .degreeDetailInfo:
......@@ -474,34 +456,6 @@ enum YHFamilyMemberType: Int {
class YHFamilyMember: SmartCodable, YHFormItemProtocol {
// 是否随行
func isFollow() -> Bool {
return follow == 1
}
func setFollow(_ follow:Bool) {
self.follow = (follow ? 1 : 0)
}
// 是否要办理港澳通行证
func isNeedHandleHKPassPort() -> Bool {
return self.isHandled == 1
}
func setNeedHandleHKPassPort(_ need:Bool) {
self.isHandled = (need ? 1 : 0)
}
// 是否与主申请人同住
func isLiveTother() -> Bool {
return self.finishFollow == 1
}
func setLiveTother(_ together:Bool) {
self.finishFollow = (together ? 1 : 0)
}
var id: Int = 0
var deceased: Int = 0
var custody: Int = 0
......@@ -618,6 +572,43 @@ class YHFamilyMember: SmartCodable, YHFormItemProtocol {
}
// 是否随行
func isFollow() -> Bool {
return follow == 1
}
func setFollow(_ follow:Bool) {
self.follow = (follow ? 1 : 0)
}
// 是否要办理港澳通行证
func isNeedHandleHKPassPort() -> Bool {
return self.isHandled == 1
}
func setNeedHandleHKPassPort(_ need:Bool) {
self.isHandled = (need ? 1 : 0)
}
// 是否与主申请人同住
func isLiveTother() -> Bool {
return self.nows == 1
}
func setLiveTother(_ together:Bool) {
self.nows = (together ? 1 : 0)
}
// 是否在海外居住满1年及以上
func isOverSeasOver1Year() -> Bool {
return self.isLiveOverseaYear == 1
}
func setOverSearsOver1Year(_ value:Bool) {
self.isLiveOverseaYear = value ? 1 : 0
}
var relationType:YHFamilyMemberType {
if relation == "1" {
......
......@@ -86,6 +86,7 @@ class YHFormItemDoubleChoiceCell: UITableViewCell {
label.textAlignment = .left
label.numberOfLines = 0
label.font = UIFont.systemFont(ofSize: 14)
label.lineBreakMode = .byCharWrapping
return label
}()
......@@ -160,6 +161,7 @@ class YHFormItemDoubleChoiceCell: UITableViewCell {
}
}
@objc func didClickResponseBtn(btn: UIButton) {
let selectIndex = btn.tag-answerBaseTag
......
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