Commit 024337b5 authored by Steven杜宇's avatar Steven杜宇

Merge branch 'youhua-dev' into develop

parents 4544db25 3562209d
...@@ -157,7 +157,8 @@ class YHChildBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol { ...@@ -157,7 +157,8 @@ class YHChildBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol {
if child.isHaveHKIdentityCard() { // 办理过香港身份证才显示证号 if child.isHaveHKIdentityCard() { // 办理过香港身份证才显示证号
let item41 = YHFormDetailItem(type: .hkIdentityCardNumber) let item41 = YHFormDetailItem(type: .hkIdentityCardNumber)
item41.value = child.hkIdentityCard item41.value = child.hkIdentityCard
item41.tips = "请输入香港身份证号".local let tips = isEmptyString(child.hkIdentityCard) ? "请输入香港身份证号码" : "请输入正确的香港身份证号码"
item41.tips = tips
arr4.append(item41) arr4.append(item41)
} }
items.append(arr4) items.append(arr4)
...@@ -255,14 +256,24 @@ extension YHChildBasicInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -255,14 +256,24 @@ extension YHChildBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
cell.placeHolder = detailItem.placeHolder cell.placeHolder = detailItem.placeHolder
cell.title = detailItem.getTitle() cell.title = detailItem.getTitle()
cell.text = detailItem.value cell.text = detailItem.value
cell.setTips(detailItem.tips, isShow: isNeedShowError && detailItem.isShowTips) if detailItem.type == .hkIdentityCardNumber { // 输入香港身份证号码
let isEmptyValue = isEmptyString(detailItem.value)
var isUnvalidFormat = true
if let value = detailItem.value, value.isHKIdentityCardNumber() {
isUnvalidFormat = false
}
let isNeedShowTips = isEmptyValue || isUnvalidFormat
cell.setTips(detailItem.tips, isShow: isNeedShowError && isNeedShowTips)
} else {
cell.setTips(detailItem.tips, isShow: isNeedShowError && detailItem.isShowTips)
}
if detailItem.type == .befourMarryFirstName { if detailItem.type == .befourMarryFirstName {
cell.textField.keyboardType = .asciiCapable // 英文键盘 cell.textField.keyboardType = .asciiCapable // 英文键盘
} else { } else {
cell.textField.keyboardType = .default cell.textField.keyboardType = .default
} }
cell.textInputCondtion = { cell.textInputCondtion = {
textField in textField in
...@@ -314,9 +325,14 @@ extension YHChildBasicInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -314,9 +325,14 @@ extension YHChildBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
} else if detailItem.type == .hkIdentityCardNumber { } else if detailItem.type == .hkIdentityCardNumber {
self.child?.hkIdentityCard = text self.child?.hkIdentityCard = text
} }
if isEditEnd { if isEditEnd {
self.loadInfo() self.loadInfo()
if detailItem.type == .hkIdentityCardNumber {
if let text = text, !text.isEmpty, !text.isHKIdentityCardNumber() {
YHHUD.flash(message: "请输入正确的香港身份证号格式")
return
}
}
save() save()
} }
} }
...@@ -583,9 +599,6 @@ extension YHChildBasicInfoVC { ...@@ -583,9 +599,6 @@ extension YHChildBasicInfoVC {
if isEmptyString(child.hkIdentityCard) { if isEmptyString(child.hkIdentityCard) {
return false return false
} }
if let hkIdentityCard = child.hkIdentityCard, !hkIdentityCard.isHKIdentityCardNumber() {
return false
}
} }
return true return true
} }
...@@ -600,6 +613,12 @@ extension YHChildBasicInfoVC { ...@@ -600,6 +613,12 @@ extension YHChildBasicInfoVC {
YHHUD.flash(message: "资料还未填完") YHHUD.flash(message: "资料还未填完")
return false return false
} }
if let hkIdentityCard = child?.hkIdentityCard, !hkIdentityCard.isHKIdentityCardNumber() {
isNeedShowError = true
loadInfo()
YHHUD.flash(message: "请输入正确的香港身份证号码")
return false
}
return true return true
} }
......
...@@ -132,7 +132,8 @@ class YHBrotherInfoVC: YHBaseViewController { ...@@ -132,7 +132,8 @@ class YHBrotherInfoVC: YHBaseViewController {
var arr4:[YHFormItemProtocol] = [title4, item40] var arr4:[YHFormItemProtocol] = [title4, item40]
if brotherInfo.isHaveHKIdentityCard() { // 办理过香港身份证才显示证号 if brotherInfo.isHaveHKIdentityCard() { // 办理过香港身份证才显示证号
let item41 = YHFormDetailItem(type: .hkIdentityCardNumber, value:brotherInfo.hkIdentityCard, tips: "请输入正确的香港身份证号码") let tips = isEmptyString(brotherInfo.hkIdentityCard) ? "请输入香港身份证号码".local : "请输入正确的香港身份证号码".local
let item41 = YHFormDetailItem(type: .hkIdentityCardNumber, value:brotherInfo.hkIdentityCard, tips: tips)
arr4.append(item41) arr4.append(item41)
} }
items.append(contentsOf: [arr1, arr2, arr3, arr4]) items.append(contentsOf: [arr1, arr2, arr3, arr4])
...@@ -273,9 +274,14 @@ extension YHBrotherInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -273,9 +274,14 @@ extension YHBrotherInfoVC : UITableViewDelegate, UITableViewDataSource {
} else if detailItem.type == .hkIdentityCardNumber { } else if detailItem.type == .hkIdentityCardNumber {
self.brotherInfo?.hkIdentityCard = text ?? "" self.brotherInfo?.hkIdentityCard = text ?? ""
} }
if isEditEnd { if isEditEnd {
self.loadInfo() self.loadInfo()
if detailItem.type == .hkIdentityCardNumber {
if let text = text, !text.isEmpty, !text.isHKIdentityCardNumber() {
YHHUD.flash(message: "请输入正确的香港身份证号格式")
return
}
}
saveInfoSilent() saveInfoSilent()
} }
} }
...@@ -563,10 +569,6 @@ extension YHBrotherInfoVC { ...@@ -563,10 +569,6 @@ extension YHBrotherInfoVC {
if isEmptyString(brotherInfo.hkIdentityCard) { if isEmptyString(brotherInfo.hkIdentityCard) {
return false return false
} }
if let hkIdCard = brotherInfo.hkIdentityCard, !hkIdCard.isHKIdentityCardNumber() {
return false
}
} }
return true return true
...@@ -585,6 +587,12 @@ extension YHBrotherInfoVC { ...@@ -585,6 +587,12 @@ extension YHBrotherInfoVC {
YHHUD.flash(message: "资料还未填完") YHHUD.flash(message: "资料还未填完")
return return
} }
if let hkIdentityCard = brotherInfo?.hkIdentityCard, !hkIdentityCard.isHKIdentityCardNumber() {
isNeedShowError = true
loadInfo()
YHHUD.flash(message: "请输入正确的香港身份证号码")
return
}
} }
guard let brotherInfo = brotherInfo else { return } guard let brotherInfo = brotherInfo else { return }
......
...@@ -168,10 +168,15 @@ class YHParentInfoVC: YHBaseViewController { ...@@ -168,10 +168,15 @@ class YHParentInfoVC: YHBaseViewController {
var arr4:[YHFormItemProtocol] = [title4, item40] var arr4:[YHFormItemProtocol] = [title4, item40]
if parentInfo.isHaveHKIdentityCard() { // 办理过香港身份证才显示证号 if parentInfo.isHaveHKIdentityCard() { // 办理过香港身份证才显示证号
let item41 = YHFormDetailItem(type: .hkIdentityCardNumber, value:parentInfo.hkIdentityCard, tips: "请输入正确的香港身份证号码".local) let tips = isEmptyString(parentInfo.hkIdentityCard) ? "请输入香港身份证号码".local : "请输入正确的香港身份证号码".local
let item41 = YHFormDetailItem(type: .hkIdentityCardNumber, value:parentInfo.hkIdentityCard, tips: tips)
arr4.append(item41) arr4.append(item41)
} }
items.append(contentsOf: [arr0, arr1, arr2, arr3, arr4]) items.append(contentsOf: [arr0, arr1, arr2, arr3, arr4])
} else { // 父母已故
if let hkIdentityCard = parentInfo.hkIdentityCard, !hkIdentityCard.isHKIdentityCardNumber() {
parentInfo.hkIdentityCard = ""
}
} }
tableView.reloadData() tableView.reloadData()
} }
...@@ -317,9 +322,14 @@ extension YHParentInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -317,9 +322,14 @@ extension YHParentInfoVC : UITableViewDelegate, UITableViewDataSource {
} else if detailItem.type == .hkIdentityCardNumber { } else if detailItem.type == .hkIdentityCardNumber {
self.parentInfo?.hkIdentityCard = text self.parentInfo?.hkIdentityCard = text
} }
if isEditEnd { if isEditEnd {
self.loadInfo() self.loadInfo()
if detailItem.type == .hkIdentityCardNumber {
if let text = text, !text.isEmpty, !text.isHKIdentityCardNumber() {
YHHUD.flash(message: "请输入正确的香港身份证号格式")
return
}
}
saveInfoSilent() saveInfoSilent()
} }
} }
...@@ -601,10 +611,6 @@ extension YHParentInfoVC { ...@@ -601,10 +611,6 @@ extension YHParentInfoVC {
if isEmptyString(parentInfo.hkIdentityCard) { if isEmptyString(parentInfo.hkIdentityCard) {
return false return false
} }
if let hkIdCard = parentInfo.hkIdentityCard, !hkIdCard.isHKIdentityCardNumber() {
return false
}
} }
return true return true
...@@ -616,13 +622,19 @@ extension YHParentInfoVC { ...@@ -616,13 +622,19 @@ extension YHParentInfoVC {
if isSubmit { if isSubmit {
let isChecked = checkIntegrity() let isChecked = checkIntegrity()
isNeedShowError = !isChecked isNeedShowError = !isChecked
loadInfo()
self.tableView .reloadData()
if !isChecked { if !isChecked {
YHHUD.flash(message: "资料还未填完") YHHUD.flash(message: "资料还未填完")
return return
} }
if let parent = parentInfo, !parent.isDead(), let hkIdentityCard = parentInfo?.hkIdentityCard, !hkIdentityCard.isHKIdentityCardNumber() {
isNeedShowError = true
loadInfo()
YHHUD.flash(message: "请输入正确的香港身份证号码")
return
}
} }
guard let parentInfo = parentInfo else { return } guard let parentInfo = parentInfo else { return }
......
...@@ -199,7 +199,8 @@ class YHSpouseBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol { ...@@ -199,7 +199,8 @@ class YHSpouseBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol {
if spouse.isHaveHKIdentityCard() { // 办理过香港身份证才显示证号 if spouse.isHaveHKIdentityCard() { // 办理过香港身份证才显示证号
let item41 = YHFormDetailItem(type: .hkIdentityCardNumber) let item41 = YHFormDetailItem(type: .hkIdentityCardNumber)
item41.value = spouse.hkIdentityCard item41.value = spouse.hkIdentityCard
item41.tips = "请输入正确的香港身份证号码".local let tips = isEmptyString(spouse.hkIdentityCard) ? "请输入香港身份证号码".local : "请输入正确的香港身份证号码".local
item41.tips = tips
arr4.append(item41) arr4.append(item41)
} }
items.append(arr4) items.append(arr4)
...@@ -262,9 +263,6 @@ class YHSpouseBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol { ...@@ -262,9 +263,6 @@ class YHSpouseBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol {
if isEmptyString(spouse.hkIdentityCard) { if isEmptyString(spouse.hkIdentityCard) {
return false return false
} }
if let hkIdentityCard = spouse.hkIdentityCard, !hkIdentityCard.isHKIdentityCardNumber() {
return false
}
} }
return true return true
} }
...@@ -280,6 +278,12 @@ class YHSpouseBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol { ...@@ -280,6 +278,12 @@ class YHSpouseBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol {
YHHUD.flash(message: "资料还未填完") YHHUD.flash(message: "资料还未填完")
return false return false
} }
if let hkIdentityCard = spouse.hkIdentityCard, !hkIdentityCard.isHKIdentityCardNumber() {
isNeedShowError = true
loadInfo()
YHHUD.flash(message: "请输入正确的香港身份证号码")
return false
}
return true return true
} }
...@@ -458,7 +462,7 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -458,7 +462,7 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
if isEditEnd { if isEditEnd {
self.loadInfo() self.loadInfo()
if detailItem.type == .hkIdentityCardNumber { if detailItem.type == .hkIdentityCardNumber {
if let text = text, !text.isHKIdentityCardNumber() { if let text = text, !text.isEmpty, !text.isHKIdentityCardNumber() {
YHHUD.flash(message: "请输入正确的香港身份证号格式") YHHUD.flash(message: "请输入正确的香港身份证号格式")
return return
} }
...@@ -502,6 +506,7 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -502,6 +506,7 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
let selectItem = answers[index] let selectItem = answers[index]
self.spouse?.setBirthOverSeas(selectItem.title == "国外".local) self.spouse?.setBirthOverSeas(selectItem.title == "国外".local)
self.loadInfo() self.loadInfo()
save()
} }
} else if detailItem.type == .isHaveHkIdentityCard || detailItem.type == .isNowInHK { // 是否办理过香港身份证 是否在岗 } else if detailItem.type == .isHaveHkIdentityCard || detailItem.type == .isNowInHK { // 是否办理过香港身份证 是否在岗
var select = false var select = false
...@@ -521,6 +526,7 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -521,6 +526,7 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
self.spouse?.setHaveHKIdentityCard(selectItem.title == "是".local) self.spouse?.setHaveHKIdentityCard(selectItem.title == "是".local)
} }
self.loadInfo() self.loadInfo()
save()
} }
} }
......
...@@ -612,6 +612,7 @@ extension YHFamilyMemberInfoListVC : UITableViewDelegate, UITableViewDataSource ...@@ -612,6 +612,7 @@ extension YHFamilyMemberInfoListVC : UITableViewDelegate, UITableViewDataSource
if detailItem.relationType == .child { if detailItem.relationType == .child {
let vc = YHChildInfoContainerVC() let vc = YHChildInfoContainerVC()
vc.child = detailItem vc.child = detailItem
vc.orderId = orderId
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
return return
} }
......
...@@ -113,7 +113,8 @@ class YHFamilyRequestViewModel { ...@@ -113,7 +113,8 @@ class YHFamilyRequestViewModel {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Family.familyInfoDetailApi let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Family.familyInfoDetailApi
let _ = YHNetRequest.postRequest(url: strUrl, params:["order_id":orderId]) { json, code in let _ = YHNetRequest.getRequest(url: strUrl, params:["order_id":orderId,
"id":detailId]) { json, code in
YHHUD.hide() YHHUD.hide()
printLog("model 是 ==> \(json)") printLog("model 是 ==> \(json)")
......
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