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

// 高才

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