Commit 2f6ea612 authored by Steven杜宇's avatar Steven杜宇

// 高才

parent f57c6c2b
......@@ -796,9 +796,15 @@ class YHFamilyMember: SmartCodable, YHFormItemProtocol {
self.nows = (value ? 1 : 0)
}
// 是否拥有现时定居国家/地区的永久居留身份
func isHavePermanentResidenceStatus() -> Bool {
return self.isCurrentlyOverseas == 1
// 是否拥有现时定居国家/地区的永久居留身份 nil表示未选
func isHavePermanentResidenceStatus() -> Bool? {
if self.isCurrentlyOverseas == 1 {
return true
} else if self.isCurrentlyOverseas == 2 {
return false
}
return nil
}
func setHavePermanentResidenceStatus(_ value: Bool) {
......
......@@ -210,14 +210,14 @@ class YHFormItemDoubleChoiceCell: UITableViewCell {
tipsLabel.text = tips
tipsLabel.isHidden = !isShow
if isShow {
tipsLabel.snp.makeConstraints { make in
tipsLabel.snp.remakeConstraints { make in
make.left.equalToSuperview().offset(horizonalGap)
make.right.equalToSuperview().offset(-horizonalGap)
make.top.equalTo(titleLabel.snp.bottom)
make.bottom.equalToSuperview().offset(-16).priority(.medium)
}
} else {
tipsLabel.snp.makeConstraints { make in
tipsLabel.snp.remakeConstraints { make in
make.left.equalToSuperview().offset(horizonalGap)
make.right.equalToSuperview().offset(-horizonalGap)
make.height.equalTo(0)
......
......@@ -75,7 +75,9 @@ class YHGCChildPrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol {
// 居住信息
let title2 = YHFormTitleItem(type: .liveInfo)
let item20 = YHFormDetailItem(type: .isLiveTother, value:String(child.isLiveTother()))
var arr2: [YHFormItemProtocol] = [title2, item20]
let item21 = YHFormDetailItem(type:.permanentResidenceStatus, value: String(child.isCurrentlyOverseas))
item21.tips = "请选择"
var arr2: [YHFormItemProtocol] = [title2, item20, item21]
if !child.isLiveTother() { // 不同住 才需填写国家/地区
let item21 = YHFormDetailItem(type: .nationOrArea, value:child.address.country, tips:"请选择国家/地区".local)
......@@ -194,6 +196,7 @@ class YHGCChildPrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol {
|| detailItem.type == .ownCustody
|| detailItem.type == .isLiveTother
|| detailItem.type == .isLiveOverSeasMore1Year
|| detailItem.type == .permanentResidenceStatus
{
return .twoChoice
}
......@@ -244,19 +247,51 @@ extension YHGCChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
cell.enableEdit = true
cell.disableEditTips = nil
var select = false
if let value = detailItem.value {
select = Bool(value)!
var isShowTips = detailItem.isShowTips
if detailItem.type == .permanentResidenceStatus {
isShowTips = ((child?.isHavePermanentResidenceStatus()) == nil)
}
cell.setTips(detailItem.tips, isShow: isNeedShowError && isShowTips)
if detailItem.type == .isAccompanyToHK, let child = child, child.is18YearsOld() { // 是否随行至香港
// 年满18岁不能随行 随行按钮不可编辑固定为否
cell.enableEdit = isFollowCanEdit
cell.disableEditTips = "年满十八岁的子女不能随行至香港"
}
let answers = [YHFormChoiceItem(title: "是".local, isSelect: select),YHFormChoiceItem(title: "否".local, isSelect: !select)]
cell.answerArr = answers
if detailItem.type == .permanentResidenceStatus { // 永久居留身份
var isSelectYES = false
var isSelectNO = false
if let value = detailItem.value, let status = Int(value) {
if status == 2 {
isSelectYES = false
isSelectNO = true
} else if status == 1 {
isSelectYES = true
isSelectNO = false
} else if status == 0 {
isSelectYES = false
isSelectNO = false
}
}
let answers = [YHFormChoiceItem(title: "是".local, isSelect: isSelectYES),YHFormChoiceItem(title: "否".local, isSelect: isSelectNO)]
cell.answerArr = answers
} else {
var select = false
if let value = detailItem.value {
select = Bool(value)!
}
let answers = [YHFormChoiceItem(title: "是".local, isSelect: select),YHFormChoiceItem(title: "否".local, isSelect: !select)]
cell.answerArr = answers
}
cell.answerBlock = {
......@@ -286,7 +321,11 @@ extension YHGCChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
} else if detailItem.type == .ownCustody { // 抚养权
self.child?.setOwnCustody(option)
} else if detailItem.type == .permanentResidenceStatus { // 永久居留身份
self.child?.setHavePermanentResidenceStatus(option)
}
self.loadInfo()
save()
}
......@@ -507,6 +546,10 @@ extension YHGCChildPrimaryInfoVC {
return false
}
if child.isHavePermanentResidenceStatus() == nil {
return false
}
if !child.isLiveTother() { // 没有与主申请人同住
if isEmptyString(child.address.country) {
return false
......
......@@ -81,8 +81,9 @@ class YHGCSpousePrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol {
let item20 = YHFormDetailItem(type:.isLiveTother, value:String(spouse.isLiveTother()))
arr2.append(item20)
// let item21 = YHFormDetailItem(type:.permanentResidenceStatus, value: "")
// arr2.append(item21)
let item21 = YHFormDetailItem(type:.permanentResidenceStatus, value: String(spouse.isCurrentlyOverseas))
item21.tips = "请选择"
arr2.append(item21)
if !spouse.isLiveTother() { // 不同住 才需填写国家/地区
......@@ -212,14 +213,45 @@ extension YHGCSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDoubleChoiceCell
cell.isMust = detailItem.isNeed
cell.title = detailItem.getTitle()
cell.setTips(detailItem.tips, isShow: isNeedShowError && detailItem.isShowTips)
var isShowTips = detailItem.isShowTips
if detailItem.type == .permanentResidenceStatus {
isShowTips = ((spouse?.isHavePermanentResidenceStatus()) == nil)
}
cell.setTips(detailItem.tips, isShow: isNeedShowError && isShowTips)
var select = false
if let value = detailItem.value {
select = Bool(value)!
if detailItem.type == .permanentResidenceStatus { // 永久居留身份
var isSelectYES = false
var isSelectNO = false
if let value = detailItem.value, let status = Int(value) {
if status == 2 {
isSelectYES = false
isSelectNO = true
} else if status == 1 {
isSelectYES = true
isSelectNO = false
} else if status == 0 {
isSelectYES = false
isSelectNO = false
}
}
let answers = [YHFormChoiceItem(title: "是".local, isSelect: isSelectYES),YHFormChoiceItem(title: "否".local, isSelect: isSelectNO)]
cell.answerArr = answers
} else {
var select = false
if let value = detailItem.value {
select = Bool(value)!
}
let answers = [YHFormChoiceItem(title: "是".local, isSelect: select),YHFormChoiceItem(title: "否".local, isSelect: !select)]
cell.answerArr = answers
}
let answers = [YHFormChoiceItem(title: "是".local, isSelect: select),YHFormChoiceItem(title: "否".local, isSelect: !select)]
cell.answerArr = answers
cell.answerBlock = {
......@@ -251,9 +283,15 @@ extension YHGCSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
} else if detailItem.type == .isLiveOverSeasMore1Year { // 是否在海外居住满1年及以上
self.spouse?.setOverSearsOver1Year(option)
self.loadInfo()
} else if detailItem.type == .isLiveOverSeasMore1Year { // 是否在海外居住满1年及以上
self.spouse?.setOverSearsOver1Year(option)
self.loadInfo()
} else if detailItem.type == .permanentResidenceStatus { // 永久居留身份
self.spouse?.setHavePermanentResidenceStatus(option)
self.loadInfo()
}
save()
}
......@@ -446,6 +484,10 @@ extension YHGCSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
return false
}
if spouse.isHavePermanentResidenceStatus() == nil {
return false
}
if !spouse.isLiveTother() { // 没有与主申请人同住
if isEmptyString(spouse.address.country) {
return false
......
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