Commit 1c44327b authored by pete谢兆麟's avatar pete谢兆麟

Merge commit '6f32074f' into xiezhaolin

parents d08b263e 6f32074f
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
041B52912B5E67F3007EBCEB /* YHFormItemEnterDetailCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52902B5E67F3007EBCEB /* YHFormItemEnterDetailCell.swift */; }; 041B52912B5E67F3007EBCEB /* YHFormItemEnterDetailCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52902B5E67F3007EBCEB /* YHFormItemEnterDetailCell.swift */; };
041B52932B5E6CBA007EBCEB /* YHFormItemTitleCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52922B5E6CBA007EBCEB /* YHFormItemTitleCell.swift */; }; 041B52932B5E6CBA007EBCEB /* YHFormItemTitleCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52922B5E6CBA007EBCEB /* YHFormItemTitleCell.swift */; };
041B52952B5E7037007EBCEB /* YHFormItemAddCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52942B5E7037007EBCEB /* YHFormItemAddCell.swift */; }; 041B52952B5E7037007EBCEB /* YHFormItemAddCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52942B5E7037007EBCEB /* YHFormItemAddCell.swift */; };
041B52982B5E8EA0007EBCEB /* YHFamilyMemberInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52972B5E8EA0007EBCEB /* YHFamilyMemberInfoVC.swift */; }; 041B52982B5E8EA0007EBCEB /* YHFamilyMemberInfoListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52972B5E8EA0007EBCEB /* YHFamilyMemberInfoListVC.swift */; };
041B52D62B5F899E007EBCEB /* YHSpousePrimaryInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52D52B5F899E007EBCEB /* YHSpousePrimaryInfoVC.swift */; }; 041B52D62B5F899E007EBCEB /* YHSpousePrimaryInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52D52B5F899E007EBCEB /* YHSpousePrimaryInfoVC.swift */; };
041B52DB2B5FDF8E007EBCEB /* YHFamilyInitialInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52DA2B5FDF8E007EBCEB /* YHFamilyInitialInfo.swift */; }; 041B52DB2B5FDF8E007EBCEB /* YHFamilyInitialInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52DA2B5FDF8E007EBCEB /* YHFamilyInitialInfo.swift */; };
041B52DD2B60A889007EBCEB /* YHTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52DC2B60A889007EBCEB /* YHTest.swift */; }; 041B52DD2B60A889007EBCEB /* YHTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52DC2B60A889007EBCEB /* YHTest.swift */; };
...@@ -75,12 +75,12 @@ ...@@ -75,12 +75,12 @@
0468D47E2B68CEA200CFB916 /* YHImagePickerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D47D2B68CEA200CFB916 /* YHImagePickerView.swift */; }; 0468D47E2B68CEA200CFB916 /* YHImagePickerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D47D2B68CEA200CFB916 /* YHImagePickerView.swift */; };
0468D4802B6914E600CFB916 /* YHSelectCountryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D47F2B6914E600CFB916 /* YHSelectCountryViewController.swift */; }; 0468D4802B6914E600CFB916 /* YHSelectCountryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D47F2B6914E600CFB916 /* YHSelectCountryViewController.swift */; };
0468D4822B6A2A8500CFB916 /* YHSelectCountryViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4812B6A2A8500CFB916 /* YHSelectCountryViewModel.swift */; }; 0468D4822B6A2A8500CFB916 /* YHSelectCountryViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4812B6A2A8500CFB916 /* YHSelectCountryViewModel.swift */; };
04754A952B96FF3D00F8ADCA /* UITextField+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04754A942B96FF3D00F8ADCA /* UITextField+Extension.swift */; };
0469750E2B96C0B900A0CB66 /* YHImageClipperViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0469750D2B96C0B900A0CB66 /* YHImageClipperViewController.swift */; }; 0469750E2B96C0B900A0CB66 /* YHImageClipperViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0469750D2B96C0B900A0CB66 /* YHImageClipperViewController.swift */; };
046975102B96C13700A0CB66 /* YHClipperView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0469750F2B96C13700A0CB66 /* YHClipperView.swift */; }; 046975102B96C13700A0CB66 /* YHClipperView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0469750F2B96C13700A0CB66 /* YHClipperView.swift */; };
046975122B96C77000A0CB66 /* YHClipperButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 046975112B96C77000A0CB66 /* YHClipperButton.swift */; }; 046975122B96C77000A0CB66 /* YHClipperButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 046975112B96C77000A0CB66 /* YHClipperButton.swift */; };
046975162B96EB2200A0CB66 /* YHImageResultViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 046975152B96EB2200A0CB66 /* YHImageResultViewController.swift */; }; 046975162B96EB2200A0CB66 /* YHImageResultViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 046975152B96EB2200A0CB66 /* YHImageResultViewController.swift */; };
046975182B96EEB200A0CB66 /* YHResultBottomView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 046975172B96EEB200A0CB66 /* YHResultBottomView.swift */; }; 046975182B96EEB200A0CB66 /* YHResultBottomView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 046975172B96EEB200A0CB66 /* YHResultBottomView.swift */; };
04754A952B96FF3D00F8ADCA /* UITextField+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04754A942B96FF3D00F8ADCA /* UITextField+Extension.swift */; };
04808C062B4686510056D53C /* ATAuthSDK.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 04808C042B4686510056D53C /* ATAuthSDK.bundle */; }; 04808C062B4686510056D53C /* ATAuthSDK.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 04808C042B4686510056D53C /* ATAuthSDK.bundle */; };
04808C082B4686C10056D53C /* ATAuthSDK_D.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 04808C032B4686510056D53C /* ATAuthSDK_D.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 04808C082B4686C10056D53C /* ATAuthSDK_D.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 04808C032B4686510056D53C /* ATAuthSDK_D.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
049A48A82B49417300D0C641 /* YHAboutUsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 049A48A72B49417300D0C641 /* YHAboutUsViewController.swift */; }; 049A48A82B49417300D0C641 /* YHAboutUsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 049A48A72B49417300D0C641 /* YHAboutUsViewController.swift */; };
...@@ -333,7 +333,7 @@ ...@@ -333,7 +333,7 @@
041B52902B5E67F3007EBCEB /* YHFormItemEnterDetailCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormItemEnterDetailCell.swift; sourceTree = "<group>"; }; 041B52902B5E67F3007EBCEB /* YHFormItemEnterDetailCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormItemEnterDetailCell.swift; sourceTree = "<group>"; };
041B52922B5E6CBA007EBCEB /* YHFormItemTitleCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormItemTitleCell.swift; sourceTree = "<group>"; }; 041B52922B5E6CBA007EBCEB /* YHFormItemTitleCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormItemTitleCell.swift; sourceTree = "<group>"; };
041B52942B5E7037007EBCEB /* YHFormItemAddCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormItemAddCell.swift; sourceTree = "<group>"; }; 041B52942B5E7037007EBCEB /* YHFormItemAddCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormItemAddCell.swift; sourceTree = "<group>"; };
041B52972B5E8EA0007EBCEB /* YHFamilyMemberInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFamilyMemberInfoVC.swift; sourceTree = "<group>"; }; 041B52972B5E8EA0007EBCEB /* YHFamilyMemberInfoListVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFamilyMemberInfoListVC.swift; sourceTree = "<group>"; };
041B52D52B5F899E007EBCEB /* YHSpousePrimaryInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSpousePrimaryInfoVC.swift; sourceTree = "<group>"; }; 041B52D52B5F899E007EBCEB /* YHSpousePrimaryInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSpousePrimaryInfoVC.swift; sourceTree = "<group>"; };
041B52DA2B5FDF8E007EBCEB /* YHFamilyInitialInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFamilyInitialInfo.swift; sourceTree = "<group>"; }; 041B52DA2B5FDF8E007EBCEB /* YHFamilyInitialInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFamilyInitialInfo.swift; sourceTree = "<group>"; };
041B52DC2B60A889007EBCEB /* YHTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHTest.swift; sourceTree = "<group>"; }; 041B52DC2B60A889007EBCEB /* YHTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHTest.swift; sourceTree = "<group>"; };
...@@ -390,12 +390,12 @@ ...@@ -390,12 +390,12 @@
0468D47D2B68CEA200CFB916 /* YHImagePickerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHImagePickerView.swift; sourceTree = "<group>"; }; 0468D47D2B68CEA200CFB916 /* YHImagePickerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHImagePickerView.swift; sourceTree = "<group>"; };
0468D47F2B6914E600CFB916 /* YHSelectCountryViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSelectCountryViewController.swift; sourceTree = "<group>"; }; 0468D47F2B6914E600CFB916 /* YHSelectCountryViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSelectCountryViewController.swift; sourceTree = "<group>"; };
0468D4812B6A2A8500CFB916 /* YHSelectCountryViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSelectCountryViewModel.swift; sourceTree = "<group>"; }; 0468D4812B6A2A8500CFB916 /* YHSelectCountryViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSelectCountryViewModel.swift; sourceTree = "<group>"; };
04754A942B96FF3D00F8ADCA /* UITextField+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UITextField+Extension.swift"; sourceTree = "<group>"; };
0469750D2B96C0B900A0CB66 /* YHImageClipperViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHImageClipperViewController.swift; sourceTree = "<group>"; }; 0469750D2B96C0B900A0CB66 /* YHImageClipperViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHImageClipperViewController.swift; sourceTree = "<group>"; };
0469750F2B96C13700A0CB66 /* YHClipperView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHClipperView.swift; sourceTree = "<group>"; }; 0469750F2B96C13700A0CB66 /* YHClipperView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHClipperView.swift; sourceTree = "<group>"; };
046975112B96C77000A0CB66 /* YHClipperButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHClipperButton.swift; sourceTree = "<group>"; }; 046975112B96C77000A0CB66 /* YHClipperButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHClipperButton.swift; sourceTree = "<group>"; };
046975152B96EB2200A0CB66 /* YHImageResultViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHImageResultViewController.swift; sourceTree = "<group>"; }; 046975152B96EB2200A0CB66 /* YHImageResultViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHImageResultViewController.swift; sourceTree = "<group>"; };
046975172B96EEB200A0CB66 /* YHResultBottomView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResultBottomView.swift; sourceTree = "<group>"; }; 046975172B96EEB200A0CB66 /* YHResultBottomView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResultBottomView.swift; sourceTree = "<group>"; };
04754A942B96FF3D00F8ADCA /* UITextField+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UITextField+Extension.swift"; sourceTree = "<group>"; };
04808C032B4686510056D53C /* ATAuthSDK_D.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = ATAuthSDK_D.framework; sourceTree = "<group>"; }; 04808C032B4686510056D53C /* ATAuthSDK_D.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = ATAuthSDK_D.framework; sourceTree = "<group>"; };
04808C042B4686510056D53C /* ATAuthSDK.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = ATAuthSDK.bundle; sourceTree = "<group>"; }; 04808C042B4686510056D53C /* ATAuthSDK.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = ATAuthSDK.bundle; sourceTree = "<group>"; };
049A48A72B49417300D0C641 /* YHAboutUsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAboutUsViewController.swift; sourceTree = "<group>"; }; 049A48A72B49417300D0C641 /* YHAboutUsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAboutUsViewController.swift; sourceTree = "<group>"; };
...@@ -682,13 +682,11 @@ ...@@ -682,13 +682,11 @@
041B52962B5E8E3B007EBCEB /* C */ = { 041B52962B5E8E3B007EBCEB /* C */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
041B52972B5E8EA0007EBCEB /* YHFamilyMemberInfoListVC.swift */,
04C8F4802B720DAB00ADF59B /* Spouse(配偶) */, 04C8F4802B720DAB00ADF59B /* Spouse(配偶) */,
04754A962B97286F00F8ADCA /* Certificates(证书上传和证书信息) */,
04754A972B97289200F8ADCA /* Parents&Brothers(父母和兄弟姐妹) */,
04C8F4812B720DCD00ADF59B /* Child(子女) */, 04C8F4812B720DCD00ADF59B /* Child(子女) */,
041B52972B5E8EA0007EBCEB /* YHFamilyMemberInfoVC.swift */,
042FBBBA2B62806D00F9DE23 /* YHCertificateInfoController.swift */,
0413A6D72B8C76290006D154 /* YHCertificateUploadVC.swift */,
042FBBC22B63DA4C00F9DE23 /* YHParentInfoVC.swift */,
042FBBD52B67BDD500F9DE23 /* YHBrotherInfoVC.swift */,
); );
path = C; path = C;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -816,6 +814,24 @@ ...@@ -816,6 +814,24 @@
path = YHAddressPicker; path = YHAddressPicker;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
04754A962B97286F00F8ADCA /* Certificates(证书上传和证书信息) */ = {
isa = PBXGroup;
children = (
042FBBBA2B62806D00F9DE23 /* YHCertificateInfoController.swift */,
0413A6D72B8C76290006D154 /* YHCertificateUploadVC.swift */,
);
path = "Certificates(证书上传和证书信息)";
sourceTree = "<group>";
};
04754A972B97289200F8ADCA /* Parents&Brothers(父母和兄弟姐妹) */ = {
isa = PBXGroup;
children = (
042FBBC22B63DA4C00F9DE23 /* YHParentInfoVC.swift */,
042FBBD52B67BDD500F9DE23 /* YHBrotherInfoVC.swift */,
);
path = "Parents&Brothers(父母和兄弟姐妹)";
sourceTree = "<group>";
};
04808C022B4686510056D53C /* Frameworks */ = { 04808C022B4686510056D53C /* Frameworks */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -2020,7 +2036,7 @@ ...@@ -2020,7 +2036,7 @@
04E86E5B2B84BF2000A35F4B /* YHWorkExampleTypeView.swift in Sources */, 04E86E5B2B84BF2000A35F4B /* YHWorkExampleTypeView.swift in Sources */,
042FBBBD2B63519C00F9DE23 /* YHFormItemSelectSheetCell.swift in Sources */, 042FBBBD2B63519C00F9DE23 /* YHFormItemSelectSheetCell.swift in Sources */,
A5FD63C32B63438A00D1D9DA /* YHContactMainItemStatusModel.swift in Sources */, A5FD63C32B63438A00D1D9DA /* YHContactMainItemStatusModel.swift in Sources */,
041B52982B5E8EA0007EBCEB /* YHFamilyMemberInfoVC.swift in Sources */, 041B52982B5E8EA0007EBCEB /* YHFamilyMemberInfoListVC.swift in Sources */,
0468D47B2B68A08600CFB916 /* YHAddressPresentAnimated.swift in Sources */, 0468D47B2B68A08600CFB916 /* YHAddressPresentAnimated.swift in Sources */,
A5C382CF2B5F9A9100C5E65C /* YHServiceCenterMainViewModel.swift in Sources */, A5C382CF2B5F9A9100C5E65C /* YHServiceCenterMainViewModel.swift in Sources */,
0468D4782B68A08600CFB916 /* YHAddressModel.swift in Sources */, 0468D4782B68A08600CFB916 /* YHAddressModel.swift in Sources */,
......
...@@ -368,7 +368,7 @@ extension YHInformationPerfectListVC : UITableViewDelegate,UITableViewDataSource ...@@ -368,7 +368,7 @@ extension YHInformationPerfectListVC : UITableViewDelegate,UITableViewDataSource
} else if indexPath.row == 1 { } else if indexPath.row == 1 {
//家庭程序信息 //家庭程序信息
let vc = YHFamilyMemberInfoVC(orderId: orderId ?? 0) let vc = YHFamilyMemberInfoListVC(orderId: orderId ?? 0)
vc.orderId = orderId ?? 0 vc.orderId = orderId ?? 0
navigationController?.pushViewController(vc) navigationController?.pushViewController(vc)
......
...@@ -70,7 +70,7 @@ class YHEducationDetailVC: YHBaseViewController { ...@@ -70,7 +70,7 @@ class YHEducationDetailVC: YHBaseViewController {
bottomView.saveBlock = { bottomView.saveBlock = {
[weak self] in [weak self] in
guard let self = self else { return } guard let self = self else { return }
saveDetailInfo(isNeedPop: true) saveDetailInfo(isNeedPop: true, isShowToast: true)
} }
bottomView.submitBlock = { bottomView.submitBlock = {
...@@ -228,7 +228,7 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource { ...@@ -228,7 +228,7 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
if isEditEnd { if isEditEnd {
loadInfo() loadInfo()
if detailId != 0 { if detailId != 0 {
saveDetailInfo(isNeedPop: false) saveDetailInfo(isNeedPop: false, isShowToast:false)
} }
} }
} }
...@@ -311,7 +311,7 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource { ...@@ -311,7 +311,7 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
} }
loadInfo() loadInfo()
if detailId != 0 { if detailId != 0 {
saveDetailInfo(isNeedPop: false) saveDetailInfo(isNeedPop: false, isShowToast:false)
} }
} }
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
...@@ -323,7 +323,7 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource { ...@@ -323,7 +323,7 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
detailInfo.teachingFormat = selectType.title detailInfo.teachingFormat = selectType.title
loadInfo() loadInfo()
if detailId != 0 { if detailId != 0 {
saveDetailInfo(isNeedPop: false) saveDetailInfo(isNeedPop: false, isShowToast:false)
} }
} }
...@@ -340,7 +340,7 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource { ...@@ -340,7 +340,7 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
} }
loadInfo() loadInfo()
if detailId != 0 { if detailId != 0 {
saveDetailInfo(isNeedPop: false) saveDetailInfo(isNeedPop: false, isShowToast:false)
} }
} }
...@@ -352,7 +352,7 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource { ...@@ -352,7 +352,7 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
detailInfo.degree = selectType.title detailInfo.degree = selectType.title
loadInfo() loadInfo()
if detailId != 0 { if detailId != 0 {
saveDetailInfo(isNeedPop: false) saveDetailInfo(isNeedPop: false, isShowToast:false)
} }
} }
...@@ -364,7 +364,7 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource { ...@@ -364,7 +364,7 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
detailInfo.degreeType = selectItem.title detailInfo.degreeType = selectItem.title
loadInfo() loadInfo()
if detailId != 0 { if detailId != 0 {
saveDetailInfo(isNeedPop: false) saveDetailInfo(isNeedPop: false, isShowToast:false)
} }
} }
...@@ -377,7 +377,7 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource { ...@@ -377,7 +377,7 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
detailInfo.schoolAddress.country = country detailInfo.schoolAddress.country = country
loadInfo() loadInfo()
if detailId != 0 { if detailId != 0 {
saveDetailInfo(isNeedPop: false) saveDetailInfo(isNeedPop: false, isShowToast:false)
} }
} }
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
...@@ -390,10 +390,17 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource { ...@@ -390,10 +390,17 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
vc.backLocationStringController = { vc.backLocationStringController = {
[weak self] (string1, string2, string3, string4) in [weak self] (string1, string2, string3, string4) in
guard let self = self else { return } guard let self = self else { return }
detailInfo.schoolAddress.area = [string1, string2, string3, string4] var citys:[String] = []
if !isEmptyString(string2) {
citys.append(string2)
}
if !isEmptyString(string3) {
citys.append(string3)
}
detailInfo.schoolAddress.area = citys
loadInfo() loadInfo()
if detailId != 0 { if detailId != 0 {
saveDetailInfo(isNeedPop: false) saveDetailInfo(isNeedPop: false, isShowToast:false)
} }
} }
self.present(vc, animated: true) self.present(vc, animated: true)
...@@ -480,7 +487,7 @@ extension YHEducationDetailVC { ...@@ -480,7 +487,7 @@ extension YHEducationDetailVC {
YHHUD.flash(message: "资料还未填完") YHHUD.flash(message: "资料还未填完")
return return
} }
saveDetailInfo(isNeedPop: true) saveDetailInfo(isNeedPop: true, isShowToast: true)
} }
// 检查填写信息完整性 // 检查填写信息完整性
...@@ -509,7 +516,7 @@ extension YHEducationDetailVC { ...@@ -509,7 +516,7 @@ extension YHEducationDetailVC {
} }
// 保存信息 isNeedPop:保存成功后是否退出该页面 // 保存信息 isNeedPop:保存成功后是否退出该页面
func saveDetailInfo(isNeedPop:Bool) { func saveDetailInfo(isNeedPop:Bool, isShowToast:Bool) {
// detailInfo.toDictionary() 对于值为空的字段不会添加 而后台需要 所以如下处理 // detailInfo.toDictionary() 对于值为空的字段不会添加 而后台需要 所以如下处理
// let dict:[String : Any] = [ // let dict:[String : Any] = [
...@@ -531,18 +538,22 @@ extension YHEducationDetailVC { ...@@ -531,18 +538,22 @@ extension YHEducationDetailVC {
guard var dict:[String:Any] = detailInfo.toDictionary() else { return } guard var dict:[String:Any] = detailInfo.toDictionary() else { return }
dict["order_id"] = self.orderId dict["order_id"] = self.orderId
self.educationRequest.saveEducationInfo(params: dict) { self.educationRequest.saveEducationInfo(params: dict, isSilent: !isShowToast) {
[weak self] success, error in [weak self] success, error in
guard let self = self else { return } guard let self = self else { return }
if success { if success {
if isShowToast {
YHHUD.flash(message: "保存成功") YHHUD.flash(message: "保存成功")
}
if isNeedPop { if isNeedPop {
self.navigationController?.popViewController(animated: true) self.navigationController?.popViewController(animated: true)
} }
} else { } else {
if isShowToast {
YHHUD.flash(message: "保存失败") YHHUD.flash(message: "保存失败")
} }
} }
} }
}
} }
...@@ -153,7 +153,7 @@ class YHEducationInfoListVC: YHBaseViewController { ...@@ -153,7 +153,7 @@ class YHEducationInfoListVC: YHBaseViewController {
let title2 = YHFormTitleItem(type: .edutionalCertificateNameAndBirthday) let title2 = YHFormTitleItem(type: .edutionalCertificateNameAndBirthday)
var arr2:[YHFormItemProtocol] = [title2] var arr2:[YHFormItemProtocol] = [title2]
// 问题集合 // 问题集合
let questions = YHQuestionInfo.getEducationQuestion() let questions = YHQuestionInfo.getEducationQuestion(eduList: educationInfo)
for questionInfo in questions { for questionInfo in questions {
if questionInfo.key == "qualification" { if questionInfo.key == "qualification" {
questionInfo.answer = educationInfo.isNameSame questionInfo.answer = educationInfo.isNameSame
......
...@@ -308,7 +308,14 @@ extension YHQualificationDetailVC : UITableViewDelegate, UITableViewDataSource { ...@@ -308,7 +308,14 @@ extension YHQualificationDetailVC : UITableViewDelegate, UITableViewDataSource {
vc.backLocationStringController = { vc.backLocationStringController = {
[weak self] (string1, string2, string3, string4) in [weak self] (string1, string2, string3, string4) in
guard let self = self else { return } guard let self = self else { return }
detailInfo.issuingAddr.area = [string1, string2, string3, string4] var citys:[String] = []
if !isEmptyString(string2) {
citys.append(string2)
}
if !isEmptyString(string3) {
citys.append(string3)
}
detailInfo.issuingAddr.area = citys
loadInfo() loadInfo()
if detailId != 0 { if detailId != 0 {
saveDetailInfo(isNeedPop: false, isShowToast: false) saveDetailInfo(isNeedPop: false, isShowToast: false)
...@@ -391,12 +398,12 @@ extension YHQualificationDetailVC { ...@@ -391,12 +398,12 @@ extension YHQualificationDetailVC {
func saveDetailInfo(isNeedPop:Bool, isShowToast:Bool) { func saveDetailInfo(isNeedPop:Bool, isShowToast:Bool) {
var dict:[String : Any] = ["orderId":self.orderId] var dict:[String : Any] = ["orderId":self.orderId]
var quaDict:[String : Any] = detailInfo.toDictionary() ?? [:] let quaDict:[String : Any] = detailInfo.toDictionary() ?? [:]
dict["qua_data"] = quaDict dict["qua_data"] = quaDict
print(dict) print(dict)
self.educationRequest.saveQualificationInfo(params: dict) { self.educationRequest.saveQualificationInfo(params: dict, isSilent:!isShowToast) {
[weak self] success, error in [weak self] success, error in
guard let self = self else { return } guard let self = self else { return }
if success { if success {
......
...@@ -18,6 +18,10 @@ class YHEducationListInfo: SmartCodable { ...@@ -18,6 +18,10 @@ class YHEducationListInfo: SmartCodable {
// 1=已婚,2=未婚,3=离婚,4=分居,5=丧偶,6=事实婚姻,7=鳏寡 // 1=已婚,2=未婚,3=离婚,4=分居,5=丧偶,6=事实婚姻,7=鳏寡
var married: Int = 0 var married: Int = 0
func isMarried() ->Bool {
return married != 2
}
enum CodingKeys: String, CodingKey { enum CodingKeys: String, CodingKey {
case orderId = "order_id" case orderId = "order_id"
case eduList = "edu_list" case eduList = "edu_list"
......
...@@ -71,15 +71,19 @@ class YHEducationRequestViewModel { ...@@ -71,15 +71,19 @@ class YHEducationRequestViewModel {
} }
// 保存学历 // 保存学历
func saveEducationInfo(params:[String:Any], callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) { func saveEducationInfo(params:[String:Any], isSilent:Bool, callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) {
if !isSilent {
YHHUD.show(.progress(message: "数据加载中...")) YHHUD.show(.progress(message: "数据加载中..."))
}
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Education.saveEducationInfoApi let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Education.saveEducationInfoApi
let _ = YHNetRequest.postRequest(url: strUrl, params:params) {[weak self] json, code in let _ = YHNetRequest.postRequest(url: strUrl, params:params) {[weak self] json, code in
if !isSilent {
YHHUD.hide() YHHUD.hide()
}
guard let self = self else { return } guard let self = self else { return }
printLog("model 是 ==> \(json)") printLog("model 是 ==> \(json)")
if json.code == NetWorkCode.success.rawValue { if json.code == NetWorkCode.success.rawValue {
...@@ -195,15 +199,19 @@ class YHEducationRequestViewModel { ...@@ -195,15 +199,19 @@ class YHEducationRequestViewModel {
} }
// 保存专业信息 // 保存专业信息
func saveQualificationInfo(params:[String:Any], callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) { func saveQualificationInfo(params:[String:Any], isSilent:Bool, callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) {
if !isSilent {
YHHUD.show(.progress(message: "数据加载中...")) YHHUD.show(.progress(message: "数据加载中..."))
}
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Qualification.saveQualificationInfoApi let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Qualification.saveQualificationInfoApi
let _ = YHNetRequest.postRequest(url: strUrl, params:params) {[weak self] json, code in let _ = YHNetRequest.postRequest(url: strUrl, params:params) {[weak self] json, code in
if !isSilent {
YHHUD.hide() YHHUD.hide()
}
guard let self = self else { return } guard let self = self else { return }
printLog("model 是 ==> \(json)") printLog("model 是 ==> \(json)")
if json.code == NetWorkCode.success.rawValue { if json.code == NetWorkCode.success.rawValue {
......
...@@ -37,7 +37,7 @@ class YHQuestionInfo: SmartCodable, YHFormItemProtocol { ...@@ -37,7 +37,7 @@ class YHQuestionInfo: SmartCodable, YHFormItemProtocol {
extension YHQuestionInfo { extension YHQuestionInfo {
// 【问题】学历证书姓名及出生日期正确性 // 【问题】学历证书姓名及出生日期正确性
static func getEducationQuestion() -> [YHQuestionInfo] { static func getEducationQuestion(eduList:YHEducationListInfo) -> [YHQuestionInfo] {
let path = Bundle.main.path(forResource: "YHQuestionList", ofType: "plist") let path = Bundle.main.path(forResource: "YHQuestionList", ofType: "plist")
let questions:[Dictionary] = NSArray(contentsOfFile:path!) as! [Dictionary<String, Any>] let questions:[Dictionary] = NSArray(contentsOfFile:path!) as! [Dictionary<String, Any>]
var res:[YHQuestionInfo] = [] var res:[YHQuestionInfo] = []
...@@ -45,8 +45,14 @@ extension YHQuestionInfo { ...@@ -45,8 +45,14 @@ extension YHQuestionInfo {
guard let questionInfo = YHQuestionInfo.deserialize(dict: dict as? [AnyHashable : Any]) else { guard let questionInfo = YHQuestionInfo.deserialize(dict: dict as? [AnyHashable : Any]) else {
continue continue
} }
if questionInfo.key == "graduate" {
if eduList.isMarried() {
res.append(questionInfo) res.append(questionInfo)
} }
} else {
res.append(questionInfo)
}
}
return res return res
} }
} }
...@@ -455,7 +455,14 @@ extension YHChildBasicInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -455,7 +455,14 @@ extension YHChildBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
[weak self] (string1, string2, string3, string4) in [weak self] (string1, string2, string3, string4) in
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.child?.birthPlace.area = [string2, string3] var citys:[String] = []
if !isEmptyString(string2) {
citys.append(string2)
}
if !isEmptyString(string3) {
citys.append(string3)
}
self.child?.birthPlace.area = citys
self.loadInfo() self.loadInfo()
save() save()
} }
......
...@@ -13,6 +13,8 @@ class YHChildPrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol { ...@@ -13,6 +13,8 @@ class YHChildPrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol {
var child:YHFamilyMember? var child:YHFamilyMember?
weak var delegate:YHSpouseInfoVCProtocol? weak var delegate:YHSpouseInfoVCProtocol?
var isNeedShowError = false var isNeedShowError = false
// 是否随行能编辑
var isFollowCanEdit = true
lazy var items:[[YHFormItemProtocol]] = [[YHFormItemProtocol]]() lazy var items:[[YHFormItemProtocol]] = [[YHFormItemProtocol]]()
...@@ -54,6 +56,7 @@ class YHChildPrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol { ...@@ -54,6 +56,7 @@ class YHChildPrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol {
items.removeAll() items.removeAll()
isFollowCanEdit = !child.is18YearsOld()
// 随行 // 随行
let title0 = YHFormTitleItem(type: .accompany) let title0 = YHFormTitleItem(type: .accompany)
let item00 = YHFormDetailItem(type: .ownCustody, value:String(child.isOwnCustody())) let item00 = YHFormDetailItem(type: .ownCustody, value:String(child.isOwnCustody()))
...@@ -205,15 +208,23 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -205,15 +208,23 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
if cellType == .twoChoice { if cellType == .twoChoice {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDoubleChoiceCell let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDoubleChoiceCell
cell.isMust = detailItem.isNeed cell.isMust = detailItem.isNeed
cell.title = detailItem.getTitle() cell.title = detailItem.getTitle()
cell.isCanEdit = true
var select = false var select = false
if let value = detailItem.value { if let value = detailItem.value {
select = Bool(value)! select = Bool(value)!
} }
if detailItem.type == .isAccompanyToHK, let child = child, child.is18YearsOld() { // 是否随行至香港
// 年满18岁不能随行
select = false
cell.isCanEdit = isFollowCanEdit
}
let answers = [YHFormChoiceItem(title: "是".local, isSelect: select),YHFormChoiceItem(title: "否".local, isSelect: !select)] let answers = [YHFormChoiceItem(title: "是".local, isSelect: select),YHFormChoiceItem(title: "否".local, isSelect: !select)]
cell.answerArr = answers cell.answerArr = answers
...@@ -363,17 +374,29 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -363,17 +374,29 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
[weak self] (string1, string2, string3, string4) in [weak self] (string1, string2, string3, string4) in
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.child?.address.area = [string2, string3] var citys:[String] = []
if !isEmptyString(string2) {
citys.append(string2)
}
if !isEmptyString(string3) {
citys.append(string3)
}
self.child?.address.area = citys
self.loadInfo() self.loadInfo()
} }
self.present(vc, animated: true) self.present(vc, animated: true)
} else if detailItem.type == .birthday { // 出生日期 } else if detailItem.type == .birthday { // 出生日期
// 子女选择年满18岁则【是否随行至香港】默认选择否,不可修改
// 如果未年满18岁则【是否随行至香港】可选择【是/否】,可修改
YHDatePickView.show(type: .yyyymmdd) { [weak self] date in YHDatePickView.show(type: .yyyymmdd) { [weak self] date in
guard let self = self else { return } guard let self = self else { return }
if detailItem.type == .birthday { if detailItem.type == .birthday {
self.child?.birthday = date guard let child = child else { return }
child.birthday = date
isFollowCanEdit = !child.is18YearsOld()
} }
self.loadInfo() self.loadInfo()
} }
...@@ -381,6 +404,8 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -381,6 +404,8 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
} }
} }
func createCorner(cell:UITableViewCell, arr:Array<Any>, indexPath:IndexPath) { func createCorner(cell:UITableViewCell, arr:Array<Any>, indexPath:IndexPath) {
// 复用时需清理 // 复用时需清理
cell.layer.mask = nil cell.layer.mask = nil
......
...@@ -408,7 +408,7 @@ extension YHBrotherInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -408,7 +408,7 @@ extension YHBrotherInfoVC : UITableViewDelegate, UITableViewDataSource {
var isBirthOverSeas = false var isBirthOverSeas = false
if let brotherInfo = brotherInfo { if let brotherInfo = brotherInfo {
isBirthOverSeas = brotherInfo.isOverSeasOver1Year() isBirthOverSeas = brotherInfo.isBirthOverSeas()
} }
// 出生国外时 出生城市是输入框 // 出生国外时 出生城市是输入框
if isBirthOverSeas { return } if isBirthOverSeas { return }
...@@ -418,7 +418,14 @@ extension YHBrotherInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -418,7 +418,14 @@ extension YHBrotherInfoVC : UITableViewDelegate, UITableViewDataSource {
[weak self] (string1, string2, string3, string4) in [weak self] (string1, string2, string3, string4) in
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.brotherInfo?.birthPlace.area = [string2, string3] var citys:[String] = []
if !isEmptyString(string2) {
citys.append(string2)
}
if !isEmptyString(string3) {
citys.append(string3)
}
self.brotherInfo?.birthPlace.area = citys
self.loadInfo() self.loadInfo()
saveInfoSilent() saveInfoSilent()
} }
......
...@@ -453,7 +453,7 @@ extension YHParentInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -453,7 +453,7 @@ extension YHParentInfoVC : UITableViewDelegate, UITableViewDataSource {
var isBirthOverSeas = false var isBirthOverSeas = false
if let parentInfo = parentInfo { if let parentInfo = parentInfo {
isBirthOverSeas = parentInfo.isOverSeasOver1Year() isBirthOverSeas = parentInfo.isBirthOverSeas()
} }
// 出生国外时 出生城市是输入框 // 出生国外时 出生城市是输入框
if isBirthOverSeas { return } if isBirthOverSeas { return }
...@@ -463,7 +463,14 @@ extension YHParentInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -463,7 +463,14 @@ extension YHParentInfoVC : UITableViewDelegate, UITableViewDataSource {
[weak self] (string1, string2, string3, string4) in [weak self] (string1, string2, string3, string4) in
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.parentInfo?.birthPlace.area = [string2, string3] var citys:[String] = []
if !isEmptyString(string2) {
citys.append(string2)
}
if !isEmptyString(string3) {
citys.append(string3)
}
self.parentInfo?.birthPlace.area = citys
self.loadInfo() self.loadInfo()
saveInfoSilent() saveInfoSilent()
} }
......
...@@ -643,7 +643,14 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -643,7 +643,14 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
[weak self] (string1, string2, string3, string4) in [weak self] (string1, string2, string3, string4) in
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] var citys:[String] = []
if !isEmptyString(string2) {
citys.append(string2)
}
if !isEmptyString(string3) {
citys.append(string3)
}
self.spouse?.birthPlace.area = citys
loadInfo() loadInfo()
save() save()
} }
......
...@@ -326,7 +326,14 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -326,7 +326,14 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
[weak self] (string1, string2, string3, string4) in [weak self] (string1, string2, string3, string4) in
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?.address.area = [string2, string3] var citys:[String] = []
if !isEmptyString(string2) {
citys.append(string2)
}
if !isEmptyString(string3) {
citys.append(string3)
}
self.spouse?.address.area = citys
self.loadInfo() self.loadInfo()
save() save()
} }
......
...@@ -14,7 +14,7 @@ enum YHFormTitleItemEditType:Int { ...@@ -14,7 +14,7 @@ enum YHFormTitleItemEditType:Int {
case canCancel = 3 case canCancel = 3
} }
class YHFamilyMemberInfoVC: YHBaseViewController { class YHFamilyMemberInfoListVC: YHBaseViewController {
var orderId:Int var orderId:Int
let familyRequest:YHFamilyRequestViewModel = YHFamilyRequestViewModel() let familyRequest:YHFamilyRequestViewModel = YHFamilyRequestViewModel()
...@@ -230,7 +230,7 @@ class YHFamilyMemberInfoVC: YHBaseViewController { ...@@ -230,7 +230,7 @@ class YHFamilyMemberInfoVC: YHBaseViewController {
} }
} }
extension YHFamilyMemberInfoVC { extension YHFamilyMemberInfoListVC {
// 请求家庭成员信息 // 请求家庭成员信息
func requestFamilyInfo() { func requestFamilyInfo() {
...@@ -293,7 +293,7 @@ extension YHFamilyMemberInfoVC { ...@@ -293,7 +293,7 @@ extension YHFamilyMemberInfoVC {
} }
} }
extension YHFamilyMemberInfoVC : UITableViewDelegate, UITableViewDataSource { extension YHFamilyMemberInfoListVC : UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int { func numberOfSections(in tableView: UITableView) -> Int {
return items.count return items.count
...@@ -368,17 +368,30 @@ extension YHFamilyMemberInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -368,17 +368,30 @@ extension YHFamilyMemberInfoVC : UITableViewDelegate, UITableViewDataSource {
cell.detailLabel.text = "还未开始填写".local cell.detailLabel.text = "还未开始填写".local
} }
if detailItem.relationType == .child || detailItem.relationType == .brother { if isEmptyString(detailItem.subsetName) { // 姓名为空
if detailItem.subsetName == nil || detailItem.subsetName == "" { // 姓名为空
if detailItem.relationType == .child { if detailItem.relationType == .child {
cell.title = String(format: "子女%d".local, indexPath.row) cell.title = String(format: "子女%d".local, indexPath.row)
} else if detailItem.relationType == .brother { } else if detailItem.relationType == .brother {
cell.title = String(format: "兄弟姐妹%d".local, indexPath.row) cell.title = String(format: "兄弟姐妹%d".local, indexPath.row)
} }
} else { } else {
cell.title = detailItem.subsetName var name = ""
if detailItem.relationType == .father {
name = "父亲"
} else if detailItem.relationType == .mother {
name = "母亲"
} else if detailItem.relationType == .spouse {
name = "配偶"
} else if detailItem.relationType == .child {
name = "子女"
} else if detailItem.relationType == .brother {
name = "兄弟姐妹"
} }
name += "-"
name += detailItem.subsetName
cell.title = name
} }
cell.isShowDeleteBtn = false cell.isShowDeleteBtn = false
cell.deleteBlock = nil cell.deleteBlock = nil
if detailItem.relationType == .child || detailItem.relationType == .brother { if detailItem.relationType == .child || detailItem.relationType == .brother {
...@@ -462,6 +475,7 @@ extension YHFamilyMemberInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -462,6 +475,7 @@ extension YHFamilyMemberInfoVC : UITableViewDelegate, UITableViewDataSource {
if formItem.type == .addChild || formItem.type == .addBrother { if formItem.type == .addChild || formItem.type == .addBrother {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemAddCell.cellReuseIdentifier, for: indexPath) as! YHFormItemAddCell let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemAddCell.cellReuseIdentifier, for: indexPath) as! YHFormItemAddCell
cell.title = formItem.getTitle()
cell.clickBlock = { [weak self] in cell.clickBlock = { [weak self] in
guard let self = self else { return } guard let self = self else { return }
if formItem.type == .addBrother { if formItem.type == .addBrother {
......
...@@ -1123,6 +1123,41 @@ class YHFamilyMember: SmartCodable, YHFormItemProtocol { ...@@ -1123,6 +1123,41 @@ class YHFamilyMember: SmartCodable, YHFormItemProtocol {
self.childStepchild.has = (val ? "Y" : "N") self.childStepchild.has = (val ? "Y" : "N")
} }
// 根据生日推算年龄
func getAge(birthday:String) ->Int {
let arr = birthday.components(separatedBy: YHDatePickView.separator)
if arr.count == 3 {
let year = Int(arr[0]) ?? 0
let month = Int(arr[1]) ?? 0
let day = Int(arr[2]) ?? 0
let now = Date()
let formatter = DateFormatter()
formatter.dateFormat = "yyyy-MM-dd"
let current = formatter.string(from: now)
let curArr = current.components(separatedBy:"-")
if curArr.count == 3 {
let cyear = Int(curArr[0]) ?? 0
let cmonth = Int(curArr[1]) ?? 0
let cday = Int(curArr[2]) ?? 0
var age = cyear - year
if cmonth < month {
age -= 1
} else if cmonth == month && cday < day {
age -= 1
}
return age
}
}
return 0
}
func is18YearsOld() -> Bool {
let age = getAge(birthday: birthday)
return age >= 18
}
var relationType:YHFamilyMemberType { var relationType:YHFamilyMemberType {
get { get {
......
...@@ -38,6 +38,13 @@ class YHFormItemDoubleChoiceCell: UITableViewCell { ...@@ -38,6 +38,13 @@ class YHFormItemDoubleChoiceCell: UITableViewCell {
// 是否必须字段 // 是否必须字段
var isMust:Bool = false var isMust:Bool = false
var answerBlock:(([YHFormChoiceItem], Int)->Void)? var answerBlock:(([YHFormChoiceItem], Int)->Void)?
// 是否能点击两个按钮
var isCanEdit:Bool = true {
didSet {
answer1Btn.isUserInteractionEnabled = isCanEdit
answer2Btn.isUserInteractionEnabled = isCanEdit
}
}
var title:String? { var title:String? {
didSet { didSet {
......
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