Commit 66d44524 authored by Steven杜宇's avatar Steven杜宇

// 家庭成员

parent cf92146c
......@@ -295,7 +295,7 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
guard let child = child else { return }
if detailItem.type == .detailAddress {
if child.address.isInChina() {
if child.isLiveInChina() {
child.address.details = text ?? ""
} else {
child.address.foreign = text ?? ""
......@@ -466,7 +466,7 @@ extension YHChildPrimaryInfoVC {
if isEmptyString(child.address.country) {
return false
}
if child.address.isInChina() {
if child.isLiveInChina() {
if isEmptyArray(child.address.area) {
return false
}
......
......@@ -250,7 +250,7 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
if detailItem.type == .detailAddress {
if spouse.address.isInChina() {
if spouse.isLiveInChina() {
spouse.address.details = text ?? ""
} else {
spouse.address.foreign = text ?? ""
......@@ -387,7 +387,7 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
if isEmptyString(spouse.address.country) {
return false
}
if spouse.address.isInChina() {
if spouse.isLiveInChina() {
if isEmptyArray(spouse.address.area) {
return false
}
......
......@@ -874,6 +874,16 @@ class YHFamilyMember: SmartCodable, YHFormItemProtocol {
self.childStepchild.has = (val ? "Y" : "N")
}
// 是否住在中国
func isLiveInChina() ->Bool {
// 默认在中国
if isEmptyString(self.address.country) { return true }
if self.address.country.contains("中国") {
return true
}
return false
}
// 根据生日推算年龄
func getAge(birthday:String) ->Int {
let arr = birthday.components(separatedBy: YHDatePickView.separator)
......@@ -986,16 +996,6 @@ class YHAddress: SmartCodable {
}
// 是否在中国
func isInChina() ->Bool {
// 默认在中国
if isEmptyString(country) { return true }
if country.contains("中国") {
return true
}
return false
}
// 清空地址信息
func clearAddress() {
self.area = []
......
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