Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile-group
galaxy-iOS
Commits
d5d3eee0
Commit
d5d3eee0
authored
Dec 19, 2024
by
pete谢兆麟
Browse files
Options
Browse Files
Download
Plain Diff
主申请人
parents
7dfae27b
33754c9c
Changes
17
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
6368 additions
and
203 deletions
+6368
-203
Podfile
galaxy/Podfile
+1
-3
project.pbxproj
galaxy/galaxy.xcodeproj/project.pbxproj
+132
-12
YHAIMainChatViewController.swift
...s/AI/AI-Dialogue(AI对话)/C/YHAIMainChatViewController.swift
+0
-2
YHAIChatDataBaseManager.swift
...ules/AI/AI-Dialogue(AI对话)/M/YHAIChatDataBaseManager.swift
+0
-100
YHAIChatDataBaseModel.swift
...odules/AI/AI-Dialogue(AI对话)/M/YHAIChatDataBaseModel.swift
+0
-86
YHGCEducationDetailVC.swift
...ion&Qualification(学历专业资格填写)/C/YHGCEducationDetailVC.swift
+691
-0
YHGCEducationInfoListVC.swift
...n&Qualification(学历专业资格填写)/C/YHGCEducationInfoListVC.swift
+623
-0
YHGCQualificationDetailVC.swift
...Qualification(学历专业资格填写)/C/YHGCQualificationDetailVC.swift
+492
-0
YHGCCertificateInfoController.swift
...rtificates(证书上传和证书信息)/YHGCCertificateInfoController.swift
+583
-0
YHGCCertificateUploadVC.swift
...)/C/Certificates(证书上传和证书信息)/YHGCCertificateUploadVC.swift
+113
-0
YHGCChildBasicInfoVC.swift
...FamilyMember(家庭成员)/C/Child(子女)/YHGCChildBasicInfoVC.swift
+649
-0
YHGCChildInfoContainerVC.swift
...lyMember(家庭成员)/C/Child(子女)/YHGCChildInfoContainerVC.swift
+316
-0
YHGCChildPrimaryInfoVC.swift
...milyMember(家庭成员)/C/Child(子女)/YHGCChildPrimaryInfoVC.swift
+552
-0
YHGCSpouseBasicInfoVC.swift
...milyMember(家庭成员)/C/Spouse(配偶)/YHGCSpouseBasicInfoVC.swift
+779
-0
YHGCSpouseInfoContainerVC.swift
...Member(家庭成员)/C/Spouse(配偶)/YHGCSpouseInfoContainerVC.swift
+312
-0
YHGCSpousePrimaryInfoVC.swift
...lyMember(家庭成员)/C/Spouse(配偶)/YHGCSpousePrimaryInfoVC.swift
+480
-0
YHGCFamilyMemberInfoListVC.swift
...流程)/FamilyMember(家庭成员)/C/YHGCFamilyMemberInfoListVC.swift
+645
-0
No files found.
galaxy/Podfile
View file @
d5d3eee0
...
@@ -115,9 +115,7 @@ target 'galaxy' do
...
@@ -115,9 +115,7 @@ target 'galaxy' do
pod
'AliyunLogProducer'
,
'4.3.3'
pod
'AliyunLogProducer'
,
'4.3.3'
#加密
#加密
pod
'xxtea'
,
'1.0.2'
pod
'xxtea'
,
'1.0.2'
#Realm
pod
'RealmSwift'
,
'20.0.0'
pod
'Realm'
,
'20.0.0'
end
end
post_install
do
|
installer
|
post_install
do
|
installer
|
...
...
galaxy/galaxy.xcodeproj/project.pbxproj
View file @
d5d3eee0
...
@@ -95,7 +95,6 @@
...
@@ -95,7 +95,6 @@
045C0FD22D12CA5F00BD2DC0
/* YHMineSchemeViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
045C0C622D12CA5E00BD2DC0
/* YHMineSchemeViewController.swift */
;
};
045C0FD22D12CA5F00BD2DC0
/* YHMineSchemeViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
045C0C622D12CA5E00BD2DC0
/* YHMineSchemeViewController.swift */
;
};
045C0FD32D12CA5F00BD2DC0
/* YHFamilyRequestViewModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
045C0DB02D12CA5E00BD2DC0
/* YHFamilyRequestViewModel.swift */
;
};
045C0FD32D12CA5F00BD2DC0
/* YHFamilyRequestViewModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
045C0DB02D12CA5E00BD2DC0
/* YHFamilyRequestViewModel.swift */
;
};
045C0FD42D12CA5F00BD2DC0
/* YHHKRecordsLastStayCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
045C0CA22D12CA5E00BD2DC0
/* YHHKRecordsLastStayCell.swift */
;
};
045C0FD42D12CA5F00BD2DC0
/* YHHKRecordsLastStayCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
045C0CA22D12CA5E00BD2DC0
/* YHHKRecordsLastStayCell.swift */
;
};
045C0FD52D12CA5F00BD2DC0
/* YHAIChatDataBaseModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
045C0A302D12CA5E00BD2DC0
/* YHAIChatDataBaseModel.swift */
;
};
045C0FD62D12CA5F00BD2DC0
/* YHCertificateEditSheetView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
045C0C162D12CA5E00BD2DC0
/* YHCertificateEditSheetView.swift */
;
};
045C0FD62D12CA5F00BD2DC0
/* YHCertificateEditSheetView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
045C0C162D12CA5E00BD2DC0
/* YHCertificateEditSheetView.swift */
;
};
045C0FD72D12CA5F00BD2DC0
/* YHCardMessageCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
045C0A462D12CA5E00BD2DC0
/* YHCardMessageCell.swift */
;
};
045C0FD72D12CA5F00BD2DC0
/* YHCardMessageCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
045C0A462D12CA5E00BD2DC0
/* YHCardMessageCell.swift */
;
};
045C0FD82D12CA5F00BD2DC0
/* YHPreviewMainApplicantInfoViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
045C0E1B2D12CA5E00BD2DC0
/* YHPreviewMainApplicantInfoViewController.swift */
;
};
045C0FD82D12CA5F00BD2DC0
/* YHPreviewMainApplicantInfoViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
045C0E1B2D12CA5E00BD2DC0
/* YHPreviewMainApplicantInfoViewController.swift */
;
};
...
@@ -757,7 +756,6 @@
...
@@ -757,7 +756,6 @@
045C12692D12CA5F00BD2DC0
/* YHResignGuidelinesExampleViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
045C0D142D12CA5E00BD2DC0
/* YHResignGuidelinesExampleViewController.swift */
;
};
045C12692D12CA5F00BD2DC0
/* YHResignGuidelinesExampleViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
045C0D142D12CA5E00BD2DC0
/* YHResignGuidelinesExampleViewController.swift */
;
};
045C126A2D12CA5F00BD2DC0
/* YHPlayerTransitionAnimator.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
045C0E862D12CA5E00BD2DC0
/* YHPlayerTransitionAnimator.swift */
;
};
045C126A2D12CA5F00BD2DC0
/* YHPlayerTransitionAnimator.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
045C0E862D12CA5E00BD2DC0
/* YHPlayerTransitionAnimator.swift */
;
};
045C126B2D12CA5F00BD2DC0
/* YHLookResignResultViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
045C0CD42D12CA5E00BD2DC0
/* YHLookResignResultViewController.swift */
;
};
045C126B2D12CA5F00BD2DC0
/* YHLookResignResultViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
045C0CD42D12CA5E00BD2DC0
/* YHLookResignResultViewController.swift */
;
};
045C126C2D12CA5F00BD2DC0
/* YHAIChatDataBaseManager.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
045C0A2F2D12CA5E00BD2DC0
/* YHAIChatDataBaseManager.swift */
;
};
045C126D2D12CA5F00BD2DC0
/* YHLookResignGuideLineView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
045C0CD92D12CA5E00BD2DC0
/* YHLookResignGuideLineView.swift */
;
};
045C126D2D12CA5F00BD2DC0
/* YHLookResignGuideLineView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
045C0CD92D12CA5E00BD2DC0
/* YHLookResignGuideLineView.swift */
;
};
045C126E2D12CA5F00BD2DC0
/* YHHeadImageViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
045C0EEA2D12CA5E00BD2DC0
/* YHHeadImageViewController.swift */
;
};
045C126E2D12CA5F00BD2DC0
/* YHHeadImageViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
045C0EEA2D12CA5E00BD2DC0
/* YHHeadImageViewController.swift */
;
};
045C126F2D12CA5F00BD2DC0
/* YHTravelModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
045C0A6F2D12CA5E00BD2DC0
/* YHTravelModel.swift */
;
};
045C126F2D12CA5F00BD2DC0
/* YHTravelModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
045C0A6F2D12CA5E00BD2DC0
/* YHTravelModel.swift */
;
};
...
@@ -1105,6 +1103,18 @@
...
@@ -1105,6 +1103,18 @@
04AE20192D12CFAF00891D24
/* YHGCApplicationTypeResponseModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04AE20032D12CFAF00891D24
/* YHGCApplicationTypeResponseModel.swift */
;
};
04AE20192D12CFAF00891D24
/* YHGCApplicationTypeResponseModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04AE20032D12CFAF00891D24
/* YHGCApplicationTypeResponseModel.swift */
;
};
04AE201A2D12D10200891D24
/* ATAuthSDK.bundle in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04FA8B2D2C084C7E00ABE43F
/* ATAuthSDK.bundle */
;
};
04AE201A2D12D10200891D24
/* ATAuthSDK.bundle in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04FA8B2D2C084C7E00ABE43F
/* ATAuthSDK.bundle */
;
};
04AE201B2D12D14E00891D24
/* ATAuthSDK_D.framework in Embed Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
045C0A562D12CA5E00BD2DC0
/* ATAuthSDK_D.framework */
;
settings
=
{
ATTRIBUTES
=
(
CodeSignOnCopy
,
RemoveHeadersOnCopy
,
);
};
};
04AE201B2D12D14E00891D24
/* ATAuthSDK_D.framework in Embed Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
045C0A562D12CA5E00BD2DC0
/* ATAuthSDK_D.framework */
;
settings
=
{
ATTRIBUTES
=
(
CodeSignOnCopy
,
RemoveHeadersOnCopy
,
);
};
};
04AE20222D13AFF200891D24
/* YHGCFamilyMemberInfoListVC.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04AE20212D13AFF200891D24
/* YHGCFamilyMemberInfoListVC.swift */
;
};
04AE20252D13B11200891D24
/* YHGCSpouseBasicInfoVC.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04AE20242D13B11200891D24
/* YHGCSpouseBasicInfoVC.swift */
;
};
04AE20272D13B1B600891D24
/* YHGCSpousePrimaryInfoVC.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04AE20262D13B1B600891D24
/* YHGCSpousePrimaryInfoVC.swift */
;
};
04AE20292D13B20900891D24
/* YHGCSpouseInfoContainerVC.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04AE20282D13B20900891D24
/* YHGCSpouseInfoContainerVC.swift */
;
};
04AE202C2D13B57000891D24
/* YHGCCertificateInfoController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04AE202B2D13B57000891D24
/* YHGCCertificateInfoController.swift */
;
};
04AE202E2D13B5EB00891D24
/* YHGCCertificateUploadVC.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04AE202D2D13B5EB00891D24
/* YHGCCertificateUploadVC.swift */
;
};
04AE20312D13B6E500891D24
/* YHGCChildBasicInfoVC.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04AE20302D13B6E500891D24
/* YHGCChildBasicInfoVC.swift */
;
};
04AE20332D13B72F00891D24
/* YHGCChildPrimaryInfoVC.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04AE20322D13B72F00891D24
/* YHGCChildPrimaryInfoVC.swift */
;
};
04AE20372D13B7CF00891D24
/* YHGCChildInfoContainerVC.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04AE20362D13B7CF00891D24
/* YHGCChildInfoContainerVC.swift */
;
};
04AE203B2D13C01B00891D24
/* YHGCEducationInfoListVC.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04AE203A2D13C01B00891D24
/* YHGCEducationInfoListVC.swift */
;
};
04AE203D2D13C14900891D24
/* YHGCEducationDetailVC.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04AE203C2D13C14900891D24
/* YHGCEducationDetailVC.swift */
;
};
04AE203F2D13C36500891D24
/* YHGCQualificationDetailVC.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04AE203E2D13C36500891D24
/* YHGCQualificationDetailVC.swift */
;
};
04EA376D2BEA06EF00DBAF64
/* WebKit.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04EA376C2BEA06EF00DBAF64
/* WebKit.framework */
;
};
04EA376D2BEA06EF00DBAF64
/* WebKit.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04EA376C2BEA06EF00DBAF64
/* WebKit.framework */
;
};
04EA376F2BEA071600DBAF64
/* libc++.tbd in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04EA376E2BEA070500DBAF64
/* libc++.tbd */
;
};
04EA376F2BEA071600DBAF64
/* libc++.tbd in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04EA376E2BEA070500DBAF64
/* libc++.tbd */
;
};
6203A87EDC96313BBE789D9C
/* Pods_galaxy.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
987C69D43AE8D85DC1930DCF
/* Pods_galaxy.framework */
;
};
6203A87EDC96313BBE789D9C
/* Pods_galaxy.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
987C69D43AE8D85DC1930DCF
/* Pods_galaxy.framework */
;
};
...
@@ -1171,8 +1181,6 @@
...
@@ -1171,8 +1181,6 @@
045C0A2B2D12CA5E00BD2DC0
/* YHAIRobotChatViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHAIRobotChatViewController.swift
;
sourceTree
=
"<group>"
;
};
045C0A2B2D12CA5E00BD2DC0
/* YHAIRobotChatViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHAIRobotChatViewController.swift
;
sourceTree
=
"<group>"
;
};
045C0A2C2D12CA5E00BD2DC0
/* YHAIServiceListViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHAIServiceListViewController.swift
;
sourceTree
=
"<group>"
;
};
045C0A2C2D12CA5E00BD2DC0
/* YHAIServiceListViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHAIServiceListViewController.swift
;
sourceTree
=
"<group>"
;
};
045C0A2D2D12CA5E00BD2DC0
/* YHAITabViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHAITabViewController.swift
;
sourceTree
=
"<group>"
;
};
045C0A2D2D12CA5E00BD2DC0
/* YHAITabViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHAITabViewController.swift
;
sourceTree
=
"<group>"
;
};
045C0A2F2D12CA5E00BD2DC0
/* YHAIChatDataBaseManager.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHAIChatDataBaseManager.swift
;
sourceTree
=
"<group>"
;
};
045C0A302D12CA5E00BD2DC0
/* YHAIChatDataBaseModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHAIChatDataBaseModel.swift
;
sourceTree
=
"<group>"
;
};
045C0A312D12CA5E00BD2DC0
/* YHAIHistoryMessage.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHAIHistoryMessage.swift
;
sourceTree
=
"<group>"
;
};
045C0A312D12CA5E00BD2DC0
/* YHAIHistoryMessage.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHAIHistoryMessage.swift
;
sourceTree
=
"<group>"
;
};
045C0A322D12CA5E00BD2DC0
/* YHAIListModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHAIListModel.swift
;
sourceTree
=
"<group>"
;
};
045C0A322D12CA5E00BD2DC0
/* YHAIListModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHAIListModel.swift
;
sourceTree
=
"<group>"
;
};
045C0A332D12CA5E00BD2DC0
/* YHAIMessageModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHAIMessageModel.swift
;
sourceTree
=
"<group>"
;
};
045C0A332D12CA5E00BD2DC0
/* YHAIMessageModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHAIMessageModel.swift
;
sourceTree
=
"<group>"
;
};
...
@@ -2248,6 +2256,18 @@
...
@@ -2248,6 +2256,18 @@
04AE20052D12CFAF00891D24
/* YHGCApplicationTypeSelectCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHGCApplicationTypeSelectCell.swift
;
sourceTree
=
"<group>"
;
};
04AE20052D12CFAF00891D24
/* YHGCApplicationTypeSelectCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHGCApplicationTypeSelectCell.swift
;
sourceTree
=
"<group>"
;
};
04AE20072D12CFAF00891D24
/* YHGCApplicationTypeViewModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHGCApplicationTypeViewModel.swift
;
sourceTree
=
"<group>"
;
};
04AE20072D12CFAF00891D24
/* YHGCApplicationTypeViewModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHGCApplicationTypeViewModel.swift
;
sourceTree
=
"<group>"
;
};
04AE200A2D12CFAF00891D24
/* YHGCBasicInfoFillViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHGCBasicInfoFillViewController.swift
;
sourceTree
=
"<group>"
;
};
04AE200A2D12CFAF00891D24
/* YHGCBasicInfoFillViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHGCBasicInfoFillViewController.swift
;
sourceTree
=
"<group>"
;
};
04AE20212D13AFF200891D24
/* YHGCFamilyMemberInfoListVC.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHGCFamilyMemberInfoListVC.swift
;
sourceTree
=
"<group>"
;
};
04AE20242D13B11200891D24
/* YHGCSpouseBasicInfoVC.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHGCSpouseBasicInfoVC.swift
;
sourceTree
=
"<group>"
;
};
04AE20262D13B1B600891D24
/* YHGCSpousePrimaryInfoVC.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHGCSpousePrimaryInfoVC.swift
;
sourceTree
=
"<group>"
;
};
04AE20282D13B20900891D24
/* YHGCSpouseInfoContainerVC.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHGCSpouseInfoContainerVC.swift
;
sourceTree
=
"<group>"
;
};
04AE202B2D13B57000891D24
/* YHGCCertificateInfoController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHGCCertificateInfoController.swift
;
sourceTree
=
"<group>"
;
};
04AE202D2D13B5EB00891D24
/* YHGCCertificateUploadVC.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHGCCertificateUploadVC.swift
;
sourceTree
=
"<group>"
;
};
04AE20302D13B6E500891D24
/* YHGCChildBasicInfoVC.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHGCChildBasicInfoVC.swift
;
sourceTree
=
"<group>"
;
};
04AE20322D13B72F00891D24
/* YHGCChildPrimaryInfoVC.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHGCChildPrimaryInfoVC.swift
;
sourceTree
=
"<group>"
;
};
04AE20362D13B7CF00891D24
/* YHGCChildInfoContainerVC.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHGCChildInfoContainerVC.swift
;
sourceTree
=
"<group>"
;
};
04AE203A2D13C01B00891D24
/* YHGCEducationInfoListVC.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHGCEducationInfoListVC.swift
;
sourceTree
=
"<group>"
;
};
04AE203C2D13C14900891D24
/* YHGCEducationDetailVC.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHGCEducationDetailVC.swift
;
sourceTree
=
"<group>"
;
};
04AE203E2D13C36500891D24
/* YHGCQualificationDetailVC.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHGCQualificationDetailVC.swift
;
sourceTree
=
"<group>"
;
};
04EA376C2BEA06EF00DBAF64
/* WebKit.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
WebKit.framework
;
path
=
System/Library/Frameworks/WebKit.framework
;
sourceTree
=
SDKROOT
;
};
04EA376C2BEA06EF00DBAF64
/* WebKit.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
WebKit.framework
;
path
=
System/Library/Frameworks/WebKit.framework
;
sourceTree
=
SDKROOT
;
};
04EA376E2BEA070500DBAF64
/* libc++.tbd */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
"sourcecode.text-based-dylib-definition"
;
name
=
"libc++.tbd"
;
path
=
"usr/lib/libc++.tbd"
;
sourceTree
=
SDKROOT
;
};
04EA376E2BEA070500DBAF64
/* libc++.tbd */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
"sourcecode.text-based-dylib-definition"
;
name
=
"libc++.tbd"
;
path
=
"usr/lib/libc++.tbd"
;
sourceTree
=
SDKROOT
;
};
04FA8B2D2C084C7E00ABE43F
/* ATAuthSDK.bundle */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
"wrapper.plug-in"
;
name
=
ATAuthSDK.bundle
;
path
=
"galaxy/Classes/Modules/AutoLogin(一键登录)/framework/ATAuthSDK_D.framework/ATAuthSDK.bundle"
;
sourceTree
=
"<group>"
;
};
04FA8B2D2C084C7E00ABE43F
/* ATAuthSDK.bundle */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
"wrapper.plug-in"
;
name
=
ATAuthSDK.bundle
;
path
=
"galaxy/Classes/Modules/AutoLogin(一键登录)/framework/ATAuthSDK_D.framework/ATAuthSDK.bundle"
;
sourceTree
=
"<group>"
;
};
...
@@ -2393,8 +2413,6 @@
...
@@ -2393,8 +2413,6 @@
045C0A352D12CA5E00BD2DC0
/* M */
=
{
045C0A352D12CA5E00BD2DC0
/* M */
=
{
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
045C0A2F2D12CA5E00BD2DC0
/* YHAIChatDataBaseManager.swift */
,
045C0A302D12CA5E00BD2DC0
/* YHAIChatDataBaseModel.swift */
,
045C0A312D12CA5E00BD2DC0
/* YHAIHistoryMessage.swift */
,
045C0A312D12CA5E00BD2DC0
/* YHAIHistoryMessage.swift */
,
045C0A322D12CA5E00BD2DC0
/* YHAIListModel.swift */
,
045C0A322D12CA5E00BD2DC0
/* YHAIListModel.swift */
,
045C0A332D12CA5E00BD2DC0
/* YHAIMessageModel.swift */
,
045C0A332D12CA5E00BD2DC0
/* YHAIMessageModel.swift */
,
...
@@ -5923,6 +5941,8 @@
...
@@ -5923,6 +5941,8 @@
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
0411CED92D14000D00644D35
/* MainApplicantInformation(主申请人信息) */
,
0411CED92D14000D00644D35
/* MainApplicantInformation(主申请人信息) */
,
04AE20382D13BAC400891D24
/* Education&Qualification(学历专业资格填写) */
,
04AE201C2D13AF1800891D24
/* FamilyMember(家庭成员) */
,
04AE20092D12CFAF00891D24
/* ApplicationType(申请类别) */
,
04AE20092D12CFAF00891D24
/* ApplicationType(申请类别) */
,
04AE200C2D12CFAF00891D24
/* BaseInformation(基本资料) */
,
04AE200C2D12CFAF00891D24
/* BaseInformation(基本资料) */
,
);
);
...
@@ -5938,6 +5958,96 @@
...
@@ -5938,6 +5958,96 @@
path
=
"TTPS(高才)"
;
path
=
"TTPS(高才)"
;
sourceTree
=
"<group>"
;
sourceTree
=
"<group>"
;
};
};
04AE201C2D13AF1800891D24
/* FamilyMember(家庭成员) */
=
{
isa
=
PBXGroup
;
children
=
(
04AE20202D13AF5800891D24
/* VM */
,
04AE201F2D13AF5100891D24
/* V */
,
04AE201E2D13AF4600891D24
/* M */
,
04AE201D2D13AF3D00891D24
/* C */
,
);
path
=
"FamilyMember(家庭成员)"
;
sourceTree
=
"<group>"
;
};
04AE201D2D13AF3D00891D24
/* C */
=
{
isa
=
PBXGroup
;
children
=
(
04AE202A2D13B54500891D24
/* Certificates(证书上传和证书信息) */
,
04AE202F2D13B6A800891D24
/* Child(子女) */
,
04AE20232D13B0D300891D24
/* Spouse(配偶) */
,
04AE20212D13AFF200891D24
/* YHGCFamilyMemberInfoListVC.swift */
,
);
path
=
C
;
sourceTree
=
"<group>"
;
};
04AE201E2D13AF4600891D24
/* M */
=
{
isa
=
PBXGroup
;
children
=
(
);
path
=
M
;
sourceTree
=
"<group>"
;
};
04AE201F2D13AF5100891D24
/* V */
=
{
isa
=
PBXGroup
;
children
=
(
);
path
=
V
;
sourceTree
=
"<group>"
;
};
04AE20202D13AF5800891D24
/* VM */
=
{
isa
=
PBXGroup
;
children
=
(
);
path
=
VM
;
sourceTree
=
"<group>"
;
};
04AE20232D13B0D300891D24
/* Spouse(配偶) */
=
{
isa
=
PBXGroup
;
children
=
(
04AE20282D13B20900891D24
/* YHGCSpouseInfoContainerVC.swift */
,
04AE20242D13B11200891D24
/* YHGCSpouseBasicInfoVC.swift */
,
04AE20262D13B1B600891D24
/* YHGCSpousePrimaryInfoVC.swift */
,
);
path
=
"Spouse(配偶)"
;
sourceTree
=
"<group>"
;
};
04AE202A2D13B54500891D24
/* Certificates(证书上传和证书信息) */
=
{
isa
=
PBXGroup
;
children
=
(
04AE202B2D13B57000891D24
/* YHGCCertificateInfoController.swift */
,
04AE202D2D13B5EB00891D24
/* YHGCCertificateUploadVC.swift */
,
);
path
=
"Certificates(证书上传和证书信息)"
;
sourceTree
=
"<group>"
;
};
04AE202F2D13B6A800891D24
/* Child(子女) */
=
{
isa
=
PBXGroup
;
children
=
(
04AE20302D13B6E500891D24
/* YHGCChildBasicInfoVC.swift */
,
04AE20322D13B72F00891D24
/* YHGCChildPrimaryInfoVC.swift */
,
04AE20362D13B7CF00891D24
/* YHGCChildInfoContainerVC.swift */
,
);
path
=
"Child(子女)"
;
sourceTree
=
"<group>"
;
};
04AE20382D13BAC400891D24
/* Education&Qualification(学历专业资格填写) */
=
{
isa
=
PBXGroup
;
children
=
(
04AE20392D13C00400891D24
/* C */
,
);
path
=
"Education&Qualification(学历专业资格填写)"
;
sourceTree
=
"<group>"
;
};
04AE20392D13C00400891D24
/* C */
=
{
isa
=
PBXGroup
;
children
=
(
04AE203A2D13C01B00891D24
/* YHGCEducationInfoListVC.swift */
,
04AE203C2D13C14900891D24
/* YHGCEducationDetailVC.swift */
,
04AE203E2D13C36500891D24
/* YHGCQualificationDetailVC.swift */
,
);
path
=
C
;
sourceTree
=
"<group>"
;
};
04E86E212B81E9FA00A35F4B
/* Recovered References */
=
{
04E86E212B81E9FA00A35F4B
/* Recovered References */
=
{
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
...
@@ -6278,6 +6388,7 @@
...
@@ -6278,6 +6388,7 @@
045C0FC52D12CA5F00BD2DC0
/* YHMainInformationTableViewCell.swift in Sources */
,
045C0FC52D12CA5F00BD2DC0
/* YHMainInformationTableViewCell.swift in Sources */
,
045C0FC62D12CA5F00BD2DC0
/* YHApplyActivityResultViewController.swift in Sources */
,
045C0FC62D12CA5F00BD2DC0
/* YHApplyActivityResultViewController.swift in Sources */
,
045C0FC72D12CA5F00BD2DC0
/* YhOverlayView.swift in Sources */
,
045C0FC72D12CA5F00BD2DC0
/* YhOverlayView.swift in Sources */
,
04AE20372D13B7CF00891D24
/* YHGCChildInfoContainerVC.swift in Sources */
,
045C0FC82D12CA5F00BD2DC0
/* YHCollectionModel.swift in Sources */
,
045C0FC82D12CA5F00BD2DC0
/* YHCollectionModel.swift in Sources */
,
045C0FC92D12CA5F00BD2DC0
/* YHOtherLanguageSelecteView.swift in Sources */
,
045C0FC92D12CA5F00BD2DC0
/* YHOtherLanguageSelecteView.swift in Sources */
,
045C0FCA2D12CA5F00BD2DC0
/* YHAutoTextView.swift in Sources */
,
045C0FCA2D12CA5F00BD2DC0
/* YHAutoTextView.swift in Sources */
,
...
@@ -6291,13 +6402,13 @@
...
@@ -6291,13 +6402,13 @@
045C0FD22D12CA5F00BD2DC0
/* YHMineSchemeViewController.swift in Sources */
,
045C0FD22D12CA5F00BD2DC0
/* YHMineSchemeViewController.swift in Sources */
,
045C0FD32D12CA5F00BD2DC0
/* YHFamilyRequestViewModel.swift in Sources */
,
045C0FD32D12CA5F00BD2DC0
/* YHFamilyRequestViewModel.swift in Sources */
,
045C0FD42D12CA5F00BD2DC0
/* YHHKRecordsLastStayCell.swift in Sources */
,
045C0FD42D12CA5F00BD2DC0
/* YHHKRecordsLastStayCell.swift in Sources */
,
045C0FD52D12CA5F00BD2DC0
/* YHAIChatDataBaseModel.swift in Sources */
,
045C0FD62D12CA5F00BD2DC0
/* YHCertificateEditSheetView.swift in Sources */
,
045C0FD62D12CA5F00BD2DC0
/* YHCertificateEditSheetView.swift in Sources */
,
045C0FD72D12CA5F00BD2DC0
/* YHCardMessageCell.swift in Sources */
,
045C0FD72D12CA5F00BD2DC0
/* YHCardMessageCell.swift in Sources */
,
045C0FD82D12CA5F00BD2DC0
/* YHPreviewMainApplicantInfoViewController.swift in Sources */
,
045C0FD82D12CA5F00BD2DC0
/* YHPreviewMainApplicantInfoViewController.swift in Sources */
,
045C0FD92D12CA5F00BD2DC0
/* YHHomeCollectionViewCell.swift in Sources */
,
045C0FD92D12CA5F00BD2DC0
/* YHHomeCollectionViewCell.swift in Sources */
,
045C0FDA2D12CA5F00BD2DC0
/* YHBasicContentView.swift in Sources */
,
045C0FDA2D12CA5F00BD2DC0
/* YHBasicContentView.swift in Sources */
,
045C0FDB2D12CA5F00BD2DC0
/* YHSelectViewController.swift in Sources */
,
045C0FDB2D12CA5F00BD2DC0
/* YHSelectViewController.swift in Sources */
,
04AE20312D13B6E500891D24
/* YHGCChildBasicInfoVC.swift in Sources */
,
045C0FDC2D12CA5F00BD2DC0
/* YHMyNotifySettingVC.swift in Sources */
,
045C0FDC2D12CA5F00BD2DC0
/* YHMyNotifySettingVC.swift in Sources */
,
045C0FDD2D12CA5F00BD2DC0
/* YHIncomeRecordCompleteModel.swift in Sources */
,
045C0FDD2D12CA5F00BD2DC0
/* YHIncomeRecordCompleteModel.swift in Sources */
,
045C0FDE2D12CA5F00BD2DC0
/* YHMainInformationModel.swift in Sources */
,
045C0FDE2D12CA5F00BD2DC0
/* YHMainInformationModel.swift in Sources */
,
...
@@ -6503,6 +6614,7 @@
...
@@ -6503,6 +6614,7 @@
045C109A2D12CA5F00BD2DC0
/* YhCacheTool.swift in Sources */
,
045C109A2D12CA5F00BD2DC0
/* YhCacheTool.swift in Sources */
,
045C109B2D12CA5F00BD2DC0
/* YHHomeInfoDetailViewController.swift in Sources */
,
045C109B2D12CA5F00BD2DC0
/* YHHomeInfoDetailViewController.swift in Sources */
,
045C109C2D12CA5F00BD2DC0
/* YHAdopterChinaViewController.swift in Sources */
,
045C109C2D12CA5F00BD2DC0
/* YHAdopterChinaViewController.swift in Sources */
,
04AE20332D13B72F00891D24
/* YHGCChildPrimaryInfoVC.swift in Sources */
,
045C109D2D12CA5F00BD2DC0
/* YHHKRecordsSectionItemBaseCell.swift in Sources */
,
045C109D2D12CA5F00BD2DC0
/* YHHKRecordsSectionItemBaseCell.swift in Sources */
,
045C109E2D12CA5F00BD2DC0
/* YHResignMaterialViewModel.swift in Sources */
,
045C109E2D12CA5F00BD2DC0
/* YHResignMaterialViewModel.swift in Sources */
,
045C109F2D12CA5F00BD2DC0
/* YHAITabViewController.swift in Sources */
,
045C109F2D12CA5F00BD2DC0
/* YHAITabViewController.swift in Sources */
,
...
@@ -6688,6 +6800,7 @@
...
@@ -6688,6 +6800,7 @@
045C11532D12CA5F00BD2DC0
/* YHLookResignResultStateOneTableViewCell.swift in Sources */
,
045C11532D12CA5F00BD2DC0
/* YHLookResignResultStateOneTableViewCell.swift in Sources */
,
045C11542D12CA5F00BD2DC0
/* YHWorkExperienceCompanyModel.swift in Sources */
,
045C11542D12CA5F00BD2DC0
/* YHWorkExperienceCompanyModel.swift in Sources */
,
045C11552D12CA5F00BD2DC0
/* YHResignInfoItemView.swift in Sources */
,
045C11552D12CA5F00BD2DC0
/* YHResignInfoItemView.swift in Sources */
,
04AE203B2D13C01B00891D24
/* YHGCEducationInfoListVC.swift in Sources */
,
045C11562D12CA5F00BD2DC0
/* YHHUDSquareBaseView.swift in Sources */
,
045C11562D12CA5F00BD2DC0
/* YHHUDSquareBaseView.swift in Sources */
,
045C11572D12CA5F00BD2DC0
/* YHCountryHotView.swift in Sources */
,
045C11572D12CA5F00BD2DC0
/* YHCountryHotView.swift in Sources */
,
045C11582D12CA5F00BD2DC0
/* YHPreviewBaseViewController.swift in Sources */
,
045C11582D12CA5F00BD2DC0
/* YHPreviewBaseViewController.swift in Sources */
,
...
@@ -6696,6 +6809,7 @@
...
@@ -6696,6 +6809,7 @@
045C115B2D12CA5F00BD2DC0
/* YHHKRecordItemDetailType.swift in Sources */
,
045C115B2D12CA5F00BD2DC0
/* YHHKRecordItemDetailType.swift in Sources */
,
045C115C2D12CA5F00BD2DC0
/* YHHUDContainerView.swift in Sources */
,
045C115C2D12CA5F00BD2DC0
/* YHHUDContainerView.swift in Sources */
,
045C115D2D12CA5F00BD2DC0
/* YHOrderTipsView.swift in Sources */
,
045C115D2D12CA5F00BD2DC0
/* YHOrderTipsView.swift in Sources */
,
04AE203F2D13C36500891D24
/* YHGCQualificationDetailVC.swift in Sources */
,
045C115E2D12CA5F00BD2DC0
/* YHInvitationWithGiftsSelectItemView.swift in Sources */
,
045C115E2D12CA5F00BD2DC0
/* YHInvitationWithGiftsSelectItemView.swift in Sources */
,
045C115F2D12CA5F00BD2DC0
/* YHAITabIndicatorView.swift in Sources */
,
045C115F2D12CA5F00BD2DC0
/* YHAITabIndicatorView.swift in Sources */
,
045C11602D12CA5F00BD2DC0
/* YHHKRecordsFamilyMembers.swift in Sources */
,
045C11602D12CA5F00BD2DC0
/* YHHKRecordsFamilyMembers.swift in Sources */
,
...
@@ -6755,6 +6869,7 @@
...
@@ -6755,6 +6869,7 @@
045C11972D12CA5F00BD2DC0
/* YHHUDRotatingImageView.swift in Sources */
,
045C11972D12CA5F00BD2DC0
/* YHHUDRotatingImageView.swift in Sources */
,
045C11982D12CA5F00BD2DC0
/* YHCerAppointViewModel.swift in Sources */
,
045C11982D12CA5F00BD2DC0
/* YHCerAppointViewModel.swift in Sources */
,
045C11992D12CA5F00BD2DC0
/* YHPayMembersCell.swift in Sources */
,
045C11992D12CA5F00BD2DC0
/* YHPayMembersCell.swift in Sources */
,
04AE203D2D13C14900891D24
/* YHGCEducationDetailVC.swift in Sources */
,
045C119A2D12CA5F00BD2DC0
/* YHValidateCodeInputView.swift in Sources */
,
045C119A2D12CA5F00BD2DC0
/* YHValidateCodeInputView.swift in Sources */
,
045C119B2D12CA5F00BD2DC0
/* YHButlerServiceMessage.swift in Sources */
,
045C119B2D12CA5F00BD2DC0
/* YHButlerServiceMessage.swift in Sources */
,
045C119C2D12CA5F00BD2DC0
/* YHSubmitAllInfoCheckView.swift in Sources */
,
045C119C2D12CA5F00BD2DC0
/* YHSubmitAllInfoCheckView.swift in Sources */
,
...
@@ -6966,7 +7081,6 @@
...
@@ -6966,7 +7081,6 @@
045C12692D12CA5F00BD2DC0
/* YHResignGuidelinesExampleViewController.swift in Sources */
,
045C12692D12CA5F00BD2DC0
/* YHResignGuidelinesExampleViewController.swift in Sources */
,
045C126A2D12CA5F00BD2DC0
/* YHPlayerTransitionAnimator.swift in Sources */
,
045C126A2D12CA5F00BD2DC0
/* YHPlayerTransitionAnimator.swift in Sources */
,
045C126B2D12CA5F00BD2DC0
/* YHLookResignResultViewController.swift in Sources */
,
045C126B2D12CA5F00BD2DC0
/* YHLookResignResultViewController.swift in Sources */
,
045C126C2D12CA5F00BD2DC0
/* YHAIChatDataBaseManager.swift in Sources */
,
045C126D2D12CA5F00BD2DC0
/* YHLookResignGuideLineView.swift in Sources */
,
045C126D2D12CA5F00BD2DC0
/* YHLookResignGuideLineView.swift in Sources */
,
045C126E2D12CA5F00BD2DC0
/* YHHeadImageViewController.swift in Sources */
,
045C126E2D12CA5F00BD2DC0
/* YHHeadImageViewController.swift in Sources */
,
045C126F2D12CA5F00BD2DC0
/* YHTravelModel.swift in Sources */
,
045C126F2D12CA5F00BD2DC0
/* YHTravelModel.swift in Sources */
,
...
@@ -7010,6 +7124,7 @@
...
@@ -7010,6 +7124,7 @@
045C12952D12CA5F00BD2DC0
/* YHHKIDCardModel.swift in Sources */
,
045C12952D12CA5F00BD2DC0
/* YHHKIDCardModel.swift in Sources */
,
045C12962D12CA5F00BD2DC0
/* YHHKVisaRenewalPaymentVC.swift in Sources */
,
045C12962D12CA5F00BD2DC0
/* YHHKVisaRenewalPaymentVC.swift in Sources */
,
045C12972D12CA5F00BD2DC0
/* YHResignAppointGroup.swift in Sources */
,
045C12972D12CA5F00BD2DC0
/* YHResignAppointGroup.swift in Sources */
,
04AE202C2D13B57000891D24
/* YHGCCertificateInfoController.swift in Sources */
,
045C12982D12CA5F00BD2DC0
/* YHAboutGalaxyViewController.swift in Sources */
,
045C12982D12CA5F00BD2DC0
/* YHAboutGalaxyViewController.swift in Sources */
,
045C12992D12CA5F00BD2DC0
/* YHPreviewControllerHoldViewController.swift in Sources */
,
045C12992D12CA5F00BD2DC0
/* YHPreviewControllerHoldViewController.swift in Sources */
,
045C129A2D12CA5F00BD2DC0
/* YHOtherMultipleChoiceItemView.swift in Sources */
,
045C129A2D12CA5F00BD2DC0
/* YHOtherMultipleChoiceItemView.swift in Sources */
,
...
@@ -7081,6 +7196,7 @@
...
@@ -7081,6 +7196,7 @@
045C12DC2D12CA5F00BD2DC0
/* YHUatHelperViewModel.swift in Sources */
,
045C12DC2D12CA5F00BD2DC0
/* YHUatHelperViewModel.swift in Sources */
,
045C12DD2D12CA5F00BD2DC0
/* YHServiceCenterViewModel.swift in Sources */
,
045C12DD2D12CA5F00BD2DC0
/* YHServiceCenterViewModel.swift in Sources */
,
045C12DE2D12CA5F00BD2DC0
/* YHActivityTitleItemView.swift in Sources */
,
045C12DE2D12CA5F00BD2DC0
/* YHActivityTitleItemView.swift in Sources */
,
04AE20272D13B1B600891D24
/* YHGCSpousePrimaryInfoVC.swift in Sources */
,
045C12DF2D12CA5F00BD2DC0
/* YHVisaRenewalPayStatusCell.swift in Sources */
,
045C12DF2D12CA5F00BD2DC0
/* YHVisaRenewalPayStatusCell.swift in Sources */
,
045C12E02D12CA5F00BD2DC0
/* YHCollegeNameCell.swift in Sources */
,
045C12E02D12CA5F00BD2DC0
/* YHCollegeNameCell.swift in Sources */
,
045C12E12D12CA5F00BD2DC0
/* YHPreviewInfoIncomeTypeCell.swift in Sources */
,
045C12E12D12CA5F00BD2DC0
/* YHPreviewInfoIncomeTypeCell.swift in Sources */
,
...
@@ -7119,6 +7235,7 @@
...
@@ -7119,6 +7235,7 @@
045C13022D12CA5F00BD2DC0
/* YHPictureReviewManager.swift in Sources */
,
045C13022D12CA5F00BD2DC0
/* YHPictureReviewManager.swift in Sources */
,
045C13032D12CA5F00BD2DC0
/* YHBasicInfoFillViewController.swift in Sources */
,
045C13032D12CA5F00BD2DC0
/* YHBasicInfoFillViewController.swift in Sources */
,
045C13042D12CA5F00BD2DC0
/* YHImproveSchemeTemplateListCell.swift in Sources */
,
045C13042D12CA5F00BD2DC0
/* YHImproveSchemeTemplateListCell.swift in Sources */
,
04AE202E2D13B5EB00891D24
/* YHGCCertificateUploadVC.swift in Sources */
,
045C13052D12CA5F00BD2DC0
/* YHActivityModel.swift in Sources */
,
045C13052D12CA5F00BD2DC0
/* YHActivityModel.swift in Sources */
,
045C13062D12CA5F00BD2DC0
/* YHInterestTopicLayout.swift in Sources */
,
045C13062D12CA5F00BD2DC0
/* YHInterestTopicLayout.swift in Sources */
,
045C13072D12CA5F00BD2DC0
/* YHSelectLookView.swift in Sources */
,
045C13072D12CA5F00BD2DC0
/* YHSelectLookView.swift in Sources */
,
...
@@ -7248,11 +7365,13 @@
...
@@ -7248,11 +7365,13 @@
045C13822D12CA5F00BD2DC0
/* YHResignMaterialUploadVC.swift in Sources */
,
045C13822D12CA5F00BD2DC0
/* YHResignMaterialUploadVC.swift in Sources */
,
045C13832D12CA5F00BD2DC0
/* YHVisaRenewalGuideIndentCell.swift in Sources */
,
045C13832D12CA5F00BD2DC0
/* YHVisaRenewalGuideIndentCell.swift in Sources */
,
045C13842D12CA5F00BD2DC0
/* YHOtherInfoFillModel.swift in Sources */
,
045C13842D12CA5F00BD2DC0
/* YHOtherInfoFillModel.swift in Sources */
,
04AE20252D13B11200891D24
/* YHGCSpouseBasicInfoVC.swift in Sources */
,
045C13852D12CA5F00BD2DC0
/* YHCertificateUploadVC.swift in Sources */
,
045C13852D12CA5F00BD2DC0
/* YHCertificateUploadVC.swift in Sources */
,
045C13862D12CA5F00BD2DC0
/* YHVisaRenewalGuideHeaderCell.swift in Sources */
,
045C13862D12CA5F00BD2DC0
/* YHVisaRenewalGuideHeaderCell.swift in Sources */
,
045C13872D12CA5F00BD2DC0
/* YHBrotherInfoVC.swift in Sources */
,
045C13872D12CA5F00BD2DC0
/* YHBrotherInfoVC.swift in Sources */
,
045C13882D12CA5F00BD2DC0
/* YHOffivialApprovalSuccessView.swift in Sources */
,
045C13882D12CA5F00BD2DC0
/* YHOffivialApprovalSuccessView.swift in Sources */
,
045C13892D12CA5F00BD2DC0
/* YHVisaRenewalWorkflowCell.swift in Sources */
,
045C13892D12CA5F00BD2DC0
/* YHVisaRenewalWorkflowCell.swift in Sources */
,
04AE20222D13AFF200891D24
/* YHGCFamilyMemberInfoListVC.swift in Sources */
,
045C138A2D12CA5F00BD2DC0
/* YHMatchCardUsageGuideView.swift in Sources */
,
045C138A2D12CA5F00BD2DC0
/* YHMatchCardUsageGuideView.swift in Sources */
,
045C138B2D12CA5F00BD2DC0
/* YHResignUploadTravelGuideView.swift in Sources */
,
045C138B2D12CA5F00BD2DC0
/* YHResignUploadTravelGuideView.swift in Sources */
,
045C138C2D12CA5F00BD2DC0
/* YHResignFamilyMemberInfoCell.swift in Sources */
,
045C138C2D12CA5F00BD2DC0
/* YHResignFamilyMemberInfoCell.swift in Sources */
,
...
@@ -7284,6 +7403,7 @@
...
@@ -7284,6 +7403,7 @@
045C13A62D12CA5F00BD2DC0
/* YHTravelDocsPreparationViewModel.swift in Sources */
,
045C13A62D12CA5F00BD2DC0
/* YHTravelDocsPreparationViewModel.swift in Sources */
,
045C13A72D12CA5F00BD2DC0
/* YHWorkExampleMessageTableViewCell.swift in Sources */
,
045C13A72D12CA5F00BD2DC0
/* YHWorkExampleMessageTableViewCell.swift in Sources */
,
045C13A82D12CA5F00BD2DC0
/* YHBasicInfoCellModel.swift in Sources */
,
045C13A82D12CA5F00BD2DC0
/* YHBasicInfoCellModel.swift in Sources */
,
04AE20292D13B20900891D24
/* YHGCSpouseInfoContainerVC.swift in Sources */
,
045C13A92D12CA5F00BD2DC0
/* YHAllowUseMyInfoViewController.swift in Sources */
,
045C13A92D12CA5F00BD2DC0
/* YHAllowUseMyInfoViewController.swift in Sources */
,
045C13AA2D12CA5F00BD2DC0
/* YHServiceCenterProgressModel.swift in Sources */
,
045C13AA2D12CA5F00BD2DC0
/* YHServiceCenterProgressModel.swift in Sources */
,
045C13AB2D12CA5F00BD2DC0
/* Dictionary+Extension.swift in Sources */
,
045C13AB2D12CA5F00BD2DC0
/* Dictionary+Extension.swift in Sources */
,
...
@@ -7400,7 +7520,7 @@
...
@@ -7400,7 +7520,7 @@
CODE_SIGN_ENTITLEMENTS
=
galaxy/galaxyTestEnv.entitlements
;
CODE_SIGN_ENTITLEMENTS
=
galaxy/galaxyTestEnv.entitlements
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_STYLE
=
Automatic
;
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
5
;
CURRENT_PROJECT_VERSION
=
7
;
DEVELOPMENT_TEAM
=
RXHYW88XR7
;
DEVELOPMENT_TEAM
=
RXHYW88XR7
;
ENABLE_USER_SCRIPT_SANDBOXING
=
NO
;
ENABLE_USER_SCRIPT_SANDBOXING
=
NO
;
FRAMEWORK_SEARCH_PATHS
=
(
FRAMEWORK_SEARCH_PATHS
=
(
...
@@ -7544,7 +7664,7 @@
...
@@ -7544,7 +7664,7 @@
CODE_SIGN_ENTITLEMENTS
=
galaxy/galaxy.entitlements
;
CODE_SIGN_ENTITLEMENTS
=
galaxy/galaxy.entitlements
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_STYLE
=
Automatic
;
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
5
;
CURRENT_PROJECT_VERSION
=
7
;
DEVELOPMENT_TEAM
=
RXHYW88XR7
;
DEVELOPMENT_TEAM
=
RXHYW88XR7
;
ENABLE_USER_SCRIPT_SANDBOXING
=
NO
;
ENABLE_USER_SCRIPT_SANDBOXING
=
NO
;
FRAMEWORK_SEARCH_PATHS
=
(
FRAMEWORK_SEARCH_PATHS
=
(
...
@@ -7751,7 +7871,7 @@
...
@@ -7751,7 +7871,7 @@
CODE_SIGN_ENTITLEMENTS
=
galaxy/galaxyDebug.entitlements
;
CODE_SIGN_ENTITLEMENTS
=
galaxy/galaxyDebug.entitlements
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_STYLE
=
Automatic
;
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
5
;
CURRENT_PROJECT_VERSION
=
7
;
DEVELOPMENT_TEAM
=
RXHYW88XR7
;
DEVELOPMENT_TEAM
=
RXHYW88XR7
;
ENABLE_USER_SCRIPT_SANDBOXING
=
NO
;
ENABLE_USER_SCRIPT_SANDBOXING
=
NO
;
FRAMEWORK_SEARCH_PATHS
=
(
FRAMEWORK_SEARCH_PATHS
=
(
...
@@ -7798,7 +7918,7 @@
...
@@ -7798,7 +7918,7 @@
CODE_SIGN_ENTITLEMENTS
=
galaxy/galaxy.entitlements
;
CODE_SIGN_ENTITLEMENTS
=
galaxy/galaxy.entitlements
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_STYLE
=
Automatic
;
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
5
;
CURRENT_PROJECT_VERSION
=
7
;
DEVELOPMENT_TEAM
=
RXHYW88XR7
;
DEVELOPMENT_TEAM
=
RXHYW88XR7
;
ENABLE_USER_SCRIPT_SANDBOXING
=
NO
;
ENABLE_USER_SCRIPT_SANDBOXING
=
NO
;
FRAMEWORK_SEARCH_PATHS
=
(
FRAMEWORK_SEARCH_PATHS
=
(
...
...
galaxy/galaxy/Classes/Modules/AI/AI-Dialogue(AI对话)/C/YHAIMainChatViewController.swift
View file @
d5d3eee0
...
@@ -73,8 +73,6 @@ class YHAIMainChatViewController: YHBaseViewController {
...
@@ -73,8 +73,6 @@ class YHAIMainChatViewController: YHBaseViewController {
gk_navigationBar
.
isHidden
=
true
gk_navigationBar
.
isHidden
=
true
view
.
backgroundColor
=
.
clear
view
.
backgroundColor
=
.
clear
IQKeyboardManager
.
shared
.
isEnabled
=
false
IQKeyboardManager
.
shared
.
isEnabled
=
false
let
historyMsgs
=
YHAIChatDataBaseManager
.
shared
.
readHistoryUIMessages
()
messages
.
append
(
contentsOf
:
historyMsgs
)
gk_navTitle
=
"AI对话"
gk_navTitle
=
"AI对话"
self
.
view
.
addSubview
(
self
.
tableView
)
self
.
view
.
addSubview
(
self
.
tableView
)
...
...
galaxy/galaxy/Classes/Modules/AI/AI-Dialogue(AI对话)/M/YHAIChatDataBaseManager.swift
deleted
100644 → 0
View file @
7dfae27b
//
// YHAIChatDataBaseManager.swift
// galaxy
//
// Created by Dufet on 2024/12/2.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
import
Realm
import
RealmSwift
class
YHAIChatDataBaseManager
{
static
let
shared
=
YHAIChatDataBaseManager
()
let
dbName
=
"AI_CHAT_DB.realm"
// 如果要存储的数据模型属性发生变化,需要配置当前版本号比之前大
let
dbVersion
:
UInt64
=
1
init
()
{
configDataBase
()
}
private
func
configDataBase
()
{
let
docPath
=
NSSearchPathForDirectoriesInDomains
(
FileManager
.
SearchPathDirectory
.
documentDirectory
,
FileManager
.
SearchPathDomainMask
.
userDomainMask
,
true
)[
0
]
as
String
let
dbPath
=
docPath
.
appending
(
"/
\(
dbName
)
"
)
let
config
=
Realm
.
Configuration
(
fileURL
:
URL
.
init
(
string
:
dbPath
),
inMemoryIdentifier
:
nil
,
encryptionKey
:
nil
,
readOnly
:
false
,
schemaVersion
:
dbVersion
,
migrationBlock
:
{
(
migration
,
oldSchemaVersion
)
in
},
deleteRealmIfMigrationNeeded
:
false
,
shouldCompactOnLaunch
:
nil
,
objectTypes
:
nil
)
Realm
.
Configuration
.
defaultConfiguration
=
config
Realm
.
asyncOpen
{
result
in
switch
result
{
case
let
.
success
(
succeed
):
print
(
"Realm 服务器配置成功!"
)
break
case
let
.
failure
(
error
):
print
(
"Realm 数据库配置失败:
\(
error
.
localizedDescription
)
"
)
break
}
}
}
private
func
getDB
()
->
Realm
{
let
docPath
=
NSSearchPathForDirectoriesInDomains
(
FileManager
.
SearchPathDirectory
.
documentDirectory
,
FileManager
.
SearchPathDomainMask
.
userDomainMask
,
true
)[
0
]
as
String
let
dbPath
=
docPath
.
appending
(
"/
\(
dbName
)
"
)
/// 传入路径会自动创建数据库
let
defaultRealm
=
try!
Realm
(
fileURL
:
URL
.
init
(
string
:
dbPath
)
!
)
return
defaultRealm
}
func
addDBMessages
(
_
messages
:
[
YHAIChatDBMessage
])
{
// 获取 Realm 实例
let
defaultRealm
=
self
.
getDB
()
// 开始写入事务
for
message
in
messages
{
let
students
=
getDBMessageBy
(
uuid
:
message
.
uuid
)
try!
defaultRealm
.
write
{
// 将新对象添加到 Realm 数据库
defaultRealm
.
add
(
message
,
update
:
students
.
count
>
0
?
.
modified
:
.
all
)
}
}
}
func
addDBMessage
(
_
message
:
YHAIChatDBMessage
)
->
Void
{
let
defaultRealm
=
self
.
getDB
()
try!
defaultRealm
.
write
{
defaultRealm
.
add
(
message
)
}
print
(
defaultRealm
.
configuration
.
fileURL
??
""
)
}
/// 获取 所保存的消息
func
getDBMessages
()
->
Results
<
YHAIChatDBMessage
>
{
let
defaultRealm
=
self
.
getDB
()
return
defaultRealm
.
objects
(
YHAIChatDBMessage
.
self
)
}
func
getDBMessageBy
(
uuid
:
String
)
->
Results
<
YHAIChatDBMessage
>
{
return
self
.
readDBMessages
(
"uuid = '
\(
uuid
)
'"
)
}
func
readDBMessages
(
_
predicate
:
String
)
->
Results
<
YHAIChatDBMessage
>
{
let
defaultRealm
=
self
.
getDB
()
print
(
defaultRealm
.
configuration
.
fileURL
??
""
)
let
predicate
=
NSPredicate
(
format
:
predicate
)
let
results
=
defaultRealm
.
objects
(
YHAIChatDBMessage
.
self
)
return
results
.
filter
(
predicate
)
}
func
readHistoryUIMessages
()
->
[
YHAIChatMessage
]
{
let
result
=
YHAIChatDataBaseManager
.
shared
.
getDBMessages
()
var
arr
=
[
YHAIChatMessage
]()
for
msg
in
result
{
let
model
=
msg
.
getMessage
()
arr
.
append
(
model
)
}
return
arr
}
}
galaxy/galaxy/Classes/Modules/AI/AI-Dialogue(AI对话)/M/YHAIChatDataBaseModel.swift
deleted
100644 → 0
View file @
7dfae27b
//
// YHAIChatDataBaseModel.swift
// galaxy
//
// Created by Dufet on 2024/12/2.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
import
Realm
import
RealmSwift
class
YHAIChatDataBaseModel
:
NSObject
{
}
class
YHAIChatDBMessage
:
Object
{
@objc
var
uuid
:
String
=
""
@objc
dynamic
var
id
:
String
=
""
@objc
dynamic
var
event
:
String
=
""
@objc
dynamic
var
data
:
String
=
""
@objc
dynamic
var
is_self
:
Bool
=
false
@objc
dynamic
var
is_done
:
Bool
=
false
//重写 Object.primaryKey() 可以设置模型的主键。
//声明主键之后,对象将被允许查询,更新速度更加高效,并且要求每个对象保持唯一性。
//一旦带有主键的对象被添加到 Realm 之后,该对象的主键将不可修改。
override
static
func
primaryKey
()
->
String
?
{
return
"uuid"
}
//重写 Object.ignoredProperties() 可以防止 Realm 存储数据模型的某个属性
override
static
func
ignoredProperties
()
->
[
String
]
{
// return ["tempID"]
return
[]
}
//重写 Object.indexedProperties() 方法可以为数据模型中需要添加索引的属性建立索引,Realm 支持为字符串、整型、布尔值以及 Date 属性建立索引。
override
static
func
indexedProperties
()
->
[
String
]
{
// return ["name"]
return
[]
}
static
func
createMessage
(
_
message
:
YHAIChatMessage
)
->
YHAIChatDBMessage
{
let
msg
=
YHAIChatDBMessage
()
msg
.
uuid
=
message
.
messageId
msg
.
id
=
message
.
id
msg
.
event
=
message
.
event
msg
.
data
=
message
.
data
msg
.
is_self
=
message
.
isSelf
msg
.
is_done
=
message
.
isDone
print
(
"DB WRITE--
\(
message
)
"
)
return
msg
}
func
getMessage
()
->
YHAIChatMessage
{
let
msg
=
YHAIChatMessage
()
msg
.
messageId
=
self
.
uuid
msg
.
id
=
self
.
id
msg
.
event
=
self
.
event
msg
.
data
=
self
.
data
msg
.
isSelf
=
self
.
is_self
msg
.
isDone
=
self
.
is_done
print
(
"DB READ--
\(
msg
)
"
)
if
let
jsonData
=
self
.
data
.
data
(
using
:
.
utf8
)
{
do
{
let
jsonDict
=
try
JSONSerialization
.
jsonObject
(
with
:
jsonData
,
options
:
[])
as?
[
String
:
Any
]
let
dic
=
(
jsonDict
??
[:])
msg
.
dataDict
=
dic
if
let
body
=
YHAIMessageBody
.
deserialize
(
from
:
dic
)
{
msg
.
body
=
body
}
}
catch
{
}
}
return
msg
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/TTPS(高才)/ServiceProcess(我的信息流程)/Education&Qualification(学历专业资格填写)/C/YHGCEducationDetailVC.swift
0 → 100644
View file @
d5d3eee0
//
// YHGCEducationDetailVC.swift
// galaxy
//
// Created by Dufet on 2024/12/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
import
SwifterSwift
//import Toast_Swift
class
YHGCEducationDetailVC
:
YHBaseViewController
{
//【WARNING!】新添加 传orderId 已有信息传detailId和orderId
// 订单ID
var
orderId
:
Int
=
0
// 学历ID
var
detailId
:
Int
=
0
// 是否显示未填写错误提示
var
isNeedShowError
=
false
let
educationRequest
:
YHEducationRequestViewModel
=
YHEducationRequestViewModel
()
var
detailInfo
:
YHEducationDetailInfo
=
YHEducationDetailInfo
()
var
items
:[[
YHFormItemProtocol
]]
=
[]
lazy
var
tableView
:
UITableView
=
{
let
tableView
=
UITableView
(
frame
:
.
zero
,
style
:
.
grouped
)
if
#available(iOS 11.0, *)
{
tableView
.
contentInsetAdjustmentBehavior
=
.
never
}
tableView
.
estimatedSectionHeaderHeight
=
14.0
tableView
.
estimatedSectionFooterHeight
=
1.0
tableView
.
showsVerticalScrollIndicator
=
false
tableView
.
backgroundColor
=
UIColor
(
hexString
:
"#F8F8F8"
)
tableView
.
separatorStyle
=
.
none
tableView
.
delegate
=
self
tableView
.
dataSource
=
self
tableView
.
register
(
UITableViewCell
.
self
,
forCellReuseIdentifier
:
"UITableViewCell"
)
tableView
.
register
(
YHFormItemTitleCell
.
self
,
forCellReuseIdentifier
:
YHFormItemTitleCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemAddCell
.
self
,
forCellReuseIdentifier
:
YHFormItemAddCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemInputTextCell
.
self
,
forCellReuseIdentifier
:
YHFormItemInputTextCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemSelectSheetCell
.
self
,
forCellReuseIdentifier
:
YHFormItemSelectSheetCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHEducationCertificateConfirmCell
.
self
,
forCellReuseIdentifier
:
YHEducationCertificateConfirmCell
.
cellReuseIdentifier
)
return
tableView
}()
var
bottomView
:
YHSaveAndSubmitView
=
{
let
view
=
YHSaveAndSubmitView
.
createView
()
return
view
}()
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
self
.
gk_navTitle
=
"学历"
.
local
self
.
gk_navigationBar
.
backgroundColor
=
.
white
view
.
backgroundColor
=
UIColor
(
hexString
:
"#F8F8F8"
)
createUI
()
}
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
super
.
viewWillAppear
(
animated
)
}
func
createUI
()
{
view
.
addSubview
(
tableView
);
view
.
addSubview
(
bottomView
)
bottomView
.
saveBlock
=
{
[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
saveDetailInfo
(
isSubmit
:
false
,
isNeedPop
:
true
,
isShowToast
:
true
)
}
bottomView
.
submitBlock
=
{
[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
submitInfo
()
}
bottomView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
equalToSuperview
()
make
.
bottom
.
equalToSuperview
()
make
.
height
.
equalTo
(
YHSaveAndSubmitView
.
height
)
}
tableView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalToSuperview
()
.
offset
(
k_Height_NavigationtBarAndStatuBar
)
make
.
bottom
.
equalTo
(
bottomView
.
snp
.
top
)
make
.
left
.
equalToSuperview
()
.
offset
(
16
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
16
)
}
loadInfo
()
if
self
.
detailId
!=
0
{
// 有学历ID则该学历已存在
getDetailInfo
()
}
}
func
loadInfo
()
{
items
.
removeAll
()
let
title0
=
YHFormTitleItem
(
type
:
.
mainApplicantEducation
)
let
item00
=
YHFormDetailItem
(
type
:
.
universityFullName
)
if
detailInfo
.
degree
.
contains
(
"学士学位"
)
{
item00
.
tips
=
"请输入学校全称"
.
local
item00
.
placeHolder
=
"请输入学校全称,例:清华,需填全称“清华大学”"
.
local
}
else
{
item00
.
tips
=
"请选择学校"
.
local
item00
.
placeHolder
=
"请选择学校"
}
item00
.
value
=
detailInfo
.
college
let
item01
=
YHFormDetailItem
(
type
:
.
educationStyle
)
item01
.
tips
=
"请选择授课形式"
.
local
item01
.
placeHolder
=
"请选择授课形式"
item01
.
value
=
detailInfo
.
teachingFormat
let
item02
=
YHFormDetailItem
(
type
:
.
educationTime
)
item02
.
tips
=
"请选择年月"
.
local
item02
.
placeHolder
=
"请选择年月"
.
local
item02
.
value
=
detailInfo
.
admissionTime
let
item03
=
YHFormDetailItem
(
type
:
.
graduateTime
)
item03
.
tips
=
"请选择年月"
.
local
item03
.
placeHolder
=
"请选择年月"
.
local
item03
.
value
=
detailInfo
.
graduateTime
let
item04
=
YHFormDetailItem
(
type
:
.
educationMajor
)
item04
.
tips
=
"请选择专业"
.
local
item04
.
placeHolder
=
"请选择专业"
.
local
item04
.
value
=
detailInfo
.
major
let
item05
=
YHFormDetailItem
(
type
:
.
educationDegree
)
item05
.
tips
=
"请选择学位"
.
local
item05
.
placeHolder
=
"请选择学位"
.
local
item05
.
value
=
detailInfo
.
degree
let
item06
=
YHFormDetailItem
(
type
:
.
degreeType
)
item06
.
tips
=
"请选择学位类型"
.
local
item06
.
value
=
detailInfo
.
degreeType
let
item07
=
YHFormDetailItem
(
type
:
.
educationCountry
)
item07
.
tips
=
"请选择国家及地区"
.
local
item07
.
placeHolder
=
"请选择国家及地区"
.
local
item07
.
value
=
detailInfo
.
schoolAddress
.
country
let
item08
=
YHFormDetailItem
(
type
:
.
educationCity
)
if
detailInfo
.
isSchoolInAboard
()
{
item08
.
value
=
detailInfo
.
schoolAddress
.
foreign
item08
.
tips
=
"请输入城市"
.
local
}
else
{
item08
.
value
=
detailInfo
.
schoolAddress
.
area
.
joined
(
separator
:
","
)
item08
.
tips
=
"请选择城市"
.
local
}
let
arr0
:[
YHFormItemProtocol
]
=
[
title0
,
item05
,
item00
,
item01
,
item02
,
item03
,
item04
,
item07
]
items
.
append
(
arr0
)
let
item10
=
YHFormDetailItem
(
type
:
.
cerConfirm
)
let
arr1
:[
YHFormItemProtocol
]
=
[
item10
]
items
.
append
(
arr1
)
self
.
tableView
.
reloadData
()
}
}
extension
YHGCEducationDetailVC
:
UITableViewDelegate
,
UITableViewDataSource
{
func
numberOfSections
(
in
tableView
:
UITableView
)
->
Int
{
return
items
.
count
}
func
tableView
(
_
tableView
:
UITableView
,
numberOfRowsInSection
section
:
Int
)
->
Int
{
if
section
>=
items
.
count
{
return
0
}
let
arr
=
items
[
section
]
return
arr
.
count
}
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
if
indexPath
.
section
>=
items
.
count
{
return
createDefaultCell
(
indexPath
)
}
let
arr
:[
YHFormItemProtocol
]
=
items
[
indexPath
.
section
]
if
indexPath
.
row
>=
arr
.
count
{
return
createDefaultCell
(
indexPath
)
}
let
item
:
YHFormItemProtocol
=
arr
[
indexPath
.
row
]
if
item
is
YHFormTitleItem
{
// 是标题
let
formItem
=
item
as!
YHFormTitleItem
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemTitleCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemTitleCell
cell
.
setTitleAndSubTitle
(
title
:
formItem
.
getTitle
())
return
cell
}
if
item
is
YHFormDetailItem
{
let
detailItem
=
item
as!
YHFormDetailItem
let
cellType
=
getCellType
(
detailItem
)
if
cellType
==
.
inputText
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemInputTextCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemInputTextCell
var
isValueValid
=
false
if
let
value
=
detailItem
.
value
,
!
value
.
isEmpty
{
isValueValid
=
true
}
cell
.
setTips
(
detailItem
.
tips
,
isShow
:
(
isNeedShowError
&&
!
isValueValid
))
cell
.
placeHolder
=
detailItem
.
placeHolder
cell
.
isMust
=
detailItem
.
isNeed
cell
.
title
=
detailItem
.
getTitle
()
cell
.
text
=
detailItem
.
value
cell
.
textInputCondtion
=
{
textField
in
var
max
=
-
1
if
detailItem
.
type
==
.
educationMajor
{
max
=
50
}
else
if
detailItem
.
type
==
.
educationCity
{
max
=
100
}
if
max
>
0
{
if
let
textStr
=
textField
.
text
{
textField
.
text
=
(
textStr
.
count
>
max
?
textStr
[
safe
:
..<
max
]
:
textStr
)
}
}
return
true
}
cell
.
textChange
=
{
[
weak
self
]
(
text
,
isEditEnd
)
in
guard
let
self
=
self
else
{
return
}
// 只有国外城市才需输入,国内城市使用的是选择器
if
detailItem
.
type
==
.
educationCity
{
if
let
text
=
text
,
!
text
.
isEmpty
{
detailInfo
.
schoolAddress
.
foreign
=
text
}
else
{
detailInfo
.
schoolAddress
.
foreign
=
""
}
}
else
if
detailItem
.
type
==
.
educationMajor
{
if
let
text
=
text
,
!
text
.
isEmpty
{
detailInfo
.
major
=
text
}
else
{
detailInfo
.
major
=
""
}
}
else
if
detailItem
.
type
==
.
universityFullName
{
if
let
text
=
text
,
!
text
.
isEmpty
{
detailInfo
.
college
=
text
}
else
{
detailInfo
.
college
=
""
}
}
if
isEditEnd
{
loadInfo
()
saveInfoSilent
()
}
}
return
cell
}
else
if
cellType
==
.
selectSheet
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemSelectSheetCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemSelectSheetCell
cell
.
isShowTipsButton
=
(
detailItem
.
type
==
.
degreeType
)
cell
.
tipsBtnClickBlock
=
{
YHWholeScreenTipsView
.
show
(
type
:
.
degreeType
,
targetView
:
cell
.
tipsButton
)
}
cell
.
placeHolder
=
detailItem
.
placeHolder
cell
.
isMust
=
detailItem
.
isNeed
cell
.
title
=
detailItem
.
getTitle
()
cell
.
detail
=
detailItem
.
value
var
isValueValid
=
false
if
let
value
=
detailItem
.
value
,
!
value
.
isEmpty
{
isValueValid
=
true
}
cell
.
setTips
(
detailItem
.
tips
,
isShow
:
(
isNeedShowError
&&
!
isValueValid
))
return
cell
}
else
if
cellType
==
.
cerConfirm
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHEducationCertificateConfirmCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHEducationCertificateConfirmCell
cell
.
isCheck
=
isNeedShowError
var
isSelectTrue
=
false
var
isSelectFalse
=
false
let
isCerConfirm
=
detailInfo
.
certConfirm
if
isCerConfirm
==
1
{
isSelectTrue
=
true
isSelectFalse
=
false
}
else
if
isCerConfirm
==
2
{
isSelectFalse
=
true
isSelectTrue
=
false
}
let
answers
=
[
YHFormChoiceItem
(
title
:
"是"
.
local
,
isSelect
:
isSelectTrue
),
YHFormChoiceItem
(
title
:
"否"
.
local
,
isSelect
:
isSelectFalse
)]
cell
.
answerArr
=
answers
cell
.
answerBlock
=
{
[
weak
self
]
(
arr
,
selectIndex
)
in
guard
let
self
=
self
else
{
return
}
let
selectItem
:
YHFormChoiceItem
=
arr
[
selectIndex
]
let
option
=
(
selectItem
.
title
==
"是"
.
local
?
true
:
false
)
detailInfo
.
certConfirm
=
option
?
1
:
2
self
.
tableView
.
reloadData
()
}
return
cell
}
}
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"UITableViewCell"
,
for
:
indexPath
)
return
cell
}
func
tableView
(
_
tableView
:
UITableView
,
willDisplay
cell
:
UITableViewCell
,
forRowAt
indexPath
:
IndexPath
)
{
if
indexPath
.
section
>=
items
.
count
{
return
}
let
arr
:[
YHFormItemProtocol
]
=
items
[
indexPath
.
section
]
if
indexPath
.
row
>=
arr
.
count
{
return
}
createCorner
(
cell
:
cell
,
arr
:
arr
,
indexPath
:
indexPath
)
}
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
return
UITableView
.
automaticDimension
}
func
tableView
(
_
tableView
:
UITableView
,
viewForHeaderInSection
section
:
Int
)
->
UIView
?
{
return
UIView
()
}
private
func
tableView
(
_
tableView
:
UITableView
,
viewForHeaderInSection
section
:
Int
)
->
CGFloat
{
return
14.0
}
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
let
arr
=
items
[
indexPath
.
section
]
let
item
:
YHFormItemProtocol
=
arr
[
indexPath
.
row
]
// 标题
if
item
is
YHFormTitleItem
{
return
}
if
item
is
YHFormDetailItem
{
let
detailItem
=
item
as!
YHFormDetailItem
if
detailItem
.
type
==
.
universityFullName
{
// 选择大学名称
if
detailInfo
.
degree
.
contains
(
"学士学位"
)
{
// 此时学位是输入
return
}
let
vc
=
YHCollegeSearchViewController
()
vc
.
orderId
=
self
.
orderId
vc
.
searchCollegeName
=
detailInfo
.
college
vc
.
selectBlock
=
{
[
weak
self
]
text
in
guard
let
self
=
self
else
{
return
}
if
let
text
=
text
,
!
text
.
isEmpty
{
detailInfo
.
college
=
text
}
else
{
detailInfo
.
college
=
""
}
loadInfo
()
saveInfoSilent
()
}
self
.
navigationController
?
.
pushViewController
(
vc
)
}
else
if
detailItem
.
type
==
.
educationStyle
{
// 授课形式
YHSheetPickerView
.
show
(
type
:
.
educationStyle
,
selectTitle
:
detailInfo
.
teachingFormat
)
{
[
weak
self
]
item
in
guard
let
self
=
self
else
{
return
}
detailInfo
.
teachingFormat
=
item
.
title
loadInfo
()
saveInfoSilent
()
}
}
else
if
detailItem
.
type
==
.
educationTime
||
detailItem
.
type
==
.
graduateTime
{
// 入学及毕业年月
var
title
=
""
var
dateStr
=
""
if
detailItem
.
type
==
.
educationTime
{
title
=
"选择入学日期"
dateStr
=
detailInfo
.
admissionTime
}
else
if
detailItem
.
type
==
.
graduateTime
{
title
=
"选择毕业日期"
dateStr
=
detailInfo
.
graduateTime
}
YHDatePickView
.
show
(
type
:
.
yyyymm
,
title
:
title
,
lastIsTaday
:
true
,
currentDay
:
dateStr
)
{
[
weak
self
]
dateStr
in
guard
let
self
=
self
else
{
return
}
let
format
=
DateFormatter
()
format
.
dateFormat
=
"yyyy-MM"
if
let
selectDate
=
format
.
date
(
from
:
dateStr
)
{
let
selectTimeInterval
=
selectDate
.
timeIntervalSince1970
let
currentTimeInterval
=
Date
()
.
timeIntervalSince1970
if
detailItem
.
type
==
.
educationTime
{
// 选择入学日期
// 入学日期须早于当前日期
if
selectTimeInterval
>
currentTimeInterval
{
YHHUD
.
flash
(
message
:
"入学日期不能晚于当前日期"
)
return
}
if
!
detailInfo
.
graduateTime
.
isEmpty
,
let
endDate
=
format
.
date
(
from
:
detailInfo
.
graduateTime
)
{
let
endTimeInterval
=
endDate
.
timeIntervalSince1970
if
selectTimeInterval
>
endTimeInterval
{
YHHUD
.
flash
(
message
:
"入学日期不能晚于毕业日期"
)
return
}
}
detailInfo
.
admissionTime
=
dateStr
}
if
detailItem
.
type
==
.
graduateTime
{
// 选择毕业日期
if
!
detailInfo
.
admissionTime
.
isEmpty
,
let
startDate
=
format
.
date
(
from
:
detailInfo
.
admissionTime
)
{
let
startTimeInterval
=
startDate
.
timeIntervalSince1970
if
selectTimeInterval
<
startTimeInterval
{
YHHUD
.
flash
(
message
:
"毕业日期不能早于入学日期"
)
return
}
}
detailInfo
.
graduateTime
=
dateStr
}
}
loadInfo
()
saveInfoSilent
()
}
}
else
if
detailItem
.
type
==
.
educationDegree
{
// 学位
YHSheetPickerView
.
show
(
type
:
.
degree
,
selectTitle
:
detailInfo
.
degree
)
{
[
weak
self
]
item
in
guard
let
self
=
self
else
{
return
}
detailInfo
.
degree
=
item
.
title
loadInfo
()
saveInfoSilent
()
}
}
else
if
detailItem
.
type
==
.
degreeType
{
// 学位类型
YHSheetPickerView
.
show
(
type
:
.
degreeCategory
,
selectTitle
:
"工程学"
)
{
[
weak
self
]
selectItem
in
guard
let
self
=
self
else
{
return
}
detailInfo
.
degreeType
=
selectItem
.
title
loadInfo
()
saveInfoSilent
()
}
}
else
if
detailItem
.
type
==
.
educationCountry
{
// 上课国家/地区
let
vc
=
YHSelectCountryViewController
()
vc
.
backLocationStringController
=
{
[
weak
self
]
country
in
guard
let
self
=
self
else
{
return
}
detailInfo
.
schoolAddress
.
country
=
country
detailInfo
.
isAboardSchool
=
detailInfo
.
isSchoolInAboard
()
loadInfo
()
saveInfoSilent
()
}
self
.
navigationController
?
.
pushViewController
(
vc
)
}
else
if
detailItem
.
type
==
.
educationCity
{
// 上课城市
if
detailInfo
.
isSchoolInAboard
()
{
return
}
let
vc
=
YHAddressViewController
()
vc
.
backLocationStringController
=
{
[
weak
self
]
(
string1
,
string2
,
string3
,
string4
)
in
guard
let
self
=
self
else
{
return
}
var
citys
:[
String
]
=
[]
if
!
isEmptyString
(
string2
)
{
citys
.
append
(
string2
)
}
if
!
isEmptyString
(
string3
)
{
citys
.
append
(
string3
)
}
detailInfo
.
schoolAddress
.
area
=
citys
loadInfo
()
saveInfoSilent
()
}
self
.
present
(
vc
,
animated
:
true
)
}
else
if
detailItem
.
type
==
.
educationMajor
{
// 专业
let
vc
=
YHMajorSearchViewController
()
vc
.
orderId
=
self
.
orderId
vc
.
searchMajorName
=
detailInfo
.
major
vc
.
selectBlock
=
{
[
weak
self
]
text
in
guard
let
self
=
self
else
{
return
}
if
let
text
=
text
,
!
text
.
isEmpty
{
detailInfo
.
major
=
text
}
else
{
detailInfo
.
major
=
""
}
loadInfo
()
saveInfoSilent
()
}
self
.
navigationController
?
.
pushViewController
(
vc
)
}
}
}
func
createDefaultCell
(
_
indexPath
:
IndexPath
)
->
UITableViewCell
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"UITableViewCell"
,
for
:
indexPath
)
return
cell
}
func
createCorner
(
cell
:
UITableViewCell
,
arr
:
Array
<
Any
>
,
indexPath
:
IndexPath
)
{
// 设置每块section圆角
if
indexPath
.
row
==
0
,
indexPath
.
row
==
arr
.
count
-
1
{
let
corner
=
UIRectCorner
(
rawValue
:
UIRectCorner
.
topLeft
.
rawValue
|
UIRectCorner
.
topRight
.
rawValue
|
UIRectCorner
.
bottomLeft
.
rawValue
|
UIRectCorner
.
bottomRight
.
rawValue
)
cell
.
createCorner
(
CGSizeMake
(
12.0
,
12.0
),
corner
)
return
}
if
(
indexPath
.
row
==
0
)
{
let
corner
=
UIRectCorner
(
rawValue
:
UIRectCorner
.
topLeft
.
rawValue
|
UIRectCorner
.
topRight
.
rawValue
)
cell
.
createCorner
(
CGSizeMake
(
12.0
,
12.0
),
corner
)
return
}
if
(
indexPath
.
row
==
arr
.
count
-
1
)
{
let
corner
=
UIRectCorner
(
rawValue
:
UIRectCorner
.
bottomLeft
.
rawValue
|
UIRectCorner
.
bottomRight
.
rawValue
)
cell
.
createCorner
(
CGSizeMake
(
12.0
,
12.0
),
corner
)
return
}
cell
.
layer
.
mask
=
nil
}
func
getCellType
(
_
item
:
Any
)
->
HKFormItemCellType
{
if
item
is
YHFormTitleItem
{
return
.
title
}
if
item
is
YHFormDetailItem
{
let
detailItem
=
item
as!
YHFormDetailItem
if
detailItem
.
type
==
.
cerConfirm
{
return
.
cerConfirm
}
// 学位选择:学士学位,
// 学习全称:直接输入学校名称,不需要进入搜索页面
//
// 学位选择:硕士学位/博士学位,
// 学习全称:需要进入名校库搜索页面,模糊搜索名校,若搜不到直接输入
if
detailItem
.
type
==
.
universityFullName
{
// 学校全称
if
detailInfo
.
degree
.
contains
(
"学士学位"
)
{
return
.
inputText
}
return
.
selectSheet
}
if
detailItem
.
type
==
.
educationCity
{
if
detailInfo
.
isSchoolInAboard
()
{
return
.
inputText
}
return
.
selectSheet
}
if
detailItem
.
type
==
.
educationMajor
||
detailItem
.
type
==
.
educationStyle
||
detailItem
.
type
==
.
educationTime
||
detailItem
.
type
==
.
graduateTime
||
detailItem
.
type
==
.
educationDegree
||
detailItem
.
type
==
.
degreeType
||
detailItem
.
type
==
.
educationCountry
{
return
.
selectSheet
}
}
return
.
defaultType
}
}
extension
YHGCEducationDetailVC
{
func
getDetailInfo
()
{
self
.
educationRequest
.
getEducationDetailInfo
(
params
:
[
"id"
:
self
.
detailId
])
{
[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
if
success
{
if
let
educationDetailInfo
=
self
.
educationRequest
.
educationDetailInfo
{
detailInfo
=
educationDetailInfo
}
loadInfo
()
}
}
}
func
submitInfo
()
{
let
isChecked
=
checkIntegrity
()
isNeedShowError
=
!
isChecked
self
.
tableView
.
reloadData
()
if
!
isChecked
{
YHHUD
.
flash
(
message
:
"资料还未填完"
)
return
}
saveDetailInfo
(
isSubmit
:
true
,
isNeedPop
:
true
,
isShowToast
:
true
)
}
// 检查填写信息完整性
func
checkIntegrity
()
->
Bool
{
if
detailInfo
.
college
.
isEmpty
||
detailInfo
.
teachingFormat
.
isEmpty
||
detailInfo
.
admissionTime
.
isEmpty
||
detailInfo
.
graduateTime
.
isEmpty
||
detailInfo
.
major
.
isEmpty
||
detailInfo
.
degree
.
isEmpty
||
detailInfo
.
schoolAddress
.
country
.
isEmpty
{
return
false
}
if
detailInfo
.
certConfirm
==
0
{
// 证件提供确认
return
false
}
// if detailInfo.isSchoolInAboard(), detailInfo.schoolAddress.foreign.isEmpty {
// return false
// }
// if !detailInfo.isSchoolInAboard(), detailInfo.schoolAddress.area.count <= 0 {
// return false
// }
return
true
}
func
saveInfoSilent
()
{
if
detailId
!=
0
{
saveDetailInfo
(
isSubmit
:
false
,
isNeedPop
:
false
,
isShowToast
:
false
)
}
}
// 保存信息 isNeedPop:保存成功后是否退出该页面
func
saveDetailInfo
(
isSubmit
:
Bool
,
isNeedPop
:
Bool
,
isShowToast
:
Bool
)
{
guard
var
dict
:[
String
:
Any
]
=
detailInfo
.
toDictionary
()
else
{
return
}
dict
[
"order_id"
]
=
self
.
orderId
dict
[
"is_aboard_school"
]
=
detailInfo
.
isSchoolInAboard
()
self
.
educationRequest
.
saveEducationInfo
(
params
:
dict
,
isSilent
:
!
isShowToast
)
{
[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
if
success
{
if
isShowToast
{
YHHUD
.
flash
(
message
:
isSubmit
?
"提交成功"
:
"保存成功"
)
}
if
isNeedPop
{
self
.
navigationController
?
.
popViewController
(
animated
:
true
)
}
}
else
{
if
isShowToast
{
var
errorMsg
=
isSubmit
?
"提交失败"
:
"保存失败"
if
let
errMsg
=
error
?
.
errorMsg
,
errMsg
.
count
>
0
{
errorMsg
=
errMsg
}
YHHUD
.
flash
(
message
:
errorMsg
)
}
}
}
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/TTPS(高才)/ServiceProcess(我的信息流程)/Education&Qualification(学历专业资格填写)/C/YHGCEducationInfoListVC.swift
0 → 100644
View file @
d5d3eee0
//
// YHGCEducationInfoListVC.swift
// galaxy
//
// Created by Dufet on 2024/12/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
class
YHGCEducationInfoListVC
:
YHBaseViewController
{
var
orderId
:
Int
=
0
let
educationRequest
:
YHEducationRequestViewModel
=
YHEducationRequestViewModel
()
var
familyMemberInfo
:
YHFamilyMemberGroupInfo
?
// 学历编辑模式
var
isDegreeEditMode
:
YHFormTitleItemEditType
=
.
none
// 专业编辑模式
var
isQualificationEditMode
:
YHFormTitleItemEditType
=
.
none
var
educationInfo
:
YHEducationListInfo
?
var
items
:[[
YHFormItemProtocol
]]
=
[]
// 是否显示未填写错误提示
var
isNeedShowError
=
false
lazy
var
tableView
:
UITableView
=
{
let
tableView
=
UITableView
(
frame
:
.
zero
,
style
:
.
grouped
)
if
#available(iOS 11.0, *)
{
tableView
.
contentInsetAdjustmentBehavior
=
.
never
}
tableView
.
estimatedSectionHeaderHeight
=
14.0
tableView
.
estimatedSectionFooterHeight
=
1.0
tableView
.
showsVerticalScrollIndicator
=
false
tableView
.
backgroundColor
=
UIColor
(
hexString
:
"#F8F8F8"
)
tableView
.
separatorStyle
=
.
none
tableView
.
delegate
=
self
tableView
.
dataSource
=
self
tableView
.
register
(
UITableViewCell
.
self
,
forCellReuseIdentifier
:
"UITableViewCell"
)
tableView
.
register
(
YHEducationInfoCell
.
self
,
forCellReuseIdentifier
:
YHEducationInfoCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemTitleCell
.
self
,
forCellReuseIdentifier
:
YHFormItemTitleCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemAddCell
.
self
,
forCellReuseIdentifier
:
YHFormItemAddCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemEnterDetailCell
.
self
,
forCellReuseIdentifier
:
YHFormItemEnterDetailCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemAddCell
.
self
,
forCellReuseIdentifier
:
YHFormItemAddCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemQuestionsCell
.
self
,
forCellReuseIdentifier
:
YHFormItemQuestionsCell
.
cellReuseIdentifier
)
return
tableView
}()
var
bottomView
:
YHSaveAndSubmitView
=
{
let
view
=
YHSaveAndSubmitView
.
createView
()
return
view
}()
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
self
.
gk_navTitle
=
"学历/专业资格填写"
.
local
self
.
gk_navigationBar
.
backgroundColor
=
.
white
view
.
backgroundColor
=
UIColor
(
hexString
:
"#F8F8F8"
)
createUI
()
}
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
super
.
viewWillAppear
(
animated
)
requestEducationInfo
()
}
func
createUI
()
{
view
.
addSubview
(
tableView
);
view
.
addSubview
(
bottomView
)
bottomView
.
saveBlock
=
{
[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
saveInfo
(
isSubmit
:
false
)
self
.
navigationController
?
.
popViewController
(
animated
:
true
)
}
bottomView
.
submitBlock
=
{
[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
submitInfo
()
}
bottomView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
equalToSuperview
()
make
.
bottom
.
equalToSuperview
()
make
.
height
.
equalTo
(
YHSaveAndSubmitView
.
height
)
}
tableView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalToSuperview
()
.
offset
(
k_Height_NavigationtBarAndStatuBar
)
make
.
bottom
.
equalTo
(
bottomView
.
snp
.
top
)
make
.
left
.
equalToSuperview
()
.
offset
(
16
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
16
)
}
loadInfo
()
}
func
loadInfo
()
{
guard
let
educationInfo
=
educationInfo
else
{
return
}
items
.
removeAll
()
// 主申请人学历
let
title0
=
YHFormTitleItem
(
type
:
.
mainApplicantEducation
)
var
arr0
:[
YHFormItemProtocol
]
=
[
title0
]
if
let
eduList
=
educationInfo
.
eduList
{
for
(
index
,
eduInfo
)
in
eduList
.
enumerated
()
{
let
item
=
YHFormDetailItem
(
type
:
.
educationInfo
)
arr0
.
append
(
item
)
}
// 多学历可编辑删除状态
if
eduList
.
count
<=
1
{
isDegreeEditMode
=
.
none
}
else
{
if
isDegreeEditMode
==
.
none
{
isDegreeEditMode
=
.
canEdit
}
}
}
else
{
isDegreeEditMode
=
.
none
}
// 新增学历信息
arr0
.
append
(
YHFormAddItem
(
type
:
.
addEducation
))
items
.
append
(
arr0
)
// 主申请人专业资格及会员资格
let
title1
=
YHFormTitleItem
(
type
:
.
mainApplicantProfessionalQualification
)
var
arr1
:[
YHFormItemProtocol
]
=
[
title1
]
if
let
quaList
=
educationInfo
.
quaList
{
for
(
index
,
quaInfo
)
in
quaList
.
enumerated
()
{
let
item
=
YHFormDetailItem
(
type
:
.
certificateInfo
)
arr1
.
append
(
item
)
}
// 多专业可编辑删除状态
if
quaList
.
count
<=
0
{
isQualificationEditMode
=
.
none
}
else
{
if
isQualificationEditMode
==
.
none
{
isQualificationEditMode
=
.
canEdit
}
}
}
else
{
isQualificationEditMode
=
.
none
}
// 新增学历信息
arr1
.
append
(
YHFormAddItem
(
type
:
.
addCertificateInfo
))
items
.
append
(
arr1
)
// 学历证书姓名及出生日期正确性
let
title2
=
YHFormTitleItem
(
type
:
.
edutionalCertificateNameAndBirthday
)
var
arr2
:[
YHFormItemProtocol
]
=
[
title2
]
// 问题集合
let
questions
=
YHQuestionInfo
.
getEducationQuestion
(
eduList
:
educationInfo
)
for
questionInfo
in
questions
{
if
questionInfo
.
key
==
"qualification"
{
questionInfo
.
answer
=
educationInfo
.
isNameSame
arr2
.
append
(
questionInfo
)
}
else
if
questionInfo
.
key
==
"graduate"
{
questionInfo
.
answer
=
educationInfo
.
isSpouseNameSame
}
}
items
.
append
(
arr2
)
self
.
tableView
.
reloadData
()
}
}
extension
YHGCEducationInfoListVC
:
UITableViewDelegate
,
UITableViewDataSource
{
func
numberOfSections
(
in
tableView
:
UITableView
)
->
Int
{
return
items
.
count
}
func
tableView
(
_
tableView
:
UITableView
,
numberOfRowsInSection
section
:
Int
)
->
Int
{
if
section
>=
items
.
count
{
return
0
}
let
arr
=
items
[
section
]
return
arr
.
count
}
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
if
indexPath
.
section
>=
items
.
count
{
return
createDefaultCell
(
indexPath
)
}
let
arr
:[
YHFormItemProtocol
]
=
items
[
indexPath
.
section
]
if
indexPath
.
row
>=
arr
.
count
{
return
createDefaultCell
(
indexPath
)
}
let
item
:
YHFormItemProtocol
=
arr
[
indexPath
.
row
]
if
item
is
YHFormTitleItem
{
// 是标题
let
formItem
=
item
as!
YHFormTitleItem
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemTitleCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemTitleCell
let
isNeedWrap
=
(
formItem
.
type
==
.
mainApplicantProfessionalQualification
)
cell
.
setTitleAndSubTitle
(
title
:
formItem
.
getTitle
(),
subTitle
:
formItem
.
getSubTitle
(),
isNeedWrap
:
isNeedWrap
)
// 决定右边按钮显示样式
cell
.
showEditType
(
type
:
.
none
)
if
formItem
.
type
==
.
mainApplicantEducation
{
// 学历
cell
.
showEditType
(
type
:
isDegreeEditMode
)
}
else
if
formItem
.
type
==
.
mainApplicantProfessionalQualification
{
// 专业
cell
.
showEditType
(
type
:
isQualificationEditMode
)
}
// 右边按钮点击事件处理
cell
.
rightClickBlock
=
{
[
weak
self
]
type
in
guard
let
self
=
self
else
{
return
}
if
formItem
.
type
==
.
mainApplicantEducation
{
// 学历
if
self
.
isDegreeEditMode
==
.
canCancel
{
self
.
isDegreeEditMode
=
.
canEdit
}
else
if
self
.
isDegreeEditMode
==
.
canEdit
{
self
.
isDegreeEditMode
=
.
canCancel
}
}
if
formItem
.
type
==
.
mainApplicantProfessionalQualification
{
// 专业
if
self
.
isQualificationEditMode
==
.
canCancel
{
self
.
isQualificationEditMode
=
.
canEdit
}
else
if
self
.
isQualificationEditMode
==
.
canEdit
{
self
.
isQualificationEditMode
=
.
canCancel
}
}
loadInfo
()
}
return
cell
}
if
item
is
YHFormAddItem
{
let
detailItem
=
item
as!
YHFormAddItem
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemAddCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemAddCell
if
detailItem
.
type
==
.
addEducation
{
cell
.
title
=
"新增学历信息"
}
else
if
detailItem
.
type
==
.
addCertificateInfo
{
cell
.
title
=
"新增证书信息"
}
else
{
cell
.
title
=
""
}
cell
.
clickBlock
=
{
[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
if
detailItem
.
type
==
.
addEducation
{
// 学历
let
vc
=
YHEducationDetailVC
()
vc
.
orderId
=
self
.
orderId
self
.
navigationController
?
.
pushViewController
(
vc
)
}
else
if
detailItem
.
type
==
.
addCertificateInfo
{
// 证书
let
vc
=
YHQualificationDetailVC
()
vc
.
orderId
=
self
.
orderId
self
.
navigationController
?
.
pushViewController
(
vc
)
}
return
}
return
cell
}
if
item
is
YHQuestionInfo
{
let
detailItem
=
item
as!
YHQuestionInfo
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemQuestionsCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemQuestionsCell
cell
.
isMust
=
true
cell
.
title
=
String
(
format
:
"%d、
\(
detailItem
.
question
)
"
,
indexPath
.
row
)
var
select0
=
false
var
select1
=
false
if
let
answer
=
detailItem
.
answer
{
select0
=
answer
select1
=
!
answer
}
let
answers
=
[
YHFormChoiceItem
(
title
:
"是"
.
local
,
isSelect
:
select0
),
YHFormChoiceItem
(
title
:
"否"
.
local
,
isSelect
:
select1
)]
cell
.
answerArr
=
answers
cell
.
answerBlock
=
{
[
weak
self
]
(
arr
,
selectIndex
)
in
guard
let
self
=
self
else
{
return
}
let
selectItem
:
YHFormChoiceItem
=
arr
[
selectIndex
]
let
option
=
(
selectItem
.
title
==
"是"
.
local
?
true
:
false
)
if
detailItem
.
key
==
"qualification"
{
self
.
educationInfo
?
.
isNameSame
=
option
}
else
if
detailItem
.
key
==
"graduate"
{
self
.
educationInfo
?
.
isSpouseNameSame
=
option
}
loadInfo
()
}
return
cell
}
if
item
is
YHFormDetailItem
{
let
detailItem
=
item
as!
YHFormDetailItem
if
detailItem
.
type
==
.
educationInfo
{
if
let
eduList
=
educationInfo
?
.
eduList
,
eduList
.
count
>
0
{
// 第一行是标题
let
eduInfo
:
YHEducationInfo
=
eduList
[
indexPath
.
row
-
1
]
if
eduInfo
.
vacantNum
>
0
{
// 有未填项
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemEnterDetailCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemEnterDetailCell
if
let
college
=
eduInfo
.
college
,
!
college
.
isEmpty
{
cell
.
title
=
eduInfo
.
college
}
else
{
cell
.
title
=
"学历标题"
.
local
}
let
tips
=
String
(
format
:
"有%d项未填"
,
eduInfo
.
vacantNum
)
cell
.
detailLabel
.
text
=
tips
cell
.
isShowDeleteBtn
=
(
isDegreeEditMode
==
.
canCancel
&&
eduList
.
count
>
1
)
cell
.
setTips
(
tips
,
isShow
:(
isNeedShowError
&&
eduInfo
.
vacantNum
>
0
))
cell
.
deleteBlock
=
{
var
title
=
"确定删除该学历吗?"
if
let
collegeName
=
eduInfo
.
college
,
!
collegeName
.
isEmpty
{
title
=
"确定删除学历
\(
collegeName
)
吗"
}
YHTwoOptionAlertView
.
showAlertView
(
message
:
title
)
{
[
weak
self
]
sure
in
guard
let
self
=
self
else
{
return
}
if
!
sure
{
return
}
isDegreeEditMode
=
.
none
deleteEducationInfo
(
id
:
eduInfo
.
id
)
}
}
return
cell
}
else
{
// 数据已填满
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHEducationInfoCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHEducationInfoCell
cell
.
titleLabel
.
text
=
eduInfo
.
college
cell
.
subTitleLabel
.
text
=
""
if
let
major
=
eduInfo
.
major
,
let
degree
=
eduInfo
.
degree
{
cell
.
subTitleLabel
.
text
=
String
(
"
\(
degree
)
-
\(
major
)
"
)
}
cell
.
timeLabel
.
text
=
""
if
let
admissionTime
=
eduInfo
.
admissionTime
,
let
graduateTime
=
eduInfo
.
graduateTime
{
cell
.
timeLabel
.
text
=
String
(
"
\(
admissionTime
)
~
\(
graduateTime
)
"
)
}
cell
.
isShowDeleteBtn
=
(
isDegreeEditMode
==
.
canCancel
)
cell
.
deleteBlock
=
{
var
title
=
"确定删除该学历吗?"
if
let
collegeName
=
eduInfo
.
college
,
!
collegeName
.
isEmpty
{
title
=
"确定删除学历
\(
collegeName
)
吗"
}
YHTwoOptionAlertView
.
showAlertView
(
message
:
title
)
{
[
weak
self
]
sure
in
guard
let
self
=
self
else
{
return
}
if
!
sure
{
return
}
isDegreeEditMode
=
.
none
deleteEducationInfo
(
id
:
eduInfo
.
id
)
}
}
return
cell
}
}
}
if
detailItem
.
type
==
.
certificateInfo
{
if
let
quaList
=
educationInfo
?
.
quaList
,
quaList
.
count
>
0
{
// 第一行是标题
let
quaInfo
:
YHQualificationInfo
=
quaList
[
indexPath
.
row
-
1
]
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemEnterDetailCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemEnterDetailCell
cell
.
title
=
"证书标题"
if
let
qualification
=
quaInfo
.
qualification
,
!
qualification
.
isEmpty
{
cell
.
title
=
qualification
}
var
tips
=
""
if
quaInfo
.
vacantNum
>
0
{
tips
=
String
(
format
:
"有%d项未填"
,
quaInfo
.
vacantNum
)
cell
.
detailLabel
.
text
=
tips
}
else
{
cell
.
detailLabel
.
text
=
"已填完"
.
local
}
cell
.
setTips
(
tips
,
isShow
:(
isNeedShowError
&&
quaInfo
.
vacantNum
>
0
))
cell
.
isShowDeleteBtn
=
(
isQualificationEditMode
==
.
canCancel
)
cell
.
deleteBlock
=
{
var
title
=
"确定要删除该证书吗?"
if
let
qualification
=
quaInfo
.
qualification
,
!
qualification
.
isEmpty
{
title
=
"确定删除证书
\(
qualification
)
吗"
}
YHTwoOptionAlertView
.
showAlertView
(
message
:
title
)
{
[
weak
self
]
sure
in
guard
let
self
=
self
else
{
return
}
if
!
sure
{
return
}
isQualificationEditMode
=
.
none
deleteQualificationInfo
(
id
:
quaInfo
.
id
)
}
}
return
cell
}
}
}
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"UITableViewCell"
,
for
:
indexPath
)
return
cell
}
func
tableView
(
_
tableView
:
UITableView
,
willDisplay
cell
:
UITableViewCell
,
forRowAt
indexPath
:
IndexPath
)
{
if
indexPath
.
section
>=
items
.
count
{
return
}
let
arr
:[
YHFormItemProtocol
]
=
items
[
indexPath
.
section
]
if
indexPath
.
row
>=
arr
.
count
{
return
}
createCorner
(
cell
:
cell
,
arr
:
arr
,
indexPath
:
indexPath
)
}
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
return
UITableView
.
automaticDimension
}
func
tableView
(
_
tableView
:
UITableView
,
viewForFooterInSection
section
:
Int
)
->
UIView
?
{
return
UIView
()
}
func
tableView
(
_
tableView
:
UITableView
,
viewForHeaderInSection
section
:
Int
)
->
UIView
?
{
return
UIView
()
}
private
func
tableView
(
_
tableView
:
UITableView
,
viewForHeaderInSection
section
:
Int
)
->
CGFloat
{
return
14.0
}
private
func
tableView
(
_
tableView
:
UITableView
,
viewForFooterInSection
section
:
Int
)
->
CGFloat
{
if
section
==
items
.
count
-
1
{
return
14.0
}
return
1.0
}
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
let
arr
=
items
[
indexPath
.
section
]
let
item
:
YHFormItemProtocol
=
arr
[
indexPath
.
row
]
// 标题
if
item
is
YHFormTitleItem
{
return
}
if
item
is
YHFormAddItem
{
return
}
if
item
is
YHFormDetailItem
{
let
detailItem
=
item
as!
YHFormDetailItem
if
detailItem
.
type
==
.
educationInfo
{
// 学历
let
vc
=
YHEducationDetailVC
()
if
let
eduList
=
educationInfo
?
.
eduList
,
indexPath
.
row
-
1
<
eduList
.
count
{
let
eduInfo
=
eduList
[
indexPath
.
row
-
1
]
vc
.
detailId
=
eduInfo
.
id
vc
.
orderId
=
self
.
orderId
}
self
.
navigationController
?
.
pushViewController
(
vc
)
return
}
if
detailItem
.
type
==
.
certificateInfo
{
// 证书
let
vc
=
YHQualificationDetailVC
()
if
let
quaList
=
educationInfo
?
.
quaList
,
indexPath
.
row
-
1
<
quaList
.
count
{
let
quaInfo
=
quaList
[
indexPath
.
row
-
1
]
vc
.
detailId
=
quaInfo
.
id
vc
.
orderId
=
self
.
orderId
}
self
.
navigationController
?
.
pushViewController
(
vc
)
return
}
}
}
func
createDefaultCell
(
_
indexPath
:
IndexPath
)
->
UITableViewCell
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"UITableViewCell"
,
for
:
indexPath
)
return
cell
}
func
createCorner
(
cell
:
UITableViewCell
,
arr
:
Array
<
Any
>
,
indexPath
:
IndexPath
)
{
// 设置每块section圆角
if
(
indexPath
.
row
==
0
)
{
let
corner
=
UIRectCorner
(
rawValue
:
UIRectCorner
.
topLeft
.
rawValue
|
UIRectCorner
.
topRight
.
rawValue
)
cell
.
createCorner
(
CGSizeMake
(
12.0
,
12.0
),
corner
)
}
else
if
(
indexPath
.
row
==
arr
.
count
-
1
)
{
let
corner
=
UIRectCorner
(
rawValue
:
UIRectCorner
.
bottomLeft
.
rawValue
|
UIRectCorner
.
bottomRight
.
rawValue
)
cell
.
createCorner
(
CGSizeMake
(
12.0
,
12.0
),
corner
)
}
else
{
cell
.
layer
.
mask
=
nil
}
}
}
extension
YHGCEducationInfoListVC
{
// 请求家庭成员信息
func
requestEducationInfo
()
{
self
.
educationRequest
.
requestEducationInfoList
(
params
:
[
"order_id"
:
self
.
orderId
])
{
[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
if
success
{
educationInfo
=
self
.
educationRequest
.
listInfo
loadInfo
()
}
}
}
// 删除学历信息
func
deleteEducationInfo
(
id
:
Int
)
{
self
.
educationRequest
.
deleteEducationInfo
(
id
:
id
)
{
[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
if
success
{
YHHUD
.
flash
(
message
:
"删除成功"
)
requestEducationInfo
()
}
else
{
var
errorMsg
=
"删除失败"
if
let
errMsg
=
error
?
.
errorMsg
,
errMsg
.
count
>
0
{
errorMsg
=
errMsg
}
YHHUD
.
flash
(
message
:
errorMsg
)
}
}
}
// 删除证书信息
func
deleteQualificationInfo
(
id
:
Int
)
{
self
.
educationRequest
.
deleteQualificationInfo
(
id
:
id
)
{
[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
if
success
{
YHHUD
.
flash
(
message
:
"删除成功"
)
requestEducationInfo
()
}
else
{
var
errorMsg
=
"删除失败"
if
let
errMsg
=
error
?
.
errorMsg
,
errMsg
.
count
>
0
{
errorMsg
=
errMsg
}
YHHUD
.
flash
(
message
:
errorMsg
)
}
}
}
// 保存
func
saveInfo
(
isSubmit
:
Bool
)
{
guard
let
educationInfo
=
educationInfo
else
{
return
}
let
params
:[
String
:
Any
]
=
[
"order_id"
:
self
.
orderId
,
"goNextFlow"
:
isSubmit
,
"isSpouseNameSame"
:
educationInfo
.
isSpouseNameSame
??
false
,
"isNameSame"
:
educationInfo
.
isNameSame
??
false
]
self
.
educationRequest
.
saveAllEducationInfo
(
params
:
params
)
{
[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
if
success
{
requestEducationInfo
()
self
.
navigationController
?
.
popViewController
()
}
else
{
var
errorMsg
=
isSubmit
?
"提交失败"
:
"保存失败"
if
let
errMsg
=
error
?
.
errorMsg
,
errMsg
.
count
>
0
{
errorMsg
=
errMsg
}
YHHUD
.
flash
(
message
:
errorMsg
)
}
}
}
func
submitInfo
()
{
let
isChecked
=
checkIntegrity
()
isNeedShowError
=
!
isChecked
self
.
tableView
.
reloadData
()
if
!
isChecked
{
YHHUD
.
flash
(
message
:
"资料还未填完"
)
return
}
saveInfo
(
isSubmit
:
true
)
}
// 检查填写信息完整性
func
checkIntegrity
()
->
Bool
{
guard
let
educationInfo
=
educationInfo
else
{
return
false
}
// 检查所有学历信息是否有未填项
if
let
eduList
=
educationInfo
.
eduList
,
eduList
.
count
>
0
{
for
eduInfo
in
eduList
{
if
eduInfo
.
vacantNum
>
0
{
return
false
}
}
}
// 检查所有证书信息是否有未填项
if
let
quaList
=
educationInfo
.
quaList
,
quaList
.
count
>
0
{
for
quaInfo
in
quaList
{
if
quaInfo
.
vacantNum
>
0
{
return
false
}
}
}
// 检查所有问题是否有未答项
if
educationInfo
.
isNameSame
==
nil
{
return
false
}
return
true
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/TTPS(高才)/ServiceProcess(我的信息流程)/Education&Qualification(学历专业资格填写)/C/YHGCQualificationDetailVC.swift
0 → 100644
View file @
d5d3eee0
//
// YHGCQualificationDetailVC.swift
// galaxy
//
// Created by Dufet on 2024/12/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
class
YHGCQualificationDetailVC
:
YHBaseViewController
{
//【WARNING!】新添加 传orderId 已有信息传detailId和orderId
// 订单ID
var
orderId
:
Int
=
0
// 专业ID
var
detailId
:
Int
=
0
let
educationRequest
:
YHEducationRequestViewModel
=
YHEducationRequestViewModel
()
// 专业详情信息
var
detailInfo
=
YHQualificationDetailInfo
()
var
isChildsEditMode
:
YHFormTitleItemEditType
=
.
none
var
isBrothersEditMode
:
YHFormTitleItemEditType
=
.
none
// 是否显示未填写错误提示
var
isNeedShowError
=
false
var
items
:[[
YHFormItemProtocol
]]
=
[]
lazy
var
tableView
:
UITableView
=
{
let
tableView
=
UITableView
(
frame
:
.
zero
,
style
:
.
grouped
)
if
#available(iOS 11.0, *)
{
tableView
.
contentInsetAdjustmentBehavior
=
.
never
}
tableView
.
estimatedSectionHeaderHeight
=
14.0
tableView
.
estimatedSectionFooterHeight
=
1.0
tableView
.
showsVerticalScrollIndicator
=
false
tableView
.
backgroundColor
=
UIColor
(
hexString
:
"#F8F8F8"
)
tableView
.
separatorStyle
=
.
none
tableView
.
delegate
=
self
tableView
.
dataSource
=
self
tableView
.
register
(
UITableViewCell
.
self
,
forCellReuseIdentifier
:
"UITableViewCell"
)
tableView
.
register
(
YHFormItemTitleCell
.
self
,
forCellReuseIdentifier
:
YHFormItemTitleCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemAddCell
.
self
,
forCellReuseIdentifier
:
YHFormItemAddCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemInputTextCell
.
self
,
forCellReuseIdentifier
:
YHFormItemInputTextCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemSelectSheetCell
.
self
,
forCellReuseIdentifier
:
YHFormItemSelectSheetCell
.
cellReuseIdentifier
)
return
tableView
}()
var
bottomView
:
YHSaveAndSubmitView
=
{
let
view
=
YHSaveAndSubmitView
.
createView
()
view
.
changeRightBtnTitle
(
"下一步"
.
local
)
return
view
}()
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
self
.
gk_navTitle
=
"专业资格及会员资格"
.
local
self
.
gk_navigationBar
.
backgroundColor
=
.
white
view
.
backgroundColor
=
UIColor
(
hexString
:
"#F8F8F8"
)
createUI
()
}
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
super
.
viewWillAppear
(
animated
)
}
func
createUI
()
{
view
.
addSubview
(
tableView
);
view
.
addSubview
(
bottomView
)
bottomView
.
saveBlock
=
{
[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
saveDetailInfo
(
isSubmit
:
false
,
isNeedPop
:
true
,
isShowToast
:
true
)
}
bottomView
.
submitBlock
=
{
[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
submitInfo
()
}
bottomView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
equalToSuperview
()
make
.
bottom
.
equalToSuperview
()
make
.
height
.
equalTo
(
YHSaveAndSubmitView
.
height
)
}
tableView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalToSuperview
()
.
offset
(
k_Height_NavigationtBarAndStatuBar
)
make
.
bottom
.
equalTo
(
bottomView
.
snp
.
top
)
make
.
left
.
equalToSuperview
()
.
offset
(
16
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
16
)
}
loadInfo
()
if
self
.
detailId
!=
0
{
// 有专业ID则该专业已存在
reqeustDetailInfo
()
}
}
func
loadInfo
()
{
items
.
removeAll
()
let
title0
=
YHFormTitleItem
(
type
:
.
mainApplicantProfessionalQualification
)
let
item00
=
YHFormDetailItem
(
type
:
.
qualificationCertificateName
)
item00
.
tips
=
"请选择资格证书名称"
.
local
item00
.
value
=
detailInfo
.
certName
let
item01
=
YHFormDetailItem
(
type
:
.
conferAgencyFullName
)
item01
.
tips
=
"请输入颁授机构"
.
local
item01
.
value
=
detailInfo
.
issuingAgent
let
item02
=
YHFormDetailItem
(
type
:
.
conferTime
)
item02
.
tips
=
"请选择颁授年份"
.
local
if
detailInfo
.
issuingYear
>
0
{
item02
.
value
=
String
(
detailInfo
.
issuingYear
)
}
let
item03
=
YHFormDetailItem
(
type
:
.
conferCountry
)
item03
.
tips
=
"请选择颁授国家/地区"
.
local
item03
.
value
=
detailInfo
.
issuingAddr
.
country
let
item04
=
YHFormDetailItem
(
type
:
.
conferCity
)
if
detailInfo
.
isCollegeInAboard
()
{
item04
.
tips
=
"请输入颁授城市"
.
local
item04
.
value
=
detailInfo
.
issuingAddr
.
foreign
}
else
{
item04
.
tips
=
"请选择颁授城市"
.
local
item04
.
value
=
detailInfo
.
issuingAddr
.
area
.
joined
(
separator
:
","
)
}
let
arr0
:[
YHFormItemProtocol
]
=
[
title0
,
item00
,
item01
,
item02
,
item03
,
item04
]
items
.
append
(
arr0
)
self
.
tableView
.
reloadData
()
}
}
extension
YHGCQualificationDetailVC
:
UITableViewDelegate
,
UITableViewDataSource
{
func
numberOfSections
(
in
tableView
:
UITableView
)
->
Int
{
return
items
.
count
}
func
tableView
(
_
tableView
:
UITableView
,
numberOfRowsInSection
section
:
Int
)
->
Int
{
if
section
>=
items
.
count
{
return
0
}
let
arr
=
items
[
section
]
return
arr
.
count
}
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
if
indexPath
.
section
>=
items
.
count
{
return
createDefaultCell
(
indexPath
)
}
let
arr
:[
YHFormItemProtocol
]
=
items
[
indexPath
.
section
]
if
indexPath
.
row
>=
arr
.
count
{
return
createDefaultCell
(
indexPath
)
}
let
item
:
YHFormItemProtocol
=
arr
[
indexPath
.
row
]
if
item
is
YHFormTitleItem
{
// 是标题
let
formItem
=
item
as!
YHFormTitleItem
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemTitleCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemTitleCell
cell
.
setTitleAndSubTitle
(
title
:
formItem
.
getTitle
())
return
cell
}
if
item
is
YHFormDetailItem
{
let
detailItem
=
item
as!
YHFormDetailItem
let
cellType
=
getCellType
(
detailItem
)
if
cellType
==
.
inputText
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemInputTextCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemInputTextCell
var
isValueValid
=
false
if
let
value
=
detailItem
.
value
,
!
value
.
isEmpty
{
isValueValid
=
true
}
cell
.
setTips
(
detailItem
.
tips
,
isShow
:
(
isNeedShowError
&&
!
isValueValid
))
cell
.
placeHolder
=
detailItem
.
placeHolder
cell
.
isMust
=
detailItem
.
isNeed
cell
.
title
=
detailItem
.
getTitle
()
cell
.
text
=
detailItem
.
value
cell
.
textInputCondtion
=
{
textField
in
var
max
=
-
1
if
detailItem
.
type
==
.
conferAgencyFullName
||
detailItem
.
type
==
.
conferCity
{
max
=
100
}
if
max
>
0
{
if
let
textStr
=
textField
.
text
{
textField
.
text
=
(
textStr
.
count
>
max
?
textStr
[
safe
:
..<
max
]
:
textStr
)
}
}
return
true
}
cell
.
textChange
=
{
[
weak
self
]
(
text
,
isEditEnd
)
in
guard
let
self
=
self
else
{
return
}
// 只有国外城市才需输入,国内城市使用的是选择器
if
detailItem
.
type
==
.
conferCity
{
if
let
text
=
text
,
!
text
.
isEmpty
{
detailInfo
.
issuingAddr
.
foreign
=
text
}
else
{
detailInfo
.
issuingAddr
.
foreign
=
""
}
}
else
if
detailItem
.
type
==
.
conferAgencyFullName
{
if
let
text
=
text
,
!
text
.
isEmpty
{
detailInfo
.
issuingAgent
=
text
}
else
{
detailInfo
.
issuingAgent
=
""
}
}
if
isEditEnd
{
loadInfo
()
saveInfoSilent
()
}
}
return
cell
}
else
if
cellType
==
.
selectSheet
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemSelectSheetCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemSelectSheetCell
cell
.
placeHolder
=
detailItem
.
placeHolder
var
isValueValid
=
false
if
let
value
=
detailItem
.
value
,
!
value
.
isEmpty
{
isValueValid
=
true
}
cell
.
setTips
(
detailItem
.
tips
,
isShow
:
(
isNeedShowError
&&
!
isValueValid
))
cell
.
isMust
=
detailItem
.
isNeed
cell
.
title
=
detailItem
.
getTitle
()
cell
.
detail
=
detailItem
.
value
return
cell
}
}
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"UITableViewCell"
,
for
:
indexPath
)
return
cell
}
func
tableView
(
_
tableView
:
UITableView
,
willDisplay
cell
:
UITableViewCell
,
forRowAt
indexPath
:
IndexPath
)
{
if
indexPath
.
section
>=
items
.
count
{
return
}
let
arr
:[
YHFormItemProtocol
]
=
items
[
indexPath
.
section
]
if
indexPath
.
row
>=
arr
.
count
{
return
}
createCorner
(
cell
:
cell
,
arr
:
arr
,
indexPath
:
indexPath
)
}
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
return
UITableView
.
automaticDimension
}
func
tableView
(
_
tableView
:
UITableView
,
viewForHeaderInSection
section
:
Int
)
->
UIView
?
{
return
UIView
()
}
private
func
tableView
(
_
tableView
:
UITableView
,
viewForHeaderInSection
section
:
Int
)
->
CGFloat
{
return
14.0
}
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
let
arr
=
items
[
indexPath
.
section
]
let
item
:
YHFormItemProtocol
=
arr
[
indexPath
.
row
]
// 标题
if
item
is
YHFormTitleItem
{
return
}
if
item
is
YHFormDetailItem
{
let
detailItem
=
item
as!
YHFormDetailItem
if
detailItem
.
type
==
.
qualificationCertificateName
{
// 资格证书名称
YHSheetPickerView
.
show
(
type
:
.
professionCertificate
,
selectTitle
:
detailInfo
.
certName
)
{
[
weak
self
]
selectItem
in
guard
let
self
=
self
else
{
return
}
detailInfo
.
certName
=
selectItem
.
title
loadInfo
()
saveInfoSilent
()
}
}
else
if
detailItem
.
type
==
.
conferTime
{
// 授权年份
YHDatePickView
.
show
(
type
:
.
yyyy
,
title
:
"选择授权年份"
.
local
,
lastIsTaday
:
true
,
currentDay
:
"
\(
detailInfo
.
issuingYear
)
"
)
{
[
weak
self
]
dateStr
in
guard
let
self
=
self
else
{
return
}
let
format
=
DateFormatter
()
format
.
dateFormat
=
"yyyy"
if
let
selectDate
=
format
.
date
(
from
:
dateStr
)
{
let
selectTimeInterval
=
selectDate
.
timeIntervalSince1970
let
currentTimeInterval
=
Date
()
.
timeIntervalSince1970
// 出生日期须早于当前日期
if
selectTimeInterval
>
currentTimeInterval
{
YHHUD
.
flash
(
message
:
"授权年份不能晚于当前年份"
.
local
)
return
}
}
detailInfo
.
issuingYear
=
Int
(
dateStr
)
??
2024
loadInfo
()
saveInfoSilent
()
}
}
else
if
detailItem
.
type
==
.
conferCountry
{
// 授权国家/地区
let
vc
=
YHSelectCountryViewController
()
vc
.
backLocationStringController
=
{
[
weak
self
]
country
in
guard
let
self
=
self
else
{
return
}
detailInfo
.
issuingAddr
.
country
=
country
detailInfo
.
isAboardAddr
=
detailInfo
.
isCollegeInAboard
()
loadInfo
()
saveInfoSilent
()
}
self
.
navigationController
?
.
pushViewController
(
vc
)
}
else
if
detailItem
.
type
==
.
conferCity
{
// 授权城市
if
detailInfo
.
isCollegeInAboard
()
{
return
}
let
vc
=
YHAddressViewController
()
vc
.
backLocationStringController
=
{
[
weak
self
]
(
string1
,
string2
,
string3
,
string4
)
in
guard
let
self
=
self
else
{
return
}
var
citys
:[
String
]
=
[]
if
!
isEmptyString
(
string2
)
{
citys
.
append
(
string2
)
}
if
!
isEmptyString
(
string3
)
{
citys
.
append
(
string3
)
}
detailInfo
.
issuingAddr
.
area
=
citys
loadInfo
()
saveInfoSilent
()
}
self
.
present
(
vc
,
animated
:
true
)
}
}
}
func
createDefaultCell
(
_
indexPath
:
IndexPath
)
->
UITableViewCell
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"UITableViewCell"
,
for
:
indexPath
)
return
cell
}
func
createCorner
(
cell
:
UITableViewCell
,
arr
:
Array
<
Any
>
,
indexPath
:
IndexPath
)
{
// 设置每块section圆角
if
(
indexPath
.
row
==
0
)
{
let
corner
=
UIRectCorner
(
rawValue
:
UIRectCorner
.
topLeft
.
rawValue
|
UIRectCorner
.
topRight
.
rawValue
)
cell
.
createCorner
(
CGSizeMake
(
12.0
,
12.0
),
corner
)
}
else
if
(
indexPath
.
row
==
arr
.
count
-
1
)
{
let
corner
=
UIRectCorner
(
rawValue
:
UIRectCorner
.
bottomLeft
.
rawValue
|
UIRectCorner
.
bottomRight
.
rawValue
)
cell
.
createCorner
(
CGSizeMake
(
12.0
,
12.0
),
corner
)
}
else
{
cell
.
layer
.
mask
=
nil
}
}
func
getCellType
(
_
item
:
Any
)
->
HKFormItemCellType
{
if
item
is
YHFormTitleItem
{
return
.
title
}
if
item
is
YHFormDetailItem
{
let
detailItem
=
item
as!
YHFormDetailItem
if
detailItem
.
type
==
.
conferCity
{
if
detailInfo
.
isCollegeInAboard
()
{
return
.
inputText
}
return
.
selectSheet
}
if
detailItem
.
type
==
.
conferAgencyFullName
{
return
.
inputText
}
if
detailItem
.
type
==
.
conferTime
||
detailItem
.
type
==
.
conferCountry
||
detailItem
.
type
==
.
conferCity
||
detailItem
.
type
==
.
qualificationCertificateName
{
return
.
selectSheet
}
}
return
.
defaultType
}
}
extension
YHGCQualificationDetailVC
{
func
reqeustDetailInfo
()
{
self
.
educationRequest
.
getQualificationDetailInfo
(
id
:
self
.
detailId
)
{
[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
if
success
{
if
let
qualificationDetailInfo
=
self
.
educationRequest
.
qualificationDetailInfo
{
detailInfo
=
qualificationDetailInfo
}
loadInfo
()
}
}
}
func
saveInfoSilent
()
{
if
detailId
!=
0
{
saveDetailInfo
(
isSubmit
:
false
,
isNeedPop
:
false
,
isShowToast
:
false
)
}
}
// 保存数据
// @param isNeedPop:保存成功后是否需要退出该页面
// @param isShowToast: 请求完成后是否弹Toast
func
saveDetailInfo
(
isSubmit
:
Bool
,
isNeedPop
:
Bool
,
isShowToast
:
Bool
)
{
var
dict
:[
String
:
Any
]
=
[
"orderId"
:
self
.
orderId
]
detailInfo
.
isAboardAddr
=
detailInfo
.
isCollegeInAboard
()
let
quaDict
:[
String
:
Any
]
=
detailInfo
.
toDictionary
()
??
[:]
dict
[
"qua_data"
]
=
quaDict
print
(
dict
)
self
.
educationRequest
.
saveQualificationInfo
(
params
:
dict
,
isSilent
:
!
isShowToast
)
{
[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
if
success
{
if
isShowToast
{
YHHUD
.
flash
(
message
:
isSubmit
?
"提交成功"
:
"保存成功"
)
}
if
isNeedPop
{
self
.
navigationController
?
.
popViewController
(
animated
:
true
)
}
}
else
{
if
isShowToast
{
var
errorMsg
=
isSubmit
?
"提交失败"
:
"保存失败"
if
let
errMsg
=
error
?
.
errorMsg
,
errMsg
.
count
>
0
{
errorMsg
=
errMsg
}
YHHUD
.
flash
(
message
:
errorMsg
)
}
}
}
}
func
submitInfo
()
{
let
isChecked
=
checkIntegrity
()
isNeedShowError
=
!
isChecked
self
.
tableView
.
reloadData
()
if
!
isChecked
{
YHHUD
.
flash
(
message
:
"资料还未填完"
)
return
}
saveDetailInfo
(
isSubmit
:
true
,
isNeedPop
:
true
,
isShowToast
:
true
)
}
// 检查填写信息完整性
func
checkIntegrity
()
->
Bool
{
if
detailInfo
.
certName
.
isEmpty
||
detailInfo
.
issuingAgent
.
isEmpty
||
detailInfo
.
issuingYear
<=
0
||
detailInfo
.
issuingAddr
.
country
.
isEmpty
{
return
false
}
if
detailInfo
.
isCollegeInAboard
(),
detailInfo
.
issuingAddr
.
foreign
.
isEmpty
{
return
false
}
if
!
detailInfo
.
isCollegeInAboard
(),
detailInfo
.
issuingAddr
.
area
.
count
<=
0
{
return
false
}
return
true
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/TTPS(高才)/ServiceProcess(我的信息流程)/FamilyMember(家庭成员)/C/Certificates(证书上传和证书信息)/YHGCCertificateInfoController.swift
0 → 100644
View file @
d5d3eee0
//
// YHGCCertificateInfoController.swift
// galaxy
//
// Created by Dufet on 2024/12/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
class
YHGCCertificateInfoController
:
YHBaseViewController
,
YHFamilyMemberProtol
{
var
familyMember
:
YHFamilyMember
?
var
mainApplicantInfo
:
YHMyMainApplicantInfoModel
?
weak
var
delegate
:
YHSpouseInfoVCProtocol
?
var
items
:[[
YHFormItemProtocol
]]
=
[[
YHFormItemProtocol
]]()
// 是否显示未填写错误提示
var
isNeedShowError
=
false
lazy
var
tableView
:
UITableView
=
{
let
tableView
=
UITableView
(
frame
:
.
zero
,
style
:
.
grouped
)
if
#available(iOS 11.0, *)
{
tableView
.
contentInsetAdjustmentBehavior
=
.
never
}
tableView
.
estimatedSectionHeaderHeight
=
14.0
tableView
.
estimatedSectionFooterHeight
=
1.0
tableView
.
showsVerticalScrollIndicator
=
false
tableView
.
backgroundColor
=
UIColor
(
hexString
:
"#F8F8F8"
)
tableView
.
separatorStyle
=
.
none
tableView
.
delegate
=
self
tableView
.
dataSource
=
self
tableView
.
register
(
UITableViewCell
.
self
,
forCellReuseIdentifier
:
"UITableViewCell"
)
tableView
.
register
(
YHFormItemDoubleChoiceCell
.
self
,
forCellReuseIdentifier
:
YHFormItemDoubleChoiceCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemInputTextCell
.
self
,
forCellReuseIdentifier
:
YHFormItemInputTextCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemEnterDetailCell
.
self
,
forCellReuseIdentifier
:
YHFormItemEnterDetailCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemTitleCell
.
self
,
forCellReuseIdentifier
:
YHFormItemTitleCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemAddCell
.
self
,
forCellReuseIdentifier
:
YHFormItemAddCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemSelectSheetCell
.
self
,
forCellReuseIdentifier
:
YHFormItemSelectSheetCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemExpireDateCell
.
self
,
forCellReuseIdentifier
:
YHFormItemExpireDateCell
.
cellReuseIdentifier
)
return
tableView
}()
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
gk_navigationBar
.
isHidden
=
true
view
.
backgroundColor
=
UIColor
(
hexString
:
"#F8F8F8"
)
createUI
()
loadInfo
()
}
func
createUI
()
{
view
.
addSubview
(
tableView
);
let
topHeight
=
k_Height_NavigationtBarAndStatuBar
+
YHStepView
.
height
let
bottomHeight
=
YHSaveAndSubmitView
.
height
tableView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalToSuperview
()
make
.
left
.
equalToSuperview
()
.
offset
(
16
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
16
)
make
.
height
.
equalTo
(
KScreenHeight
-
topHeight
-
bottomHeight
)
}
guard
let
familyMember
=
familyMember
else
{
return
}
loadInfo
()
}
func
showLogic
()
->
(
showHK
:
Bool
,
isHKMust
:
Bool
,
showPassport
:
Bool
,
isPassportMust
:
Bool
)
{
guard
let
familyMember
=
familyMember
else
{
return
(
false
,
false
,
false
,
false
)
}
// 中国国籍&居住国内、中国国籍&居住国外不满一年
// 1) 办理过港澳通
// 证件上传:身份证+港澳通
// 证件信息:港澳通行证必填(无身份证、护照)
//
// 2) 没办理过港澳通
// 证件上传:身份证
// 证件信息:港澳通行证非必填(无身份证、护照)
//
// 中国国籍&居住国外满一年
// 证件上传:护照+身份证
// 证件信息:护照必填(无身份证)
//
// 外籍国籍(无论是否在国外居住满一年):
// 证件上传:护照
// 证件信息:仅护照且必填(无身份证)
// 是否显示港澳通行证
var
showHK
=
false
// 港澳通行证是否必填
var
isHKMust
=
false
// 是否显示护照
var
showPassport
=
false
// 护照是否必填
var
isPassportMust
=
false
// 国籍
let
nationality
=
familyMember
.
nationality
// 居住国外是否满一年
var
is_live_oversea_year
=
familyMember
.
isOverSeasOver1Year
()
// 居住国家
var
liveCountry
=
familyMember
.
address
.
country
if
familyMember
.
isLiveTother
(),
let
mainApplicant
=
mainApplicantInfo
{
// 与主申请人同住用主申请人的居住信息判断
liveCountry
=
mainApplicant
.
applicant_address
.
country
is_live_oversea_year
=
mainApplicant
.
isOverSeasOver1Year
()
}
if
nationality
.
contains
(
"中国"
)
{
// 中国国籍
let
isLiveInChina
=
liveCountry
.
contains
(
"中国"
.
local
)
if
isLiveInChina
{
// 居住国内
if
familyMember
.
isHandled
==
0
{
// 没办理过港澳通行证
// 证件信息:港澳通行证非必填(无身份证、护照)
showHK
=
true
isHKMust
=
false
}
else
{
// 办理过港澳通行证
// 证件信息:港澳通行证必填(无身份证、护照)
showHK
=
true
isHKMust
=
true
}
}
else
{
// 居住国外
if
!
is_live_oversea_year
{
// 居住国外不满一年
if
familyMember
.
isHandled
==
0
{
// 没办理过港澳通行证
// 证件信息:港澳通行证非必填(无身份证、护照)
showHK
=
true
isHKMust
=
false
}
else
{
// 办理过港澳通行证
// 证件信息:港澳通行证必填(无身份证、护照)
showHK
=
true
isHKMust
=
true
}
}
else
{
// 居住国外满一年
// 证件信息:护照必填(无身份证)
showPassport
=
true
isPassportMust
=
true
}
}
}
else
{
// 外国国籍
// 证件信息:仅护照且必填(无身份证)
showPassport
=
true
isPassportMust
=
true
}
return
(
showHK
,
isHKMust
,
showPassport
,
isPassportMust
)
}
func
loadInfo
()
{
guard
let
familyMember
=
familyMember
else
{
return
}
items
.
removeAll
()
let
a
=
showLogic
()
let
showHK
=
a
.
showHK
let
isHKMust
=
a
.
isHKMust
let
showPassport
=
a
.
showPassport
let
isPassportMust
=
a
.
isPassportMust
if
showHK
{
// 显示港澳通行证
let
title1
=
YHFormTitleItem
(
type
:
.
hkAndMacaoPassport
)
let
item10
=
YHFormDetailItem
(
type
:
.
traverlPassportNumber
,
isNeed
:
isHKMust
,
value
:
familyMember
.
certificates
.
hkMacaoPass
.
number
,
tips
:
"请输入证件号码"
.
local
)
let
item11
=
YHFormDetailItem
(
type
:
.
certificateSignPlace
,
isNeed
:
isHKMust
,
value
:
familyMember
.
certificates
.
hkMacaoPass
.
issueAt
,
tips
:
"请输入签发地"
.
local
)
let
item12
=
YHFormDetailItem
(
type
:
.
certificateSignDate
,
isNeed
:
isHKMust
,
value
:
familyMember
.
certificates
.
hkMacaoPass
.
issueDateStartAt
,
tips
:
"请选择签发日期"
.
local
)
let
item13
=
YHFormDetailItem
(
type
:
.
certificateValidDate
,
isNeed
:
isHKMust
,
value
:
familyMember
.
certificates
.
hkMacaoPass
.
issueDateEndAt
,
tips
:
"请选择届满日期"
.
local
)
let
arr1
:[
YHFormItemProtocol
]
=
[
title1
,
item10
,
item11
,
item12
,
item13
]
items
.
append
(
arr1
)
}
if
showPassport
{
// 显示护照
let
title2
=
YHFormTitleItem
(
type
:
.
passPortOrTravelInfo
)
let
item21
=
YHFormDetailItem
(
type
:
.
certificateNumber
,
isNeed
:
isPassportMust
,
value
:
familyMember
.
certificates
.
passport
.
number
,
tips
:
"请输入证件号码"
.
local
)
let
item22
=
YHFormDetailItem
(
type
:
.
certificateSignPlace
,
isNeed
:
isPassportMust
,
value
:
familyMember
.
certificates
.
passport
.
issueAt
,
tips
:
"请输入签发地"
.
local
)
let
item23
=
YHFormDetailItem
(
type
:
.
certificateSignDate
,
isNeed
:
isPassportMust
,
value
:
familyMember
.
certificates
.
passport
.
issueDateStartAt
,
tips
:
"请选择签发日期"
.
local
)
let
item24
=
YHFormDetailItem
(
type
:
.
certificateValidDate
,
isNeed
:
isPassportMust
,
value
:
familyMember
.
certificates
.
passport
.
issueDateEndAt
,
tips
:
"请选择届满日期"
.
local
)
let
arr2
:[
YHFormItemProtocol
]
=
[
title2
,
item21
,
item22
,
item23
,
item24
]
items
.
append
(
arr2
)
}
tableView
.
reloadData
()
}
}
extension
YHGCCertificateInfoController
:
UITableViewDelegate
,
UITableViewDataSource
{
func
numberOfSections
(
in
tableView
:
UITableView
)
->
Int
{
return
items
.
count
}
func
tableView
(
_
tableView
:
UITableView
,
numberOfRowsInSection
section
:
Int
)
->
Int
{
if
section
>=
items
.
count
{
return
0
}
let
arr
=
items
[
section
]
return
arr
.
count
}
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
if
indexPath
.
section
>=
items
.
count
{
return
createDefaultCell
(
indexPath
)
}
let
arr
:[
YHFormItemProtocol
]
=
items
[
indexPath
.
section
]
if
indexPath
.
row
>=
arr
.
count
{
return
createDefaultCell
(
indexPath
)
}
let
item
:
YHFormItemProtocol
=
arr
[
indexPath
.
row
]
if
item
is
YHFormTitleItem
{
// 标题
let
titleItem
=
item
as!
YHFormTitleItem
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemTitleCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemTitleCell
// var isNeedText = ""
// if titleItem.type == .chinaIdCardInfo {
// if let familyMember = familyMember {
// let isChinaCardMust = familyMember.isChinese() && familyMember.relationType != .child
// isNeedText = isChinaCardMust ? "(必填)" : "(选填)"
// }
//
// } else if titleItem.type == .hkAndMacaoPassport {
// if let familyMember = familyMember {
// isNeedText = familyMember.isNeedHandleHKPassPort() ? "(必填)" : "(选填)"
// }
//
// } else if titleItem.type == .passPortOrTravelInfo {
// if let familyMember = familyMember {
// let isPassPortMust = !familyMember.isChinese()
// isNeedText = isPassPortMust ? "(必填)" : "(选填)"
// }
// }
var
title
=
item
.
getTitle
()
// if isNeedText.isEmpty {
// title = item.getTitle()
// } else {
// title = "\(item.getTitle())\(isNeedText)"
// }
cell
.
setTitleAndSubTitle
(
title
:
title
)
return
cell
}
if
item
is
YHFormDetailItem
{
let
detailItem
=
item
as!
YHFormDetailItem
let
title
=
arr
[
0
]
as!
YHFormTitleItem
if
detailItem
.
type
==
.
chinaIdentityCardNumber
||
detailItem
.
type
==
.
certificateSignPlace
||
detailItem
.
type
==
.
traverlPassportNumber
||
detailItem
.
type
==
.
certificateNumber
{
// 证件号码和签发地需要填写
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemInputTextCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemInputTextCell
cell
.
isMust
=
detailItem
.
isNeed
cell
.
placeHolder
=
detailItem
.
placeHolder
cell
.
title
=
detailItem
.
getTitle
()
cell
.
text
=
detailItem
.
value
if
detailItem
.
type
==
.
chinaIdentityCardNumber
{
cell
.
setTips
(
detailItem
.
tips
,
isShow
:
isNeedShowError
&&
detailItem
.
isNeed
&&
detailItem
.
value
?
.
count
!=
18
)
}
else
{
cell
.
setTips
(
detailItem
.
tips
,
isShow
:
isNeedShowError
&&
detailItem
.
isNeed
&&
detailItem
.
isShowTips
)
}
cell
.
textInputCondtion
=
{
textField
in
var
max
=
-
1
if
detailItem
.
type
==
.
chinaIdentityCardNumber
{
// 身份证
max
=
18
}
else
if
detailItem
.
type
==
.
certificateSignPlace
{
// 签发地
max
=
50
}
else
if
detailItem
.
type
==
.
traverlPassportNumber
||
detailItem
.
type
==
.
certificateNumber
{
max
=
50
}
if
max
>
0
{
if
let
textStr
=
textField
.
text
{
textField
.
text
=
(
textStr
.
count
>
max
?
textStr
[
safe
:
..<
max
]
:
textStr
)
}
}
return
true
}
cell
.
textChange
=
{
[
weak
self
]
(
text
,
isEditEnd
)
in
guard
let
self
=
self
else
{
return
}
if
detailItem
.
type
==
.
chinaIdentityCardNumber
{
self
.
familyMember
?
.
certificates
.
cnIdentityCard
.
number
=
text
??
""
}
else
if
detailItem
.
type
==
.
traverlPassportNumber
{
self
.
familyMember
?
.
certificates
.
hkMacaoPass
.
number
=
text
??
""
}
else
if
detailItem
.
type
==
.
certificateNumber
{
self
.
familyMember
?
.
certificates
.
passport
.
number
=
text
??
""
}
else
if
detailItem
.
type
==
.
certificateSignPlace
{
// 签发地
if
title
.
type
==
.
chinaIdCardInfo
{
self
.
familyMember
?
.
certificates
.
cnIdentityCard
.
issueAt
=
text
??
""
}
else
if
title
.
type
==
.
hkAndMacaoPassport
{
self
.
familyMember
?
.
certificates
.
hkMacaoPass
.
issueAt
=
text
??
""
}
else
if
title
.
type
==
.
passPortOrTravelInfo
{
self
.
familyMember
?
.
certificates
.
passport
.
issueAt
=
text
??
""
}
}
if
isEditEnd
{
self
.
loadInfo
()
self
.
save
()
}
}
return
cell
}
if
detailItem
.
type
==
.
certificateType
||
detailItem
.
type
==
.
certificateSignDate
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemSelectSheetCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemSelectSheetCell
cell
.
isMust
=
detailItem
.
isNeed
cell
.
title
=
detailItem
.
getTitle
()
cell
.
detail
=
detailItem
.
value
cell
.
setTips
(
detailItem
.
tips
,
isShow
:
isNeedShowError
&&
detailItem
.
isNeed
&&
detailItem
.
isShowTips
)
return
cell
}
if
detailItem
.
type
==
.
certificateValidDate
{
// 届满日期
if
title
.
type
==
.
chinaIdCardInfo
{
// 身份证
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemExpireDateCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemExpireDateCell
cell
.
isMust
=
detailItem
.
isNeed
cell
.
title
=
detailItem
.
getTitle
()
cell
.
detail
=
(
detailItem
.
value
==
YHCNIdentityCard
.
longTime
?
""
:
detailItem
.
value
)
cell
.
isLongTime
=
(
detailItem
.
value
==
YHCNIdentityCard
.
longTime
)
cell
.
clickBlock
=
{
[
weak
self
]
isLongTime
in
guard
let
self
=
self
else
{
return
}
if
title
.
type
==
.
chinaIdCardInfo
{
guard
let
familyMember
=
familyMember
else
{
return
}
familyMember
.
certificates
.
cnIdentityCard
.
issueDateEndAt
=
(
isLongTime
?
YHCNIdentityCard
.
longTime
:
familyMember
.
certificates
.
cnIdentityCard
.
lastIssueDateEndAt
)
loadInfo
()
save
()
}
}
cell
.
setTips
(
detailItem
.
tips
,
isShow
:
isNeedShowError
&&
detailItem
.
isNeed
&&
detailItem
.
isShowTips
)
return
cell
}
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemSelectSheetCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemSelectSheetCell
cell
.
isMust
=
detailItem
.
isNeed
cell
.
title
=
detailItem
.
getTitle
()
cell
.
detail
=
detailItem
.
value
cell
.
setTips
(
detailItem
.
tips
,
isShow
:
isNeedShowError
&&
detailItem
.
isNeed
&&
detailItem
.
isShowTips
)
return
cell
}
}
return
createDefaultCell
(
indexPath
)
}
func
tableView
(
_
tableView
:
UITableView
,
willDisplay
cell
:
UITableViewCell
,
forRowAt
indexPath
:
IndexPath
)
{
if
indexPath
.
section
>=
items
.
count
{
return
}
let
arr
:[
YHFormItemProtocol
]
=
items
[
indexPath
.
section
]
if
indexPath
.
row
>=
arr
.
count
{
return
}
createCorner
(
cell
:
cell
,
arr
:
arr
,
indexPath
:
indexPath
)
}
func
createDefaultCell
(
_
indexPath
:
IndexPath
)
->
UITableViewCell
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"UITableViewCell"
,
for
:
indexPath
)
return
cell
}
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
return
UITableView
.
automaticDimension
}
func
tableView
(
_
tableView
:
UITableView
,
viewForHeaderInSection
section
:
Int
)
->
UIView
?
{
return
UIView
()
}
func
tableView
(
_
tableView
:
UITableView
,
viewForFooterInSection
section
:
Int
)
->
UIView
?
{
return
UIView
()
}
private
func
tableView
(
_
tableView
:
UITableView
,
viewForFooterInSection
section
:
Int
)
->
CGFloat
{
return
1.0
}
private
func
tableView
(
_
tableView
:
UITableView
,
viewForHeaderInSection
section
:
Int
)
->
CGFloat
{
return
14.0
}
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
if
!
(
0
..<
items
.
count
)
.
contains
(
indexPath
.
section
)
{
return
}
let
arr
:[
YHFormItemProtocol
]
=
items
[
indexPath
.
section
]
if
!
(
0
..<
arr
.
count
)
.
contains
(
indexPath
.
row
)
{
return
}
let
item
=
arr
[
indexPath
.
row
]
if
item
is
YHFormTitleItem
{
return
}
if
item
is
YHFormDetailItem
{
let
detailItem
=
item
as!
YHFormDetailItem
let
titleItem
=
arr
[
0
]
as!
YHFormTitleItem
if
detailItem
.
type
==
.
certificateValidDate
||
detailItem
.
type
==
.
certificateSignDate
{
// 届满日期 签发日期
var
title
=
""
var
lastIsTaday
=
false
if
detailItem
.
type
==
.
certificateValidDate
{
title
=
"选择届满日期"
lastIsTaday
=
false
}
else
if
detailItem
.
type
==
.
certificateSignDate
{
title
=
"选择签发日期"
lastIsTaday
=
true
}
self
.
view
?
.
endEditing
(
true
)
guard
let
familyMember
=
self
.
familyMember
else
{
return
}
var
timeString
=
""
var
certificate
=
familyMember
.
certificates
.
cnIdentityCard
if
titleItem
.
type
==
.
chinaIdCardInfo
{
certificate
=
familyMember
.
certificates
.
cnIdentityCard
}
else
if
titleItem
.
type
==
.
hkAndMacaoPassport
{
certificate
=
familyMember
.
certificates
.
hkMacaoPass
}
else
if
titleItem
.
type
==
.
passPortOrTravelInfo
{
certificate
=
familyMember
.
certificates
.
passport
}
if
detailItem
.
type
==
.
certificateSignDate
{
// 选择签发日期
timeString
=
certificate
.
issueDateStartAt
}
else
if
detailItem
.
type
==
.
certificateValidDate
{
// 届满日期
timeString
=
certificate
.
issueDateEndAt
}
YHDatePickView
.
show
(
type
:
.
yyyymmdd
,
title
:
title
,
lastIsTaday
:
lastIsTaday
,
currentDay
:
timeString
)
{
[
weak
self
]
dateStr
in
print
(
dateStr
)
guard
let
self
=
self
else
{
return
}
let
format
=
DateFormatter
()
format
.
dateFormat
=
"yyyy-MM-dd"
if
let
selectDate
=
format
.
date
(
from
:
dateStr
)
{
let
selectTimeInterval
=
selectDate
.
timeIntervalSince1970
let
currentTimeInterval
=
Date
()
.
timeIntervalSince1970
if
detailItem
.
type
==
.
certificateSignDate
{
// 选择签发日期
// 签发日期须早于当前日期
if
selectTimeInterval
>
currentTimeInterval
{
YHHUD
.
flash
(
message
:
"签发日期不能晚于当前日期"
)
return
}
if
!
certificate
.
issueDateEndAt
.
isEmpty
,
let
endDate
=
format
.
date
(
from
:
certificate
.
issueDateEndAt
)
{
let
endTimeInterval
=
endDate
.
timeIntervalSince1970
if
selectTimeInterval
>
endTimeInterval
{
YHHUD
.
flash
(
message
:
"签发日期不能晚于届满日期"
)
return
}
}
}
if
detailItem
.
type
==
.
certificateValidDate
{
// 届满日期
if
!
certificate
.
issueDateStartAt
.
isEmpty
,
let
startDate
=
format
.
date
(
from
:
certificate
.
issueDateStartAt
)
{
let
startTimeInterval
=
startDate
.
timeIntervalSince1970
if
selectTimeInterval
<
startTimeInterval
{
YHHUD
.
flash
(
message
:
"届满日期不能早于签发日期"
)
return
}
}
}
}
changeCertificateDate
(
certificate
,
type
:
detailItem
.
type
,
date
:
dateStr
)
self
.
loadInfo
()
save
()
}
}
else
if
detailItem
.
type
==
.
certificateType
{
// 选择证件类别
let
type
=
self
.
familyMember
?
.
certificates
.
passport
.
passPortType
??
3
YHSheetPickerView
.
show
(
type
:
.
certificate
,
selectIndex
:
type
)
{
[
weak
self
]
selectItem
in
guard
let
self
=
self
else
{
return
}
self
.
familyMember
?
.
certificates
.
passport
.
passPortType
=
selectItem
.
index
self
.
loadInfo
()
self
.
save
()
}
}
return
}
}
func
changeCertificateDate
(
_
certificate
:
YHCNIdentityCard
?,
type
:
YHFormDetailItemType
,
date
:
String
?)
{
if
type
==
.
certificateSignDate
{
certificate
?
.
issueDateStartAt
=
date
??
""
}
else
if
type
==
.
certificateValidDate
{
certificate
?
.
issueDateEndAt
=
date
??
""
}
}
func
createCorner
(
cell
:
UITableViewCell
,
arr
:
Array
<
Any
>
,
indexPath
:
IndexPath
)
{
// 复用时需清理
cell
.
layer
.
mask
=
nil
// 设置每块section圆角
if
(
indexPath
.
row
==
0
)
{
let
corner
=
UIRectCorner
(
rawValue
:
UIRectCorner
.
topLeft
.
rawValue
|
UIRectCorner
.
topRight
.
rawValue
)
cell
.
createCorner
(
CGSizeMake
(
12.0
,
12.0
),
corner
)
}
else
if
(
indexPath
.
row
==
arr
.
count
-
1
)
{
let
corner
=
UIRectCorner
(
rawValue
:
UIRectCorner
.
bottomLeft
.
rawValue
|
UIRectCorner
.
bottomRight
.
rawValue
)
cell
.
createCorner
(
CGSizeMake
(
12.0
,
12.0
),
corner
)
}
else
{
cell
.
layer
.
mask
=
nil
}
}
func
save
()
{
if
let
delegate
=
delegate
,
delegate
.
responds
(
to
:
#selector(
YHSpouseInfoVCProtocol.saveInfoSilent
)
)
{
delegate
.
saveInfoSilent
()
}
}
// 检查填写信息完整性
func
checkIntegrity
()
->
Bool
{
guard
let
familyMember
=
familyMember
else
{
return
false
}
let
a
=
showLogic
()
let
showHK
=
a
.
showHK
let
isHKMust
=
a
.
isHKMust
let
showPassport
=
a
.
showPassport
let
isPassportMust
=
a
.
isPassportMust
if
showHK
,
isHKMust
{
if
familyMember
.
certificates
.
hkMacaoPass
.
number
.
count
<=
0
||
familyMember
.
certificates
.
hkMacaoPass
.
issueAt
.
count
<=
0
||
familyMember
.
certificates
.
hkMacaoPass
.
issueDateStartAt
.
count
<=
0
||
familyMember
.
certificates
.
hkMacaoPass
.
issueDateEndAt
.
count
<=
0
{
return
false
}
}
if
showPassport
,
isPassportMust
{
if
familyMember
.
certificates
.
passport
.
number
.
count
<=
0
||
familyMember
.
certificates
.
passport
.
issueAt
.
count
<=
0
||
familyMember
.
certificates
.
passport
.
issueDateStartAt
.
count
<=
0
||
familyMember
.
certificates
.
passport
.
issueDateEndAt
.
count
<=
0
{
return
false
}
}
return
true
}
func
nextStep
()
->
Bool
{
let
isChecked
=
checkIntegrity
()
isNeedShowError
=
!
isChecked
loadInfo
()
if
!
isChecked
{
YHHUD
.
flash
(
message
:
"资料还未填完"
)
return
false
}
return
true
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/TTPS(高才)/ServiceProcess(我的信息流程)/FamilyMember(家庭成员)/C/Certificates(证书上传和证书信息)/YHGCCertificateUploadVC.swift
0 → 100644
View file @
d5d3eee0
//
// YHGCCertificateUploadVC.swift
// galaxy
//
// Created by Dufet on 2024/12/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
class
YHGCCertificateUploadVC
:
YHBaseViewController
,
YHFamilyMemberProtol
{
var
tableView
:
UITableView
!
weak
var
delegate
:
YHSpouseInfoVCProtocol
?
var
familyMember
:
YHFamilyMember
?
{
didSet
{
if
let
familyMember
=
familyMember
{
viewModel
.
familyMemberModel
=
familyMember
}
}
}
var
mainApplicantInfo
:
YHMyMainApplicantInfoModel
?
{
didSet
{
if
let
mainApplicantInfo
=
mainApplicantInfo
{
viewModel
.
mainApplicantInfo
=
mainApplicantInfo
}
}
}
lazy
var
viewModel
:
YHFamilyMemberViewModel
=
{
let
model
=
YHFamilyMemberViewModel
()
model
.
saveInfoSilentBlock
=
{
if
let
delegate
=
self
.
delegate
,
delegate
.
responds
(
to
:
#selector(
YHSpouseInfoVCProtocol.saveInfoSilent
)
)
{
delegate
.
saveInfoSilent
()
}
}
return
model
}()
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
view
.
backgroundColor
=
UIColor
(
hexString
:
"#F8F8F8"
)
gk_navigationBar
.
isHidden
=
true
createUI
()
}
func
loadInfo
()
{
self
.
tableView
.
reloadData
()
}
func
nextStep
()
->
Bool
{
return
true
}
func
createUI
()
{
tableView
=
{
let
tableView
=
UITableView
(
frame
:
.
zero
,
style
:
.
plain
)
if
#available(iOS 11.0, *)
{
tableView
.
contentInsetAdjustmentBehavior
=
.
never
}
tableView
.
backgroundColor
=
UIColor
(
hexString
:
"#F8F8F8"
)
tableView
.
separatorStyle
=
.
none
tableView
.
delegate
=
self
tableView
.
dataSource
=
self
tableView
.
register
(
cellWithClass
:
YHIdentityCardCell
.
self
)
return
tableView
}()
view
.
addSubview
(
tableView
)
let
topHeight
=
k_Height_NavigationtBarAndStatuBar
+
YHStepView
.
height
let
bottomHeight
=
YHSaveAndSubmitView
.
height
tableView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalToSuperview
()
make
.
left
.
equalToSuperview
()
make
.
right
.
equalToSuperview
()
make
.
height
.
equalTo
(
KScreenHeight
-
topHeight
-
bottomHeight
)
}
}
}
extension
YHGCCertificateUploadVC
:
UITableViewDelegate
,
UITableViewDataSource
{
func
tableView
(
_
tableView
:
UITableView
,
numberOfRowsInSection
section
:
Int
)
->
Int
{
return
viewModel
.
getIDCardDataSource
(
false
)
.
count
}
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
let
cell
=
tableView
.
dequeueReusableCell
(
withClass
:
YHIdentityCardCell
.
self
)
let
dataSource
=
viewModel
.
getIDCardDataSource
(
false
)
if
indexPath
.
row
<
dataSource
.
count
{
if
dataSource
[
indexPath
.
row
]
.
models
?
.
first
?
.
id
==
.
id5
{
cell
.
type
=
.
identity
}
if
dataSource
[
indexPath
.
row
]
.
models
?
.
first
?
.
id
==
.
id6
{
cell
.
type
=
.
passport
}
if
dataSource
[
indexPath
.
row
]
.
models
?
.
first
?
.
id
==
.
id7
{
cell
.
type
=
.
other
}
cell
.
viewModel
=
viewModel
cell
.
backSurfaceDeleteButton
.
isHidden
=
true
cell
.
frontDeleteButton
.
isHidden
=
true
}
return
cell
}
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
return
217
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/TTPS(高才)/ServiceProcess(我的信息流程)/FamilyMember(家庭成员)/C/Child(子女)/YHGCChildBasicInfoVC.swift
0 → 100644
View file @
d5d3eee0
//
// YHGCChildBasicInfoVC.swift
// galaxy
//
// Created by Dufet on 2024/12/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
class
YHGCChildBasicInfoVC
:
YHBaseViewController
,
YHFamilyMemberProtol
{
var
child
:
YHFamilyMember
?
weak
var
delegate
:
YHSpouseInfoVCProtocol
?
var
isNeedShowError
=
false
var
items
:[[
YHFormItemProtocol
]]
=
[[
YHFormItemProtocol
]]()
lazy
var
tableView
:
UITableView
=
{
let
tableView
=
UITableView
(
frame
:
.
zero
,
style
:
.
grouped
)
if
#available(iOS 11.0, *)
{
tableView
.
contentInsetAdjustmentBehavior
=
.
never
}
tableView
.
estimatedSectionHeaderHeight
=
14.0
tableView
.
estimatedSectionFooterHeight
=
1.0
tableView
.
showsVerticalScrollIndicator
=
false
tableView
.
backgroundColor
=
UIColor
(
hexString
:
"#F8F8F8"
)
tableView
.
separatorStyle
=
.
none
tableView
.
delegate
=
self
tableView
.
dataSource
=
self
tableView
.
register
(
UITableViewCell
.
self
,
forCellReuseIdentifier
:
"UITableViewCell"
)
tableView
.
register
(
YHFormItemDoubleChoiceCell
.
self
,
forCellReuseIdentifier
:
YHFormItemDoubleChoiceCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemInputTextCell
.
self
,
forCellReuseIdentifier
:
YHFormItemInputTextCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemEnterDetailCell
.
self
,
forCellReuseIdentifier
:
YHFormItemEnterDetailCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemTitleCell
.
self
,
forCellReuseIdentifier
:
YHFormItemTitleCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemAddCell
.
self
,
forCellReuseIdentifier
:
YHFormItemAddCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemSelectSheetCell
.
self
,
forCellReuseIdentifier
:
YHFormItemSelectSheetCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemDegreeInfoCell
.
self
,
forCellReuseIdentifier
:
YHFormItemDegreeInfoCell
.
cellReuseIdentifier
)
return
tableView
}()
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
gk_navigationBar
.
isHidden
=
true
view
.
backgroundColor
=
UIColor
(
hexString
:
"#F8F8F8"
)
createUI
()
loadInfo
()
}
func
createUI
()
{
view
.
addSubview
(
tableView
);
let
topHeight
=
k_Height_NavigationtBarAndStatuBar
+
YHStepView
.
height
let
bottomHeight
=
YHSaveAndSubmitView
.
height
tableView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalToSuperview
()
make
.
left
.
equalToSuperview
()
.
offset
(
16
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
16
)
make
.
height
.
equalTo
(
KScreenHeight
-
topHeight
-
bottomHeight
)
}
}
func
loadInfo
()
{
guard
let
child
=
child
else
{
return
}
items
.
removeAll
()
// 子女信息
let
title0
=
YHFormTitleItem
(
type
:
.
childInfo
)
let
item00
=
YHFormDetailItem
(
type
:
.
childName
)
item00
.
value
=
child
.
subsetName
item00
.
tips
=
"请输入子女姓名"
.
local
let
item01
=
YHFormDetailItem
(
type
:
.
everName
,
isNeed
:
false
)
item01
.
value
=
child
.
usedName
let
item02
=
YHFormDetailItem
(
type
:
.
befourMarryFirstName
,
isNeed
:
false
)
item02
.
value
=
child
.
surname
let
item03
=
YHFormDetailItem
(
type
:
.
gender
)
item03
.
value
=
child
.
sexName
()
item03
.
tips
=
"请选择性别"
.
local
let
item04
=
YHFormDetailItem
(
type
:
.
marriageState
)
item04
.
value
=
child
.
married
item04
.
tips
=
"请选择婚姻状况"
.
local
let
item06
=
YHFormDetailItem
(
type
:
.
birthNation
)
item06
.
value
=
String
(
child
.
isBirthOverSeas
())
item06
.
tips
=
"请选择出生国家/地区"
.
local
let
item07
=
YHFormDetailItem
(
type
:
.
birthCity
)
if
child
.
isBirthOverSeas
()
{
item07
.
value
=
child
.
birthPlace
.
foreign
item07
.
tips
=
"请输入出生城市"
.
local
}
else
{
item07
.
value
=
child
.
birthPlace
.
details
item07
.
tips
=
"请输入出生城市"
.
local
// item07.value = child.birthPlace.area.joined(separator: ",")
// item07.tips = "请选择出生城市".local
}
let
arr0
:[
YHFormItemProtocol
]
=
[
title0
,
item00
,
item01
,
item02
,
item03
,
item04
,
item06
,
item07
]
items
.
append
(
arr0
)
// 职业信息
// let title1 = YHFormTitleItem(type: .occupationInfo)
// let item10 = YHFormDetailItem(type: .occupation)
// item10.value = child.occupation
// item10.tips = "请选择职业".local
// var arr1:[YHFormItemProtocol] = [title1, item10]
//
// if child.isNowHaveJob() {
// let item11 = YHFormDetailItem(type: .occupationName)
// item11.value = child.occupationName
// item11.tips = "请输入职业名称".local
// arr1.append(item11)
// }
// items.append(arr1)
if
child
.
isFollow
()
{
// 是否前次婚姻子女
let
title2
=
YHFormTitleItem
(
type
:
.
isPreviousMarriageChild
)
let
item20
=
YHFormDetailItem
(
type
:
.
isPreviousMarriageChild
)
item20
.
value
=
String
(
child
.
isPreviousMarriageChild
())
item20
.
tips
=
"请选择是否前次婚姻子女"
.
local
let
arr2
:[
YHFormItemProtocol
]
=
[
title2
,
item20
]
items
.
append
(
arr2
)
// 在港信息
// let title3 = YHFormTitleItem(type: .inHongKongInfo)
// let item30 = YHFormDetailItem(type: .isNowInHK)
// item30.value = String(child.isNowInHK())
// item30.tips = "请选择目前是否在港".local
//
// var arr3:[YHFormItemProtocol] = [title3, item30]
//
//
// if child.isNowInHK() { // 目前在港才显示 逗留期限和在港身份
// let item31 = YHFormDetailItem(type: .stayHKDate)
// item31.tips = "请选择获准逗留期限".local
// item31.value = child.childInHk.info
//
// let item32 = YHFormDetailItem(type: .roleInHK)
// item32.tips = "请选择在港身份".local
// item32.value = child.hkIdentity
//
// arr3.append(contentsOf: [item31, item32])
// }
// items.append(arr3)
}
// 香港身份证
let
title4
=
YHFormTitleItem
(
type
:
.
hkIdentityCardInfo
)
let
item40
=
YHFormDetailItem
(
type
:
.
isHaveHkIdentityCard
)
item40
.
value
=
String
(
child
.
isHaveHKIdentityCard
())
item40
.
tips
=
"请选择是否办理过香港身份证"
.
local
var
arr4
:[
YHFormItemProtocol
]
=
[
title4
,
item40
]
if
child
.
isHaveHKIdentityCard
()
{
// 办理过香港身份证才显示证号
let
item41
=
YHFormDetailItem
(
type
:
.
hkIdentityCardNumber
)
item41
.
value
=
child
.
hkIdentityCard
let
tips
=
isEmptyString
(
child
.
hkIdentityCard
)
?
"请输入香港身份证号码"
:
"请输入正确的香港身份证号码"
item41
.
tips
=
tips
arr4
.
append
(
item41
)
}
items
.
append
(
arr4
)
tableView
.
reloadData
()
}
func
getCellType
(
_
item
:
Any
)
->
HKFormItemCellType
{
if
item
is
YHFormTitleItem
{
return
.
title
}
if
item
is
YHFormDetailItem
{
let
detailItem
=
item
as!
YHFormDetailItem
if
detailItem
.
type
==
.
birthCity
{
return
.
inputText
// var isBirthOverSeas = false
// if let child = child {
// isBirthOverSeas = child.isBirthOverSeas()
// }
// if isBirthOverSeas {
// return .inputText
// } else {
// return .selectSheet
// }
}
if
detailItem
.
type
==
.
childName
||
detailItem
.
type
==
.
everName
||
detailItem
.
type
==
.
befourMarryFirstName
||
detailItem
.
type
==
.
occupationName
||
detailItem
.
type
==
.
hkIdentityCardNumber
{
return
.
inputText
}
if
detailItem
.
type
==
.
occupation
||
detailItem
.
type
==
.
stayHKDate
||
detailItem
.
type
==
.
roleInHK
||
detailItem
.
type
==
.
ownDegree
||
detailItem
.
type
==
.
gender
||
detailItem
.
type
==
.
marriageState
{
return
.
selectSheet
}
if
detailItem
.
type
==
.
birthNation
||
detailItem
.
type
==
.
isNowInHK
||
detailItem
.
type
==
.
isHaveHkIdentityCard
||
detailItem
.
type
==
.
isPreviousMarriageChild
{
return
.
twoChoice
}
if
detailItem
.
type
==
.
degreeDetailInfo
{
return
.
degreeDetailInfo
}
}
return
.
defaultType
}
}
extension
YHGCChildBasicInfoVC
:
UITableViewDelegate
,
UITableViewDataSource
{
func
numberOfSections
(
in
tableView
:
UITableView
)
->
Int
{
return
items
.
count
}
func
tableView
(
_
tableView
:
UITableView
,
numberOfRowsInSection
section
:
Int
)
->
Int
{
if
section
>=
items
.
count
{
return
0
}
let
arr
=
items
[
section
]
return
arr
.
count
}
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
if
indexPath
.
section
>=
items
.
count
{
return
createDefaultCell
(
indexPath
)
}
let
arr
:[
YHFormItemProtocol
]
=
items
[
indexPath
.
section
]
if
indexPath
.
row
>=
arr
.
count
{
return
createDefaultCell
(
indexPath
)
}
let
item
:
YHFormItemProtocol
=
arr
[
indexPath
.
row
]
let
cellType
=
getCellType
(
item
)
if
cellType
==
.
title
{
// 标题
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemTitleCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemTitleCell
cell
.
setTitleAndSubTitle
(
title
:
item
.
getTitle
())
return
cell
}
if
item
is
YHFormDetailItem
{
let
detailItem
=
item
as!
YHFormDetailItem
if
cellType
==
.
inputText
{
// 输入文字cell
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemInputTextCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemInputTextCell
cell
.
isMust
=
detailItem
.
isNeed
cell
.
placeHolder
=
detailItem
.
placeHolder
cell
.
title
=
detailItem
.
getTitle
()
cell
.
text
=
detailItem
.
value
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
{
cell
.
textField
.
keyboardType
=
.
asciiCapable
// 英文键盘
}
else
{
cell
.
textField
.
keyboardType
=
.
default
}
cell
.
textInputCondtion
=
{
textField
in
if
detailItem
.
type
==
.
befourMarryFirstName
{
// 仅支持输入最多30个大写字母
let
regex
=
"[^A-Za-z]+"
textField
.
limitInputWithPattern
(
pattern
:
regex
,
30
)
return
true
}
var
max
=
-
1
if
detailItem
.
type
==
.
childName
||
detailItem
.
type
==
.
everName
{
max
=
30
}
else
if
detailItem
.
type
==
.
occupationName
{
max
=
50
}
else
if
detailItem
.
type
==
.
birthCity
{
max
=
100
}
if
max
>
0
{
if
let
textStr
=
textField
.
text
{
textField
.
text
=
(
textStr
.
count
>
max
?
textStr
[
safe
:
..<
max
]
:
textStr
)
}
}
return
true
}
cell
.
textChange
=
{
[
weak
self
]
(
text
,
isEditEnd
)
in
guard
let
self
=
self
else
{
return
}
if
detailItem
.
type
==
.
childName
{
self
.
child
?
.
subsetName
=
text
??
""
}
else
if
detailItem
.
type
==
.
everName
{
self
.
child
?
.
usedName
=
text
??
""
}
else
if
detailItem
.
type
==
.
befourMarryFirstName
{
let
tt
=
text
?
.
uppercased
()
self
.
child
?
.
surname
=
tt
??
""
cell
.
textField
.
text
=
tt
}
else
if
detailItem
.
type
==
.
birthCity
{
if
let
child
=
child
,
child
.
isBirthOverSeas
()
{
// 出生国外
self
.
child
?
.
birthPlace
.
foreign
=
text
??
""
}
else
{
self
.
child
?
.
birthPlace
.
details
=
text
??
""
}
}
else
if
detailItem
.
type
==
.
occupationName
{
self
.
child
?
.
occupationName
=
text
??
""
}
else
if
detailItem
.
type
==
.
hkIdentityCardNumber
{
self
.
child
?
.
hkIdentityCard
=
text
}
if
isEditEnd
{
self
.
loadInfo
()
if
detailItem
.
type
==
.
hkIdentityCardNumber
{
if
let
text
=
text
,
!
text
.
isEmpty
,
!
text
.
isHKIdentityCardNumber
()
{
YHHUD
.
flash
(
message
:
"请输入正确的香港身份证号格式"
)
return
}
}
save
()
}
}
return
cell
}
if
cellType
==
.
selectSheet
{
// 点击选择列表cell
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemSelectSheetCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemSelectSheetCell
cell
.
isMust
=
detailItem
.
isNeed
cell
.
placeHolder
=
detailItem
.
placeHolder
cell
.
title
=
detailItem
.
getTitle
()
cell
.
detail
=
detailItem
.
value
cell
.
setTips
(
detailItem
.
tips
,
isShow
:
isNeedShowError
&&
detailItem
.
isShowTips
)
return
cell
}
if
cellType
==
.
twoChoice
{
// 双项选择cell
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemDoubleChoiceCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemDoubleChoiceCell
cell
.
isMust
=
detailItem
.
isNeed
cell
.
title
=
item
.
getTitle
()
cell
.
answerArr
=
nil
cell
.
setTips
(
detailItem
.
tips
,
isShow
:
detailItem
.
isShowTips
)
if
detailItem
.
type
==
.
birthNation
{
// 出生国家
var
select
=
false
if
let
value
=
detailItem
.
value
{
select
=
Bool
(
value
)
!
}
let
answers
=
[
YHFormChoiceItem
(
title
:
"国内"
.
local
,
isSelect
:
!
select
),
YHFormChoiceItem
(
title
:
"国外"
.
local
,
isSelect
:
select
)]
cell
.
answerArr
=
answers
cell
.
answerBlock
=
{
[
weak
self
]
(
answers
,
index
)
in
guard
let
self
=
self
else
{
return
}
let
selectItem
=
answers
[
index
]
self
.
view
.
endEditing
(
true
)
self
.
child
?
.
setBirthOverSeas
(
selectItem
.
title
==
"国外"
.
local
)
self
.
loadInfo
()
save
()
}
}
else
if
detailItem
.
type
==
.
isHaveHkIdentityCard
||
detailItem
.
type
==
.
isNowInHK
||
detailItem
.
type
==
.
isPreviousMarriageChild
{
// 是否办理过香港身份证 是否在岗 是否前次婚姻子女
var
select
=
false
if
let
value
=
detailItem
.
value
{
select
=
Bool
(
value
)
!
}
let
answers
=
[
YHFormChoiceItem
(
title
:
"是"
.
local
,
isSelect
:
select
),
YHFormChoiceItem
(
title
:
"否"
.
local
,
isSelect
:
!
select
)]
cell
.
answerArr
=
answers
cell
.
answerBlock
=
{
[
weak
self
]
(
answers
,
index
)
in
guard
let
self
=
self
else
{
return
}
let
selectItem
=
answers
[
index
]
let
option
=
selectItem
.
title
==
"是"
.
local
if
detailItem
.
type
==
.
isNowInHK
{
self
.
child
?
.
setNowIsInHK
(
option
)
}
else
if
detailItem
.
type
==
.
isHaveHkIdentityCard
{
self
.
child
?
.
setHaveHKIdentityCard
(
option
)
if
!
option
{
self
.
child
?
.
hkIdentityCard
=
""
}
}
else
if
detailItem
.
type
==
.
isPreviousMarriageChild
{
self
.
child
?
.
setPreviousMarriageChild
(
option
)
}
self
.
loadInfo
()
save
()
}
}
return
cell
}
}
return
createDefaultCell
(
indexPath
)
}
func
tableView
(
_
tableView
:
UITableView
,
willDisplay
cell
:
UITableViewCell
,
forRowAt
indexPath
:
IndexPath
)
{
if
indexPath
.
section
>=
items
.
count
{
return
}
let
arr
:[
YHFormItemProtocol
]
=
items
[
indexPath
.
section
]
if
indexPath
.
row
>=
arr
.
count
{
return
}
createCorner
(
cell
:
cell
,
arr
:
arr
,
indexPath
:
indexPath
)
}
func
createDefaultCell
(
_
indexPath
:
IndexPath
)
->
UITableViewCell
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"UITableViewCell"
,
for
:
indexPath
)
return
cell
}
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
return
UITableView
.
automaticDimension
}
func
tableView
(
_
tableView
:
UITableView
,
viewForFooterInSection
section
:
Int
)
->
UIView
?
{
return
UIView
()
}
func
tableView
(
_
tableView
:
UITableView
,
viewForHeaderInSection
section
:
Int
)
->
UIView
?
{
return
UIView
()
}
private
func
tableView
(
_
tableView
:
UITableView
,
viewForHeaderInSection
section
:
Int
)
->
CGFloat
{
return
14.0
}
private
func
tableView
(
_
tableView
:
UITableView
,
viewForFooterInSection
section
:
Int
)
->
CGFloat
{
if
section
==
items
.
count
-
1
{
return
14.0
}
return
1.0
}
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
if
!
(
0
..<
items
.
count
)
.
contains
(
indexPath
.
section
)
{
return
}
let
arr
:[
YHFormItemProtocol
]
=
items
[
indexPath
.
section
]
if
!
(
0
..<
arr
.
count
)
.
contains
(
indexPath
.
row
)
{
return
}
let
item
=
arr
[
indexPath
.
row
]
if
item
is
YHFormDetailItem
{
let
detailItem
=
item
as!
YHFormDetailItem
if
detailItem
.
type
==
.
stayHKDate
{
// 出生日期/获准滞留至
var
title
=
""
if
detailItem
.
type
==
.
stayHKDate
{
title
=
"选择逗留日期"
}
YHDatePickView
.
show
(
type
:
.
yyyymmdd
,
title
:
title
,
lastIsTaday
:
true
,
currentDay
:
self
.
child
?
.
childInHk
.
info
??
""
)
{
[
weak
self
]
dateStr
in
guard
let
self
=
self
else
{
return
}
if
detailItem
.
type
==
.
stayHKDate
{
self
.
child
?
.
childInHk
.
info
=
dateStr
}
loadInfo
()
save
()
}
}
else
if
detailItem
.
type
==
.
birthCity
{
// 出生城市
return
// var isBirthOverSeas = false
// if let child = child {
// isBirthOverSeas = child.isBirthOverSeas()
// }
// // 出生国外时 出生城市是输入框
// if isBirthOverSeas { return }
//
// let vc = YHAddressViewController()
// vc.backLocationStringController = {
// [weak self] (string1, string2, string3, string4) in
// guard let self = self else { return }
// print("\(string1)\n\(string2)\n\(string3)\n\(string4)")
// var citys:[String] = []
// if !isEmptyString(string2) {
// citys.append(string2)
// }
// if !isEmptyString(string3) {
// citys.append(string3)
// }
// self.child?.birthPlace.area = citys
// self.loadInfo()
// save()
// }
// self.present(vc, animated: true)
}
else
if
detailItem
.
type
==
.
roleInHK
{
// 在港身份
let
identity
=
self
.
child
?
.
hkIdentity
??
""
YHSheetPickerView
.
show
(
type
:
.
identity
,
selectTitle
:
identity
)
{
[
weak
self
]
selectItem
in
guard
let
self
=
self
else
{
return
}
self
.
child
?
.
hkIdentity
=
selectItem
.
title
self
.
loadInfo
()
save
()
}
}
else
if
detailItem
.
type
==
.
occupation
{
// 职业
let
occupation
=
self
.
child
?
.
occupation
??
""
YHSheetPickerView
.
show
(
type
:
.
occupation
,
selectTitle
:
occupation
)
{
[
weak
self
]
selectItem
in
guard
let
self
=
self
else
{
return
}
self
.
child
?
.
occupation
=
selectItem
.
title
self
.
loadInfo
()
save
()
}
}
else
if
detailItem
.
type
==
.
gender
{
// 性别
YHSheetPickerView
.
show
(
type
:
.
gender
,
selectTitle
:
child
?
.
sexName
())
{
[
weak
self
]
selectItem
in
guard
let
self
=
self
else
{
return
}
self
.
child
?
.
setSexName
(
selectItem
.
title
)
self
.
loadInfo
()
save
()
}
}
else
if
detailItem
.
type
==
.
marriageState
{
// 婚姻
YHSheetPickerView
.
show
(
type
:
.
marriageText
,
selectTitle
:
self
.
child
?
.
married
)
{
[
weak
self
]
selectItem
in
guard
let
self
=
self
else
{
return
}
self
.
child
?
.
married
=
selectItem
.
title
self
.
loadInfo
()
save
()
}
}
}
}
func
createCorner
(
cell
:
UITableViewCell
,
arr
:
Array
<
Any
>
,
indexPath
:
IndexPath
)
{
// 复用时需清理
cell
.
layer
.
mask
=
nil
// 设置每块section圆角
if
(
indexPath
.
row
==
0
)
{
let
corner
=
UIRectCorner
(
rawValue
:
UIRectCorner
.
topLeft
.
rawValue
|
UIRectCorner
.
topRight
.
rawValue
)
cell
.
createCorner
(
CGSizeMake
(
12.0
,
12.0
),
corner
)
}
else
if
(
indexPath
.
row
==
arr
.
count
-
1
)
{
let
corner
=
UIRectCorner
(
rawValue
:
UIRectCorner
.
bottomLeft
.
rawValue
|
UIRectCorner
.
bottomRight
.
rawValue
)
cell
.
createCorner
(
CGSizeMake
(
12.0
,
12.0
),
corner
)
}
else
{
cell
.
layer
.
mask
=
nil
}
}
}
extension
YHGCChildBasicInfoVC
{
// 检查填写信息完整性
func
checkIntegrity
()
->
Bool
{
guard
let
child
=
child
else
{
return
false
}
if
isEmptyString
(
child
.
subsetName
)
||
child
.
sex
==
0
||
isEmptyString
(
child
.
married
){
return
false
}
if
child
.
isBirthOverSeas
()
{
if
isEmptyString
(
child
.
birthPlace
.
foreign
)
{
return
false
}
}
else
{
if
isEmptyString
(
child
.
birthPlace
.
details
)
{
return
false
}
}
// if isEmptyString(child.occupation) {
// return false
// }
// if child.isNowHaveJob(), isEmptyString(child.occupationName) {
// 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
)
{
return
false
}
}
return
true
}
func
nextStep
()
->
Bool
{
let
isChecked
=
checkIntegrity
()
isNeedShowError
=
!
isChecked
loadInfo
()
if
!
isChecked
{
YHHUD
.
flash
(
message
:
"资料还未填完"
)
return
false
}
guard
let
child
=
child
else
{
return
false
}
if
child
.
isHaveHKIdentityCard
(),
let
hkIdentityCard
=
child
.
hkIdentityCard
,
!
hkIdentityCard
.
isHKIdentityCardNumber
()
{
isNeedShowError
=
true
loadInfo
()
YHHUD
.
flash
(
message
:
"请输入正确的香港身份证号码"
)
return
false
}
return
true
}
func
save
()
{
if
let
delegate
=
delegate
,
delegate
.
responds
(
to
:
#selector(
YHSpouseInfoVCProtocol.saveInfoSilent
)
)
{
delegate
.
saveInfoSilent
()
}
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/TTPS(高才)/ServiceProcess(我的信息流程)/FamilyMember(家庭成员)/C/Child(子女)/YHGCChildInfoContainerVC.swift
0 → 100644
View file @
d5d3eee0
//
// YHGCChildInfoContainerVC.swift
// galaxy
//
// Created by Dufet on 2024/12/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
class
YHGCChildInfoContainerVC
:
YHBaseViewController
,
YHSpouseInfoVCProtocol
{
let
familyRequest
:
YHFamilyRequestViewModel
=
YHFamilyRequestViewModel
()
var
orderId
:
Int
=
0
var
child
:
YHFamilyMember
?
{
didSet
{
primaryInfoVC
.
child
=
child
uploadVC
.
familyMember
=
child
certificateVC
.
familyMember
=
child
basicInfoVC
.
child
=
child
}
}
var
mainApplicantInfo
:
YHMyMainApplicantInfoModel
?
{
didSet
{
if
let
mainApplicantInfo
=
mainApplicantInfo
{
primaryInfoVC
.
mainApplicantInfo
=
mainApplicantInfo
uploadVC
.
mainApplicantInfo
=
mainApplicantInfo
certificateVC
.
mainApplicantInfo
=
mainApplicantInfo
}
}
}
var
stepVCs
:[
YHFaimilyStepItem
]
=
[]
var
_currentStep
=
0
var
currentStep
:
Int
{
get
{
return
_currentStep
}
set
{
if
let
child
=
child
,
!
child
.
isFollow
(),
newValue
>
0
{
_currentStep
=
3
}
else
{
_currentStep
=
newValue
}
let
index
=
getArrayIndexOfCurrentStep
()
if
let
index
=
index
{
stepView
.
currentIndex
=
index
bottomView
.
changeRightBtnTitle
(
index
==
stepVCs
.
count
-
1
?
"提交"
.
local
:
"下一步"
.
local
)
}
for
vcItem
in
stepVCs
{
vcItem
.
vc
.
view
.
isHidden
=
(
vcItem
.
step
!=
currentStep
)
if
vcItem
.
step
==
currentStep
{
// 刷新
if
vcItem
.
vc
.
responds
(
to
:
#selector(
YHFamilyMemberProtol.loadInfo
)
)
{
vcItem
.
vc
.
loadInfo
()
}
}
}
}
}
var
stepView
:
YHStepView
=
{
let
step
=
YHStepView
()
return
step
}()
var
bottomView
:
YHSaveAndSubmitView
=
{
let
view
=
YHSaveAndSubmitView
.
createView
()
view
.
changeRightBtnTitle
(
"下一步"
)
return
view
}()
let
primaryInfoVC
=
YHGCChildPrimaryInfoVC
()
let
uploadVC
=
YHGCCertificateUploadVC
()
let
certificateVC
=
YHGCCertificateInfoController
()
let
basicInfoVC
=
YHGCChildBasicInfoVC
()
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
gk_navTitle
=
"子女信息填写"
.
local
gk_navigationBar
.
backgroundColor
=
.
white
view
.
backgroundColor
=
UIColor
(
hexString
:
"#F8F8F8"
)
createUI
()
}
func
createUI
()
{
guard
let
child
=
child
else
{
return
}
primaryInfoVC
.
delegate
=
self
uploadVC
.
delegate
=
self
certificateVC
.
delegate
=
self
basicInfoVC
.
delegate
=
self
updateStepView
()
print
(
"step:
\(
child
.
step
)
"
)
currentStep
=
child
.
step
stepView
.
maxIndex
=
getArrayIndexOfCurrentStep
()
??
stepVCs
.
count
-
1
view
.
addSubview
(
stepView
)
view
.
addSubview
(
bottomView
)
bottomView
.
submitBlock
=
{
[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
submit
()
}
bottomView
.
saveBlock
=
{
[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
self
.
saveInfo
(
isSubmit
:
false
,
isShowSubmitMsg
:
false
,
isShowLoading
:
true
,
callBack
:
nil
)
}
stepView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalTo
(
k_Height_NavigationtBarAndStatuBar
)
make
.
left
.
right
.
equalTo
(
view
)
make
.
height
.
equalTo
(
YHStepView
.
height
)
}
bottomView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
equalToSuperview
()
make
.
bottom
.
equalToSuperview
()
make
.
height
.
equalTo
(
YHSaveAndSubmitView
.
height
)
}
}
func
updateStepView
()
{
guard
let
child
=
child
else
{
return
}
for
vc
in
self
.
children
{
vc
.
willMove
(
toParent
:
nil
)
vc
.
removeFromParent
()
vc
.
view
.
removeFromSuperview
()
}
print
(
self
.
children
)
if
child
.
isFollow
()
{
stepVCs
=
[
YHFaimilyStepItem
(
title
:
"初始信息"
.
local
,
vc
:
primaryInfoVC
,
step
:
0
),
YHFaimilyStepItem
(
title
:
"证件上传"
.
local
,
vc
:
uploadVC
,
step
:
1
),
YHFaimilyStepItem
(
title
:
"证件信息"
.
local
,
vc
:
certificateVC
,
step
:
2
),
YHFaimilyStepItem
(
title
:
"基本信息"
.
local
,
vc
:
basicInfoVC
,
step
:
3
)]
}
else
{
stepVCs
=
[
YHFaimilyStepItem
(
title
:
"初始信息"
.
local
,
vc
:
primaryInfoVC
,
step
:
0
),
YHFaimilyStepItem
(
title
:
"基本信息"
.
local
,
vc
:
basicInfoVC
,
step
:
3
)]
}
var
titles
:[
String
]
=
[]
for
vcItem
in
stepVCs
{
let
topHeight
=
k_Height_NavigationtBarAndStatuBar
+
YHStepView
.
height
let
bottomHeight
=
YHSaveAndSubmitView
.
height
vcItem
.
vc
.
view
.
frame
=
CGRectMake
(
0
,
topHeight
,
KScreenWidth
,
KScreenHeight
-
topHeight
-
bottomHeight
)
self
.
addChild
(
vcItem
.
vc
)
self
.
view
.
addSubview
(
vcItem
.
vc
.
view
)
titles
.
append
(
vcItem
.
title
)
}
stepView
.
dataSource
=
titles
let
step
=
currentStep
currentStep
=
step
stepView
.
block
=
{
[
weak
self
]
index
in
guard
let
self
=
self
else
{
return
}
if
let
targetStep
=
getStepForArrayIndex
(
index
)
{
currentStep
=
targetStep
}
requestDetail
()
print
(
"index:
\(
index
)
"
)
}
self
.
view
.
bringSubviewToFront
(
stepView
)
self
.
view
.
bringSubviewToFront
(
bottomView
)
}
func
submit
()
{
if
let
targetVC
=
getCurrentStepViewController
()
{
if
targetVC
.
nextStep
()
{
var
isShowSubmitMsg
=
false
let
index
=
getArrayIndexOfCurrentStep
()
if
let
index
=
index
,
index
==
stepVCs
.
count
-
1
{
// 最后一步
isShowSubmitMsg
=
true
}
saveInfo
(
isSubmit
:
true
,
isShowSubmitMsg
:
isShowSubmitMsg
,
isShowLoading
:
true
)
{
[
weak
self
]
success
in
guard
let
self
=
self
else
{
return
}
if
success
{
// 当前步骤已是最后一步
if
let
vc
=
stepVCs
.
last
,
vc
.
step
==
currentStep
{
self
.
navigationController
?
.
popViewController
()
return
}
requestDetail
()
if
let
cur
=
getArrayIndexOfCurrentStep
(),
let
item
=
stepVCs
[
safe
:
cur
+
1
]
{
currentStep
=
item
.
step
if
cur
+
1
>
stepView
.
maxIndex
{
stepView
.
maxIndex
=
cur
+
1
}
}
print
(
"currentIndex:
\(
currentStep
)
"
)
}
}
}
}
}
// 【WARNING!】步骤step和在数组中的下标有时候并不是一一对应
func
getArrayIndexOfCurrentStep
()
->
Int
?
{
for
(
i
,
item
)
in
stepVCs
.
enumerated
()
{
if
item
.
step
==
currentStep
{
return
i
}
}
return
nil
}
// 【WARNING!】步骤step和在数组中的下标有时候并不是一一对应
func
getStepForArrayIndex
(
_
index
:
Int
)
->
Int
?
{
if
let
targetVCItem
=
stepVCs
[
safe
:
index
]
{
return
targetVCItem
.
step
}
return
nil
}
func
getCurrentStepViewController
()
->
(
UIViewController
&
YHFamilyMemberProtol
)?
{
for
vcItem
in
stepVCs
{
if
vcItem
.
step
==
currentStep
{
return
vcItem
.
vc
}
}
return
nil
}
}
extension
YHGCChildInfoContainerVC
{
// @param isSubmit:是否为提交 false为保存 true为提交
// @param isShowLoading: 是否展示loading和toast
//
func
saveInfo
(
isSubmit
:
Bool
,
isShowSubmitMsg
:
Bool
,
isShowLoading
:
Bool
,
callBack
:((
Bool
)
->
Void
)?)
{
guard
let
child
=
child
else
{
return
}
guard
let
info
=
child
.
toDictionary
()
else
{
return
}
let
dict
:[
String
:
Any
]
=
[
"order_id"
:
child
.
orderId
,
"relation"
:
child
.
relation
,
"step"
:
currentStep
,
"next"
:
isSubmit
,
"info"
:
info
]
self
.
familyRequest
.
addOrSaveFamilyMember
(
params
:
dict
,
isShowLoading
:
isShowLoading
)
{
[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
if
isShowLoading
{
if
success
{
YHHUD
.
flash
(
message
:
isSubmit
&&
isShowSubmitMsg
?
"提交成功"
:
"保存成功"
)
}
else
{
var
msg
=
isSubmit
&&
isShowSubmitMsg
?
"提交失败"
:
"保存失败"
if
let
errorMsg
=
error
?
.
errorMsg
,
errorMsg
.
count
>
0
{
msg
=
errorMsg
}
YHHUD
.
flash
(
message
:
msg
)
}
}
if
let
callBack
=
callBack
{
callBack
(
success
)
}
}
}
func
requestDetail
()
{
guard
let
child
=
child
else
{
return
}
if
orderId
<=
0
||
child
.
detailId
<=
0
{
print
(
"订单号或成员ID不存在"
)
return
}
self
.
familyRequest
.
requestFamilyMemberInfo
(
orderId
:
orderId
,
detailId
:
child
.
detailId
)
{
[
weak
self
]
detail
,
error
in
guard
let
self
=
self
else
{
return
}
if
let
detail
=
detail
{
self
.
child
=
detail
for
vcItem
in
stepVCs
{
vcItem
.
vc
.
loadInfo
()
}
}
}
}
func
saveInfoSilent
()
{
saveInfo
(
isSubmit
:
false
,
isShowSubmitMsg
:
false
,
isShowLoading
:
false
,
callBack
:
nil
)
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/TTPS(高才)/ServiceProcess(我的信息流程)/FamilyMember(家庭成员)/C/Child(子女)/YHGCChildPrimaryInfoVC.swift
0 → 100644
View file @
d5d3eee0
//
// YHGCChildPrimaryInfoVC.swift
// galaxy
//
// Created by Dufet on 2024/12/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
class
YHGCChildPrimaryInfoVC
:
YHBaseViewController
,
YHFamilyMemberProtol
{
var
child
:
YHFamilyMember
?
var
mainApplicantInfo
:
YHMyMainApplicantInfoModel
?
weak
var
delegate
:
YHSpouseInfoVCProtocol
?
var
isNeedShowError
=
false
// 是否随行能编辑
var
isFollowCanEdit
=
true
lazy
var
items
:[[
YHFormItemProtocol
]]
=
[[
YHFormItemProtocol
]]()
lazy
var
tableView
:
UITableView
=
{
let
tableView
=
UITableView
(
frame
:
.
zero
,
style
:
.
grouped
)
if
#available(iOS 11.0, *)
{
tableView
.
contentInsetAdjustmentBehavior
=
.
never
}
tableView
.
estimatedSectionHeaderHeight
=
14.0
tableView
.
estimatedSectionFooterHeight
=
1.0
tableView
.
showsVerticalScrollIndicator
=
false
tableView
.
backgroundColor
=
UIColor
(
hexString
:
"#F8F8F8"
)
tableView
.
separatorStyle
=
.
none
tableView
.
delegate
=
self
tableView
.
dataSource
=
self
tableView
.
register
(
UITableViewCell
.
self
,
forCellReuseIdentifier
:
"UITableViewCell"
)
tableView
.
register
(
YHFormItemDoubleChoiceCell
.
self
,
forCellReuseIdentifier
:
YHFormItemDoubleChoiceCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemInputTextCell
.
self
,
forCellReuseIdentifier
:
YHFormItemInputTextCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemEnterDetailCell
.
self
,
forCellReuseIdentifier
:
YHFormItemEnterDetailCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemTitleCell
.
self
,
forCellReuseIdentifier
:
YHFormItemTitleCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemAddCell
.
self
,
forCellReuseIdentifier
:
YHFormItemAddCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemSelectSheetCell
.
self
,
forCellReuseIdentifier
:
YHFormItemSelectSheetCell
.
cellReuseIdentifier
)
return
tableView
}()
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
gk_navigationBar
.
isHidden
=
true
view
.
backgroundColor
=
UIColor
(
hexString
:
"#F8F8F8"
)
createUI
()
loadInfo
()
}
func
loadInfo
()
{
guard
let
child
=
child
else
{
return
}
items
.
removeAll
()
isFollowCanEdit
=
!
child
.
is18YearsOld
()
// 随行
let
title0
=
YHFormTitleItem
(
type
:
.
accompany
)
let
item00
=
YHFormDetailItem
(
type
:
.
ownCustody
,
value
:
String
(
child
.
isOwnCustody
()))
let
item01
=
YHFormDetailItem
(
type
:
.
birthday
,
value
:
child
.
birthday
,
tips
:
"请选择出生日期"
.
local
)
let
item02
=
YHFormDetailItem
(
type
:
.
isAccompanyToHK
,
value
:
String
(
child
.
isFollow
()))
let
arr0
:[
YHFormItemProtocol
]
=
[
title0
,
item00
,
item01
,
item02
]
items
.
append
(
arr0
)
if
child
.
isFollow
()
{
// 随行才加后面的信息
// 国籍
let
title1
=
YHFormTitleItem
(
type
:
.
nationality
)
let
item10
=
YHFormDetailItem
(
type
:
.
nationOrArea
,
value
:
child
.
nationality
,
tips
:
"请选择国籍"
.
local
)
let
arr1
:[
YHFormItemProtocol
]
=
[
title1
,
item10
]
// 居住信息
let
title2
=
YHFormTitleItem
(
type
:
.
liveInfo
)
let
item20
=
YHFormDetailItem
(
type
:
.
isLiveTother
,
value
:
String
(
child
.
isLiveTother
()))
var
arr2
:
[
YHFormItemProtocol
]
=
[
title2
,
item20
]
if
!
child
.
isLiveTother
()
{
// 不同住 才需填写国家/地区
let
item21
=
YHFormDetailItem
(
type
:
.
nationOrArea
,
value
:
child
.
address
.
country
,
tips
:
"请选择国家/地区"
.
local
)
arr2
.
append
(
item21
)
// 国家/地区已填写 才显示现居住城市和详细地址两行
if
!
child
.
address
.
country
.
isEmpty
{
// 居住信息中选择中国才会显示现居住城市
let
isLiveInChina
=
child
.
address
.
country
.
contains
(
"中国"
.
local
)
if
isLiveInChina
{
var
value
=
""
if
!
child
.
address
.
area
.
isEmpty
{
value
=
child
.
address
.
area
.
joined
(
separator
:
","
)
}
let
item22
=
YHFormDetailItem
(
type
:
.
liveCity
,
value
:
value
,
tips
:
"请选择现居住城市"
.
local
)
arr2
.
append
(
item22
)
}
let
placeHolder
=
(
isLiveInChina
?
"请填写小区、楼栋、单元室等"
.
local
:
"请填写国外居住地"
.
local
)
let
detailAddress
=
isLiveInChina
?
child
.
address
.
details
:
child
.
address
.
foreign
let
item23
=
YHFormDetailItem
(
type
:
.
detailAddress
,
value
:
detailAddress
,
placeHolder
:
placeHolder
,
tips
:
placeHolder
)
arr2
.
append
(
item23
)
if
!
isLiveInChina
{
// 在国外
// 是否在海外居住满1年及以上
let
item24
=
YHFormDetailItem
(
type
:
.
isLiveOverSeasMore1Year
,
value
:
String
(
child
.
isOverSeasOver1Year
()))
arr2
.
append
(
item24
)
}
}
}
items
.
append
(
contentsOf
:[
arr1
,
arr2
])
// 港澳通信证
var
isHiddenHK
=
true
// 国籍
let
nationality
=
child
.
nationality
// 居住国家
var
liveCountry
=
child
.
address
.
country
// 居住海外是否满一年
var
isLiveOverseaYear
=
child
.
isOverSeasOver1Year
()
if
child
.
isLiveTother
(),
let
mainApplicantInfo
=
mainApplicantInfo
{
// 与主申请人同住需要用主申请人居住信息判断
liveCountry
=
mainApplicantInfo
.
applicant_address
.
country
isLiveOverseaYear
=
mainApplicantInfo
.
isOverSeasOver1Year
()
}
if
child
.
nationality
.
contains
(
"中国"
)
{
// 中国国籍
let
isLiveInChina
=
liveCountry
.
contains
(
"中国"
.
local
)
if
isLiveInChina
||
(
!
isLiveInChina
&&
!
isLiveOverseaYear
)
{
// 中国国籍&居住国内、中国国籍&居住国外不满一年 需展示“港澳通行证”询问框
isHiddenHK
=
false
}
}
if
!
isHiddenHK
{
let
title3
=
YHFormTitleItem
(
type
:
.
hkAndMacaoPassport
)
let
item30
=
YHFormDetailItem
(
type
:
.
isHandleHKPassPort
,
value
:
String
(
child
.
isNeedHandleHKPassPort
()))
let
arr3
:[
YHFormItemProtocol
]
=
[
title3
,
item30
]
items
.
append
(
arr3
)
}
}
tableView
.
reloadData
()
}
func
createUI
()
{
view
.
addSubview
(
tableView
);
let
topHeight
=
k_Height_NavigationtBarAndStatuBar
+
YHStepView
.
height
let
bottomHeight
=
YHSaveAndSubmitView
.
height
tableView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalToSuperview
()
make
.
left
.
equalToSuperview
()
.
offset
(
16
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
16
)
make
.
height
.
equalTo
(
KScreenHeight
-
topHeight
-
bottomHeight
)
}
}
func
getCellType
(
_
item
:
Any
)
->
HKFormItemCellType
{
if
item
is
YHFormTitleItem
{
return
.
title
}
if
item
is
YHFormDetailItem
{
let
detailItem
=
item
as!
YHFormDetailItem
if
detailItem
.
type
==
.
birthCity
{
var
isBirthOverSeas
=
false
if
let
child
=
child
{
isBirthOverSeas
=
child
.
isBirthOverSeas
()
}
if
isBirthOverSeas
{
return
.
inputText
}
else
{
return
.
selectSheet
}
}
if
detailItem
.
type
==
.
detailAddress
{
return
.
inputText
}
if
detailItem
.
type
==
.
nationOrArea
||
detailItem
.
type
==
.
nationOrArea
||
detailItem
.
type
==
.
liveCity
||
detailItem
.
type
==
.
birthday
{
return
.
selectSheet
}
if
detailItem
.
type
==
.
isAccompanyToHK
||
detailItem
.
type
==
.
isHandleHKPassPort
||
detailItem
.
type
==
.
ownCustody
||
detailItem
.
type
==
.
isLiveTother
||
detailItem
.
type
==
.
isLiveOverSeasMore1Year
{
return
.
twoChoice
}
}
return
.
defaultType
}
}
extension
YHGCChildPrimaryInfoVC
:
UITableViewDelegate
,
UITableViewDataSource
{
func
numberOfSections
(
in
tableView
:
UITableView
)
->
Int
{
return
items
.
count
}
func
tableView
(
_
tableView
:
UITableView
,
numberOfRowsInSection
section
:
Int
)
->
Int
{
if
section
>=
items
.
count
{
return
0
}
let
arr
=
items
[
section
]
return
arr
.
count
}
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
if
indexPath
.
section
>=
items
.
count
{
return
createDefaultCell
(
indexPath
)
}
let
arr
:[
YHFormItemProtocol
]
=
items
[
indexPath
.
section
]
if
indexPath
.
row
>=
arr
.
count
{
return
createDefaultCell
(
indexPath
)
}
let
item
:
YHFormItemProtocol
=
arr
[
indexPath
.
row
]
if
item
is
YHFormTitleItem
{
// 标题
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemTitleCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemTitleCell
cell
.
setTitleAndSubTitle
(
title
:
item
.
getTitle
())
return
cell
}
else
if
item
is
YHFormDetailItem
{
// 具体信息
let
detailItem
=
item
as!
YHFormDetailItem
let
cellType
=
self
.
getCellType
(
detailItem
)
if
cellType
==
.
twoChoice
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemDoubleChoiceCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemDoubleChoiceCell
cell
.
isMust
=
detailItem
.
isNeed
cell
.
title
=
detailItem
.
getTitle
()
cell
.
enableEdit
=
true
cell
.
disableEditTips
=
nil
var
select
=
false
if
let
value
=
detailItem
.
value
{
select
=
Bool
(
value
)
!
}
if
detailItem
.
type
==
.
isAccompanyToHK
,
let
child
=
child
,
child
.
is18YearsOld
()
{
// 是否随行至香港
// 年满18岁不能随行 随行按钮不可编辑固定为否
cell
.
enableEdit
=
isFollowCanEdit
cell
.
disableEditTips
=
"年满十八岁的子女不能随行至香港"
}
let
answers
=
[
YHFormChoiceItem
(
title
:
"是"
.
local
,
isSelect
:
select
),
YHFormChoiceItem
(
title
:
"否"
.
local
,
isSelect
:
!
select
)]
cell
.
answerArr
=
answers
cell
.
answerBlock
=
{
[
weak
self
]
(
arr
,
selectIndex
)
in
let
selectItem
:
YHFormChoiceItem
=
arr
[
selectIndex
]
let
option
=
(
selectItem
.
title
==
"是"
.
local
?
true
:
false
)
guard
let
self
=
self
else
{
return
}
if
detailItem
.
type
==
.
isAccompanyToHK
{
// 是否随行
self
.
child
?
.
setFollow
(
option
)
if
let
delegate
=
delegate
,
delegate
.
responds
(
to
:
#selector(
YHSpouseInfoVCProtocol.updateStepView
)
)
{
delegate
.
updateStepView
()
}
}
else
if
detailItem
.
type
==
.
isHandleHKPassPort
{
// 是否办理港澳通行证
self
.
child
?
.
setNeedHandleHKPassPort
(
option
)
}
else
if
detailItem
.
type
==
.
isLiveTother
{
// 是否与主申请人同住
self
.
child
?
.
setLiveTother
(
option
)
if
option
{
self
.
child
?
.
address
.
clearAddress
()
}
}
else
if
detailItem
.
type
==
.
isLiveOverSeasMore1Year
{
// 是否在海外居住满1年及以上
self
.
child
?
.
setOverSearsOver1Year
(
option
)
}
else
if
detailItem
.
type
==
.
ownCustody
{
// 抚养权
self
.
child
?
.
setOwnCustody
(
option
)
}
self
.
loadInfo
()
save
()
}
return
cell
}
else
if
cellType
==
.
selectSheet
{
// 选择列表面板
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemSelectSheetCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemSelectSheetCell
cell
.
isMust
=
detailItem
.
isNeed
cell
.
title
=
detailItem
.
getTitle
()
cell
.
detail
=
detailItem
.
value
cell
.
setTips
(
detailItem
.
tips
,
isShow
:
isNeedShowError
&&
detailItem
.
isShowTips
)
return
cell
}
else
if
cellType
==
.
inputText
{
// 输入文字cell
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemInputTextCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemInputTextCell
cell
.
isMust
=
detailItem
.
isNeed
cell
.
placeHolder
=
detailItem
.
placeHolder
cell
.
title
=
detailItem
.
getTitle
()
cell
.
text
=
detailItem
.
value
cell
.
setTips
(
detailItem
.
tips
,
isShow
:
isNeedShowError
&&
detailItem
.
isShowTips
)
cell
.
textInputCondtion
=
{
textField
in
if
let
textStr
=
textField
.
text
{
let
max
=
100
textField
.
text
=
textStr
.
count
>
max
?
textStr
[
safe
:
..<
max
]
:
textStr
}
return
true
}
cell
.
textChange
=
{
[
weak
self
]
(
text
,
isEditEnd
)
in
guard
let
self
=
self
else
{
return
}
guard
let
child
=
child
else
{
return
}
if
detailItem
.
type
==
.
detailAddress
{
if
child
.
isLiveInChina
()
{
child
.
address
.
details
=
text
??
""
}
else
{
child
.
address
.
foreign
=
text
??
""
}
}
if
isEditEnd
{
self
.
loadInfo
()
save
()
}
}
return
cell
}
}
return
createDefaultCell
(
indexPath
)
}
func
tableView
(
_
tableView
:
UITableView
,
willDisplay
cell
:
UITableViewCell
,
forRowAt
indexPath
:
IndexPath
)
{
if
indexPath
.
section
>=
items
.
count
{
return
}
let
arr
:[
YHFormItemProtocol
]
=
items
[
indexPath
.
section
]
if
indexPath
.
row
>=
arr
.
count
{
return
}
createCorner
(
cell
:
cell
,
arr
:
arr
,
indexPath
:
indexPath
)
}
func
createDefaultCell
(
_
indexPath
:
IndexPath
)
->
UITableViewCell
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"UITableViewCell"
,
for
:
indexPath
)
return
cell
}
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
return
UITableView
.
automaticDimension
}
func
tableView
(
_
tableView
:
UITableView
,
viewForFooterInSection
section
:
Int
)
->
UIView
?
{
return
UIView
()
}
func
tableView
(
_
tableView
:
UITableView
,
viewForHeaderInSection
section
:
Int
)
->
UIView
?
{
return
UIView
()
}
private
func
tableView
(
_
tableView
:
UITableView
,
viewForHeaderInSection
section
:
Int
)
->
CGFloat
{
return
14.0
}
private
func
tableView
(
_
tableView
:
UITableView
,
viewForFooterInSection
section
:
Int
)
->
CGFloat
{
if
section
==
items
.
count
-
1
{
return
14.0
}
return
1.0
}
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
if
!
(
0
..<
items
.
count
)
.
contains
(
indexPath
.
section
)
{
return
}
let
arr
:[
YHFormItemProtocol
]
=
items
[
indexPath
.
section
]
if
!
(
0
..<
arr
.
count
)
.
contains
(
indexPath
.
row
)
{
return
}
let
item
=
arr
[
indexPath
.
row
]
if
item
is
YHFormDetailItem
{
let
detailItem
=
item
as!
YHFormDetailItem
// 选国籍/现居住城市/详细地址
if
detailItem
.
type
==
.
nationOrArea
{
let
vc
=
YHSelectCountryViewController
()
vc
.
backLocationStringController
=
{
[
weak
self
]
country
in
guard
let
self
=
self
else
{
return
}
let
title
=
arr
[
0
]
as!
YHFormTitleItem
if
title
.
type
==
.
nationality
{
// 选国籍
self
.
child
?
.
nationality
=
country
}
else
if
title
.
type
==
.
liveInfo
{
// // 居住信息选国家地区
self
.
child
?
.
address
.
country
=
country
// 选择国家地区后需清空城市
self
.
child
?
.
address
.
area
=
[]
}
self
.
loadInfo
()
save
()
}
self
.
navigationController
?
.
pushViewController
(
vc
)
}
else
if
detailItem
.
type
==
.
liveCity
{
var
provice
=
""
if
let
country
=
self
.
child
?
.
address
.
country
{
if
country
.
contains
(
"台湾"
)
{
provice
=
"台湾省"
}
if
country
.
contains
(
"香港"
)
{
provice
=
"香港特别行政区"
}
if
country
.
contains
(
"澳门"
)
{
provice
=
"澳门特别行政区"
}
}
let
addressPicker
=
YHAddressViewController
(
selectProvince
:
provice
)
addressPicker
.
backLocationStringController
=
{
[
weak
self
]
(
address
,
province
,
city
,
area
)
in
guard
let
self
=
self
else
{
return
}
print
(
"
\(
address
)\n\(
province
)\n\(
city
)\n\(
area
)
"
)
var
citys
:[
String
]
=
[]
if
!
isEmptyString
(
province
)
{
citys
.
append
(
province
)
}
if
!
isEmptyString
(
city
)
{
citys
.
append
(
city
)
}
self
.
child
?
.
address
.
area
=
citys
self
.
loadInfo
()
save
()
}
UIViewController
.
current
?
.
present
(
addressPicker
,
animated
:
true
,
completion
:
nil
)
}
else
if
detailItem
.
type
==
.
birthday
{
// 出生日期
// 子女选择年满18岁则【是否随行至香港】默认选择否,不可修改
// 如果未年满18岁则【是否随行至香港】可选择【是/否】,可修改
YHDatePickView
.
show
(
type
:
.
yyyymmdd
,
title
:
"选择出生日期"
.
local
,
lastIsTaday
:
true
,
currentDay
:
child
?
.
birthday
??
""
)
{
[
weak
self
]
date
in
guard
let
self
=
self
else
{
return
}
if
detailItem
.
type
==
.
birthday
{
guard
let
child
=
child
else
{
return
}
child
.
birthday
=
date
isFollowCanEdit
=
!
child
.
is18YearsOld
()
if
child
.
is18YearsOld
()
{
child
.
setFollow
(
false
)
}
if
let
delegate
=
delegate
,
delegate
.
responds
(
to
:
#selector(
YHSpouseInfoVCProtocol.updateStepView
)
)
{
delegate
.
updateStepView
()
}
}
self
.
loadInfo
()
save
()
}
}
}
}
func
createCorner
(
cell
:
UITableViewCell
,
arr
:
Array
<
Any
>
,
indexPath
:
IndexPath
)
{
// 复用时需清理
cell
.
layer
.
mask
=
nil
// 设置每块section圆角
if
(
indexPath
.
row
==
0
)
{
let
corner
=
UIRectCorner
(
rawValue
:
UIRectCorner
.
topLeft
.
rawValue
|
UIRectCorner
.
topRight
.
rawValue
)
cell
.
createCorner
(
CGSizeMake
(
12.0
,
12.0
),
corner
)
}
else
if
(
indexPath
.
row
==
arr
.
count
-
1
)
{
let
corner
=
UIRectCorner
(
rawValue
:
UIRectCorner
.
bottomLeft
.
rawValue
|
UIRectCorner
.
bottomRight
.
rawValue
)
cell
.
createCorner
(
CGSizeMake
(
12.0
,
12.0
),
corner
)
}
else
{
cell
.
layer
.
mask
=
nil
}
}
}
extension
YHGCChildPrimaryInfoVC
{
// 检查填写信息完整性
func
checkIntegrity
()
->
Bool
{
guard
let
child
=
child
else
{
return
false
}
if
!
child
.
isFollow
()
{
if
isEmptyString
(
child
.
birthday
)
{
return
false
}
return
true
}
if
isEmptyString
(
child
.
birthday
)
{
return
false
}
if
isEmptyString
(
child
.
nationality
)
{
return
false
}
if
!
child
.
isLiveTother
()
{
// 没有与主申请人同住
if
isEmptyString
(
child
.
address
.
country
)
{
return
false
}
if
child
.
isLiveInChina
()
{
if
isEmptyArray
(
child
.
address
.
area
)
{
return
false
}
if
isEmptyString
(
child
.
address
.
details
)
{
return
false
}
}
else
{
// 住在国外
if
isEmptyString
(
child
.
address
.
foreign
)
{
return
false
}
}
}
return
true
}
func
nextStep
()
->
Bool
{
let
isChecked
=
checkIntegrity
()
isNeedShowError
=
!
isChecked
loadInfo
()
if
!
isChecked
{
YHHUD
.
flash
(
message
:
"资料还未填完"
)
return
false
}
return
true
}
func
save
()
{
if
let
delegate
=
delegate
,
delegate
.
responds
(
to
:
#selector(
YHSpouseInfoVCProtocol.saveInfoSilent
)
)
{
delegate
.
saveInfoSilent
()
}
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/TTPS(高才)/ServiceProcess(我的信息流程)/FamilyMember(家庭成员)/C/Spouse(配偶)/YHGCSpouseBasicInfoVC.swift
0 → 100644
View file @
d5d3eee0
//
// YHGCSpouseBasicInfoVC.swift
// galaxy
//
// Created by Dufet on 2024/12/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
class
YHGCSpouseBasicInfoVC
:
YHBaseViewController
,
YHFamilyMemberProtol
{
var
spouse
:
YHFamilyMember
?
weak
var
delegate
:
YHSpouseInfoVCProtocol
?
// 是否显示未填写错误提示
var
isNeedShowError
=
false
var
items
:[[
YHFormItemProtocol
]]
=
[[
YHFormItemProtocol
]]()
lazy
var
tableView
:
UITableView
=
{
let
tableView
=
UITableView
(
frame
:
.
zero
,
style
:
.
grouped
)
if
#available(iOS 11.0, *)
{
tableView
.
contentInsetAdjustmentBehavior
=
.
never
}
tableView
.
estimatedSectionHeaderHeight
=
14.0
tableView
.
estimatedSectionFooterHeight
=
1.0
tableView
.
showsVerticalScrollIndicator
=
false
tableView
.
backgroundColor
=
UIColor
(
hexString
:
"#F8F8F8"
)
tableView
.
separatorStyle
=
.
none
tableView
.
delegate
=
self
tableView
.
dataSource
=
self
tableView
.
register
(
UITableViewCell
.
self
,
forCellReuseIdentifier
:
"UITableViewCell"
)
tableView
.
register
(
YHFormItemDoubleChoiceCell
.
self
,
forCellReuseIdentifier
:
YHFormItemDoubleChoiceCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemInputTextCell
.
self
,
forCellReuseIdentifier
:
YHFormItemInputTextCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemEnterDetailCell
.
self
,
forCellReuseIdentifier
:
YHFormItemEnterDetailCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemTitleCell
.
self
,
forCellReuseIdentifier
:
YHFormItemTitleCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemAddCell
.
self
,
forCellReuseIdentifier
:
YHFormItemAddCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemSelectSheetCell
.
self
,
forCellReuseIdentifier
:
YHFormItemSelectSheetCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemDegreeInfoCell
.
self
,
forCellReuseIdentifier
:
YHFormItemDegreeInfoCell
.
cellReuseIdentifier
)
return
tableView
}()
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
gk_navigationBar
.
isHidden
=
true
view
.
backgroundColor
=
UIColor
(
hexString
:
"#F8F8F8"
)
createUI
()
loadInfo
()
}
func
createUI
()
{
view
.
addSubview
(
tableView
);
let
topHeight
=
k_Height_NavigationtBarAndStatuBar
+
YHStepView
.
height
let
bottomHeight
=
YHSaveAndSubmitView
.
height
tableView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalToSuperview
()
make
.
left
.
equalToSuperview
()
.
offset
(
16
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
16
)
make
.
height
.
equalTo
(
KScreenHeight
-
topHeight
-
bottomHeight
)
}
}
func
loadInfo
()
{
guard
let
spouse
=
spouse
else
{
return
}
items
.
removeAll
()
// 配偶信息
let
title0
=
YHFormTitleItem
(
type
:
.
spouseInfo
)
let
item00
=
YHFormDetailItem
(
type
:
.
spouseName
)
item00
.
placeHolder
=
"请输入"
.
local
item00
.
value
=
spouse
.
subsetName
item00
.
tips
=
"请输入配偶姓名"
.
local
let
item01
=
YHFormDetailItem
(
type
:
.
everName
,
isNeed
:
false
)
item01
.
placeHolder
=
"选填"
.
local
item01
.
value
=
spouse
.
usedName
let
item02
=
YHFormDetailItem
(
type
:
.
befourMarryFirstName
,
isNeed
:
false
)
item02
.
placeHolder
=
"如有则填写,仅支持输入字"
.
local
item02
.
value
=
spouse
.
surname
let
item03
=
YHFormDetailItem
(
type
:
.
birthday
)
item03
.
placeHolder
=
"请选择"
.
local
item03
.
value
=
spouse
.
birthday
item03
.
tips
=
"请选择出生日期"
.
local
let
item04
=
YHFormDetailItem
(
type
:
.
birthNation
)
item04
.
value
=
String
(
spouse
.
isBirthOverSeas
())
let
item05
=
YHFormDetailItem
(
type
:
.
birthCity
)
if
spouse
.
isBirthOverSeas
()
{
item05
.
value
=
spouse
.
birthPlace
.
foreign
item05
.
placeHolder
=
"请输入"
.
local
item05
.
tips
=
"请输入出生城市"
.
local
}
else
{
item05
.
value
=
spouse
.
birthPlace
.
details
item05
.
placeHolder
=
"请输入"
.
local
item05
.
tips
=
"请输入出生城市"
.
local
// item05.value = spouse.birthPlace.area.joined(separator: ",")
// item05.placeHolder = "请选择".local
// item05.tips = "请选择出生城市".local
}
let
arr0
:[
YHFormItemProtocol
]
=
[
title0
,
item00
,
item01
,
item02
,
item03
,
item04
,
item05
]
items
.
append
(
arr0
)
// 职业信息
// let title1 = YHFormTitleItem(type: .occupationInfo)
// let item10 = YHFormDetailItem(type: .occupation)
// item10.value = spouse.occupation
// item10.placeHolder = "请选择".local
// item10.tips = "请选择职业".local
//
// var arr1:[YHFormItemProtocol] = [title1, item10]
//
// if spouse.isNowHaveJob() {
// let item11 = YHFormDetailItem(type: .occupationName)
// item11.value = spouse.occupationName
// item11.placeHolder = "请输入".local
// item11.tips = "请输入职业名称".local
// arr1.append(item11)
// }
//
// 学位信息
// let title2 = YHFormTitleItem(type: .degreeInfo)
// let item20 = YHFormDetailItem(type: .ownDegree)
// item20.placeHolder = "请选择".local
// item20.value = spouse.hasDegreeName()
// item20.tips = "请选择是否拥有学位".local
//
// var arr2:[YHFormItemProtocol] = [title2, item20]
//
// if spouse.isHaveDegree() { // 选择了有学位
// if !spouse.hasDegreeJson.isEmpty {
// for degreeInfo in spouse.hasDegreeJson {
// let item = YHFormDetailItem(type: .degreeDetailInfo)
// arr2.append(item)
// }
// } else { // 学位数组为空则添加一个
// let item = YHFormDetailItem(type: .degreeDetailInfo)
// let newDegree = YHHasDegreeJson()
// spouse.hasDegreeJson = [newDegree]
// arr2.append(item)
// }
// // 添加一行增加学历学位信息
// let item = YHFormAddItem(type: .addDegree)
// arr2.append(item)
// }
// items.append(contentsOf: [arr1, arr2])
// if spouse.isFollow() {
// // 在港信息
// let title3 = YHFormTitleItem(type: .inHongKongInfo)
// let item30 = YHFormDetailItem(type: .isNowInHK)
// item30.value = String(spouse.isNowInHK())
// var arr3:[YHFormItemProtocol] = [title3, item30]
//
// if spouse.isNowInHK() { // 目前在港才显示 逗留期限和在港身份
// let item31 = YHFormDetailItem(type: .stayHKDate)
// item31.placeHolder = "请选择".local
// item31.value = spouse.childInHk.info
// item31.tips = "请选择".local
//
// let item32 = YHFormDetailItem(type: .roleInHK)
// item32.placeHolder = "请选择".local
// item32.value = spouse.hkIdentity
// item32.tips = "请选择".local
//
// arr3.append(contentsOf: [item31, item32])
// }
// items.append(arr3)
// }
// 香港身份证
let
title4
=
YHFormTitleItem
(
type
:
.
hkIdentityCardInfo
)
let
item40
=
YHFormDetailItem
(
type
:
.
isHaveHkIdentityCard
)
item40
.
value
=
String
(
spouse
.
isHaveHKIdentityCard
())
var
arr4
:[
YHFormItemProtocol
]
=
[
title4
,
item40
]
if
spouse
.
isHaveHKIdentityCard
()
{
// 办理过香港身份证才显示证号
let
item41
=
YHFormDetailItem
(
type
:
.
hkIdentityCardNumber
)
item41
.
value
=
spouse
.
hkIdentityCard
let
tips
=
isEmptyString
(
spouse
.
hkIdentityCard
)
?
"请输入香港身份证号码"
.
local
:
"请输入正确的香港身份证号码"
.
local
item41
.
tips
=
tips
arr4
.
append
(
item41
)
}
items
.
append
(
arr4
)
tableView
.
reloadData
()
}
// 检查填写信息完整性
func
checkIntegrity
()
->
Bool
{
guard
let
spouse
=
spouse
else
{
return
false
}
if
isEmptyString
(
spouse
.
subsetName
)
{
return
false
}
if
isEmptyString
(
spouse
.
birthday
)
{
return
false
}
if
spouse
.
isBirthOverSeas
()
{
if
isEmptyString
(
spouse
.
birthPlace
.
foreign
)
{
return
false
}
}
else
{
if
isEmptyString
(
spouse
.
birthPlace
.
details
)
{
return
false
}
}
// if isEmptyString(spouse.occupation) {
// return false
// }
// if spouse.isNowHaveJob(), isEmptyString(spouse.occupationName) {
// return false
// }
// if spouse.hasDegree.isEmpty {
// return false
// }
// if spouse.isHaveDegree() { // 选择了有学位
// if !spouse.hasDegreeJson.isEmpty {
// for degreeInfo in spouse.hasDegreeJson {
// if isEmptyString(degreeInfo.degree) || isEmptyString(degreeInfo.address) {
// return false
// }
// }
// }
// }
// if spouse.isFollow() {
// if spouse.isNowInHK() {
// if isEmptyString(spouse.childInHk.info) || isEmptyString(spouse.hkIdentity) {
// return false
// }
// }
// }
if
spouse
.
isHaveHKIdentityCard
()
{
if
isEmptyString
(
spouse
.
hkIdentityCard
)
{
return
false
}
}
return
true
}
func
nextStep
()
->
Bool
{
guard
let
spouse
=
spouse
else
{
return
false
}
let
isChecked
=
checkIntegrity
()
isNeedShowError
=
!
isChecked
loadInfo
()
if
!
isChecked
{
YHHUD
.
flash
(
message
:
"资料还未填完"
)
return
false
}
if
spouse
.
isHaveHKIdentityCard
(),
let
hkIdentityCard
=
spouse
.
hkIdentityCard
,
!
hkIdentityCard
.
isHKIdentityCardNumber
()
{
isNeedShowError
=
true
loadInfo
()
YHHUD
.
flash
(
message
:
"请输入正确的香港身份证号码"
)
return
false
}
return
true
}
func
getCellType
(
_
item
:
Any
)
->
HKFormItemCellType
{
if
item
is
YHFormTitleItem
{
return
.
title
}
if
item
is
YHFormAddItem
{
return
.
addItem
}
if
item
is
YHFormDetailItem
{
let
detailItem
=
item
as!
YHFormDetailItem
if
detailItem
.
type
==
.
birthCity
{
return
.
inputText
// var isBirthOverSeas = false
// if let spouse = spouse {
// isBirthOverSeas = spouse.isBirthOverSeas()
// }
// if isBirthOverSeas {
// return .inputText
// } else {
// return .selectSheet
// }
}
if
detailItem
.
type
==
.
spouseName
||
detailItem
.
type
==
.
everName
||
detailItem
.
type
==
.
befourMarryFirstName
||
detailItem
.
type
==
.
occupationName
||
detailItem
.
type
==
.
hkIdentityCardNumber
{
return
.
inputText
}
if
detailItem
.
type
==
.
birthday
||
detailItem
.
type
==
.
occupation
||
detailItem
.
type
==
.
stayHKDate
||
detailItem
.
type
==
.
roleInHK
||
detailItem
.
type
==
.
ownDegree
{
return
.
selectSheet
}
if
detailItem
.
type
==
.
birthNation
||
detailItem
.
type
==
.
isNowInHK
||
detailItem
.
type
==
.
isHaveHkIdentityCard
{
return
.
twoChoice
}
if
detailItem
.
type
==
.
degreeDetailInfo
{
return
.
degreeDetailInfo
}
}
return
.
defaultType
}
}
extension
YHGCSpouseBasicInfoVC
:
UITableViewDelegate
,
UITableViewDataSource
{
func
numberOfSections
(
in
tableView
:
UITableView
)
->
Int
{
return
items
.
count
}
func
tableView
(
_
tableView
:
UITableView
,
numberOfRowsInSection
section
:
Int
)
->
Int
{
if
section
>=
items
.
count
{
return
0
}
let
arr
=
items
[
section
]
return
arr
.
count
}
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
if
indexPath
.
section
>=
items
.
count
{
return
createDefaultCell
(
indexPath
)
}
let
arr
:[
YHFormItemProtocol
]
=
items
[
indexPath
.
section
]
if
indexPath
.
row
>=
arr
.
count
{
return
createDefaultCell
(
indexPath
)
}
let
item
:
YHFormItemProtocol
=
arr
[
indexPath
.
row
]
let
cellType
=
getCellType
(
item
)
if
cellType
==
.
title
{
// 标题
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemTitleCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemTitleCell
cell
.
setTitleAndSubTitle
(
title
:
item
.
getTitle
())
return
cell
}
if
cellType
==
.
addItem
{
// 新增item cell
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemAddCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemAddCell
cell
.
title
=
item
.
getTitle
()
cell
.
clickBlock
=
{
[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
let
newDegree
=
YHHasDegreeJson
()
self
.
spouse
?
.
hasDegreeJson
.
append
(
newDegree
)
self
.
loadInfo
()
}
return
cell
}
if
item
is
YHFormDetailItem
{
let
detailItem
=
item
as!
YHFormDetailItem
if
cellType
==
.
inputText
{
// 输入文字cell
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemInputTextCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemInputTextCell
cell
.
isMust
=
detailItem
.
isNeed
cell
.
placeHolder
=
detailItem
.
placeHolder
cell
.
title
=
detailItem
.
getTitle
()
cell
.
text
=
detailItem
.
value
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
{
cell
.
textField
.
keyboardType
=
.
asciiCapable
// 英文键盘
}
else
{
cell
.
textField
.
keyboardType
=
.
default
}
cell
.
textInputCondtion
=
{
textField
in
if
detailItem
.
type
==
.
befourMarryFirstName
{
// 仅支持输入最多30个大写字母
let
regex
=
"[^A-Za-z]+"
textField
.
limitInputWithPattern
(
pattern
:
regex
,
30
)
return
true
}
var
max
=
-
1
if
detailItem
.
type
==
.
spouseName
||
detailItem
.
type
==
.
everName
{
max
=
30
}
else
if
detailItem
.
type
==
.
occupationName
{
max
=
50
}
else
if
detailItem
.
type
==
.
birthCity
{
max
=
100
}
if
max
>
0
{
if
let
textStr
=
textField
.
text
{
textField
.
text
=
(
textStr
.
count
>
max
?
textStr
[
safe
:
..<
max
]
:
textStr
)
}
}
return
true
}
cell
.
textChange
=
{
[
weak
self
]
(
text
,
isEditEnd
)
in
guard
let
self
=
self
else
{
return
}
if
detailItem
.
type
==
.
spouseName
{
self
.
spouse
?
.
subsetName
=
text
??
""
}
else
if
detailItem
.
type
==
.
everName
{
self
.
spouse
?
.
usedName
=
text
??
""
}
else
if
detailItem
.
type
==
.
befourMarryFirstName
{
let
tt
=
text
?
.
uppercased
()
self
.
spouse
?
.
surname
=
tt
??
""
cell
.
textField
.
text
=
tt
}
else
if
detailItem
.
type
==
.
birthCity
{
if
let
spouse
=
spouse
,
spouse
.
isBirthOverSeas
()
{
// 出生国外
self
.
spouse
?
.
birthPlace
.
foreign
=
text
??
""
}
else
{
self
.
spouse
?
.
birthPlace
.
details
=
text
??
""
}
}
else
if
detailItem
.
type
==
.
occupationName
{
self
.
spouse
?
.
occupationName
=
text
??
""
}
else
if
detailItem
.
type
==
.
hkIdentityCardNumber
{
self
.
spouse
?
.
hkIdentityCard
=
text
}
if
isEditEnd
{
self
.
loadInfo
()
if
detailItem
.
type
==
.
hkIdentityCardNumber
{
if
let
text
=
text
,
!
text
.
isEmpty
,
!
text
.
isHKIdentityCardNumber
()
{
YHHUD
.
flash
(
message
:
"请输入正确的香港身份证号格式"
)
return
}
}
save
()
}
}
return
cell
}
if
cellType
==
.
selectSheet
{
// 点击选择列表cell
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemSelectSheetCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemSelectSheetCell
cell
.
isMust
=
detailItem
.
isNeed
cell
.
placeHolder
=
detailItem
.
placeHolder
cell
.
title
=
detailItem
.
getTitle
()
cell
.
detail
=
detailItem
.
value
cell
.
setTips
(
detailItem
.
tips
,
isShow
:
isNeedShowError
&&
detailItem
.
isShowTips
)
return
cell
}
if
cellType
==
.
twoChoice
{
// 双项选择cell
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemDoubleChoiceCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemDoubleChoiceCell
cell
.
isMust
=
detailItem
.
isNeed
cell
.
title
=
item
.
getTitle
()
cell
.
answerArr
=
nil
if
detailItem
.
type
==
.
birthNation
{
// 出生国家
var
select
=
false
if
let
value
=
detailItem
.
value
{
select
=
Bool
(
value
)
!
}
let
answers
=
[
YHFormChoiceItem
(
title
:
"国内"
.
local
,
isSelect
:
!
select
),
YHFormChoiceItem
(
title
:
"国外"
.
local
,
isSelect
:
select
)]
cell
.
answerArr
=
answers
cell
.
answerBlock
=
{
[
weak
self
]
(
answers
,
index
)
in
guard
let
self
=
self
else
{
return
}
let
selectItem
=
answers
[
index
]
self
.
view
.
endEditing
(
true
)
self
.
spouse
?
.
setBirthOverSeas
(
selectItem
.
title
==
"国外"
.
local
)
self
.
loadInfo
()
save
()
}
}
else
if
detailItem
.
type
==
.
isHaveHkIdentityCard
||
detailItem
.
type
==
.
isNowInHK
{
// 是否办理过香港身份证 是否在岗
var
select
=
false
if
let
value
=
detailItem
.
value
{
select
=
Bool
(
value
)
!
}
let
answers
=
[
YHFormChoiceItem
(
title
:
"是"
.
local
,
isSelect
:
select
),
YHFormChoiceItem
(
title
:
"否"
.
local
,
isSelect
:
!
select
)]
cell
.
answerArr
=
answers
cell
.
answerBlock
=
{
[
weak
self
]
(
answers
,
index
)
in
guard
let
self
=
self
else
{
return
}
let
selectItem
=
answers
[
index
]
if
detailItem
.
type
==
.
isNowInHK
{
self
.
spouse
?
.
setNowIsInHK
(
selectItem
.
title
==
"是"
.
local
)
}
else
if
detailItem
.
type
==
.
isHaveHkIdentityCard
{
let
isHaveIdCard
=
selectItem
.
title
==
"是"
.
local
self
.
spouse
?
.
setHaveHKIdentityCard
(
isHaveIdCard
)
if
!
isHaveIdCard
{
self
.
spouse
?
.
hkIdentityCard
=
""
}
}
self
.
loadInfo
()
save
()
}
}
return
cell
}
if
cellType
==
.
degreeDetailInfo
{
// 学位cell
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemDegreeInfoCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemDegreeInfoCell
if
let
degreeArr
=
self
.
spouse
?
.
hasDegreeJson
{
if
indexPath
.
row
-
2
<
degreeArr
.
count
{
let
degreeInfo
=
degreeArr
[
indexPath
.
row
-
2
]
cell
.
title
=
String
(
format
:
"%@%d"
,
"学位信息"
.
local
,
indexPath
.
row
-
1
)
// 前两行是 学历学位信息标题 和 是否拥有学位
cell
.
showDeleteBtn
(
indexPath
.
row
>
2
)
// 学位
var
degreeDesc
=
""
if
let
degreeInt
=
Int
(
degreeInfo
.
degree
),
let
item
=
YHSheetPickerView
.
getItem
(
type
:
.
degree
,
index
:
degreeInt
)
{
degreeDesc
=
item
.
title
}
cell
.
degree
=
degreeDesc
// 颁发地区
var
degreeAreaDesc
=
""
if
let
areaInt
=
Int
(
degreeInfo
.
address
),
let
item
=
YHSheetPickerView
.
getItem
(
type
:
.
degreeLocation
,
index
:
areaInt
)
{
degreeAreaDesc
=
item
.
title
}
cell
.
degreePlace
=
degreeAreaDesc
let
isNeedShowDegreeTips
=
isNeedShowError
&&
isEmptyString
(
degreeDesc
)
let
isNeedShowPlaceTips
=
isNeedShowError
&&
isEmptyString
(
degreeAreaDesc
)
cell
.
showTips
(
isShowDegreeTips
:
isNeedShowDegreeTips
,
isShowPlaceTips
:
isNeedShowPlaceTips
)
cell
.
degreeClickBlock
=
{
YHSheetPickerView
.
show
(
type
:
.
degree
,
selectTitle
:
degreeDesc
)
{
[
weak
self
]
selectItem
in
guard
let
self
=
self
else
{
return
}
degreeInfo
.
degree
=
String
(
selectItem
.
index
)
loadInfo
()
save
()
}
}
cell
.
areaClickBlock
=
{
YHSheetPickerView
.
show
(
type
:
.
degreeLocation
,
selectTitle
:
degreeAreaDesc
)
{
[
weak
self
]
selectType
in
guard
let
self
=
self
else
{
return
}
degreeInfo
.
address
=
String
(
selectType
.
index
)
loadInfo
()
save
()
}
}
cell
.
deleteBlock
=
{
[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
var
msg
=
"确定删除学位信息
\(
indexPath
.
row
-
1
)
吗"
YHTwoOptionAlertView
.
showAlertView
(
message
:
msg
)
{
sure
in
if
!
sure
{
return
}
self
.
spouse
?
.
hasDegreeJson
.
remove
(
at
:
indexPath
.
row
-
2
)
self
.
loadInfo
()
self
.
save
()
}
}
}
}
return
cell
}
}
return
createDefaultCell
(
indexPath
)
}
func
tableView
(
_
tableView
:
UITableView
,
willDisplay
cell
:
UITableViewCell
,
forRowAt
indexPath
:
IndexPath
)
{
if
indexPath
.
section
>=
items
.
count
{
return
}
let
arr
:[
YHFormItemProtocol
]
=
items
[
indexPath
.
section
]
if
indexPath
.
row
>=
arr
.
count
{
return
}
createCorner
(
cell
:
cell
,
arr
:
arr
,
indexPath
:
indexPath
)
}
func
createDefaultCell
(
_
indexPath
:
IndexPath
)
->
UITableViewCell
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"UITableViewCell"
,
for
:
indexPath
)
return
cell
}
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
return
UITableView
.
automaticDimension
}
func
tableView
(
_
tableView
:
UITableView
,
viewForFooterInSection
section
:
Int
)
->
UIView
?
{
return
UIView
()
}
func
tableView
(
_
tableView
:
UITableView
,
viewForHeaderInSection
section
:
Int
)
->
UIView
?
{
return
UIView
()
}
private
func
tableView
(
_
tableView
:
UITableView
,
viewForHeaderInSection
section
:
Int
)
->
CGFloat
{
return
14.0
}
private
func
tableView
(
_
tableView
:
UITableView
,
viewForFooterInSection
section
:
Int
)
->
CGFloat
{
if
section
==
items
.
count
-
1
{
return
14.0
}
return
1.0
}
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
if
!
(
0
..<
items
.
count
)
.
contains
(
indexPath
.
section
)
{
return
}
let
arr
:[
YHFormItemProtocol
]
=
items
[
indexPath
.
section
]
if
!
(
0
..<
arr
.
count
)
.
contains
(
indexPath
.
row
)
{
return
}
let
item
=
arr
[
indexPath
.
row
]
if
item
is
YHFormDetailItem
{
let
detailItem
=
item
as!
YHFormDetailItem
if
detailItem
.
type
==
.
birthday
||
detailItem
.
type
==
.
stayHKDate
{
// 出生日期/获准滞留至
var
title
=
""
if
detailItem
.
type
==
.
birthday
{
title
=
"选择出生日期"
}
else
if
detailItem
.
type
==
.
stayHKDate
{
title
=
"选择逗留日期"
}
YHDatePickView
.
show
(
type
:
.
yyyymmdd
,
title
:
title
,
lastIsTaday
:
true
,
currentDay
:
spouse
?
.
birthday
??
""
)
{
[
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
.
spouse
?
.
birthday
=
dateStr
}
else
if
detailItem
.
type
==
.
stayHKDate
{
self
.
spouse
?
.
childInHk
.
info
=
dateStr
}
loadInfo
()
save
()
}
}
else
if
detailItem
.
type
==
.
birthCity
{
// 出生城市
// var isBirthOverSeas = false
// if let spouse = spouse {
// isBirthOverSeas = spouse.isBirthOverSeas()
// }
// // 出生国外时 出生城市是输入框
// if isBirthOverSeas { return }
//
// let vc = YHAddressViewController()
// vc.backLocationStringController = {
// [weak self] (string1, string2, string3, string4) in
// guard let self = self else { return }
// print("\(string1)\n\(string2)\n\(string3)\n\(string4)")
// var citys:[String] = []
// if !isEmptyString(string2) {
// citys.append(string2)
// }
// if !isEmptyString(string3) {
// citys.append(string3)
// }
// self.spouse?.birthPlace.area = citys
// loadInfo()
// save()
// }
// self.present(vc, animated: true)
}
else
if
detailItem
.
type
==
.
roleInHK
{
// 在港身份
let
identity
=
self
.
spouse
?
.
hkIdentity
??
""
YHSheetPickerView
.
show
(
type
:
.
identity
,
selectTitle
:
identity
)
{
[
weak
self
]
selectItem
in
guard
let
self
=
self
else
{
return
}
self
.
spouse
?
.
hkIdentity
=
selectItem
.
title
loadInfo
()
save
()
}
}
else
if
detailItem
.
type
==
.
occupation
{
let
occupation
=
self
.
spouse
?
.
occupation
??
""
YHSheetPickerView
.
show
(
type
:
.
occupation
,
selectTitle
:
occupation
)
{
[
weak
self
]
selectItem
in
guard
let
self
=
self
else
{
return
}
self
.
spouse
?
.
occupation
=
selectItem
.
title
loadInfo
()
save
()
}
}
else
if
detailItem
.
type
==
.
ownDegree
{
YHSheetPickerView
.
show
(
type
:
.
ownDegree
,
selectTitle
:
self
.
spouse
?
.
hasDegreeName
())
{
[
weak
self
]
selectItem
in
guard
let
self
=
self
else
{
return
}
let
hasDegree
=
selectItem
.
index
==
1
self
.
spouse
?
.
setHaveDegree
(
hasDegree
)
self
.
loadInfo
()
save
()
}
}
}
}
func
createCorner
(
cell
:
UITableViewCell
,
arr
:
Array
<
Any
>
,
indexPath
:
IndexPath
)
{
// 复用时需清理
cell
.
layer
.
mask
=
nil
// 设置每块section圆角
if
(
indexPath
.
row
==
0
)
{
let
corner
=
UIRectCorner
(
rawValue
:
UIRectCorner
.
topLeft
.
rawValue
|
UIRectCorner
.
topRight
.
rawValue
)
cell
.
createCorner
(
CGSizeMake
(
12.0
,
12.0
),
corner
)
}
else
if
(
indexPath
.
row
==
arr
.
count
-
1
)
{
let
corner
=
UIRectCorner
(
rawValue
:
UIRectCorner
.
bottomLeft
.
rawValue
|
UIRectCorner
.
bottomRight
.
rawValue
)
cell
.
createCorner
(
CGSizeMake
(
12.0
,
12.0
),
corner
)
}
else
{
cell
.
layer
.
mask
=
nil
}
}
func
save
()
{
if
let
delegate
=
delegate
,
delegate
.
responds
(
to
:
#selector(
YHSpouseInfoVCProtocol.saveInfoSilent
)
)
{
delegate
.
saveInfoSilent
()
}
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/TTPS(高才)/ServiceProcess(我的信息流程)/FamilyMember(家庭成员)/C/Spouse(配偶)/YHGCSpouseInfoContainerVC.swift
0 → 100644
View file @
d5d3eee0
//
// YHGCSpouseInfoContainerVC.swift
// galaxy
//
// Created by Dufet on 2024/12/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
class
YHGCSpouseInfoContainerVC
:
YHBaseViewController
,
YHSpouseInfoVCProtocol
{
let
familyRequest
:
YHFamilyRequestViewModel
=
YHFamilyRequestViewModel
()
var
stepVCs
:[
YHFaimilyStepItem
]
=
[]
var
orderId
:
Int
=
0
var
spouse
:
YHFamilyMember
?
{
didSet
{
if
let
spouse
=
spouse
{
primaryInfoVC
.
spouse
=
spouse
uploadVC
.
familyMember
=
spouse
certificateVC
.
familyMember
=
spouse
basicInfoVC
.
spouse
=
spouse
}
}
}
var
mainApplicantInfo
:
YHMyMainApplicantInfoModel
?
{
didSet
{
if
let
mainApplicantInfo
=
mainApplicantInfo
{
primaryInfoVC
.
mainApplicantInfo
=
mainApplicantInfo
uploadVC
.
mainApplicantInfo
=
mainApplicantInfo
certificateVC
.
mainApplicantInfo
=
mainApplicantInfo
}
}
}
var
_currentStep
=
0
var
currentStep
:
Int
{
get
{
return
_currentStep
}
set
{
if
let
spouse
=
spouse
,
!
spouse
.
isFollow
(),
newValue
>
0
{
_currentStep
=
3
}
else
{
_currentStep
=
newValue
}
let
index
=
getArrayIndexOfCurrentStep
()
if
let
index
=
index
{
stepView
.
currentIndex
=
index
bottomView
.
changeRightBtnTitle
(
index
==
stepVCs
.
count
-
1
?
"提交"
.
local
:
"下一步"
.
local
)
}
for
vcItem
in
stepVCs
{
vcItem
.
vc
.
view
.
isHidden
=
(
vcItem
.
step
!=
currentStep
)
if
vcItem
.
step
==
currentStep
{
// 刷新
if
vcItem
.
vc
.
responds
(
to
:
#selector(
YHFamilyMemberProtol.loadInfo
)
)
{
vcItem
.
vc
.
loadInfo
()
}
}
}
}
}
var
stepView
:
YHStepView
=
{
let
stepV
=
YHStepView
()
return
stepV
}()
var
bottomView
:
YHSaveAndSubmitView
=
{
let
view
=
YHSaveAndSubmitView
.
createView
()
view
.
changeRightBtnTitle
(
"下一步"
)
return
view
}()
let
primaryInfoVC
=
YHGCSpousePrimaryInfoVC
()
let
uploadVC
=
YHGCCertificateUploadVC
()
let
certificateVC
=
YHGCCertificateInfoController
()
let
basicInfoVC
=
YHGCSpouseBasicInfoVC
()
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
gk_navTitle
=
"配偶信息填写"
.
local
gk_navigationBar
.
backgroundColor
=
.
white
view
.
backgroundColor
=
UIColor
(
hexString
:
"#F8F8F8"
)
createUI
()
}
func
createUI
()
{
guard
let
spouse
=
spouse
else
{
return
}
primaryInfoVC
.
delegate
=
self
uploadVC
.
delegate
=
self
certificateVC
.
delegate
=
self
basicInfoVC
.
delegate
=
self
view
.
addSubview
(
stepView
)
view
.
addSubview
(
bottomView
)
updateStepView
()
print
(
"step:
\(
spouse
.
step
)
"
)
currentStep
=
spouse
.
step
stepView
.
maxIndex
=
getArrayIndexOfCurrentStep
()
??
stepVCs
.
count
-
1
bottomView
.
submitBlock
=
{
[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
submit
()
}
bottomView
.
saveBlock
=
{
[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
saveInfo
(
isSubmit
:
false
,
isShowSubmitMsg
:
false
,
isLoading
:
true
,
callBack
:
nil
)
}
stepView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalTo
(
k_Height_NavigationtBarAndStatuBar
)
make
.
left
.
right
.
equalTo
(
view
)
make
.
height
.
equalTo
(
YHStepView
.
height
)
}
bottomView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
equalToSuperview
()
make
.
bottom
.
equalToSuperview
()
make
.
height
.
equalTo
(
YHSaveAndSubmitView
.
height
)
}
}
func
updateStepView
()
{
guard
let
spouse
=
spouse
else
{
return
}
for
vc
in
self
.
children
{
vc
.
willMove
(
toParent
:
nil
)
vc
.
removeFromParent
()
vc
.
view
.
removeFromSuperview
()
}
print
(
self
.
children
)
if
spouse
.
isFollow
()
{
stepVCs
=
[
YHFaimilyStepItem
(
title
:
"初始信息"
.
local
,
vc
:
primaryInfoVC
,
step
:
0
),
YHFaimilyStepItem
(
title
:
"证件上传"
.
local
,
vc
:
uploadVC
,
step
:
1
),
YHFaimilyStepItem
(
title
:
"证件信息"
.
local
,
vc
:
certificateVC
,
step
:
2
),
YHFaimilyStepItem
(
title
:
"基本信息"
.
local
,
vc
:
basicInfoVC
,
step
:
3
)]
}
else
{
stepVCs
=
[
YHFaimilyStepItem
(
title
:
"初始信息"
.
local
,
vc
:
primaryInfoVC
,
step
:
0
),
YHFaimilyStepItem
(
title
:
"基本信息"
.
local
,
vc
:
basicInfoVC
,
step
:
3
)]
}
var
titles
:[
String
]
=
[]
for
vcItem
in
stepVCs
{
let
topHeight
=
k_Height_NavigationtBarAndStatuBar
+
YHStepView
.
height
let
bottomHeight
=
YHSaveAndSubmitView
.
height
vcItem
.
vc
.
view
.
frame
=
CGRectMake
(
0
,
topHeight
,
KScreenWidth
,
KScreenHeight
-
topHeight
-
bottomHeight
)
self
.
addChild
(
vcItem
.
vc
)
self
.
view
.
addSubview
(
vcItem
.
vc
.
view
)
titles
.
append
(
vcItem
.
title
)
}
stepView
.
dataSource
=
titles
// 数据源可能会变,所以需要重新设置step
let
step
=
currentStep
currentStep
=
step
stepView
.
block
=
{
[
weak
self
]
index
in
guard
let
self
=
self
else
{
return
}
if
let
targetStep
=
getStepForArrayIndex
(
index
)
{
currentStep
=
targetStep
}
requestDetail
()
print
(
"index:
\(
index
)
"
)
}
self
.
view
.
bringSubviewToFront
(
stepView
)
self
.
view
.
bringSubviewToFront
(
bottomView
)
}
}
extension
YHGCSpouseInfoContainerVC
{
// isSubmit:是否为提交 false为保存 true为提交
func
saveInfo
(
isSubmit
:
Bool
,
isShowSubmitMsg
:
Bool
,
isLoading
:
Bool
,
callBack
:((
Bool
)
->
Void
)?)
{
guard
let
spouse
=
spouse
else
{
return
}
guard
let
info
=
spouse
.
toDictionary
()
else
{
return
}
let
dict
:[
String
:
Any
]
=
[
"order_id"
:
orderId
,
"relation"
:
spouse
.
relation
,
"step"
:
currentStep
,
"next"
:
isSubmit
,
"info"
:
info
]
self
.
familyRequest
.
addOrSaveFamilyMember
(
params
:
dict
,
isShowLoading
:
isLoading
)
{
success
,
error
in
if
isLoading
{
if
success
{
YHHUD
.
flash
(
message
:
isSubmit
&&
isShowSubmitMsg
?
"提交成功"
:
"保存成功"
)
}
else
{
var
msg
=
isSubmit
&&
isShowSubmitMsg
?
"提交失败"
:
"保存失败"
if
let
errorMsg
=
error
?
.
errorMsg
,
errorMsg
.
count
>
0
{
msg
=
errorMsg
}
YHHUD
.
flash
(
message
:
msg
)
}
}
if
let
callBack
=
callBack
{
callBack
(
success
)
}
}
}
func
saveInfoSilent
()
{
saveInfo
(
isSubmit
:
false
,
isShowSubmitMsg
:
false
,
isLoading
:
false
)
{
[
weak
self
]
success
in
}
}
func
submit
()
{
if
let
targetVC
=
getCurrentStepViewController
()
{
if
targetVC
.
nextStep
()
{
var
isShowSubmitMsg
=
false
let
index
=
getArrayIndexOfCurrentStep
()
if
let
index
=
index
,
index
==
stepVCs
.
count
-
1
{
// 最后一步
isShowSubmitMsg
=
true
}
saveInfo
(
isSubmit
:
true
,
isShowSubmitMsg
:
isShowSubmitMsg
,
isLoading
:
true
)
{
[
weak
self
]
success
in
guard
let
self
=
self
else
{
return
}
if
success
{
// 当前步骤已是最后一步
if
let
vc
=
stepVCs
.
last
,
vc
.
step
==
currentStep
{
self
.
navigationController
?
.
popViewController
()
return
}
requestDetail
()
if
let
cur
=
getArrayIndexOfCurrentStep
(),
let
item
=
stepVCs
[
safe
:
cur
+
1
]
{
currentStep
=
item
.
step
if
cur
+
1
>
stepView
.
maxIndex
{
stepView
.
maxIndex
=
cur
+
1
}
}
print
(
"currentIndex:
\(
currentStep
)
"
)
}
}
}
}
}
func
requestDetail
()
{
if
orderId
<=
0
{
print
(
"订单号不存在"
)
return
}
self
.
familyRequest
.
requestFamilyMemberDetailInfo
(
memberType
:
.
spouse
,
orderId
:
orderId
)
{
[
weak
self
]
detail
in
guard
let
self
=
self
else
{
return
}
if
let
detail
=
detail
{
self
.
spouse
=
detail
for
vcItem
in
stepVCs
{
vcItem
.
vc
.
loadInfo
()
}
}
}
}
// 【WARNING!】步骤step和在数组中的下标有时候并不是一一对应
func
getArrayIndexOfCurrentStep
()
->
Int
?
{
for
(
i
,
item
)
in
stepVCs
.
enumerated
()
{
if
item
.
step
==
currentStep
{
return
i
}
}
return
nil
}
// 【WARNING!】步骤step和在数组中的下标有时候并不是一一对应
func
getStepForArrayIndex
(
_
index
:
Int
)
->
Int
?
{
if
let
targetVCItem
=
stepVCs
[
safe
:
index
]
{
return
targetVCItem
.
step
}
return
nil
}
func
getCurrentStepViewController
()
->
(
UIViewController
&
YHFamilyMemberProtol
)?
{
for
vcItem
in
stepVCs
{
if
vcItem
.
step
==
currentStep
{
return
vcItem
.
vc
}
}
return
nil
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/TTPS(高才)/ServiceProcess(我的信息流程)/FamilyMember(家庭成员)/C/Spouse(配偶)/YHGCSpousePrimaryInfoVC.swift
0 → 100644
View file @
d5d3eee0
//
// YHGCSpousePrimaryInfoVC.swift
// galaxy
//
// Created by Dufet on 2024/12/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
import
SmartCodable
import
SwifterSwift
class
YHGCSpousePrimaryInfoVC
:
YHBaseViewController
,
YHFamilyMemberProtol
{
var
spouse
:
YHFamilyMember
?
var
mainApplicantInfo
:
YHMyMainApplicantInfoModel
?
weak
var
delegate
:
YHSpouseInfoVCProtocol
?
// 是否显示未填写错误提示
var
isNeedShowError
=
false
lazy
var
items
:[[
YHFormItemProtocol
]]
=
[[
YHFormItemProtocol
]]()
lazy
var
tableView
:
UITableView
=
{
let
tableView
=
UITableView
(
frame
:
.
zero
,
style
:
.
grouped
)
if
#available(iOS 11.0, *)
{
tableView
.
contentInsetAdjustmentBehavior
=
.
never
}
tableView
.
rowHeight
=
UITableView
.
automaticDimension
tableView
.
estimatedRowHeight
=
52.0
tableView
.
estimatedSectionHeaderHeight
=
14.0
tableView
.
estimatedSectionFooterHeight
=
1.0
tableView
.
showsVerticalScrollIndicator
=
false
tableView
.
backgroundColor
=
UIColor
(
hexString
:
"#F8F8F8"
)
tableView
.
separatorStyle
=
.
none
tableView
.
delegate
=
self
tableView
.
dataSource
=
self
tableView
.
register
(
UITableViewCell
.
self
,
forCellReuseIdentifier
:
"UITableViewCell"
)
tableView
.
register
(
YHFormItemDoubleChoiceCell
.
self
,
forCellReuseIdentifier
:
YHFormItemDoubleChoiceCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemInputTextCell
.
self
,
forCellReuseIdentifier
:
YHFormItemInputTextCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemSelectSheetCell
.
self
,
forCellReuseIdentifier
:
YHFormItemSelectSheetCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemTitleCell
.
self
,
forCellReuseIdentifier
:
YHFormItemTitleCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemAddCell
.
self
,
forCellReuseIdentifier
:
YHFormItemAddCell
.
cellReuseIdentifier
)
return
tableView
}()
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
gk_navigationBar
.
isHidden
=
true
view
.
backgroundColor
=
UIColor
(
hexString
:
"#F8F8F8"
)
createUI
()
loadInfo
()
}
func
loadInfo
()
{
guard
let
spouse
=
spouse
else
{
return
}
items
.
removeAll
()
// 随行
let
title0
=
YHFormTitleItem
(
type
:
.
accompany
)
let
item0
=
YHFormDetailItem
(
type
:
.
isAccompanyToHK
)
item0
.
value
=
String
(
spouse
.
isFollow
())
let
arr0
:[
YHFormItemProtocol
]
=
[
title0
,
item0
]
items
.
append
(
arr0
)
if
spouse
.
isFollow
()
{
// 随行才加后面的信息
// 国籍
let
title1
=
YHFormTitleItem
(
type
:
.
nationality
)
let
item10
=
YHFormDetailItem
(
type
:
.
nationOrArea
,
value
:
spouse
.
nationality
,
placeHolder
:
"请选择"
.
local
,
tips
:
"请选择国籍"
.
local
)
let
arr1
:[
YHFormItemProtocol
]
=
[
title1
,
item10
]
// 居住信息
var
arr2
=
[
YHFormItemProtocol
]()
let
title2
=
YHFormTitleItem
(
type
:
.
liveInfo
)
let
item20
=
YHFormDetailItem
(
type
:
.
isLiveTother
,
value
:
String
(
spouse
.
isLiveTother
()))
arr2
.
append
(
title2
)
arr2
.
append
(
item20
)
if
!
spouse
.
isLiveTother
()
{
// 不同住 才需填写国家/地区
let
item21
=
YHFormDetailItem
(
type
:
.
nationOrArea
,
value
:
spouse
.
address
.
country
,
placeHolder
:
"请选择"
.
local
,
tips
:
"请选择国家/地区"
.
local
)
arr2
.
append
(
item21
)
// 国家/地区已填写 才显示现居住城市和详细地址两行
if
!
spouse
.
address
.
country
.
isEmpty
{
// 居住信息中选择中国才会显示现居住城市
let
isLiveInChina
=
spouse
.
address
.
country
.
contains
(
"中国"
.
local
)
if
isLiveInChina
{
var
value
:
String
?
=
""
if
!
spouse
.
address
.
area
.
isEmpty
{
value
=
spouse
.
address
.
area
.
joined
(
separator
:
","
)
}
let
item22
=
YHFormDetailItem
(
type
:
.
liveCity
,
value
:
value
,
tips
:
"请选择省市地区"
.
local
)
arr2
.
append
(
item22
)
}
let
placeHolder
=
(
isLiveInChina
?
"请填写小区、楼栋、单元室等"
.
local
:
"请填写国外居住地"
.
local
)
let
tips
=
(
isLiveInChina
?
"请填写小区、楼栋、单元室等"
.
local
:
"请填写国外居住地"
.
local
)
let
detailAddress
=
isLiveInChina
?
spouse
.
address
.
details
:
spouse
.
address
.
foreign
let
item23
=
YHFormDetailItem
(
type
:
.
detailAddress
,
value
:
detailAddress
,
placeHolder
:
placeHolder
,
tips
:
tips
)
arr2
.
append
(
item23
)
if
!
isLiveInChina
{
// 在国外
// 是否在海外居住满1年及以上
let
item24
=
YHFormDetailItem
(
type
:
.
isLiveOverSeasMore1Year
)
item24
.
value
=
String
(
spouse
.
isOverSeasOver1Year
())
arr2
.
append
(
item24
)
}
}
}
items
.
append
(
contentsOf
:[
arr1
,
arr2
])
// 港澳通信证
var
isHiddenHK
=
true
// 国籍
let
nationality
=
spouse
.
nationality
// 居住国家
var
liveCountry
=
spouse
.
address
.
country
// 居住海外是否满一年
var
isLiveOverseaYear
=
spouse
.
isOverSeasOver1Year
()
if
spouse
.
isLiveTother
(),
let
mainApplicantInfo
=
mainApplicantInfo
{
// 与主申请人同住需要用主申请人居住信息判断
liveCountry
=
mainApplicantInfo
.
applicant_address
.
country
isLiveOverseaYear
=
mainApplicantInfo
.
isOverSeasOver1Year
()
}
if
nationality
.
contains
(
"中国"
)
{
// 中国国籍
let
isLiveInChina
=
liveCountry
.
contains
(
"中国"
.
local
)
if
isLiveInChina
||
(
!
isLiveInChina
&&
!
isLiveOverseaYear
)
{
// 中国国籍&居住国内、中国国籍&居住国外不满一年 需展示“港澳通行证”询问框
isHiddenHK
=
false
}
}
if
!
isHiddenHK
{
let
title3
=
YHFormTitleItem
(
type
:
.
hkAndMacaoPassport
)
let
item30
=
YHFormDetailItem
(
type
:
.
isHandleHKPassPort
)
item30
.
value
=
String
(
spouse
.
isNeedHandleHKPassPort
())
let
arr3
:[
YHFormItemProtocol
]
=
[
title3
,
item30
]
items
.
append
(
arr3
)
}
}
tableView
.
reloadData
()
}
func
createUI
()
{
view
.
addSubview
(
tableView
);
let
topHeight
=
k_Height_NavigationtBarAndStatuBar
+
YHStepView
.
height
let
bottomHeight
=
YHSaveAndSubmitView
.
height
tableView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalToSuperview
()
make
.
left
.
equalToSuperview
()
.
offset
(
16
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
16
)
make
.
height
.
equalTo
(
KScreenHeight
-
topHeight
-
bottomHeight
)
}
}
}
extension
YHGCSpousePrimaryInfoVC
:
UITableViewDelegate
,
UITableViewDataSource
{
func
numberOfSections
(
in
tableView
:
UITableView
)
->
Int
{
return
items
.
count
}
func
tableView
(
_
tableView
:
UITableView
,
numberOfRowsInSection
section
:
Int
)
->
Int
{
if
section
>=
items
.
count
{
return
0
}
let
arr
=
items
[
section
]
return
arr
.
count
}
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
if
indexPath
.
section
>=
items
.
count
{
return
createDefaultCell
(
indexPath
)
}
let
arr
:[
YHFormItemProtocol
]
=
items
[
indexPath
.
section
]
if
indexPath
.
row
>=
arr
.
count
{
return
createDefaultCell
(
indexPath
)
}
let
item
:
YHFormItemProtocol
=
arr
[
indexPath
.
row
]
if
item
is
YHFormTitleItem
{
// 标题
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemTitleCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemTitleCell
cell
.
setTitleAndSubTitle
(
title
:
item
.
getTitle
())
return
cell
}
else
if
item
is
YHFormDetailItem
{
// 具体信息
let
detailItem
=
item
as!
YHFormDetailItem
// 是否随行到香港 / 是否办理港澳通行证 / // 是否与主申请人同住 均用双项按钮cell
if
detailItem
.
type
==
.
isAccompanyToHK
||
detailItem
.
type
==
.
isHandleHKPassPort
||
detailItem
.
type
==
.
isLiveTother
||
detailItem
.
type
==
.
isLiveOverSeasMore1Year
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemDoubleChoiceCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemDoubleChoiceCell
cell
.
isMust
=
detailItem
.
isNeed
cell
.
title
=
detailItem
.
getTitle
()
cell
.
setTips
(
detailItem
.
tips
,
isShow
:
isNeedShowError
&&
detailItem
.
isShowTips
)
var
select
=
false
if
let
value
=
detailItem
.
value
{
select
=
Bool
(
value
)
!
}
let
answers
=
[
YHFormChoiceItem
(
title
:
"是"
.
local
,
isSelect
:
select
),
YHFormChoiceItem
(
title
:
"否"
.
local
,
isSelect
:
!
select
)]
cell
.
answerArr
=
answers
cell
.
answerBlock
=
{
[
weak
self
]
(
arr
,
selectIndex
)
in
guard
let
self
=
self
else
{
return
}
let
selectItem
:
YHFormChoiceItem
=
arr
[
selectIndex
]
let
option
=
(
selectItem
.
title
==
"是"
.
local
?
true
:
false
)
if
detailItem
.
type
==
.
isAccompanyToHK
{
// 是否随行
self
.
spouse
?
.
setFollow
(
option
)
self
.
loadInfo
()
if
let
delegate
=
delegate
,
delegate
.
responds
(
to
:
#selector(
YHSpouseInfoVCProtocol.updateStepView
)
)
{
delegate
.
updateStepView
()
}
}
else
if
detailItem
.
type
==
.
isHandleHKPassPort
{
// 是否办理港澳通行证
self
.
spouse
?
.
setNeedHandleHKPassPort
(
option
)
self
.
loadInfo
()
}
else
if
detailItem
.
type
==
.
isLiveTother
{
// 是否与主申请人同住
self
.
spouse
?
.
setLiveTother
(
option
)
if
option
{
self
.
spouse
?
.
address
.
clearAddress
()
}
self
.
loadInfo
()
}
else
if
detailItem
.
type
==
.
isLiveOverSeasMore1Year
{
// 是否在海外居住满1年及以上
self
.
spouse
?
.
setOverSearsOver1Year
(
option
)
self
.
loadInfo
()
}
else
if
detailItem
.
type
==
.
isLiveOverSeasMore1Year
{
// 是否在海外居住满1年及以上
self
.
spouse
?
.
setOverSearsOver1Year
(
option
)
self
.
loadInfo
()
}
save
()
}
return
cell
}
if
detailItem
.
type
==
.
nationOrArea
||
detailItem
.
type
==
.
liveCity
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemSelectSheetCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemSelectSheetCell
cell
.
isMust
=
detailItem
.
isNeed
cell
.
title
=
detailItem
.
getTitle
()
cell
.
placeHolder
=
detailItem
.
placeHolder
cell
.
detail
=
detailItem
.
value
cell
.
setTips
(
detailItem
.
tips
,
isShow
:
isNeedShowError
&&
detailItem
.
isShowTips
)
return
cell
}
if
detailItem
.
type
==
.
detailAddress
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemInputTextCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemInputTextCell
cell
.
isMust
=
detailItem
.
isNeed
cell
.
title
=
detailItem
.
getTitle
()
cell
.
text
=
detailItem
.
value
cell
.
placeHolder
=
detailItem
.
placeHolder
cell
.
setTips
(
detailItem
.
tips
,
isShow
:
isNeedShowError
&&
detailItem
.
isShowTips
)
cell
.
textInputCondtion
=
{
textField
in
if
let
textStr
=
textField
.
text
{
let
max
=
100
textField
.
text
=
textStr
.
count
>
max
?
textStr
[
safe
:
..<
max
]
:
textStr
}
return
true
}
cell
.
textChange
=
{
[
weak
self
]
(
text
,
isEditEnd
)
in
guard
let
self
=
self
else
{
return
}
guard
let
spouse
=
spouse
else
{
return
}
if
detailItem
.
type
==
.
detailAddress
{
if
spouse
.
isLiveInChina
()
{
spouse
.
address
.
details
=
text
??
""
}
else
{
spouse
.
address
.
foreign
=
text
??
""
}
}
if
isEditEnd
{
self
.
loadInfo
()
save
()
}
}
return
cell
}
}
return
createDefaultCell
(
indexPath
)
}
func
tableView
(
_
tableView
:
UITableView
,
willDisplay
cell
:
UITableViewCell
,
forRowAt
indexPath
:
IndexPath
)
{
if
indexPath
.
section
>=
items
.
count
{
return
}
let
arr
:[
YHFormItemProtocol
]
=
items
[
indexPath
.
section
]
if
indexPath
.
row
>=
arr
.
count
{
return
}
createCorner
(
cell
:
cell
,
arr
:
arr
,
indexPath
:
indexPath
)
}
func
createDefaultCell
(
_
indexPath
:
IndexPath
)
->
UITableViewCell
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"UITableViewCell"
,
for
:
indexPath
)
return
cell
}
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
return
UITableView
.
automaticDimension
}
func
tableView
(
_
tableView
:
UITableView
,
viewForFooterInSection
section
:
Int
)
->
UIView
?
{
return
UIView
()
}
func
tableView
(
_
tableView
:
UITableView
,
viewForHeaderInSection
section
:
Int
)
->
UIView
?
{
return
UIView
()
}
private
func
tableView
(
_
tableView
:
UITableView
,
viewForHeaderInSection
section
:
Int
)
->
CGFloat
{
return
14.0
}
private
func
tableView
(
_
tableView
:
UITableView
,
viewForFooterInSection
section
:
Int
)
->
CGFloat
{
if
section
==
items
.
count
-
1
{
return
14.0
}
return
1.0
}
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
if
!
(
0
..<
items
.
count
)
.
contains
(
indexPath
.
section
)
{
return
}
let
arr
:[
YHFormItemProtocol
]
=
items
[
indexPath
.
section
]
if
!
(
0
..<
arr
.
count
)
.
contains
(
indexPath
.
row
)
{
return
}
let
item
=
arr
[
indexPath
.
row
]
if
item
is
YHFormDetailItem
{
let
detailItem
=
item
as!
YHFormDetailItem
// 选国籍/现居住城市/详细地址
if
detailItem
.
type
==
.
nationOrArea
{
let
vc
=
YHSelectCountryViewController
()
vc
.
backLocationStringController
=
{
[
weak
self
]
country
in
guard
let
self
=
self
else
{
return
}
let
title
=
arr
[
0
]
as!
YHFormTitleItem
if
title
.
type
==
.
nationality
{
// 选国籍
self
.
spouse
?
.
nationality
=
country
}
else
if
title
.
type
==
.
liveInfo
{
// 居住信息选国家地区
self
.
spouse
?
.
address
.
country
=
country
// 选择国家地区后需清空城市
self
.
spouse
?
.
address
.
area
=
[]
}
self
.
loadInfo
()
save
()
}
self
.
navigationController
?
.
pushViewController
(
vc
)
}
else
if
detailItem
.
type
==
.
liveCity
{
var
provice
=
""
if
let
country
=
self
.
spouse
?
.
address
.
country
{
if
country
.
contains
(
"台湾"
)
{
provice
=
"台湾省"
}
if
country
.
contains
(
"香港"
)
{
provice
=
"香港特别行政区"
}
if
country
.
contains
(
"澳门"
)
{
provice
=
"澳门特别行政区"
}
}
let
addressPicker
=
YHAddressViewController
(
selectProvince
:
provice
)
addressPicker
.
backLocationStringController
=
{
[
weak
self
]
(
address
,
province
,
city
,
area
)
in
guard
let
self
=
self
else
{
return
}
print
(
"
\(
address
)\n\(
province
)\n\(
city
)\n\(
area
)
"
)
var
citys
:[
String
]
=
[]
if
!
isEmptyString
(
province
)
{
citys
.
append
(
province
)
}
if
!
isEmptyString
(
city
)
{
citys
.
append
(
city
)
}
self
.
spouse
?
.
address
.
area
=
citys
self
.
loadInfo
()
save
()
}
UIViewController
.
current
?
.
present
(
addressPicker
,
animated
:
true
,
completion
:
nil
)
}
}
}
func
createCorner
(
cell
:
UITableViewCell
,
arr
:
Array
<
Any
>
,
indexPath
:
IndexPath
)
{
// 复用时需清理
cell
.
layer
.
mask
=
nil
// 设置每块section圆角
if
(
indexPath
.
row
==
0
)
{
let
corner
=
UIRectCorner
(
rawValue
:
UIRectCorner
.
topLeft
.
rawValue
|
UIRectCorner
.
topRight
.
rawValue
)
cell
.
createCorner
(
CGSizeMake
(
12.0
,
12.0
),
corner
)
}
else
if
(
indexPath
.
row
==
arr
.
count
-
1
)
{
let
corner
=
UIRectCorner
(
rawValue
:
UIRectCorner
.
bottomLeft
.
rawValue
|
UIRectCorner
.
bottomRight
.
rawValue
)
cell
.
createCorner
(
CGSizeMake
(
12.0
,
12.0
),
corner
)
}
else
{
cell
.
layer
.
mask
=
nil
}
}
// 检查填写信息完整性
func
checkIntegrity
()
->
Bool
{
guard
let
spouse
=
spouse
else
{
return
false
}
if
!
spouse
.
isFollow
()
{
return
true
}
if
isEmptyString
(
spouse
.
nationality
)
{
return
false
}
if
!
spouse
.
isLiveTother
()
{
// 没有与主申请人同住
if
isEmptyString
(
spouse
.
address
.
country
)
{
return
false
}
if
spouse
.
isLiveInChina
()
{
if
isEmptyArray
(
spouse
.
address
.
area
)
{
return
false
}
if
isEmptyString
(
spouse
.
address
.
details
)
{
return
false
}
}
else
{
// 住在国外
if
isEmptyString
(
spouse
.
address
.
foreign
)
{
return
false
}
}
}
return
true
}
func
nextStep
()
->
Bool
{
let
isChecked
=
checkIntegrity
()
isNeedShowError
=
!
isChecked
loadInfo
()
if
!
isChecked
{
YHHUD
.
flash
(
message
:
"资料还未填完"
)
return
false
}
return
true
}
func
save
()
{
if
let
delegate
=
delegate
,
delegate
.
responds
(
to
:
#selector(
YHSpouseInfoVCProtocol.saveInfoSilent
)
)
{
delegate
.
saveInfoSilent
()
}
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/TTPS(高才)/ServiceProcess(我的信息流程)/FamilyMember(家庭成员)/C/YHGCFamilyMemberInfoListVC.swift
0 → 100644
View file @
d5d3eee0
//
// YHGCFamilyMemberInfoListVC.swift
// galaxy
//
// Created by Dufet on 2024/12/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
class
YHGCFamilyMemberInfoListVC
:
YHBaseViewController
{
var
orderId
:
Int
let
familyRequest
:
YHFamilyRequestViewModel
=
YHFamilyRequestViewModel
()
var
familyMemberInfo
:
YHFamilyMemberGroupInfo
?
var
isChildsEditMode
:
YHFormTitleItemEditType
=
.
none
var
isBrothersEditMode
:
YHFormTitleItemEditType
=
.
none
// 是否显示未填写错误提示
var
isNeedShowError
=
false
var
items
:[[
YHFormItemProtocol
]]
=
[]
lazy
var
tableView
:
UITableView
=
{
let
tableView
=
UITableView
(
frame
:
.
zero
,
style
:
.
grouped
)
if
#available(iOS 11.0, *)
{
tableView
.
contentInsetAdjustmentBehavior
=
.
never
}
tableView
.
showsVerticalScrollIndicator
=
false
tableView
.
estimatedSectionHeaderHeight
=
14.0
tableView
.
estimatedSectionFooterHeight
=
1.0
tableView
.
backgroundColor
=
UIColor
(
hexString
:
"#F8F8F8"
)
tableView
.
separatorStyle
=
.
none
tableView
.
delegate
=
self
tableView
.
dataSource
=
self
tableView
.
register
(
UITableViewCell
.
self
,
forCellReuseIdentifier
:
"UITableViewCell"
)
tableView
.
register
(
YHFormItemDoubleChoiceCell
.
self
,
forCellReuseIdentifier
:
YHFormItemDoubleChoiceCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemInputTextCell
.
self
,
forCellReuseIdentifier
:
YHFormItemInputTextCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemEnterDetailCell
.
self
,
forCellReuseIdentifier
:
YHFormItemEnterDetailCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemTitleCell
.
self
,
forCellReuseIdentifier
:
YHFormItemTitleCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemAddCell
.
self
,
forCellReuseIdentifier
:
YHFormItemAddCell
.
cellReuseIdentifier
)
return
tableView
}()
lazy
var
submitBtn
:
UIButton
=
{
let
btn
=
UIButton
()
btn
.
setTitle
(
"提交"
.
local
,
for
:
.
normal
)
btn
.
titleLabel
?
.
font
=
UIFont
.
PFSC_R
(
ofSize
:
14
)
btn
.
setTitleColor
(
.
white
,
for
:
.
normal
)
btn
.
backgroundColor
=
UIColor
.
brandMainColor
btn
.
layer
.
cornerRadius
=
kCornerRadius3
btn
.
addTarget
(
self
,
action
:
#selector(
didClickSubmitBtn
)
,
for
:
.
touchUpInside
)
return
btn
}()
lazy
var
bottomView
:
UIView
=
{
let
view
=
UIView
()
view
.
backgroundColor
=
.
white
view
.
addSubview
(
submitBtn
)
return
view
}()
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
self
.
gk_navTitle
=
"家庭成员信息填写"
.
local
gk_navigationBar
.
backgroundColor
=
.
white
view
.
backgroundColor
=
UIColor
(
hexString
:
"#F8F8F8"
)
createUI
()
}
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
super
.
viewWillAppear
(
animated
)
requestFamilyInfo
()
}
init
(
orderId
:
Int
)
{
self
.
orderId
=
orderId
super
.
init
(
nibName
:
nil
,
bundle
:
nil
)
}
required
init
?(
coder
:
NSCoder
)
{
fatalError
(
"init(coder:) has not been implemented"
)
}
func
createUI
()
{
view
.
addSubview
(
tableView
);
view
.
addSubview
(
bottomView
)
let
submitBtnHeight
=
48.0
let
gap
=
8.0
bottomView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
equalToSuperview
()
make
.
bottom
.
equalTo
(
view
)
make
.
height
.
equalTo
(
submitBtnHeight
+
gap
*
2
+
k_Height_safeAreaInsetsBottom
())
}
submitBtn
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalToSuperview
()
.
offset
(
16
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
16
)
make
.
height
.
equalTo
(
48
)
make
.
top
.
equalTo
(
8
)
}
tableView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalToSuperview
()
.
offset
(
k_Height_NavigationtBarAndStatuBar
)
make
.
bottom
.
equalTo
(
bottomView
.
snp
.
top
)
make
.
left
.
equalToSuperview
()
.
offset
(
16
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
16
)
}
}
@objc
func
didClickSubmitBtn
()
{
let
isChecked
=
checkIntegrity
()
isNeedShowError
=
!
isChecked
self
.
tableView
.
reloadData
()
if
!
isChecked
{
YHHUD
.
flash
(
message
:
"资料还未填完"
)
return
}
submit
()
}
// 检查填写信息完整性
func
checkIntegrity
()
->
Bool
{
if
let
sponse
=
familyMemberInfo
?
.
spouse
,
sponse
.
notFillNumber
!=
0
{
return
false
}
// if let father = familyMemberInfo?.father, father.notFillNumber != 0 {
// return false
// }
//
// if let mother = familyMemberInfo?.mother, mother.notFillNumber != 0 {
// return false
// }
if
let
childs
=
familyMemberInfo
?
.
child
,
!
childs
.
isEmpty
{
for
child
in
childs
{
if
child
.
notFillNumber
!=
0
{
return
false
}
}
}
// if let brothers = familyMemberInfo?.brother, !brothers.isEmpty {
// for brother in brothers {
// if brother.notFillNumber != 0 {
// return false
// }
// }
// }
return
true
}
func
loadFamilyMember
()
{
items
.
removeAll
()
// 配偶section
if
let
sponse
=
familyMemberInfo
?
.
spouse
{
// 信息未填写时服务器返回的relation=0
sponse
.
relationType
=
.
spouse
let
sponseArray
:[
YHFormItemProtocol
]
=
[
YHFormTitleItem
(
type
:
.
sponse
),
sponse
]
items
.
append
(
sponseArray
)
}
// 子女section
var
childArr
:[
YHFormItemProtocol
]
=
[
YHFormTitleItem
(
type
:
.
child
),
YHFormAddItem
(
type
:
.
addChild
)]
if
let
childs
=
familyMemberInfo
?
.
child
,
!
childs
.
isEmpty
{
childArr
.
insert
(
contentsOf
:
childs
,
at
:
1
)
}
items
.
append
(
childArr
)
// 父母section
// var parents = [YHFormItemProtocol]()
// let item0 = YHFormTitleItem(type: .parent)
// parents.append(item0)
//
// if let father = familyMemberInfo?.father {
// // 信息未填写时服务器返回的relation=0
// father.relationType = .father
// parents.append(father)
// }
//
// if let mother = familyMemberInfo?.mother {
// // 信息未填写时服务器返回的relation=0
// mother.relationType = .mother
// parents.append(mother)
// }
// items.append(parents)
// 兄妹section
// var brotherArr:[YHFormItemProtocol] = [YHFormTitleItem(type: .brother), YHFormAddItem(type: .addBrother)]
// if let brothers = familyMemberInfo?.brother, !brothers.isEmpty {
// for brother in brothers {
// // 信息未填写时服务器返回的relation=0
// brother.relation = String(format: "%d", YHFamilyMemberType.brother.rawValue)
// }
// brotherArr.insert(contentsOf: brothers, at:1)
// }
// items.append(brotherArr)
let
childCount
=
familyMemberInfo
?
.
child
?
.
count
??
0
if
childCount
<=
0
{
isChildsEditMode
=
.
none
}
else
{
if
isChildsEditMode
==
.
none
{
isChildsEditMode
=
.
canEdit
}
}
// let brotherCount = familyMemberInfo?.brother?.count ?? 0
// if brotherCount <= 0 {
// isBrothersEditMode = .none
// } else {
// if isBrothersEditMode == .none {
// isBrothersEditMode = .canEdit
// }
// }
tableView
.
reloadData
()
}
}
extension
YHGCFamilyMemberInfoListVC
{
// 请求家庭成员信息
func
requestFamilyInfo
()
{
self
.
familyRequest
.
getFamilyInfoList
(
orderId
:
orderId
)
{
[
weak
self
]
detail
,
error
in
guard
let
self
=
self
else
{
return
}
if
let
detail
=
detail
{
familyMemberInfo
=
detail
}
loadFamilyMember
()
}
}
// 添加兄弟姐妹子女
func
addFamilyMember
(
_
type
:
YHFamilyMemberType
)
{
let
dict
:[
String
:
Any
]
=
[
"order_id"
:
self
.
orderId
,
"relation"
:
String
(
type
.
rawValue
),
"step"
:
0
,
"next"
:
false
,
"info"
:[
"subset_name"
:
""
,
"not_fill_number"
:
-
1
,
"follow"
:
0
]]
self
.
familyRequest
.
addOrSaveFamilyMember
(
params
:
dict
)
{
[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
if
success
{
self
.
requestFamilyInfo
()
}
else
{
var
errorMsg
=
"添加失败"
if
let
errMsg
=
error
?
.
errorMsg
,
errMsg
.
count
>
0
{
errorMsg
=
errMsg
}
YHHUD
.
flash
(
message
:
errorMsg
)
}
}
}
// 添加兄弟姐妹子女
func
deleteFamilyMember
(
orderId
:
Int
,
memberId
:
Int
,
callBack
:((
Bool
)
->
Void
)?)
{
if
orderId
>
0
&&
memberId
>
0
{
let
dict
=
[
"id"
:
memberId
,
"order_id"
:
orderId
]
self
.
familyRequest
.
deleteFamilyMember
(
params
:
dict
)
{
success
,
error
in
if
success
{
YHHUD
.
flash
(
message
:
"删除成功"
.
local
)
}
else
{
var
errorMsg
=
"删除失败"
if
let
errMsg
=
error
?
.
errorMsg
,
errMsg
.
count
>
0
{
errorMsg
=
errMsg
}
YHHUD
.
flash
(
message
:
errorMsg
)
}
if
let
callBack
=
callBack
{
callBack
(
success
)
}
}
}
}
func
submit
()
{
self
.
familyRequest
.
submitAllFamilyInfo
(
orderId
:
self
.
orderId
)
{
success
,
error
in
if
success
{
YHHUD
.
flash
(
message
:
"提交成功"
)
self
.
navigationController
?
.
popViewController
()
}
else
{
var
errorMsg
=
"提交失败"
if
let
errMsg
=
error
?
.
errorMsg
,
errMsg
.
count
>
0
{
errorMsg
=
errMsg
}
YHHUD
.
flash
(
message
:
errorMsg
,
duration
:
3
)
}
}
}
}
extension
YHGCFamilyMemberInfoListVC
:
UITableViewDelegate
,
UITableViewDataSource
{
func
numberOfSections
(
in
tableView
:
UITableView
)
->
Int
{
return
items
.
count
}
func
tableView
(
_
tableView
:
UITableView
,
numberOfRowsInSection
section
:
Int
)
->
Int
{
if
section
>=
items
.
count
{
return
0
}
let
arr
=
items
[
section
]
return
arr
.
count
}
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
let
arr
=
items
[
indexPath
.
section
]
let
item
:
YHFormItemProtocol
=
arr
[
indexPath
.
row
]
if
item
is
YHFormTitleItem
{
// 是标题
let
formItem
=
item
as!
YHFormTitleItem
// 配偶父母子女兄妹title
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemTitleCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemTitleCell
cell
.
setTitleAndSubTitle
(
title
:
formItem
.
getTitle
(),
subTitle
:
formItem
.
getSubTitle
())
// 决定右边按钮显示样式
cell
.
showEditType
(
type
:
.
none
)
if
formItem
.
type
==
.
child
{
cell
.
showEditType
(
type
:
isChildsEditMode
)
}
else
if
formItem
.
type
==
.
brother
{
cell
.
showEditType
(
type
:
isBrothersEditMode
)
}
// 右边按钮点击事件处理
cell
.
rightClickBlock
=
{
[
weak
self
]
type
in
guard
let
self
=
self
else
{
return
}
if
formItem
.
type
==
.
child
{
if
self
.
isChildsEditMode
==
.
canCancel
{
self
.
isChildsEditMode
=
.
canEdit
}
else
if
self
.
isChildsEditMode
==
.
canEdit
{
self
.
isChildsEditMode
=
.
canCancel
}
}
if
formItem
.
type
==
.
brother
{
if
self
.
isBrothersEditMode
==
.
canCancel
{
self
.
isBrothersEditMode
=
.
canEdit
}
else
if
self
.
isBrothersEditMode
==
.
canEdit
{
self
.
isBrothersEditMode
=
.
canCancel
}
}
self
.
loadFamilyMember
()
}
return
cell
}
// 配偶父母子女兄妹具体条目
if
item
is
YHFamilyMember
{
let
detailItem
=
item
as!
YHFamilyMember
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemEnterDetailCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemEnterDetailCell
cell
.
isNeedTopLineNoGap
=
(
indexPath
.
row
==
1
)
cell
.
title
=
detailItem
.
getTitle
()
// cell.detailLabel.textColor = (isNeedShowError && detailItem.notFillNumber != 0 ? .failColor : .labelTextColor2)
var
tips
=
""
if
detailItem
.
notFillNumber
>
0
{
tips
=
String
(
format
:
"有%d项未填写"
.
local
,
detailItem
.
notFillNumber
)
}
else
if
detailItem
.
notFillNumber
==
0
{
tips
=
"已填完"
.
local
}
else
{
tips
=
"还未开始填写"
.
local
}
cell
.
detailLabel
.
text
=
tips
cell
.
setTips
(
tips
,
isShow
:
(
isNeedShowError
&&
detailItem
.
notFillNumber
!=
0
))
if
isEmptyString
(
detailItem
.
subsetName
)
{
// 姓名为空
if
detailItem
.
relationType
==
.
child
{
cell
.
title
=
String
(
format
:
"子女%d"
.
local
,
indexPath
.
row
)
}
else
if
detailItem
.
relationType
==
.
brother
{
cell
.
title
=
String
(
format
:
"兄弟姐妹%d"
.
local
,
indexPath
.
row
)
}
}
else
{
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
.
deleteBlock
=
nil
if
detailItem
.
relationType
==
.
child
||
detailItem
.
relationType
==
.
brother
{
if
detailItem
.
relationType
==
.
child
{
cell
.
isShowDeleteBtn
=
(
isChildsEditMode
==
.
canCancel
)
}
else
if
detailItem
.
relationType
==
.
brother
{
cell
.
isShowDeleteBtn
=
(
isBrothersEditMode
==
.
canCancel
)
}
// 删除子女兄妹处理
cell
.
deleteBlock
=
{
[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
if
detailItem
.
relationType
==
.
child
{
let
childCount
=
self
.
familyMemberInfo
?
.
child
?
.
count
??
0
// 因为子女兄妹section第一行都是标题所以row-1
if
(
indexPath
.
row
-
1
>=
childCount
)
{
return
}
guard
let
child
=
self
.
familyMemberInfo
?
.
child
?[
indexPath
.
row
-
1
]
else
{
return
}
var
name
=
String
(
format
:
"子女%d"
,
indexPath
.
row
)
if
!
detailItem
.
subsetName
.
isEmpty
{
name
+=
"(
\(
detailItem
.
subsetName
)
)"
}
let
msg
=
String
(
format
:
"确定要删除%@吗?"
.
local
,
name
)
YHTwoOptionAlertView
.
showAlertView
(
message
:
msg
)
{
sure
in
if
!
sure
{
return
}
self
.
deleteFamilyMember
(
orderId
:
self
.
orderId
,
memberId
:
child
.
detailId
)
{
[
weak
self
]
success
in
guard
let
self
=
self
else
{
return
}
if
success
{
self
.
isChildsEditMode
=
.
none
self
.
isBrothersEditMode
=
.
none
self
.
requestFamilyInfo
()
}
}
}
}
else
if
detailItem
.
relationType
==
.
brother
{
let
brotherCount
=
self
.
familyMemberInfo
?
.
brother
?
.
count
??
0
// 因为子女兄妹section第一行都是标题所以row-1
if
(
indexPath
.
row
-
1
>=
brotherCount
)
{
return
}
guard
let
brother
=
self
.
familyMemberInfo
?
.
brother
?[
indexPath
.
row
-
1
]
else
{
return
}
var
name
=
String
(
format
:
"兄弟姐妹%d"
,
indexPath
.
row
)
if
!
detailItem
.
subsetName
.
isEmpty
{
name
+=
"(
\(
detailItem
.
subsetName
)
)"
}
let
msg
=
String
(
format
:
"确定要删除%@吗?"
.
local
,
name
)
YHTwoOptionAlertView
.
showAlertView
(
message
:
msg
)
{
sure
in
if
!
sure
{
return
}
self
.
deleteFamilyMember
(
orderId
:
self
.
orderId
,
memberId
:
brother
.
detailId
)
{
[
weak
self
]
success
in
guard
let
self
=
self
else
{
return
}
if
success
{
self
.
isChildsEditMode
=
.
none
self
.
isBrothersEditMode
=
.
none
self
.
requestFamilyInfo
()
}
}
}
}
}
}
return
cell
}
// 新增子女/兄弟姐妹
if
item
is
YHFormAddItem
{
let
formItem
=
item
as!
YHFormAddItem
if
formItem
.
type
==
.
addChild
||
formItem
.
type
==
.
addBrother
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemAddCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemAddCell
cell
.
title
=
formItem
.
getTitle
()
cell
.
isNeedTopLineNoGap
=
true
if
formItem
.
type
==
.
addChild
{
var
hiddenTopLine
=
false
if
let
childs
=
familyMemberInfo
?
.
child
,
!
childs
.
isEmpty
{
hiddenTopLine
=
true
}
cell
.
isHiddenTopLine
=
hiddenTopLine
}
else
if
formItem
.
type
==
.
addBrother
{
var
hiddenTopLine
=
false
if
let
brothers
=
familyMemberInfo
?
.
brother
,
!
brothers
.
isEmpty
{
hiddenTopLine
=
true
}
cell
.
isHiddenTopLine
=
hiddenTopLine
}
cell
.
clickBlock
=
{
[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
if
formItem
.
type
==
.
addBrother
{
self
.
addFamilyMember
(
.
brother
)
}
else
if
formItem
.
type
==
.
addChild
{
self
.
addFamilyMember
(
.
child
)
}
}
return
cell
}
}
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"UITableViewCell"
,
for
:
indexPath
)
return
cell
}
func
tableView
(
_
tableView
:
UITableView
,
willDisplay
cell
:
UITableViewCell
,
forRowAt
indexPath
:
IndexPath
)
{
if
indexPath
.
section
>=
items
.
count
{
return
}
let
arr
:[
YHFormItemProtocol
]
=
items
[
indexPath
.
section
]
if
indexPath
.
row
>=
arr
.
count
{
return
}
createCorner
(
cell
:
cell
,
arr
:
arr
,
indexPath
:
indexPath
)
}
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
return
UITableView
.
automaticDimension
}
func
tableView
(
_
tableView
:
UITableView
,
viewForFooterInSection
section
:
Int
)
->
UIView
?
{
return
UIView
()
}
func
tableView
(
_
tableView
:
UITableView
,
viewForHeaderInSection
section
:
Int
)
->
UIView
?
{
return
UIView
()
}
private
func
tableView
(
_
tableView
:
UITableView
,
viewForHeaderInSection
section
:
Int
)
->
CGFloat
{
return
14.0
}
private
func
tableView
(
_
tableView
:
UITableView
,
viewForFooterInSection
section
:
Int
)
->
CGFloat
{
if
section
==
items
.
count
-
1
{
return
14.0
}
return
1.0
}
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
let
arr
=
items
[
indexPath
.
section
]
let
item
:
YHFormItemProtocol
=
arr
[
indexPath
.
row
]
// 标题
if
item
is
YHFormTitleItem
{
return
}
// 新增子女兄妹
if
item
is
YHFormAddItem
{
let
detailItem
=
item
as!
YHFormAddItem
if
detailItem
.
type
==
.
addChild
{
}
else
if
detailItem
.
type
==
.
addBrother
{
}
return
}
if
item
is
YHFamilyMember
{
let
detailItem
=
item
as!
YHFamilyMember
// 配偶
if
detailItem
.
relationType
==
.
spouse
{
let
vc
=
YHGCSpouseInfoContainerVC
()
vc
.
spouse
=
detailItem
vc
.
mainApplicantInfo
=
self
.
familyMemberInfo
?
.
applicant
vc
.
orderId
=
orderId
self
.
navigationController
?
.
pushViewController
(
vc
)
return
}
// 父母
if
detailItem
.
relationType
==
.
father
||
detailItem
.
relationType
==
.
mother
{
let
vc
=
YHParentInfoVC
()
vc
.
parentInfo
=
detailItem
vc
.
orderId
=
orderId
self
.
navigationController
?
.
pushViewController
(
vc
)
return
}
// 子女
if
detailItem
.
relationType
==
.
child
{
let
vc
=
YHGCChildInfoContainerVC
()
vc
.
child
=
detailItem
vc
.
mainApplicantInfo
=
self
.
familyMemberInfo
?
.
applicant
vc
.
orderId
=
orderId
self
.
navigationController
?
.
pushViewController
(
vc
)
return
}
// 兄弟姐妹
if
detailItem
.
relationType
==
.
brother
{
let
vc
=
YHBrotherInfoVC
()
vc
.
orderId
=
orderId
vc
.
brotherInfo
=
detailItem
self
.
navigationController
?
.
pushViewController
(
vc
)
return
}
}
}
func
createCorner
(
cell
:
UITableViewCell
,
arr
:
Array
<
Any
>
,
indexPath
:
IndexPath
)
{
// 设置每块section圆角
if
(
indexPath
.
row
==
0
)
{
let
corner
=
UIRectCorner
(
rawValue
:
UIRectCorner
.
topLeft
.
rawValue
|
UIRectCorner
.
topRight
.
rawValue
)
cell
.
createCorner
(
CGSizeMake
(
12.0
,
12.0
),
corner
)
}
else
if
(
indexPath
.
row
==
arr
.
count
-
1
)
{
let
corner
=
UIRectCorner
(
rawValue
:
UIRectCorner
.
bottomLeft
.
rawValue
|
UIRectCorner
.
bottomRight
.
rawValue
)
cell
.
createCorner
(
CGSizeMake
(
12.0
,
12.0
),
corner
)
}
else
{
cell
.
layer
.
mask
=
nil
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment