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
c5daef8c
Commit
c5daef8c
authored
Nov 12, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 家庭成员
parent
54bddd77
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1272 additions
and
0 deletions
+1272
-0
project.pbxproj
galaxy/galaxy.xcodeproj/project.pbxproj
+12
-0
YHGCCertificateInfoController.swift
...rtificates(证书上传和证书信息)/YHGCCertificateInfoController.swift
+520
-0
YHGCCertificateUploadVC.swift
...)/C/Certificates(证书上传和证书信息)/YHGCCertificateUploadVC.swift
+98
-0
YHGCFamilyMemberInfoListVC.swift
.../FamilyMember(家庭成员信息表)/C/YHGCFamilyMemberInfoListVC.swift
+642
-0
No files found.
galaxy/galaxy.xcodeproj/project.pbxproj
View file @
c5daef8c
...
@@ -492,6 +492,9 @@
...
@@ -492,6 +492,9 @@
047F3DC62CDF3E19001B2A6D
/* YHGCChildPrimaryInfoVC.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
047F3DC52CDF3E19001B2A6D
/* YHGCChildPrimaryInfoVC.swift */
;
};
047F3DC62CDF3E19001B2A6D
/* YHGCChildPrimaryInfoVC.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
047F3DC52CDF3E19001B2A6D
/* YHGCChildPrimaryInfoVC.swift */
;
};
047F3DC82CDF3E38001B2A6D
/* YHGCChildInfoContainerVC.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
047F3DC72CDF3E38001B2A6D
/* YHGCChildInfoContainerVC.swift */
;
};
047F3DC82CDF3E38001B2A6D
/* YHGCChildInfoContainerVC.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
047F3DC72CDF3E38001B2A6D
/* YHGCChildInfoContainerVC.swift */
;
};
047F3DCA2CDF3E5C001B2A6D
/* YHGCChildBasicInfoVC.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
047F3DC92CDF3E5C001B2A6D
/* YHGCChildBasicInfoVC.swift */
;
};
047F3DCA2CDF3E5C001B2A6D
/* YHGCChildBasicInfoVC.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
047F3DC92CDF3E5C001B2A6D
/* YHGCChildBasicInfoVC.swift */
;
};
047F3DCD2CE2F96E001B2A6D
/* YHGCFamilyMemberInfoListVC.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
047F3DCC2CE2F96E001B2A6D
/* YHGCFamilyMemberInfoListVC.swift */
;
};
047F3DCF2CE2FB64001B2A6D
/* YHGCCertificateUploadVC.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
047F3DCE2CE2FB64001B2A6D
/* YHGCCertificateUploadVC.swift */
;
};
047F3DD12CE2FB81001B2A6D
/* YHGCCertificateInfoController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
047F3DD02CE2FB81001B2A6D
/* YHGCCertificateInfoController.swift */
;
};
0480582F2C7CA77900502CAA
/* YHDisappointHKAlertView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0480582E2C7CA77900502CAA
/* YHDisappointHKAlertView.swift */
;
};
0480582F2C7CA77900502CAA
/* YHDisappointHKAlertView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0480582E2C7CA77900502CAA
/* YHDisappointHKAlertView.swift */
;
};
048058312C7DBDC900502CAA
/* YHTravelCertificateTipsView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
048058302C7DBDC900502CAA
/* YHTravelCertificateTipsView.swift */
;
};
048058312C7DBDC900502CAA
/* YHTravelCertificateTipsView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
048058302C7DBDC900502CAA
/* YHTravelCertificateTipsView.swift */
;
};
048058332C7DC0CF00502CAA
/* YHTravelCertificateTipsCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
048058322C7DC0CF00502CAA
/* YHTravelCertificateTipsCell.swift */
;
};
048058332C7DC0CF00502CAA
/* YHTravelCertificateTipsCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
048058322C7DC0CF00502CAA
/* YHTravelCertificateTipsCell.swift */
;
};
...
@@ -1474,6 +1477,9 @@
...
@@ -1474,6 +1477,9 @@
047F3DC52CDF3E19001B2A6D
/* YHGCChildPrimaryInfoVC.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHGCChildPrimaryInfoVC.swift
;
sourceTree
=
"<group>"
;
};
047F3DC52CDF3E19001B2A6D
/* YHGCChildPrimaryInfoVC.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHGCChildPrimaryInfoVC.swift
;
sourceTree
=
"<group>"
;
};
047F3DC72CDF3E38001B2A6D
/* YHGCChildInfoContainerVC.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHGCChildInfoContainerVC.swift
;
sourceTree
=
"<group>"
;
};
047F3DC72CDF3E38001B2A6D
/* YHGCChildInfoContainerVC.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHGCChildInfoContainerVC.swift
;
sourceTree
=
"<group>"
;
};
047F3DC92CDF3E5C001B2A6D
/* YHGCChildBasicInfoVC.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHGCChildBasicInfoVC.swift
;
sourceTree
=
"<group>"
;
};
047F3DC92CDF3E5C001B2A6D
/* YHGCChildBasicInfoVC.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHGCChildBasicInfoVC.swift
;
sourceTree
=
"<group>"
;
};
047F3DCC2CE2F96E001B2A6D
/* YHGCFamilyMemberInfoListVC.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHGCFamilyMemberInfoListVC.swift
;
sourceTree
=
"<group>"
;
};
047F3DCE2CE2FB64001B2A6D
/* YHGCCertificateUploadVC.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHGCCertificateUploadVC.swift
;
sourceTree
=
"<group>"
;
};
047F3DD02CE2FB81001B2A6D
/* YHGCCertificateInfoController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHGCCertificateInfoController.swift
;
sourceTree
=
"<group>"
;
};
0480582E2C7CA77900502CAA
/* YHDisappointHKAlertView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHDisappointHKAlertView.swift
;
sourceTree
=
"<group>"
;
};
0480582E2C7CA77900502CAA
/* YHDisappointHKAlertView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHDisappointHKAlertView.swift
;
sourceTree
=
"<group>"
;
};
048058302C7DBDC900502CAA
/* YHTravelCertificateTipsView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHTravelCertificateTipsView.swift
;
sourceTree
=
"<group>"
;
};
048058302C7DBDC900502CAA
/* YHTravelCertificateTipsView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHTravelCertificateTipsView.swift
;
sourceTree
=
"<group>"
;
};
048058322C7DC0CF00502CAA
/* YHTravelCertificateTipsCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHTravelCertificateTipsCell.swift
;
sourceTree
=
"<group>"
;
};
048058322C7DC0CF00502CAA
/* YHTravelCertificateTipsCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHTravelCertificateTipsCell.swift
;
sourceTree
=
"<group>"
;
};
...
@@ -3632,6 +3638,7 @@
...
@@ -3632,6 +3638,7 @@
047F3DBD2CDF3C89001B2A6D
/* Certificates(证书上传和证书信息) */
,
047F3DBD2CDF3C89001B2A6D
/* Certificates(证书上传和证书信息) */
,
047F3DBC2CDF3C6C001B2A6D
/* Child(子女) */
,
047F3DBC2CDF3C6C001B2A6D
/* Child(子女) */
,
047F3DBB2CDF3C56001B2A6D
/* Spouse(配偶) */
,
047F3DBB2CDF3C56001B2A6D
/* Spouse(配偶) */
,
047F3DCC2CE2F96E001B2A6D
/* YHGCFamilyMemberInfoListVC.swift */
,
);
);
path
=
C
;
path
=
C
;
sourceTree
=
"<group>"
;
sourceTree
=
"<group>"
;
...
@@ -3659,6 +3666,8 @@
...
@@ -3659,6 +3666,8 @@
047F3DBD2CDF3C89001B2A6D
/* Certificates(证书上传和证书信息) */
=
{
047F3DBD2CDF3C89001B2A6D
/* Certificates(证书上传和证书信息) */
=
{
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
047F3DCE2CE2FB64001B2A6D
/* YHGCCertificateUploadVC.swift */
,
047F3DD02CE2FB81001B2A6D
/* YHGCCertificateInfoController.swift */
,
);
);
path
=
"Certificates(证书上传和证书信息)"
;
path
=
"Certificates(证书上传和证书信息)"
;
sourceTree
=
"<group>"
;
sourceTree
=
"<group>"
;
...
@@ -5573,6 +5582,7 @@
...
@@ -5573,6 +5582,7 @@
044867B82BA1C75700DFAD4A
/* YHCertificateUploadFailTipsView.swift in Sources */
,
044867B82BA1C75700DFAD4A
/* YHCertificateUploadFailTipsView.swift in Sources */
,
04256DE02C72DC0600A37BA4
/* YHCertificateAppointOptionView.swift in Sources */
,
04256DE02C72DC0600A37BA4
/* YHCertificateAppointOptionView.swift in Sources */
,
04CA2BEE2CB7771000F36DE7
/* YHResignUploadTravelCardFootViewController.swift in Sources */
,
04CA2BEE2CB7771000F36DE7
/* YHResignUploadTravelCardFootViewController.swift in Sources */
,
047F3DCD2CE2F96E001B2A6D
/* YHGCFamilyMemberInfoListVC.swift in Sources */
,
044D0C062C22736F00C5CF5E
/* YHSetExplainView.swift in Sources */
,
044D0C062C22736F00C5CF5E
/* YHSetExplainView.swift in Sources */
,
04256DF02C733B2D00A37BA4
/* YHGrabNumberInfoView.swift in Sources */
,
04256DF02C733B2D00A37BA4
/* YHGrabNumberInfoView.swift in Sources */
,
04213B252C48C15400797900
/* YHHomeIdentityViewController.swift in Sources */
,
04213B252C48C15400797900
/* YHHomeIdentityViewController.swift in Sources */
,
...
@@ -5857,6 +5867,7 @@
...
@@ -5857,6 +5867,7 @@
044EE24A2C9434D400A2FE3A
/* YHResignCertificateDetailPassPortViewController.swift in Sources */
,
044EE24A2C9434D400A2FE3A
/* YHResignCertificateDetailPassPortViewController.swift in Sources */
,
0449EEF02C902A4100A397FD
/* YHResignMaterialUploadVC.swift in Sources */
,
0449EEF02C902A4100A397FD
/* YHResignMaterialUploadVC.swift in Sources */
,
04129E862CD0C8490072F87B
/* YHAliYunLogManager.swift in Sources */
,
04129E862CD0C8490072F87B
/* YHAliYunLogManager.swift in Sources */
,
047F3DD12CE2FB81001B2A6D
/* YHGCCertificateInfoController.swift in Sources */
,
04174D642BCD52BD000BA46D
/* YHDeviceInfoViewController.swift in Sources */
,
04174D642BCD52BD000BA46D
/* YHDeviceInfoViewController.swift in Sources */
,
0472E25E2C534723008EAB6E
/* YHLifeDetailViewController.swift in Sources */
,
0472E25E2C534723008EAB6E
/* YHLifeDetailViewController.swift in Sources */
,
0457920D2CBCE8A800EBD99B
/* YHResignUploadTravelCardListModel.swift in Sources */
,
0457920D2CBCE8A800EBD99B
/* YHResignUploadTravelCardListModel.swift in Sources */
,
...
@@ -5875,6 +5886,7 @@
...
@@ -5875,6 +5886,7 @@
A567E5A92BD7643D00D5D5A0
/* YHSearchInfoHistoryView.swift in Sources */
,
A567E5A92BD7643D00D5D5A0
/* YHSearchInfoHistoryView.swift in Sources */
,
045EEE802B9F171A0022A143
/* YHAcademicPreviewModel.swift in Sources */
,
045EEE802B9F171A0022A143
/* YHAcademicPreviewModel.swift in Sources */
,
04256E122C75BD2700A37BA4
/* YHPayMemberContentItem.swift in Sources */
,
04256E122C75BD2700A37BA4
/* YHPayMemberContentItem.swift in Sources */
,
047F3DCF2CE2FB64001B2A6D
/* YHGCCertificateUploadVC.swift in Sources */
,
04C693642B723B56004C1758
/* YHMySettingCell.swift in Sources */
,
04C693642B723B56004C1758
/* YHMySettingCell.swift in Sources */
,
A5FD63C92B63A35B00D1D9DA
/* YHInformationFillTipsAlertView.swift in Sources */
,
A5FD63C92B63A35B00D1D9DA
/* YHInformationFillTipsAlertView.swift in Sources */
,
04174D762BCD5B74000BA46D
/* YHMsgListModel.swift in Sources */
,
04174D762BCD5B74000BA46D
/* YHMsgListModel.swift in Sources */
,
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/TTPS(高才)/ServiceProcess(我的信息流程)/FamilyMember(家庭成员信息表)/C/Certificates(证书上传和证书信息)/YHGCCertificateInfoController.swift
0 → 100644
View file @
c5daef8c
//
// YHGCCertificateInfoController.swift
// galaxy
//
// Created by edy on 2024/11/12.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
class
YHGCCertificateInfoController
:
YHBaseViewController
,
YHFamilyMemberProtol
{
var
familyMember
:
YHFamilyMember
?
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
loadInfo
()
{
guard
let
familyMember
=
familyMember
else
{
return
}
items
.
removeAll
()
// 中国身份证
let
isChinaCardMust
=
familyMember
.
isChinese
()
&&
familyMember
.
relationType
!=
.
child
let
title0
=
YHFormTitleItem
(
type
:
.
chinaIdCardInfo
)
let
item01
=
YHFormDetailItem
(
type
:
.
chinaIdentityCardNumber
,
isNeed
:
isChinaCardMust
,
value
:
familyMember
.
certificates
.
cnIdentityCard
.
number
,
tips
:
"请输入正确的中国身份证号"
.
local
)
let
item02
=
YHFormDetailItem
(
type
:
.
certificateSignPlace
,
isNeed
:
isChinaCardMust
,
value
:
familyMember
.
certificates
.
cnIdentityCard
.
issueAt
,
tips
:
"请输入签发地"
.
local
)
let
item03
=
YHFormDetailItem
(
type
:
.
certificateSignDate
,
isNeed
:
isChinaCardMust
,
value
:
familyMember
.
certificates
.
cnIdentityCard
.
issueDateStartAt
,
tips
:
"请选择签发日期"
.
local
)
let
item04
=
YHFormDetailItem
(
type
:
.
certificateValidDate
,
isNeed
:
isChinaCardMust
,
value
:
familyMember
.
certificates
.
cnIdentityCard
.
issueDateEndAt
,
tips
:
"请选择签发日期"
.
local
)
let
arr0
:[
YHFormItemProtocol
]
=
[
title0
,
item01
,
item02
,
item03
,
item04
]
items
.
append
(
arr0
)
// 港澳通行证 非必须
if
familyMember
.
isNeedHandleHKPassPort
()
{
let
title1
=
YHFormTitleItem
(
type
:
.
hkAndMacaoPassport
)
let
item10
=
YHFormDetailItem
(
type
:
.
traverlPassportNumber
,
value
:
familyMember
.
certificates
.
hkMacaoPass
.
number
,
tips
:
"请输入证件号码"
.
local
)
let
item11
=
YHFormDetailItem
(
type
:
.
certificateSignPlace
,
value
:
familyMember
.
certificates
.
hkMacaoPass
.
issueAt
,
tips
:
"请输入签发地"
.
local
)
let
item12
=
YHFormDetailItem
(
type
:
.
certificateSignDate
,
value
:
familyMember
.
certificates
.
hkMacaoPass
.
issueDateStartAt
,
tips
:
"请选择签发日期"
.
local
)
let
item13
=
YHFormDetailItem
(
type
:
.
certificateValidDate
,
value
:
familyMember
.
certificates
.
hkMacaoPass
.
issueDateEndAt
,
tips
:
"请选择届满日期"
.
local
)
let
arr1
:[
YHFormItemProtocol
]
=
[
title1
,
item10
,
item11
,
item12
,
item13
]
items
.
append
(
arr1
)
}
// 护照及其他旅行证件 信息必有
let
isPassPortMust
=
!
familyMember
.
isChinese
()
let
title2
=
YHFormTitleItem
(
type
:
.
passPortOrTravelInfo
)
// 证件类别名称
var
value
=
""
let
passPortType
=
self
.
familyMember
?
.
certificates
.
passport
.
passPortType
??
0
if
let
item
=
YHSheetPickerView
.
getItem
(
type
:
.
certificate
,
index
:
passPortType
)
{
value
=
item
.
title
}
let
item20
=
YHFormDetailItem
(
type
:
.
certificateType
,
isNeed
:
isPassPortMust
,
value
:
value
,
tips
:
"请选择证件类别"
.
local
)
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
,
item20
,
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
=
""
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
isChinaCardMust
=
familyMember
.
isChinese
()
&&
familyMember
.
relationType
!=
.
child
if
isChinaCardMust
{
if
familyMember
.
certificates
.
cnIdentityCard
.
number
.
count
!=
18
||
familyMember
.
certificates
.
cnIdentityCard
.
issueAt
.
count
<=
0
||
familyMember
.
certificates
.
cnIdentityCard
.
issueDateStartAt
.
count
<=
0
||
familyMember
.
certificates
.
cnIdentityCard
.
issueDateEndAt
.
count
<=
0
{
return
false
}
}
// 如果选了办理过港澳通行证,则需要验证港澳通行证
if
familyMember
.
isNeedHandleHKPassPort
()
{
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
!
familyMember
.
isChinese
()
{
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
||
familyMember
.
certificates
.
passport
.
passPortType
==
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 @
c5daef8c
//
// YHGCCertificateUploadVC.swift
// galaxy
//
// Created by edy on 2024/11/12.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
class
YHGCCertificateUploadVC
:
YHBaseViewController
,
YHFamilyMemberProtol
{
var
tableView
:
UITableView
!
weak
var
delegate
:
YHSpouseInfoVCProtocol
?
var
familyMember
:
YHFamilyMember
?
{
didSet
{
if
let
familyMember
=
familyMember
{
viewModel
.
mainModel
=
familyMember
}
}
}
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
)
cell
.
type
=
YHCardType
(
rawValue
:
indexPath
.
row
)
??
.
identity
cell
.
viewModel
=
viewModel
cell
.
backSurfaceDeleteButton
.
isHidden
=
true
cell
.
frontDeleteButton
.
isHidden
=
true
cell
.
informationBlock
=
{[
weak
self
]
type
,
image
,
isLeft
in
guard
let
self
=
self
else
{
return
}
}
return
cell
}
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
return
UITableView
.
automaticDimension
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/TTPS(高才)/ServiceProcess(我的信息流程)/FamilyMember(家庭成员信息表)/C/YHGCFamilyMemberInfoListVC.swift
0 → 100644
View file @
c5daef8c
//
// YHGCFamilyMemberInfoListVC.swift
// galaxy
//
// Created by edy on 2024/11/12.
// 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
=
YHSpouseInfoContainerVC
()
vc
.
spouse
=
detailItem
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
=
YHChildInfoContainerVC
()
vc
.
child
=
detailItem
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