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

// 家庭成员

parent 1dc3e06a
......@@ -238,9 +238,7 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
} else if detailItem.type == .isLiveTother { // 是否与主申请人同住
self.child?.setLiveTother(option)
if option {
self.child?.address.country = ""
self.child?.address.details = ""
self.child?.address.area = []
self.child?.address.clearAddress()
}
} else if detailItem.type == .isLiveOverSeasMore1Year { // 是否在海外居住满1年及以上
self.child?.setOverSearsOver1Year(option)
......
......@@ -140,7 +140,7 @@ class YHSpouseBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol {
let title2 = YHFormTitleItem(type: .degreeInfo)
let item20 = YHFormDetailItem(type: .ownDegree)
item20.placeHolder = "请选择".local
item20.value = spouse.haveDegreeName()
item20.value = spouse.hasDegreeName()
item20.tips = "请选择".local
var arr2:[YHFormItemProtocol] = [title2, item20]
......@@ -488,50 +488,55 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
if indexPath.row-2 < degreeArr.count {
let degreeInfo = degreeArr[indexPath.row-2]
cell.title = String(format: "%@%d", "学位信息".local, indexPath.row-1)
cell.degreePlace = degreeInfo.address
// 前两行是 学历学位信息标题 和 是否拥有学位
cell.showDeleteBtn(indexPath.row > 2)
var degree = ""
if !degreeInfo.degree.isEmpty {
if let degreeIndex = Int(degreeInfo.degree), let subType = YHPickerViewDegreeType(rawValue: degreeIndex) {
degree = YHFormPickerViewSubType.degree(subType).title
}
// 学位
var degreeDesc = ""
if let degreeInt = Int(degreeInfo.degree), let item = YHSheetPickerView.getItem(type:.degree, index:degreeInt)
{
degreeDesc = item.title
}
cell.degree = degree
cell.degree = degreeDesc
var degreePlace = ""
if !degreeInfo.address.isEmpty {
if let addressIndex = Int(degreeInfo.address), let subType = YHPickerViewDegreeLocationType(rawValue: addressIndex) {
degreePlace = YHFormPickerViewSubType.degreeLocation(subType).title
}
// 颁发地区
var degreeAreaDesc = ""
if let areaInt = Int(degreeInfo.address), let item = YHSheetPickerView.getItem(type:.degreeLocation, index: areaInt)
{
degreeAreaDesc = item.title
}
cell.degreePlace = degreePlace
cell.degreePlace = degreeAreaDesc
let isNeedShowDegreeTips = isNeedShowError && isEmptyString(degree)
let isNeedShowPlaceTips = isNeedShowError && isEmptyString(degreePlace)
let isNeedShowDegreeTips = isNeedShowError && isEmptyString(degreeDesc)
let isNeedShowPlaceTips = isNeedShowError && isEmptyString(degreeAreaDesc)
cell.showTips(isShowDegreeTips:isNeedShowDegreeTips, isShowPlaceTips:isNeedShowPlaceTips)
cell.degreeClickBlock = {
YHFormPickerView.show(type: .degree) { [weak self] selectType in
YHSheetPickerView.show(type: .degree, selectTitle:degreeDesc) {
[weak self] selectItem in
guard let self = self else { return }
degreeInfo.degree = String(selectType.index)
self.loadInfo()
degreeInfo.degree = String(selectItem.index)
loadInfo()
save()
}
}
cell.areaClickBlock = {
YHFormPickerView.show(type: .degreeLocation) { [weak self] selectType in
YHSheetPickerView.show(type: .degreeLocation, selectTitle: degreeAreaDesc) {
[weak self] selectType in
guard let self = self else { return }
degreeInfo.address = String(selectType.index)
self.loadInfo()
loadInfo()
save()
}
}
cell.deleteBlock = {
[weak self] in
guard let self = self else { return }
self.spouse?.hasDegreeJson.remove(at: indexPath.row-2)
self.loadInfo()
loadInfo()
save()
}
}
......@@ -595,7 +600,8 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
} else if detailItem.type == .stayHKDate {
self.spouse?.childInHk.info = date
}
self.loadInfo()
loadInfo()
save()
}
} else if detailItem.type == .birthCity { // 出生城市
......@@ -613,38 +619,42 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
guard let self = self else { return }
print("\(string1)\n\(string2)\n\(string3)\n\(string4)")
self.spouse?.birthPlace.area = [string2, string3]
self.loadInfo()
loadInfo()
save()
}
self.present(vc, animated: true)
} else if detailItem.type == .roleInHK { // 在港身份
let identity = self.spouse?.hkIdentity ?? ""
YHFormPickerView.show(type: .identity, selectTitle:identity ) {
[weak self] selectType in
YHSheetPickerView.show(type:.identity, selectTitle:identity) {
[weak self] selectItem in
guard let self = self else { return }
self.spouse?.hkIdentity = selectType.title
self.loadInfo()
self.spouse?.hkIdentity = selectItem.title
loadInfo()
save()
}
} else if detailItem.type == .occupation {
let occupation = self.spouse?.occupation ?? ""
YHFormPickerView.show(type: .occupation, selectTitle:occupation ) {
[weak self] selectType in
YHSheetPickerView.show(type: .occupation, selectTitle:occupation) {
[weak self] selectItem in
guard let self = self else { return }
self.spouse?.occupation = selectType.title
self.loadInfo()
self.spouse?.occupation = selectItem.title
loadInfo()
save()
}
} else if detailItem.type == .ownDegree {
let hasDegree = self.spouse?.haveDegreeName() ?? "无学位"
YHFormPickerView.show(type: .ownDegree, selectTitle:hasDegree ) {
[weak self] selectType in
YHSheetPickerView.show(type: .ownDegree, selectTitle:self.spouse?.hasDegreeName()) {
[weak self] selectItem in
guard let self = self else { return }
let ownDegree = (selectType.index == YHFormPickerViewSubType.ownDegree(.hasDegree).index)
self.spouse?.setHaveDegree(ownDegree)
let hasDegree = selectItem.index == 1
self.spouse?.setHaveDegree(hasDegree)
self.loadInfo()
save()
}
}
}
}
......
......@@ -198,9 +198,7 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
} else if detailItem.type == .isLiveTother { // 是否与主申请人同住
self.spouse?.setLiveTother(option)
if option {
self.spouse?.address.country = ""
self.spouse?.address.details = ""
self.spouse?.address.area = []
self.spouse?.address.clearAddress()
}
self.loadInfo()
......
......@@ -554,6 +554,8 @@ extension YHBrotherInfoVC {
// 静默保存 不显示toast和loading
func saveInfoSilent() {
guard let brotherInfo = brotherInfo else { return }
if brotherInfo.id == 0 { return }
saveInfo(isSubmit: false, isLoading: false, callBack: nil)
}
}
......
......@@ -590,7 +590,10 @@ extension YHParentInfoVC {
}
}
// 静默保存 不显示toast和loading
func saveInfoSilent() {
saveInfo(isSubmit: false, isLoading: false, callBack:nil)
guard let parentInfo = parentInfo else { return }
if parentInfo.id == 0 { return }
saveInfo(isSubmit: false, isLoading: false, callBack: nil)
}
}
......@@ -1044,12 +1044,11 @@ class YHFamilyMember: SmartCodable, YHFormItemProtocol {
}
// 是否拥有学位
func haveDegreeName() -> String? {
func hasDegreeName() -> String {
if hasDegree == "1" {
return "有学位"
} else {
return "无学位"
return "有学位".local
}
return "无学位".local
}
func isHaveDegree() ->Bool {
......@@ -1205,6 +1204,14 @@ class YHAddress: SmartCodable {
}
return false
}
// 清空地址信息
func clearAddress() {
self.area = []
self.country = ""
self.details = ""
self.foreign = ""
}
}
// MARK: - YHChildStepchildClass
......
......@@ -108,9 +108,9 @@ enum YHPicerViewProfessionType: Int {
enum YHPickerViewGenderType: Int {
// 男
case male = 0
case male = 1
// 女
case female = 1
case female = 2
}
enum YHPickerViewCertificateType: Int {
......
......@@ -156,9 +156,9 @@ class YHSheetPickerView: UIView {
// 学位
.degree:
[YHSheetPickerViewItem(title:"学士学位".local, index:0),
YHSheetPickerViewItem(title:"硕士学位".local, index:1),
YHSheetPickerViewItem(title:"博士学位".local, index:2)
[YHSheetPickerViewItem(title:"学士学位".local, index:1),
YHSheetPickerViewItem(title:"硕士学位".local, index:2),
YHSheetPickerViewItem(title:"博士学位".local, index:3)
],
// 婚姻
......@@ -236,8 +236,8 @@ class YHSheetPickerView: UIView {
// 学位颁发地区
.degreeLocation:
[YHSheetPickerViewItem(title:"国内 (颁发)".local, index:0),
YHSheetPickerViewItem(title:"国外 (颁发)".local, index:1),
[YHSheetPickerViewItem(title:"国内 (颁发)".local, index:1),
YHSheetPickerViewItem(title:"国外 (颁发)".local, index:2),
],
// 专业证书
......
......@@ -797,7 +797,7 @@ private extension YHPreviewViewModel {
if model.nationality != "中国-China" {
//护照及其他旅行证件
var str = String(model.certificates.passport.passportType)//for test hjl todo
var str = String(model.certificates.passport.passPortType)//for test hjl todo
let tmp8 = YHPreviewQuestionAndAnswerModel(question: "证件类别:", answer: str)
str = model.certificates.passport.number
......
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