Commit 0a6c3da8 authored by Steven杜宇's avatar Steven杜宇

// 产品走查

parent 77da0cf5
......@@ -85,10 +85,6 @@ class YHChildBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol {
let item04 = YHFormDetailItem(type: .marriageState)
item04.value = child.married
item04.tips = "请选择婚姻状况".local
let item05 = YHFormDetailItem(type: .birthday)
item05.value = child.birthday
item05.tips = "请选择出生日期".local
item05.placeHolder = "请选择出生日期".local
let item06 = YHFormDetailItem(type: .birthNation)
item06.value = String(child.isBirthOverSeas())
item06.tips = "请选择出生国家/地区".local
......@@ -105,7 +101,7 @@ class YHChildBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol {
item07.tips = "请选择出生城市".local
}
let arr0:[YHFormItemProtocol] = [title0, item00, item01, item02, item03, item04, item05, item06, item07]
let arr0:[YHFormItemProtocol] = [title0, item00, item01, item02, item03, item04, item06, item07]
// 职业信息
let title1 = YHFormTitleItem(type: .occupationInfo)
......@@ -122,7 +118,9 @@ class YHChildBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol {
item11.placeHolder = "请输入职业名称".local
arr1.append(item11)
}
items.append(contentsOf: [arr0, arr1])
if child.isFollow() {
// 是否前次婚姻子女
let title2 = YHFormTitleItem(type: .isPreviousMarriageChild)
......@@ -130,6 +128,7 @@ class YHChildBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol {
item20.value = String(child.isPreviousMarriageChild())
item20.tips = "请选择是否前次婚姻子女".local
let arr2:[YHFormItemProtocol] = [title2, item20]
items.append(arr2)
// 在港信息
let title3 = YHFormTitleItem(type: .inHongKongInfo)
......@@ -153,6 +152,9 @@ class YHChildBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol {
arr3.append(contentsOf: [item31, item32])
}
items.append(arr3)
}
// 香港身份证
let title4 = YHFormTitleItem(type: .hkIdentityCardInfo)
......@@ -167,8 +169,7 @@ class YHChildBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol {
item41.tips = "请输入香港身份证号".local
arr4.append(item41)
}
items.append(contentsOf: [arr0, arr1, arr2, arr3, arr4])
items.append(arr4)
tableView.reloadData()
}
......@@ -200,8 +201,7 @@ class YHChildBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol {
{
return .inputText
}
if detailItem.type == .birthday
|| detailItem.type == .occupation
if detailItem.type == .occupation
|| detailItem.type == .stayHKDate
|| detailItem.type == .roleInHK
|| detailItem.type == .ownDegree
......@@ -445,31 +445,15 @@ extension YHChildBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem
if detailItem.type == .birthday || detailItem.type == .stayHKDate { // 出生日期/获准滞留至
if detailItem.type == .stayHKDate { // 出生日期/获准滞留至
var title = ""
if detailItem.type == .birthday {
title = "选择出生日期"
} else if detailItem.type == .stayHKDate {
if detailItem.type == .stayHKDate {
title = "选择逗留日期"
}
YHDatePickView.show(type: .yyyymmdd, title:title) { [weak self] dateStr in
guard let self = self else { return }
if detailItem.type == .birthday {
let format = DateFormatter()
format.dateFormat = "yyyy-MM-dd"
if let selectDate = format.date(from:dateStr) {
let selectTimeInterval = selectDate.timeIntervalSince1970
let currentTimeInterval = Date().timeIntervalSince1970
// 出生日期须早于当前日期
if selectTimeInterval > currentTimeInterval {
YHHUD.flash(message: "出生日期须早于当前日期".local)
return
}
}
self.child?.birthday = dateStr
} else if detailItem.type == .stayHKDate {
if detailItem.type == .stayHKDate {
self.child?.childInHk.info = dateStr
}
loadInfo()
......@@ -574,8 +558,7 @@ extension YHChildBasicInfoVC {
guard let child = child else { return false}
if isEmptyString(child.subsetName)
|| child.sex == 0
|| isEmptyString(child.married)
|| isEmptyString(child.birthday){
|| isEmptyString(child.married){
return false
}
......@@ -597,11 +580,13 @@ extension YHChildBasicInfoVC {
return false
}
if child.isFollow() {
if child.isNowInHK() {
if isEmptyString(child.childInHk.info) || isEmptyString(child.hkIdentity) {
return false
}
}
}
if child.isHaveHKIdentityCard() {
if isEmptyString(child.hkIdentityCard) {
......
......@@ -406,7 +406,7 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
// 子女选择年满18岁则【是否随行至香港】默认选择否,不可修改
// 如果未年满18岁则【是否随行至香港】可选择【是/否】,可修改
YHDatePickView.show(type: .yyyymmdd) { [weak self] date in
YHDatePickView.show(type: .yyyymmdd, title:"选择出生日期".local) { [weak self] date in
guard let self = self else { return }
if detailItem.type == .birthday {
......
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