Commit d32f1e31 authored by David黄金龙's avatar David黄金龙

Merge branch 'develop' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS into develop

* 'develop' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS:
  // 家庭成员
  // 家庭成员
  // 家庭成员
parents 2857bc23 da66c041
...@@ -440,41 +440,39 @@ extension YHChildBasicInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -440,41 +440,39 @@ extension YHChildBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
} else if detailItem.type == .roleInHK { // 在港身份 } else if detailItem.type == .roleInHK { // 在港身份
let identity = self.child?.hkIdentity ?? "" let identity = self.child?.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 } guard let self = self else { return }
self.child?.hkIdentity = selectType.title self.child?.hkIdentity = selectItem.title
self.loadInfo() self.loadInfo()
save() save()
} }
} else if detailItem.type == .occupation { // 职业 } else if detailItem.type == .occupation { // 职业
let occupation = self.child?.occupation ?? "" let occupation = self.child?.occupation ?? ""
YHFormPickerView.show(type: .occupation, selectTitle:occupation ) { YHSheetPickerView.show(type:.occupation, selectTitle: occupation) {
[weak self] selectType in [weak self] selectItem in
guard let self = self else { return } guard let self = self else { return }
self.child?.occupation = selectType.title self.child?.occupation = selectItem.title
self.loadInfo() self.loadInfo()
save() save()
} }
} else if detailItem.type == .gender { // 性别 } else if detailItem.type == .gender { // 性别
guard let child = child else { return } YHSheetPickerView.show(type: .gender, selectTitle:child?.sexName()) {
let isMale = child.isMale() [weak self] selectItem in
let selectType:YHFormPickerViewSubType = isMale ? .gender(.male) : .gender(.female)
YHFormPickerView.show(type: .gender, selectType:selectType) {
[weak self] selectType in
guard let self = self else { return } guard let self = self else { return }
let selectMale = (selectType.index == YHFormPickerViewSubType.gender(.male).index) self.child?.setSexName(selectItem.title)
self.child?.setMale(selectMale)
self.loadInfo() self.loadInfo()
save() save()
} }
} else if detailItem.type == .marriageState { // 婚姻 } else if detailItem.type == .marriageState { // 婚姻
let marriage = self.child?.married YHSheetPickerView.show(type: .marriage, selectTitle:self.child?.married) {
YHFormPickerView.show(type: .marriage, selectTitle:marriage) { [weak self] selectItem in
[weak self] selectType in
guard let self = self else { return } guard let self = self else { return }
self.child?.married = selectType.title self.child?.married = selectItem.title
self.loadInfo() self.loadInfo()
save() save()
} }
......
...@@ -238,9 +238,7 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -238,9 +238,7 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
} else if detailItem.type == .isLiveTother { // 是否与主申请人同住 } else if detailItem.type == .isLiveTother { // 是否与主申请人同住
self.child?.setLiveTother(option) self.child?.setLiveTother(option)
if option { if option {
self.child?.address.country = "" self.child?.address.clearAddress()
self.child?.address.details = ""
self.child?.address.area = []
} }
} else if detailItem.type == .isLiveOverSeasMore1Year { // 是否在海外居住满1年及以上 } else if detailItem.type == .isLiveOverSeasMore1Year { // 是否在海外居住满1年及以上
self.child?.setOverSearsOver1Year(option) self.child?.setOverSearsOver1Year(option)
......
...@@ -140,7 +140,7 @@ class YHSpouseBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol { ...@@ -140,7 +140,7 @@ class YHSpouseBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol {
let title2 = YHFormTitleItem(type: .degreeInfo) let title2 = YHFormTitleItem(type: .degreeInfo)
let item20 = YHFormDetailItem(type: .ownDegree) let item20 = YHFormDetailItem(type: .ownDegree)
item20.placeHolder = "请选择".local item20.placeHolder = "请选择".local
item20.value = spouse.haveDegreeName() item20.value = spouse.hasDegreeName()
item20.tips = "请选择".local item20.tips = "请选择".local
var arr2:[YHFormItemProtocol] = [title2, item20] var arr2:[YHFormItemProtocol] = [title2, item20]
...@@ -488,50 +488,55 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -488,50 +488,55 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
if indexPath.row-2 < degreeArr.count { if indexPath.row-2 < degreeArr.count {
let degreeInfo = degreeArr[indexPath.row-2] let degreeInfo = degreeArr[indexPath.row-2]
cell.title = String(format: "%@%d", "学位信息".local, indexPath.row-1) cell.title = String(format: "%@%d", "学位信息".local, indexPath.row-1)
cell.degreePlace = degreeInfo.address
// 前两行是 学历学位信息标题 和 是否拥有学位 // 前两行是 学历学位信息标题 和 是否拥有学位
cell.showDeleteBtn(indexPath.row > 2) cell.showDeleteBtn(indexPath.row > 2)
var degree = "" // 学位
if !degreeInfo.degree.isEmpty { var degreeDesc = ""
if let degreeIndex = Int(degreeInfo.degree), let subType = YHPickerViewDegreeType(rawValue: degreeIndex) { if let degreeInt = Int(degreeInfo.degree), let item = YHSheetPickerView.getItem(type:.degree, index:degreeInt)
degree = YHFormPickerViewSubType.degree(subType).title {
} degreeDesc = item.title
} }
cell.degree = degree cell.degree = degreeDesc
var degreePlace = "" // 颁发地区
if !degreeInfo.address.isEmpty { var degreeAreaDesc = ""
if let addressIndex = Int(degreeInfo.address), let subType = YHPickerViewDegreeLocationType(rawValue: addressIndex) { if let areaInt = Int(degreeInfo.address), let item = YHSheetPickerView.getItem(type:.degreeLocation, index: areaInt)
degreePlace = YHFormPickerViewSubType.degreeLocation(subType).title {
} degreeAreaDesc = item.title
} }
cell.degreePlace = degreePlace cell.degreePlace = degreeAreaDesc
let isNeedShowDegreeTips = isNeedShowError && isEmptyString(degree) let isNeedShowDegreeTips = isNeedShowError && isEmptyString(degreeDesc)
let isNeedShowPlaceTips = isNeedShowError && isEmptyString(degreePlace) let isNeedShowPlaceTips = isNeedShowError && isEmptyString(degreeAreaDesc)
cell.showTips(isShowDegreeTips:isNeedShowDegreeTips, isShowPlaceTips:isNeedShowPlaceTips) cell.showTips(isShowDegreeTips:isNeedShowDegreeTips, isShowPlaceTips:isNeedShowPlaceTips)
cell.degreeClickBlock = { 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 } guard let self = self else { return }
degreeInfo.degree = String(selectType.index) degreeInfo.degree = String(selectItem.index)
self.loadInfo() loadInfo()
save()
} }
} }
cell.areaClickBlock = { 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 } guard let self = self else { return }
degreeInfo.address = String(selectType.index) degreeInfo.address = String(selectType.index)
self.loadInfo() loadInfo()
save()
} }
} }
cell.deleteBlock = { cell.deleteBlock = {
[weak self] in [weak self] in
guard let self = self else { return } guard let self = self else { return }
self.spouse?.hasDegreeJson.remove(at: indexPath.row-2) self.spouse?.hasDegreeJson.remove(at: indexPath.row-2)
self.loadInfo() loadInfo()
save()
} }
} }
...@@ -595,7 +600,8 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -595,7 +600,8 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
} else if detailItem.type == .stayHKDate { } else if detailItem.type == .stayHKDate {
self.spouse?.childInHk.info = date self.spouse?.childInHk.info = date
} }
self.loadInfo() loadInfo()
save()
} }
} else if detailItem.type == .birthCity { // 出生城市 } else if detailItem.type == .birthCity { // 出生城市
...@@ -613,38 +619,42 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -613,38 +619,42 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
guard let self = self else { return } guard let self = self else { return }
print("\(string1)\n\(string2)\n\(string3)\n\(string4)") print("\(string1)\n\(string2)\n\(string3)\n\(string4)")
self.spouse?.birthPlace.area = [string2, string3] self.spouse?.birthPlace.area = [string2, string3]
self.loadInfo() loadInfo()
save()
} }
self.present(vc, animated: true) self.present(vc, animated: true)
} else if detailItem.type == .roleInHK { // 在港身份 } else if detailItem.type == .roleInHK { // 在港身份
let identity = self.spouse?.hkIdentity ?? "" let identity = self.spouse?.hkIdentity ?? ""
YHFormPickerView.show(type: .identity, selectTitle:identity ) { YHSheetPickerView.show(type:.identity, selectTitle:identity) {
[weak self] selectType in [weak self] selectItem in
guard let self = self else { return } guard let self = self else { return }
self.spouse?.hkIdentity = selectType.title self.spouse?.hkIdentity = selectItem.title
self.loadInfo() loadInfo()
save()
} }
} else if detailItem.type == .occupation { } else if detailItem.type == .occupation {
let occupation = self.spouse?.occupation ?? "" let occupation = self.spouse?.occupation ?? ""
YHFormPickerView.show(type: .occupation, selectTitle:occupation ) { YHSheetPickerView.show(type: .occupation, selectTitle:occupation) {
[weak self] selectType in [weak self] selectItem in
guard let self = self else { return } guard let self = self else { return }
self.spouse?.occupation = selectType.title self.spouse?.occupation = selectItem.title
self.loadInfo() loadInfo()
save()
} }
} else if detailItem.type == .ownDegree { } else if detailItem.type == .ownDegree {
let hasDegree = self.spouse?.haveDegreeName() ?? "无学位"
YHFormPickerView.show(type: .ownDegree, selectTitle:hasDegree ) { YHSheetPickerView.show(type: .ownDegree, selectTitle:self.spouse?.hasDegreeName()) {
[weak self] selectType in [weak self] selectItem in
guard let self = self else { return } guard let self = self else { return }
let ownDegree = (selectType.index == YHFormPickerViewSubType.ownDegree(.hasDegree).index) let hasDegree = selectItem.index == 1
self.spouse?.setHaveDegree(ownDegree) self.spouse?.setHaveDegree(hasDegree)
self.loadInfo() self.loadInfo()
save()
} }
} }
} }
} }
......
...@@ -198,9 +198,7 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -198,9 +198,7 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
} else if detailItem.type == .isLiveTother { // 是否与主申请人同住 } else if detailItem.type == .isLiveTother { // 是否与主申请人同住
self.spouse?.setLiveTother(option) self.spouse?.setLiveTother(option)
if option { if option {
self.spouse?.address.country = "" self.spouse?.address.clearAddress()
self.spouse?.address.details = ""
self.spouse?.address.area = []
} }
self.loadInfo() self.loadInfo()
......
...@@ -438,7 +438,8 @@ extension YHBrotherInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -438,7 +438,8 @@ extension YHBrotherInfoVC : UITableViewDelegate, UITableViewDataSource {
self.loadInfo() self.loadInfo()
saveInfoSilent() saveInfoSilent()
} }
self.present(vc, animated: true) self.navigationController?.pushViewController(vc)
} else if detailItem.type == .gender { // 性别 } else if detailItem.type == .gender { // 性别
guard let brotherInfo = brotherInfo else { return } guard let brotherInfo = brotherInfo else { return }
...@@ -554,6 +555,8 @@ extension YHBrotherInfoVC { ...@@ -554,6 +555,8 @@ extension YHBrotherInfoVC {
// 静默保存 不显示toast和loading // 静默保存 不显示toast和loading
func saveInfoSilent() { func saveInfoSilent() {
guard let brotherInfo = brotherInfo else { return }
if brotherInfo.id == 0 { return }
saveInfo(isSubmit: false, isLoading: false, callBack: nil) saveInfo(isSubmit: false, isLoading: false, callBack: nil)
} }
} }
......
...@@ -461,8 +461,7 @@ extension YHParentInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -461,8 +461,7 @@ extension YHParentInfoVC : UITableViewDelegate, UITableViewDataSource {
} }
} else if detailItem.type == .marriageState { // 婚姻 } else if detailItem.type == .marriageState { // 婚姻
let marriage = self.parentInfo?.married ?? "" YHSheetPickerView.show(type: .marriage, selectTitle:self.parentInfo?.married) {
YHSheetPickerView.show(type: .marriage, selectTitle:marriage) {
[weak self] selectItem in [weak self] selectItem in
guard let self = self else { return } guard let self = self else { return }
self.parentInfo?.married = selectItem.title self.parentInfo?.married = selectItem.title
...@@ -479,7 +478,7 @@ extension YHParentInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -479,7 +478,7 @@ extension YHParentInfoVC : UITableViewDelegate, UITableViewDataSource {
self.loadInfo() self.loadInfo()
saveInfoSilent() saveInfoSilent()
} }
self.present(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
} }
} }
} }
...@@ -590,7 +589,10 @@ extension YHParentInfoVC { ...@@ -590,7 +589,10 @@ extension YHParentInfoVC {
} }
} }
// 静默保存 不显示toast和loading
func saveInfoSilent() { 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 { ...@@ -1044,12 +1044,11 @@ class YHFamilyMember: SmartCodable, YHFormItemProtocol {
} }
// 是否拥有学位 // 是否拥有学位
func haveDegreeName() -> String? { func hasDegreeName() -> String {
if hasDegree == "1" { if hasDegree == "1" {
return "有学位" return "有学位".local
} else {
return "无学位"
} }
return "无学位".local
} }
func isHaveDegree() ->Bool { func isHaveDegree() ->Bool {
...@@ -1205,6 +1204,14 @@ class YHAddress: SmartCodable { ...@@ -1205,6 +1204,14 @@ class YHAddress: SmartCodable {
} }
return false return false
} }
// 清空地址信息
func clearAddress() {
self.area = []
self.country = ""
self.details = ""
self.foreign = ""
}
} }
// MARK: - YHChildStepchildClass // MARK: - YHChildStepchildClass
......
...@@ -108,9 +108,9 @@ enum YHPicerViewProfessionType: Int { ...@@ -108,9 +108,9 @@ enum YHPicerViewProfessionType: Int {
enum YHPickerViewGenderType: Int { enum YHPickerViewGenderType: Int {
// 男 // 男
case male = 0 case male = 1
// 女 // 女
case female = 1 case female = 2
} }
enum YHPickerViewCertificateType: Int { enum YHPickerViewCertificateType: Int {
......
...@@ -156,9 +156,9 @@ class YHSheetPickerView: UIView { ...@@ -156,9 +156,9 @@ class YHSheetPickerView: UIView {
// 学位 // 学位
.degree: .degree:
[YHSheetPickerViewItem(title:"学士学位".local, index:0), [YHSheetPickerViewItem(title:"学士学位".local, index:1),
YHSheetPickerViewItem(title:"硕士学位".local, index:1), YHSheetPickerViewItem(title:"硕士学位".local, index:2),
YHSheetPickerViewItem(title:"博士学位".local, index:2) YHSheetPickerViewItem(title:"博士学位".local, index:3)
], ],
// 婚姻 // 婚姻
...@@ -236,8 +236,8 @@ class YHSheetPickerView: UIView { ...@@ -236,8 +236,8 @@ class YHSheetPickerView: UIView {
// 学位颁发地区 // 学位颁发地区
.degreeLocation: .degreeLocation:
[YHSheetPickerViewItem(title:"国内 (颁发)".local, index:0), [YHSheetPickerViewItem(title:"国内 (颁发)".local, index:1),
YHSheetPickerViewItem(title:"国外 (颁发)".local, index:1), YHSheetPickerViewItem(title:"国外 (颁发)".local, index:2),
], ],
// 专业证书 // 专业证书
......
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