Commit ea572067 authored by Steven杜宇's avatar Steven杜宇

// 家庭

parent faaae409
...@@ -122,9 +122,9 @@ class YHFamilyInfoUpdateViewController: YHBaseViewController { ...@@ -122,9 +122,9 @@ class YHFamilyInfoUpdateViewController: YHBaseViewController {
action: .edit, action: .edit,
isMust: true, isMust: true,
title: "主申请人姓名", title: "主申请人姓名",
detail: name, value: name,
previousTitle: "原主申人姓名", previousTitle: "原主申人姓名",
previousDetail: name, previousValue: name,
isEditMode: isEditMode, isEditMode: isEditMode,
isShowPreviousInfo: isShowPreviousInfo) isShowPreviousInfo: isShowPreviousInfo)
arr1.append(mainApplicantNameInfo) arr1.append(mainApplicantNameInfo)
...@@ -135,9 +135,9 @@ class YHFamilyInfoUpdateViewController: YHBaseViewController { ...@@ -135,9 +135,9 @@ class YHFamilyInfoUpdateViewController: YHBaseViewController {
action: .edit, action: .edit,
isMust: true, isMust: true,
title: "配偶姓名", title: "配偶姓名",
detail: name, value: name,
previousTitle: "原配偶姓名", previousTitle: "原配偶姓名",
previousDetail: name, previousValue: name,
isEditMode: isEditMode, isEditMode: isEditMode,
isShowPreviousInfo: isShowPreviousInfo) isShowPreviousInfo: isShowPreviousInfo)
arr1.append(spouseNameInfo) arr1.append(spouseNameInfo)
...@@ -148,9 +148,9 @@ class YHFamilyInfoUpdateViewController: YHBaseViewController { ...@@ -148,9 +148,9 @@ class YHFamilyInfoUpdateViewController: YHBaseViewController {
action: .edit, action: .edit,
isMust: true, isMust: true,
title: "子女姓名", title: "子女姓名",
detail: name, value: name,
previousTitle: "原子女姓名", previousTitle: "原子女姓名",
previousDetail: name, previousValue: name,
isEditMode: isEditMode, isEditMode: isEditMode,
isShowPreviousInfo: isShowPreviousInfo) isShowPreviousInfo: isShowPreviousInfo)
arr1.append(childNameInfo) arr1.append(childNameInfo)
...@@ -161,9 +161,9 @@ class YHFamilyInfoUpdateViewController: YHBaseViewController { ...@@ -161,9 +161,9 @@ class YHFamilyInfoUpdateViewController: YHBaseViewController {
action: .edit, action: .edit,
isMust: true, isMust: true,
title: "姓(拼音)", title: "姓(拼音)",
detail: firsName, value: firsName,
previousTitle: "原姓(拼音)", previousTitle: "原姓(拼音)",
previousDetail: firsName, previousValue: firsName,
isEditMode: isEditMode, isEditMode: isEditMode,
isShowPreviousInfo: isShowPreviousInfo) isShowPreviousInfo: isShowPreviousInfo)
arr1.append(firstNameInfo) arr1.append(firstNameInfo)
...@@ -173,9 +173,9 @@ class YHFamilyInfoUpdateViewController: YHBaseViewController { ...@@ -173,9 +173,9 @@ class YHFamilyInfoUpdateViewController: YHBaseViewController {
action: .edit, action: .edit,
isMust: true, isMust: true,
title: "名(拼音)", title: "名(拼音)",
detail: lastName, value: lastName,
previousTitle: "原名(拼音)", previousTitle: "原名(拼音)",
previousDetail: lastName, previousValue: lastName,
isEditMode: isEditMode, isEditMode: isEditMode,
isShowPreviousInfo: isShowPreviousInfo) isShowPreviousInfo: isShowPreviousInfo)
arr1.append(lastNameInfo) arr1.append(lastNameInfo)
...@@ -187,9 +187,9 @@ class YHFamilyInfoUpdateViewController: YHBaseViewController { ...@@ -187,9 +187,9 @@ class YHFamilyInfoUpdateViewController: YHBaseViewController {
action: .select, action: .select,
isMust: true, isMust: true,
title: "婚姻状况", title: "婚姻状况",
detail: marriage, value: marriage,
previousTitle: "原婚姻状况", previousTitle: "原婚姻状况",
previousDetail: marriage, previousValue: marriage,
isEditMode: isEditMode, isEditMode: isEditMode,
isShowPreviousInfo: isShowPreviousInfo) isShowPreviousInfo: isShowPreviousInfo)
arr1.append(marriageInfo) arr1.append(marriageInfo)
...@@ -202,9 +202,9 @@ class YHFamilyInfoUpdateViewController: YHBaseViewController { ...@@ -202,9 +202,9 @@ class YHFamilyInfoUpdateViewController: YHBaseViewController {
action: .choice, action: .choice,
isMust: true, isMust: true,
title: "出生国家/地区", title: "出生国家/地区",
detail: birthNation, value: birthNation,
previousTitle: "原出生国家/地区", previousTitle: "原出生国家/地区",
previousDetail: birthNation, previousValue: birthNation,
options: options, options: options,
isEditMode: isEditMode, isEditMode: isEditMode,
isShowPreviousInfo: isShowPreviousInfo) isShowPreviousInfo: isShowPreviousInfo)
...@@ -215,9 +215,9 @@ class YHFamilyInfoUpdateViewController: YHBaseViewController { ...@@ -215,9 +215,9 @@ class YHFamilyInfoUpdateViewController: YHBaseViewController {
action: .select, action: .select,
isMust: true, isMust: true,
title: "出生地", title: "出生地",
detail: birthPlace, value: birthPlace,
previousTitle: "原出生地", previousTitle: "原出生地",
previousDetail: birthPlace, previousValue: birthPlace,
isEditMode: isEditMode, isEditMode: isEditMode,
isShowPreviousInfo: isShowPreviousInfo) isShowPreviousInfo: isShowPreviousInfo)
arr1.append(birthPlaceInfo) arr1.append(birthPlaceInfo)
...@@ -227,9 +227,9 @@ class YHFamilyInfoUpdateViewController: YHBaseViewController { ...@@ -227,9 +227,9 @@ class YHFamilyInfoUpdateViewController: YHBaseViewController {
action: .select, action: .select,
isMust: true, isMust: true,
title: "申报国籍", title: "申报国籍",
detail: declareNation, value: declareNation,
previousTitle: "原申报国籍", previousTitle: "原申报国籍",
previousDetail: declareNation, previousValue: declareNation,
isEditMode: isEditMode, isEditMode: isEditMode,
isShowPreviousInfo: isShowPreviousInfo) isShowPreviousInfo: isShowPreviousInfo)
arr1.append(declareNationInfo) arr1.append(declareNationInfo)
...@@ -239,9 +239,9 @@ class YHFamilyInfoUpdateViewController: YHBaseViewController { ...@@ -239,9 +239,9 @@ class YHFamilyInfoUpdateViewController: YHBaseViewController {
action: .edit, action: .edit,
isMust: true, isMust: true,
title: "职业", title: "职业",
detail: occupation, value: occupation,
previousTitle: "原职业", previousTitle: "原职业",
previousDetail: occupation, previousValue: occupation,
isEditMode: isEditMode, isEditMode: isEditMode,
isShowPreviousInfo: isShowPreviousInfo) isShowPreviousInfo: isShowPreviousInfo)
arr1.append(occupationInfo) arr1.append(occupationInfo)
...@@ -251,9 +251,9 @@ class YHFamilyInfoUpdateViewController: YHBaseViewController { ...@@ -251,9 +251,9 @@ class YHFamilyInfoUpdateViewController: YHBaseViewController {
action: .edit, action: .edit,
isMust: true, isMust: true,
title: "香港身份证号", title: "香港身份证号",
detail: hongkongId, value: hongkongId,
previousTitle: "原香港身份证号", previousTitle: "原香港身份证号",
previousDetail: hongkongId, previousValue: hongkongId,
isEditMode: isEditMode, isEditMode: isEditMode,
isShowPreviousInfo: isShowPreviousInfo) isShowPreviousInfo: isShowPreviousInfo)
arr1.append(hongkongIdInfo) arr1.append(hongkongIdInfo)
...@@ -267,9 +267,9 @@ class YHFamilyInfoUpdateViewController: YHBaseViewController { ...@@ -267,9 +267,9 @@ class YHFamilyInfoUpdateViewController: YHBaseViewController {
action: .select, action: .select,
isMust: true, isMust: true,
title: "申报旅行证件", title: "申报旅行证件",
detail: travelCerType, value: travelCerType,
previousTitle: "原申报旅行证件", previousTitle: "原申报旅行证件",
previousDetail: travelCerType, previousValue: travelCerType,
isEditMode: false, isEditMode: false,
isShowPreviousInfo: false) isShowPreviousInfo: false)
arr2.append(travelCerInfo) arr2.append(travelCerInfo)
...@@ -279,9 +279,9 @@ class YHFamilyInfoUpdateViewController: YHBaseViewController { ...@@ -279,9 +279,9 @@ class YHFamilyInfoUpdateViewController: YHBaseViewController {
action: .edit, action: .edit,
isMust: true, isMust: true,
title: "证件号", title: "证件号",
detail: cerId, value: cerId,
previousTitle: "原证件号", previousTitle: "原证件号",
previousDetail: cerId, previousValue: cerId,
isEditMode: false, isEditMode: false,
isShowPreviousInfo: false) isShowPreviousInfo: false)
arr2.append(cerIdInfo) arr2.append(cerIdInfo)
...@@ -301,7 +301,7 @@ class YHFamilyInfoUpdateViewController: YHBaseViewController { ...@@ -301,7 +301,7 @@ class YHFamilyInfoUpdateViewController: YHBaseViewController {
if let arr1 = items.first { if let arr1 = items.first {
for item in arr1 { for item in arr1 {
item.isEditMode = isEditMode item.isEditMode = isEditMode
if !isEditMode, !item.previousDetail.isEmpty, item.previousDetail != item.detail { if !isEditMode, !item.previousValue.isEmpty, item.previousValue != item.value {
item.isShowPreviousInfo = true item.isShowPreviousInfo = true
} else { } else {
item.isShowPreviousInfo = false item.isShowPreviousInfo = false
......
...@@ -48,28 +48,28 @@ class YHFamilyInfoItem { ...@@ -48,28 +48,28 @@ class YHFamilyInfoItem {
var action:YHFamilyInfoActionType = .none var action:YHFamilyInfoActionType = .none
var isMust: Bool = false var isMust: Bool = false
var title: String = "" var title: String = ""
var detail: String = "" var value: String = ""
var previousTitle: String = "" var previousTitle: String = ""
var previousDetail: String = "" var previousValue: String = ""
var options:[YHFamilyInfoOption] = []
var isEditMode: Bool = false var isEditMode: Bool = false
var isShowPreviousInfo: Bool = false var isShowPreviousInfo: Bool = false
var options:[YHFamilyInfoOption] = []
required init() { required init() {
} }
init(id: YHFamilyInfoType, action: YHFamilyInfoActionType, isMust: Bool, title: String, detail: String, previousTitle: String, previousDetail: String, options:[YHFamilyInfoOption] = [], isEditMode: Bool, isShowPreviousInfo: Bool) { init(id: YHFamilyInfoType, action: YHFamilyInfoActionType, isMust: Bool, title: String, value: String, previousTitle: String, previousValue: String, options: [YHFamilyInfoOption] = [], isEditMode: Bool, isShowPreviousInfo: Bool) {
self.id = id self.id = id
self.action = action self.action = action
self.isMust = isMust self.isMust = isMust
self.title = title self.title = title
self.detail = detail self.value = value
self.previousTitle = previousTitle self.previousTitle = previousTitle
self.previousDetail = previousDetail self.previousValue = previousValue
self.options = options
self.isEditMode = isEditMode self.isEditMode = isEditMode
self.isShowPreviousInfo = isShowPreviousInfo self.isShowPreviousInfo = isShowPreviousInfo
self.options = options
} }
} }
......
...@@ -175,10 +175,10 @@ class YHInfoItemView: UIView { ...@@ -175,10 +175,10 @@ class YHInfoItemView: UIView {
if item.action == .select { if item.action == .select {
if item.id == .marriage { if item.id == .marriage {
YHSheetPickerView.show(type:.marriage, selectTitle: item.detail) { YHSheetPickerView.show(type:.marriage, selectTitle: item.value) {
[weak self] item in [weak self] item in
guard let self = self else { return } guard let self = self else { return }
self.item.detail = item.title self.item.value = item.title
self.detailLabel.text = item.title self.detailLabel.text = item.title
} }
...@@ -195,7 +195,7 @@ class YHInfoItemView: UIView { ...@@ -195,7 +195,7 @@ class YHInfoItemView: UIView {
if !isEmptyString(string3) { if !isEmptyString(string3) {
address += string3 address += string3
} }
self.item.detail = address self.item.value = address
self.detailLabel.text = address self.detailLabel.text = address
} }
UIViewController.current?.present(vc, animated: true) UIViewController.current?.present(vc, animated: true)
...@@ -203,7 +203,7 @@ class YHInfoItemView: UIView { ...@@ -203,7 +203,7 @@ class YHInfoItemView: UIView {
} else if item.id == .declareNation { } else if item.id == .declareNation {
let vc = YHSelectCountryViewController() let vc = YHSelectCountryViewController()
vc.backLocationStringController = { (country) in vc.backLocationStringController = { (country) in
self.item.detail = country self.item.value = country
self.detailLabel.text = country self.detailLabel.text = country
} }
UIViewController.current?.navigationController?.pushViewController(vc) UIViewController.current?.navigationController?.pushViewController(vc)
...@@ -225,14 +225,14 @@ class YHInfoItemView: UIView { ...@@ -225,14 +225,14 @@ class YHInfoItemView: UIView {
titleLabel.attributed.text = title titleLabel.attributed.text = title
let isTextEdit = item.isEditMode && item.action == .edit let isTextEdit = item.isEditMode && item.action == .edit
detailLabel.text = item.detail detailLabel.text = item.value
detailLabel.isHidden = isTextEdit detailLabel.isHidden = isTextEdit
textField.isHidden = !isTextEdit textField.isHidden = !isTextEdit
let isSelectSheet = item.isEditMode && item.action == .select let isSelectSheet = item.isEditMode && item.action == .select
clickRowBtn.isHidden = !isSelectSheet clickRowBtn.isHidden = !isSelectSheet
textField.text = item.detail textField.text = item.value
rightBtn.isHidden = !item.isEditMode rightBtn.isHidden = !item.isEditMode
if item.action == .edit { if item.action == .edit {
rightBtn.setImage(UIImage(named: "family_info_del"), for: .normal) rightBtn.setImage(UIImage(named: "family_info_del"), for: .normal)
...@@ -240,7 +240,7 @@ class YHInfoItemView: UIView { ...@@ -240,7 +240,7 @@ class YHInfoItemView: UIView {
rightBtn.setImage(UIImage(named: "family_info_arrow"), for: .normal) rightBtn.setImage(UIImage(named: "family_info_arrow"), for: .normal)
} }
previousTitleLabel.text = item.previousTitle previousTitleLabel.text = item.previousTitle
previousDetailLabel.text = item.previousDetail previousDetailLabel.text = item.previousValue
previousContentView.isHidden = !item.isShowPreviousInfo previousContentView.isHidden = !item.isShowPreviousInfo
detailLabel.snp.remakeConstraints { make in detailLabel.snp.remakeConstraints { make in
...@@ -277,7 +277,8 @@ extension YHInfoItemView: UITextFieldDelegate { ...@@ -277,7 +277,8 @@ extension YHInfoItemView: UITextFieldDelegate {
// YHHUD.flash(message: "限制最多\(Self.maxWordsCount)个字符") // YHHUD.flash(message: "限制最多\(Self.maxWordsCount)个字符")
// return false // return false
// } // }
self.item.detail = newText self.item.value = newText
self.updateItem(item)
return true return true
} }
} }
...@@ -413,7 +414,7 @@ class YHInfoOptionView: UIView { ...@@ -413,7 +414,7 @@ class YHInfoOptionView: UIView {
title = mustTag + title title = mustTag + title
} }
titleLabel.attributed.text = title titleLabel.attributed.text = title
detailLabel.text = item.detail detailLabel.text = item.value
detailLabel.isHidden = item.isEditMode detailLabel.isHidden = item.isEditMode
optionsView.isHidden = !item.isEditMode optionsView.isHidden = !item.isEditMode
...@@ -441,7 +442,7 @@ class YHInfoOptionView: UIView { ...@@ -441,7 +442,7 @@ class YHInfoOptionView: UIView {
} }
previousTitleLabel.text = item.previousTitle previousTitleLabel.text = item.previousTitle
previousDetailLabel.text = item.previousDetail previousDetailLabel.text = item.previousValue
previousContentView.isHidden = !item.isShowPreviousInfo previousContentView.isHidden = !item.isShowPreviousInfo
previousContentView.snp.remakeConstraints { make in previousContentView.snp.remakeConstraints { make in
make.left.right.equalToSuperview() make.left.right.equalToSuperview()
...@@ -461,7 +462,7 @@ class YHInfoOptionView: UIView { ...@@ -461,7 +462,7 @@ class YHInfoOptionView: UIView {
let isSelect = (selectIndex == index) let isSelect = (selectIndex == index)
option.isSelect = isSelect option.isSelect = isSelect
if isSelect { if isSelect {
item.detail = option.value item.value = option.value
} }
} }
self.updateItem(item) self.updateItem(item)
......
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