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
3b479025
Commit
3b479025
authored
Jan 27, 2024
by
David黄金龙
Browse files
Options
Browse Files
Download
Plain Diff
Merge commit '
cc26e543
' into davidhuang
* commit '
cc26e543
': // 父母信息 // 父母信息
parents
f2813fb9
cc26e543
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
301 additions
and
228 deletions
+301
-228
project.pbxproj
galaxy/galaxy.xcodeproj/project.pbxproj
+8
-8
YHCertificateViewController.swift
...cess(流程)/FamilyMember/C/YHCertificateViewController.swift
+0
-2
YHFamilyMemberFormVC.swift
...viceProcess(流程)/FamilyMember/C/YHFamilyMemberFormVC.swift
+30
-1
YHParentInfoVC.swift
...心)/ServiceProcess(流程)/FamilyMember/C/YHParentInfoVC.swift
+78
-42
YHSpouseBasicInfoVC.swift
...rviceProcess(流程)/FamilyMember/C/YHSpouseBasicInfoVC.swift
+4
-1
YHSpouseInitialInfoVC.swift
...iceProcess(流程)/FamilyMember/C/YHSpouseInitialInfoVC.swift
+13
-13
YHConsortInfo.swift
...中心)/ServiceProcess(流程)/FamilyMember/M/YHConsortInfo.swift
+0
-143
YHFamilyInitialInfo.swift
...rviceProcess(流程)/FamilyMember/M/YHFamilyInitialInfo.swift
+40
-18
YHFormItemOnlyDoubleChoiceCell.swift
...程)/FamilyMember/View/YHFormItemOnlyDoubleChoiceCell.swift
+128
-0
No files found.
galaxy/galaxy.xcodeproj/project.pbxproj
View file @
3b479025
...
...
@@ -16,7 +16,6 @@
041B52952B5E7037007EBCEB
/* YHFormItemAddCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
041B52942B5E7037007EBCEB
/* YHFormItemAddCell.swift */
;
};
041B52982B5E8EA0007EBCEB
/* YHFamilyMemberFormVC.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
041B52972B5E8EA0007EBCEB
/* YHFamilyMemberFormVC.swift */
;
};
041B52D62B5F899E007EBCEB
/* YHSpouseInitialInfoVC.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
041B52D52B5F899E007EBCEB
/* YHSpouseInitialInfoVC.swift */
;
};
041B52D92B5F8B07007EBCEB
/* YHConsortInfo.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
041B52D82B5F8B07007EBCEB
/* YHConsortInfo.swift */
;
};
041B52DB2B5FDF8E007EBCEB
/* YHFamilyInitialInfo.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
041B52DA2B5FDF8E007EBCEB
/* YHFamilyInitialInfo.swift */
;
};
041B52DD2B60A889007EBCEB
/* YHTest.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
041B52DC2B60A889007EBCEB
/* YHTest.swift */
;
};
042FBBB92B627C0F00F9DE23
/* YHCertificateInfo.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
042FBBB82B627C0E00F9DE23
/* YHCertificateInfo.swift */
;
};
...
...
@@ -24,7 +23,8 @@
042FBBBD2B63519C00F9DE23
/* YHFormItemSelectSheetCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
042FBBBC2B63519C00F9DE23
/* YHFormItemSelectSheetCell.swift */
;
};
042FBBBF2B639F0300F9DE23
/* YHSpouseBasicInfoVC.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
042FBBBE2B639F0300F9DE23
/* YHSpouseBasicInfoVC.swift */
;
};
042FBBC12B63B21700F9DE23
/* YHFormItemDegreeInfoCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
042FBBC02B63B21700F9DE23
/* YHFormItemDegreeInfoCell.swift */
;
};
042FBBC32B63DA4C00F9DE23
/* YHParentViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
042FBBC22B63DA4C00F9DE23
/* YHParentViewController.swift */
;
};
042FBBC32B63DA4C00F9DE23
/* YHParentInfoVC.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
042FBBC22B63DA4C00F9DE23
/* YHParentInfoVC.swift */
;
};
042FBBC52B64AE3D00F9DE23
/* YHFormItemOnlyDoubleChoiceCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
042FBBC42B64AE3D00F9DE23
/* YHFormItemOnlyDoubleChoiceCell.swift */
;
};
0468D4202B49320900CFB916
/* YHVerificationCodeLoginController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0468D41F2B49320900CFB916
/* YHVerificationCodeLoginController.swift */
;
};
0468D4222B493A5E00CFB916
/* YHPhoneMessageView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0468D4212B493A5E00CFB916
/* YHPhoneMessageView.swift */
;
};
0468D4242B494BEA00CFB916
/* YHCodeResultViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0468D4232B494BEA00CFB916
/* YHCodeResultViewController.swift */
;
};
...
...
@@ -178,7 +178,6 @@
041B52942B5E7037007EBCEB
/* YHFormItemAddCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHFormItemAddCell.swift
;
sourceTree
=
"<group>"
;
};
041B52972B5E8EA0007EBCEB
/* YHFamilyMemberFormVC.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHFamilyMemberFormVC.swift
;
sourceTree
=
"<group>"
;
};
041B52D52B5F899E007EBCEB
/* YHSpouseInitialInfoVC.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHSpouseInitialInfoVC.swift
;
sourceTree
=
"<group>"
;
};
041B52D82B5F8B07007EBCEB
/* YHConsortInfo.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHConsortInfo.swift
;
sourceTree
=
"<group>"
;
};
041B52DA2B5FDF8E007EBCEB
/* YHFamilyInitialInfo.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHFamilyInitialInfo.swift
;
sourceTree
=
"<group>"
;
};
041B52DC2B60A889007EBCEB
/* YHTest.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHTest.swift
;
sourceTree
=
"<group>"
;
};
042FBBB82B627C0E00F9DE23
/* YHCertificateInfo.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHCertificateInfo.swift
;
sourceTree
=
"<group>"
;
};
...
...
@@ -186,7 +185,8 @@
042FBBBC2B63519C00F9DE23
/* YHFormItemSelectSheetCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHFormItemSelectSheetCell.swift
;
sourceTree
=
"<group>"
;
};
042FBBBE2B639F0300F9DE23
/* YHSpouseBasicInfoVC.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHSpouseBasicInfoVC.swift
;
sourceTree
=
"<group>"
;
};
042FBBC02B63B21700F9DE23
/* YHFormItemDegreeInfoCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHFormItemDegreeInfoCell.swift
;
sourceTree
=
"<group>"
;
};
042FBBC22B63DA4C00F9DE23
/* YHParentViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHParentViewController.swift
;
sourceTree
=
"<group>"
;
};
042FBBC22B63DA4C00F9DE23
/* YHParentInfoVC.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHParentInfoVC.swift
;
sourceTree
=
"<group>"
;
};
042FBBC42B64AE3D00F9DE23
/* YHFormItemOnlyDoubleChoiceCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHFormItemOnlyDoubleChoiceCell.swift
;
sourceTree
=
"<group>"
;
};
0468D41F2B49320900CFB916
/* YHVerificationCodeLoginController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHVerificationCodeLoginController.swift
;
sourceTree
=
"<group>"
;
};
0468D4212B493A5E00CFB916
/* YHPhoneMessageView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHPhoneMessageView.swift
;
sourceTree
=
"<group>"
;
};
0468D4232B494BEA00CFB916
/* YHCodeResultViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHCodeResultViewController.swift
;
sourceTree
=
"<group>"
;
};
...
...
@@ -364,6 +364,7 @@
041B52902B5E67F3007EBCEB
/* YHFormItemEnterDetailCell.swift */
,
042FBBBC2B63519C00F9DE23
/* YHFormItemSelectSheetCell.swift */
,
042FBBC02B63B21700F9DE23
/* YHFormItemDegreeInfoCell.swift */
,
042FBBC42B64AE3D00F9DE23
/* YHFormItemOnlyDoubleChoiceCell.swift */
,
);
path
=
View
;
sourceTree
=
"<group>"
;
...
...
@@ -375,7 +376,7 @@
041B52D52B5F899E007EBCEB
/* YHSpouseInitialInfoVC.swift */
,
042FBBBA2B62806D00F9DE23
/* YHCertificateViewController.swift */
,
042FBBBE2B639F0300F9DE23
/* YHSpouseBasicInfoVC.swift */
,
042FBBC22B63DA4C00F9DE23
/* YHParent
ViewController
.swift */
,
042FBBC22B63DA4C00F9DE23
/* YHParent
InfoVC
.swift */
,
);
path
=
C
;
sourceTree
=
"<group>"
;
...
...
@@ -383,7 +384,6 @@
041B52D72B5F8ADA007EBCEB
/* M */
=
{
isa
=
PBXGroup
;
children
=
(
041B52D82B5F8B07007EBCEB
/* YHConsortInfo.swift */
,
041B52DA2B5FDF8E007EBCEB
/* YHFamilyInitialInfo.swift */
,
042FBBB82B627C0E00F9DE23
/* YHCertificateInfo.swift */
,
041B52DC2B60A889007EBCEB
/* YHTest.swift */
,
...
...
@@ -1081,7 +1081,6 @@
A5ACE9332B4564F7002C94D2
/* NetBaseModel.swift in Sources */
,
049A48AA2B49536000D0C641
/* YHAboutUsAdvantageCell.swift in Sources */
,
A5C5B3002B55623800A7C5D1
/* ContentBaseViewController.swift in Sources */
,
041B52D92B5F8B07007EBCEB
/* YHConsortInfo.swift in Sources */
,
A5573ED22B317BFF00D98EC0
/* AppDelegate.swift in Sources */
,
A5ACE9542B4564F7002C94D2
/* YHNavigationController.swift in Sources */
,
A5ACE95E2B4571BF002C94D2
/* YHHomeViewController.swift in Sources */
,
...
...
@@ -1096,6 +1095,7 @@
04AF58C42B4FC51C0066011A
/* YHLocalizable.swift in Sources */
,
042FBBBF2B639F0300F9DE23
/* YHSpouseBasicInfoVC.swift in Sources */
,
A5C5B2E82B4EC95600A7C5D1
/* YHDavidTestCollectionViewCell.swift in Sources */
,
042FBBC52B64AE3D00F9DE23
/* YHFormItemOnlyDoubleChoiceCell.swift in Sources */
,
041B52DB2B5FDF8E007EBCEB
/* YHFamilyInitialInfo.swift in Sources */
,
0468D4222B493A5E00CFB916
/* YHPhoneMessageView.swift in Sources */
,
0468D4362B57752F00CFB916
/* YHUserModel.swift in Sources */
,
...
...
@@ -1138,7 +1138,7 @@
A5C5B3102B57677300A7C5D1
/* YHGestureTableView.swift in Sources */
,
A5ACE9312B4564F7002C94D2
/* YHPersonalCenterCell.swift in Sources */
,
A5ACE9532B4564F7002C94D2
/* YHBaseViewController.swift in Sources */
,
042FBBC32B63DA4C00F9DE23
/* YHParent
ViewController
.swift in Sources */
,
042FBBC32B63DA4C00F9DE23
/* YHParent
InfoVC
.swift in Sources */
,
A5ACE9392B4564F7002C94D2
/* UIDevice+Extension.swift in Sources */
,
041B52912B5E67F3007EBCEB
/* YHFormItemEnterDetailCell.swift in Sources */
,
A5ACE9422B4564F7002C94D2
/* AppDelegate+Extension.swift in Sources */
,
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/FamilyMember/C/YHCertificateViewController.swift
View file @
3b479025
...
...
@@ -179,8 +179,6 @@ extension YHCertificateViewController : UITableViewDelegate, UITableViewDataSour
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
let
vc
=
YHSpouseBasicInfoVC
()
self
.
navigationController
?
.
pushViewController
(
vc
)
}
func
createCorner
(
cell
:
UITableViewCell
,
arr
:
Array
<
Any
>
,
indexPath
:
IndexPath
)
{
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/FamilyMember/C/YHFamilyMemberFormVC.swift
View file @
3b479025
...
...
@@ -628,10 +628,39 @@ extension YHFamilyMemberFormVC : UITableViewDelegate, UITableViewDataSource {
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
if
let
spouse
=
familyMemberInfo
?
.
spouse
{
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
YHParent
{
let
parent
=
item
as!
YHParent
let
vc
=
YHParentInfoVC
()
vc
.
parentInfo
=
parent
self
.
navigationController
?
.
pushViewController
(
vc
)
return
}
// 配偶
if
item
is
YHSpouse
{
let
spouse
=
item
as!
YHSpouse
let
vc
=
YHSpouseInitialInfoVC
()
vc
.
spouse
=
spouse
self
.
navigationController
?
.
pushViewController
(
vc
)
return
}
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/FamilyMember/C/YHParent
ViewController
.swift
→
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/FamilyMember/C/YHParent
InfoVC
.swift
View file @
3b479025
...
...
@@ -8,7 +8,7 @@
import
UIKit
class
YHParent
ViewController
:
YHBaseViewController
{
class
YHParent
InfoVC
:
YHBaseViewController
{
var
parentInfo
:
YHParent
?
...
...
@@ -33,8 +33,7 @@ class YHParentViewController: YHBaseViewController {
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
)
tableView
.
register
(
YHFormItemOnlyDoubleChoiceCell
.
self
,
forCellReuseIdentifier
:
YHFormItemOnlyDoubleChoiceCell
.
cellReuseIdentifier
)
return
tableView
}()
...
...
@@ -55,39 +54,63 @@ class YHParentViewController: YHBaseViewController {
make
.
left
.
equalToSuperview
()
.
offset
(
16
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
16
)
}
loadBasicInfo
()
}
func
loadBasicInfo
()
{
let
title0
=
YHFormTitleItem
(
type
:
.
spouseInfo
)
let
item01
=
YHFormDetailItem
(
type
:
.
everName
)
let
item02
=
YHFormDetailItem
(
type
:
.
befourMarryFirstName
)
let
item03
=
YHFormDetailItem
(
type
:
.
birthday
)
let
item04
=
YHFormDetailItem
(
type
:
.
birthNation
)
let
item05
=
YHFormDetailItem
(
type
:
.
birthCity
)
let
arr0
:[
YHFormItemProtocol
]
=
[
title0
,
item01
,
item02
,
item03
,
item04
,
item05
]
let
title1
=
YHFormTitleItem
(
type
:
.
occupationInfo
)
let
item10
=
YHFormDetailItem
(
type
:
.
occupation
)
let
item11
=
YHFormDetailItem
(
type
:
.
occupationName
)
let
arr1
:[
YHFormItemProtocol
]
=
[
title1
,
item10
,
item11
]
guard
let
parentInfo
=
parentInfo
else
{
return
}
items
.
removeAll
()
// 基本信息
let
title0
:
YHFormItemProtocol
=
YHFormTitleItem
(
type
:
.
basicInfo
)
let
item00
:
YHFormItemProtocol
=
YHFormDetailItem
(
type
:
.
onlyDoubleChoice
)
let
arr0
:[
YHFormItemProtocol
]
=
[
title0
,
item00
]
// 父母亲信息
var
arr1
=
[
YHFormItemProtocol
]()
if
parentInfo
.
sex
==
-
1
{
// 父亲
let
title1
:
YHFormItemProtocol
=
YHFormTitleItem
(
type
:
.
fatherInfo
)
let
item10
:
YHFormItemProtocol
=
YHFormDetailItem
(
type
:
.
fatherName
)
arr1
.
append
(
contentsOf
:
[
title1
,
item10
])
}
else
{
// 母亲
let
title1
:
YHFormItemProtocol
=
YHFormTitleItem
(
type
:
.
motherInfo
)
let
item10
:
YHFormItemProtocol
=
YHFormDetailItem
(
type
:
.
motherName
)
arr1
.
append
(
contentsOf
:
[
title1
,
item10
])
}
let
title2
=
YHFormTitleItem
(
type
:
.
degreeInfo
)
let
item20
=
YHFormDetailItem
(
type
:
.
ownDegree
)
let
item11
:
YHFormItemProtocol
=
YHFormDetailItem
(
type
:
.
birthday
)
let
item12
:
YHFormItemProtocol
=
YHFormDetailItem
(
type
:
.
birthNation
)
let
item13
:
YHFormItemProtocol
=
YHFormDetailItem
(
type
:
.
birthCity
)
arr1
.
append
(
contentsOf
:
[
item11
,
item12
,
item13
])
let
item21
=
YHFormDetailItem
(
type
:
.
degreeDetailInfo
)
let
item22
=
YHFormDetailItem
(
type
:
.
degreeDetailInfo
)
if
parentInfo
.
deceased
!=
1
{
// 健在
let
item14
:
YHFormItemProtocol
=
YHFormDetailItem
(
type
:
.
marriageState
)
arr1
.
append
(
item14
)
}
// 职业信息
let
title2
:
YHFormItemProtocol
=
YHFormTitleItem
(
type
:
.
occupationInfo
)
let
item20
:
YHFormItemProtocol
=
YHFormDetailItem
(
type
:
.
occupation
)
let
arr2
:[
YHFormItemProtocol
]
=
[
title2
,
item20
]
let
item23
=
YHFormAddItem
(
type
:
.
addDegree
)
let
arr2
:[
YHFormItemProtocol
]
=
[
title2
,
item20
,
item21
,
item22
,
item23
]
// 居住信息
let
title3
:
YHFormItemProtocol
=
YHFormTitleItem
(
type
:
.
liveInfo
)
let
item30
:
YHFormItemProtocol
=
YHFormDetailItem
(
type
:
.
liveNationOrArea
)
let
arr3
:[
YHFormItemProtocol
]
=
[
title3
,
item30
]
let
title3
=
YHFormTitleItem
(
type
:
.
hkIdentityCardInfo
)
let
item30
=
YHFormDetailItem
(
type
:
.
isHaveHkIdentityCard
)
let
item31
=
YHFormDetailItem
(
type
:
.
hkIdentityCardNumber
)
let
arr3
:[
YHFormItemProtocol
]
=
[
title3
,
item30
,
item31
]
// 香港身份证
let
title4
:
YHFormItemProtocol
=
YHFormTitleItem
(
type
:
.
hkIdentityCardInfo
)
let
item40
:
YHFormItemProtocol
=
YHFormDetailItem
(
type
:
.
isHaveHkIdentityCard
)
let
item41
:
YHFormItemProtocol
=
YHFormDetailItem
(
type
:
.
hkIdentityCardNumber
)
let
arr4
:[
YHFormItemProtocol
]
=
[
title4
,
item40
,
item41
]
items
.
append
(
contentsOf
:
[
arr0
,
arr1
,
arr2
,
arr3
])
items
.
append
(
contentsOf
:
[
arr0
,
arr1
,
arr2
,
arr3
,
arr4
])
tableView
.
reloadData
()
}
func
getCellType
(
_
item
:
Any
)
->
HKFormItemCellType
{
...
...
@@ -95,38 +118,31 @@ class YHParentViewController: YHBaseViewController {
return
.
title
}
if
item
is
YHFormAddItem
{
return
.
addItem
}
if
item
is
YHFormDetailItem
{
let
detailItem
=
item
as!
YHFormDetailItem
if
detailItem
.
type
==
.
spouseName
||
detailItem
.
type
==
.
everName
||
detailItem
.
type
==
.
befourMarryFirstName
||
detailItem
.
type
==
.
occupationName
if
detailItem
.
type
==
.
fatherName
||
detailItem
.
type
==
.
motherName
||
detailItem
.
type
==
.
nationOrArea
||
detailItem
.
type
==
.
hkIdentityCardNumber
{
return
.
inputText
}
if
detailItem
.
type
==
.
birthday
||
detailItem
.
type
==
.
birthCity
||
detailItem
.
type
==
.
marriageState
||
detailItem
.
type
==
.
occupation
||
detailItem
.
type
==
.
stayHKDate
||
detailItem
.
type
==
.
roleInHK
||
detailItem
.
type
==
.
ownDegree
||
detailItem
.
type
==
.
liveNationOrArea
{
return
.
selectSheet
}
if
detailItem
.
type
==
.
birthNation
||
detailItem
.
type
==
.
isNowInHK
||
detailItem
.
type
==
.
isHaveHkIdentityCard
{
return
.
twoChoice
}
if
detailItem
.
type
==
.
degreeDetailInfo
if
detailItem
.
type
==
.
onlyDoubleChoice
{
return
.
degreeDetailInfo
return
.
onlyTwoChoice
}
}
return
.
defaultType
...
...
@@ -134,7 +150,7 @@ class YHParentViewController: YHBaseViewController {
}
extension
YHParent
ViewController
:
UITableViewDelegate
,
UITableViewDataSource
{
extension
YHParent
InfoVC
:
UITableViewDelegate
,
UITableViewDataSource
{
func
numberOfSections
(
in
tableView
:
UITableView
)
->
Int
{
return
items
.
count
...
...
@@ -173,7 +189,7 @@ extension YHParentViewController : UITableViewDelegate, UITableViewDataSource {
return
cell
}
if
cellType
==
.
twoChoice
{
// 双项选择cell
if
cellType
==
.
twoChoice
{
//
问答
双项选择cell
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemDoubleChoiceCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemDoubleChoiceCell
cell
.
title
=
item
.
getTitle
()
...
...
@@ -183,6 +199,26 @@ extension YHParentViewController : UITableViewDelegate, UITableViewDataSource {
return
cell
}
if
cellType
==
.
onlyTwoChoice
{
// 仅有双项选择cell
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemOnlyDoubleChoiceCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemOnlyDoubleChoiceCell
var
isDead
=
0
if
let
dead
=
parentInfo
?
.
deceased
,
dead
==
1
{
// 已故
isDead
=
1
}
let
answers
=
[
YHFormChoiceItem
(
title
:
"健在"
.
local
,
isSelect
:
isDead
!=
1
),
YHFormChoiceItem
(
title
:
"已故"
.
local
,
isSelect
:
isDead
==
1
)]
cell
.
answerArr
=
answers
cell
.
answerBlock
=
{
[
weak
self
]
(
arr
,
selectIndex
)
in
let
selectItem
:
YHFormChoiceItem
=
arr
[
selectIndex
]
self
?
.
parentInfo
?
.
deceased
=
(
selectItem
.
title
==
"已故"
?
1
:
0
)
self
?
.
loadBasicInfo
()
}
return
cell
}
if
cellType
==
.
addItem
{
// 新增item cell
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemAddCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemAddCell
cell
.
title
=
item
.
getTitle
()
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/FamilyMember/C/YHSpouseBasicInfoVC.swift
View file @
3b479025
...
...
@@ -18,6 +18,7 @@ enum HKFormItemCellType: Int {
case
twoChoice
=
5
case
addItem
=
6
case
degreeDetailInfo
=
7
case
onlyTwoChoice
=
8
}
...
...
@@ -258,7 +259,9 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
}
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
let
vc
=
YHParentInfoVC
()
self
.
navigationController
?
.
pushViewController
(
vc
)
}
func
createCorner
(
cell
:
UITableViewCell
,
arr
:
Array
<
Any
>
,
indexPath
:
IndexPath
)
{
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/FamilyMember/C/YHSpouseInitialInfoVC.swift
View file @
3b479025
...
...
@@ -80,7 +80,7 @@ class YHSpouseInitialInfoVC: YHBaseViewController {
// 随行
let
title0
=
YHFormTitleItem
(
type
:
.
accompany
)
let
item0
=
YHFormDetailItem
(
type
:
.
accompany
)
let
item0
=
YHFormDetailItem
(
type
:
.
isAccompanyToHK
)
item0
.
isAccompany
=
(
spouse
.
follow
==
1
)
let
arr0
:[
YHFormItemProtocol
]
=
[
title0
,
item0
]
items
.
append
(
arr0
)
...
...
@@ -88,7 +88,7 @@ class YHSpouseInitialInfoVC: YHBaseViewController {
if
item0
.
isAccompany
{
// 随行才加后面的信息
// 国籍
let
title1
=
YHFormTitleItem
(
type
:
.
country
)
let
item10
=
YHFormDetailItem
(
type
:
.
country
)
let
item10
=
YHFormDetailItem
(
type
:
.
nationOrArea
)
item10
.
country
=
"中国"
let
arr1
:[
YHFormItemProtocol
]
=
[
title1
,
item10
]
...
...
@@ -96,14 +96,14 @@ class YHSpouseInitialInfoVC: YHBaseViewController {
let
title2
=
YHFormTitleItem
(
type
:
.
liveInfo
)
let
item20
=
YHFormDetailItem
(
type
:
.
isLiveTother
)
item20
.
isLiveTogether
=
(
spouse
.
finishFollow
==
1
)
let
item21
=
YHFormDetailItem
(
type
:
.
liveContry
)
let
item21
=
YHFormDetailItem
(
type
:
.
nationOrArea
)
let
item22
=
YHFormDetailItem
(
type
:
.
liveCity
)
let
item23
=
YHFormDetailItem
(
type
:
.
detailAddress
)
let
arr2
:[
YHFormItemProtocol
]
=
[
title2
,
item20
,
item21
,
item22
,
item23
]
// 港澳通信证
let
title3
=
YHFormTitleItem
(
type
:
.
getHK
Passport
)
let
item30
=
YHFormDetailItem
(
type
:
.
hkPassp
ort
)
let
title3
=
YHFormTitleItem
(
type
:
.
hkAndMacao
Passport
)
let
item30
=
YHFormDetailItem
(
type
:
.
isHandleHKPassP
ort
)
item30
.
isHandleHkPassport
=
(
spouse
.
isHandled
==
1
)
let
arr3
:[
YHFormItemProtocol
]
=
[
title3
,
item30
]
items
.
append
(
contentsOf
:[
arr1
,
arr2
,
arr3
])
...
...
@@ -187,20 +187,20 @@ extension YHSpouseInitialInfoVC : UITableViewDelegate, UITableViewDataSource {
let
detailItem
=
item
as!
YHFormDetailItem
if
detailItem
.
type
==
.
accompany
||
detailItem
.
type
==
.
hkPassp
ort
||
detailItem
.
type
==
.
isLiveTother
{
if
detailItem
.
type
==
.
isAccompanyToHK
||
detailItem
.
type
==
.
isHandleHKPassP
ort
||
detailItem
.
type
==
.
isLiveTother
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemDoubleChoiceCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemDoubleChoiceCell
cell
.
title
=
detailItem
.
getTitle
()
let
answers
=
[
YHFormChoiceItem
(
title
:
"是"
.
local
,
isSelect
:
true
),
YHFormChoiceItem
(
title
:
"否"
.
local
,
isSelect
:
false
)]
cell
.
answerArr
=
answers
if
detailItem
.
type
==
.
accompany
{
if
detailItem
.
type
==
.
isAccompanyToHK
{
let
answers
=
[
YHFormChoiceItem
(
title
:
"是"
.
local
,
isSelect
:
detailItem
.
isAccompany
),
YHFormChoiceItem
(
title
:
"否"
.
local
,
isSelect
:
!
detailItem
.
isAccompany
)]
cell
.
answerArr
=
answers
}
else
if
detailItem
.
type
==
.
hkPassp
ort
{
}
else
if
detailItem
.
type
==
.
isHandleHKPassP
ort
{
let
answers
=
[
YHFormChoiceItem
(
title
:
"是"
.
local
,
isSelect
:
detailItem
.
isHandleHkPassport
),
YHFormChoiceItem
(
title
:
"否"
.
local
,
isSelect
:
!
detailItem
.
isHandleHkPassport
)]
...
...
@@ -218,12 +218,12 @@ extension YHSpouseInitialInfoVC : UITableViewDelegate, UITableViewDataSource {
let
selectItem
:
YHFormChoiceItem
=
arr
[
selectIndex
]
if
detailItem
.
type
==
.
accompany
{
// 是否随行
if
detailItem
.
type
==
.
isAccompanyToHK
{
// 是否随行
let
follow
=
(
selectItem
.
title
==
"是"
.
local
?
1
:
0
)
self
?
.
spouse
?
.
follow
=
follow
self
?
.
loadSponseInfo
()
}
else
if
detailItem
.
type
==
.
hkPassp
ort
{
// 是否办理港澳通行证
}
else
if
detailItem
.
type
==
.
isHandleHKPassP
ort
{
// 是否办理港澳通行证
let
handlePassport
=
(
selectItem
.
title
==
"是"
.
local
?
1
:
0
)
self
?
.
spouse
?
.
isHandled
=
handlePassport
self
?
.
loadSponseInfo
()
...
...
@@ -236,7 +236,7 @@ extension YHSpouseInitialInfoVC : UITableViewDelegate, UITableViewDataSource {
}
return
cell
}
else
if
detailItem
.
type
==
.
country
||
detailItem
.
type
==
.
liveContry
||
detailItem
.
type
==
.
liveCity
||
detailItem
.
type
==
.
detailAddress
{
}
else
if
detailItem
.
type
==
.
nationOrArea
||
detailItem
.
type
==
.
nationOrArea
||
detailItem
.
type
==
.
liveCity
||
detailItem
.
type
==
.
detailAddress
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemEnterDetailCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemEnterDetailCell
cell
.
isMust
=
detailItem
.
isNeed
...
...
@@ -277,8 +277,8 @@ extension YHSpouseInitialInfoVC : UITableViewDelegate, UITableViewDataSource {
if
item
is
YHFormDetailItem
{
let
detailItem
=
item
as!
YHFormDetailItem
if
detailItem
.
type
==
.
isLiveTother
||
detailItem
.
type
==
.
accompany
||
detailItem
.
type
==
.
hkPassp
ort
detailItem
.
type
==
.
isAccompanyToHK
||
detailItem
.
type
==
.
isHandleHKPassP
ort
{
return
UITableView
.
automaticDimension
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/FamilyMember/M/YHConsortInfo.swift
deleted
100644 → 0
View file @
f2813fb9
//
// YHConsortInfo.swift
// galaxy
//
// Created by edy on 2024/1/23.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
class
YHConsortInfo
{
}
public
enum
YHTableItemType
:
Int32
{
// 是否随行
case
accompany
=
0
// 国籍
case
country
=
1
// 居住信息
case
address
=
2
// 港澳通信证
case
hongkongMacaouPassport
=
3
}
//表单条目信息
class
YHTableItemInfo
{
var
type
:
YHTableItemType
var
title
:
String
{
return
getTitle
()
}
init
(
type
:
YHTableItemType
)
{
self
.
type
=
type
}
var
subTitleItems
:[
YHTableSubItemInfo
]?
=
Array
()
func
getTitle
()
->
String
{
switch
self
.
type
{
case
.
accompany
:
return
"随行"
.
local
case
.
country
:
return
"国籍"
.
local
case
.
address
:
return
"居住信息"
.
local
case
.
hongkongMacaouPassport
:
return
"港澳通信证"
.
local
}
}
func
getSubItems
()
->
[
YHTableSubItemInfo
]
{
let
item0
=
YHTableSubItemInfo
(
type
:
.
subTitle
)
var
res
=
[
item0
]
switch
self
.
type
{
case
.
accompany
:
res
.
append
(
YHTableSubItemInfo
(
type
:
.
subAcompany
))
case
.
country
:
res
.
append
(
YHTableSubItemInfo
(
type
:
.
subCountry
))
case
.
address
:
let
item1
=
YHTableSubItemInfo
(
type
:
.
subIsLiveTogether
,
isMust
:
true
)
let
item2
=
YHTableSubItemInfo
(
type
:
.
subLiveNation
,
isMust
:
true
)
let
item3
=
YHTableSubItemInfo
(
type
:
.
subDetailAddress
,
isMust
:
true
)
res
.
append
(
contentsOf
:[
item1
,
item2
,
item3
])
case
.
hongkongMacaouPassport
:
res
.
append
(
YHTableSubItemInfo
(
type
:
.
subHongkongMacaouPassport
,
isMust
:
true
))
}
return
res
}
}
public
enum
YHTableSubItemType
:
Int32
{
// 标题
case
subTitle
=
0
// 是否随行
case
subAcompany
=
1
// 国籍
case
subCountry
=
2
/* 居住信息 */
// 是否与主申请人同住
case
subIsLiveTogether
=
3
// 居住国家/地区
case
subLiveNation
=
4
// 现居住城市
case
subLiveCity
=
5
// 详细地址
case
subDetailAddress
=
6
// 港澳通信证
case
subHongkongMacaouPassport
=
7
}
class
YHTableSubItemInfo
{
var
type
:
YHTableSubItemType
// 是否必填
var
isMust
:
Bool
var
title
:
String
{
return
getTitle
()
}
init
(
type
:
YHTableSubItemType
,
isMust
:
Bool
=
true
)
{
self
.
type
=
type
self
.
isMust
=
isMust
}
func
getTitle
()
->
String
{
switch
self
.
type
{
case
.
subTitle
:
return
""
.
local
case
.
subAcompany
:
return
"是否随行至香港"
.
local
case
.
subCountry
:
return
"国家/地区"
.
local
case
.
subIsLiveTogether
:
return
"是否与主申请人同住"
.
local
case
.
subLiveNation
:
return
"国家/地区"
.
local
case
.
subLiveCity
:
return
"现居住城市"
.
local
case
.
subDetailAddress
:
return
"现居住地址"
.
local
case
.
subHongkongMacaouPassport
:
return
"是否办理"
.
local
}
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/FamilyMember/M/YHFamilyInitialInfo.swift
View file @
3b479025
...
...
@@ -18,15 +18,23 @@ protocol YHFormItemProtocol {
// 表单标题类型
enum
YHFormTitleItemType
:
Int
{
// 配偶
case
sponse
=
1
// 父母
case
parent
=
2
// 子女
case
child
=
3
// 兄弟姐妹
case
brother
=
4
// 随行
case
accompany
=
5
// 国籍
case
country
=
6
// 居住信息
case
liveInfo
=
7
case
getHKPassport
=
8
// 港澳通信证
case
hkAndMacaoPassport
=
8
// 中国身份证
case
chinaIdCardInfo
=
9
...
...
@@ -46,8 +54,10 @@ enum YHFormTitleItemType:Int {
// 父亲信息
case
fatherInfo
=
16
//
父
亲信息
//
母
亲信息
case
motherInfo
=
17
// 基本信息
case
basicInfo
=
18
}
...
...
@@ -62,13 +72,18 @@ enum YHFormAddItemType:Int {
// 表单具体条目类型
enum
YHFormDetailItemType
:
Int
{
case
accompany
=
1
case
country
=
2
// 是否随行至香港
case
isAccompanyToHK
=
1
// 是否与主申请人同住
case
isLiveTother
=
3
case
liveContry
=
4
// 国家/地区
case
nationOrArea
=
4
// 现居住城市
case
liveCity
=
5
// 详细地址
case
detailAddress
=
6
case
hkPassport
=
7
// 是否办理
case
isHandleHKPassPort
=
7
// 证件类别
case
cetificateType
=
8
...
...
@@ -119,7 +134,9 @@ enum YHFormDetailItemType:Int {
// 婚姻状况
case
marriageState
=
30
// 现居住国家/地区
case
liveNation
=
31
case
liveNationOrArea
=
31
// 仅有两个按钮 标题数组有外部提供
case
onlyDoubleChoice
=
32
}
...
...
@@ -174,7 +191,7 @@ class YHFormTitleItem : YHFormItemProtocol {
return
"国籍"
.
local
case
.
liveInfo
:
return
"居住信息"
.
local
case
.
getHK
Passport
:
case
.
hkAndMacao
Passport
:
return
"港澳通行证"
.
local
case
.
chinaIdCardInfo
:
return
"中国身份证"
.
local
...
...
@@ -194,6 +211,8 @@ class YHFormTitleItem : YHFormItemProtocol {
return
"父亲信息"
.
local
case
.
motherInfo
:
return
"母亲信息"
.
local
case
.
basicInfo
:
return
"基本信息"
.
local
}
}
...
...
@@ -214,7 +233,7 @@ class YHFormTitleItem : YHFormItemProtocol {
return
""
.
local
case
.
liveInfo
:
return
""
.
local
case
.
getHK
Passport
:
case
.
hkAndMacao
Passport
:
return
""
.
local
case
.
chinaIdCardInfo
:
return
""
.
local
...
...
@@ -234,7 +253,8 @@ class YHFormTitleItem : YHFormItemProtocol {
return
""
.
local
case
.
motherInfo
:
return
""
.
local
case
.
basicInfo
:
return
""
.
local
}
}
...
...
@@ -264,27 +284,26 @@ class YHFormDetailItem : YHFormItemProtocol {
// 现居住详细地址
var
liveAddress
:
String
?
=
""
init
(
type
:
YHFormDetailItemType
)
{
init
(
type
:
YHFormDetailItemType
,
isNeed
:
Bool
=
true
)
{
self
.
type
=
type
self
.
isNeed
=
isNeed
}
func
getTitle
()
->
String
{
switch
type
{
case
.
accompany
:
case
.
isAccompanyToHK
:
return
"是否随行至香港"
.
local
case
.
country
:
return
String
(
format
:
"%@/%@"
,
"国家"
.
local
,
"地区"
.
local
)
case
.
isLiveTother
:
return
"是否与主申请人同住"
.
local
case
.
liveContry
:
case
.
nationOrArea
:
return
String
(
format
:
"%@/%@"
,
"国家"
.
local
,
"地区"
.
local
)
case
.
liveCity
:
return
String
(
format
:
"%@/%@"
,
"国家"
.
local
,
"地区"
.
local
)
return
"现居住城市"
.
local
case
.
detailAddress
:
return
"详细地址"
.
local
case
.
hkPassp
ort
:
case
.
isHandleHKPassP
ort
:
return
"是否办理"
.
local
// 证件类别
case
.
cetificateType
:
...
...
@@ -351,8 +370,11 @@ class YHFormDetailItem : YHFormItemProtocol {
return
"母亲姓名"
.
local
case
.
marriageState
:
return
"婚姻状况"
.
local
case
.
liveNation
:
case
.
liveNation
OrArea
:
return
"现居住国家/地区"
.
local
case
.
onlyDoubleChoice
:
return
""
.
local
}
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/FamilyMember/View/YHFormItemOnlyDoubleChoiceCell.swift
0 → 100644
View file @
3b479025
//
// YHFormItemOnlyDoubleChoiceCell.swift
// galaxy
//
// Created by edy on 2024/1/27.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
class
YHFormItemOnlyDoubleChoiceCell
:
UITableViewCell
{
static
let
cellReuseIdentifier
=
"YHFormItemOnlyDoubleChoiceCell"
let
btnWidth
=
70.0
let
btnHeight
=
32.0
let
btnTitleSelectColor
=
UIColor
(
hex
:
0x4487F9
)
let
btnTitleDefaultColor
=
UIColor
(
hex
:
0x222222
)
let
btnBgDefaultColor
=
UIColor
(
hex
:
0xF8F9FB
)
let
btnBgSelectColor
=
UIColor
(
hex
:
0x4487F9
,
alpha
:
0.08
)
let
answerBaseTag
=
9527
var
answerBlock
:(([
YHFormChoiceItem
],
Int
)
->
Void
)?
// 必须传2个item的arr
var
answerArr
:[
YHFormChoiceItem
]?
{
didSet
{
if
let
answerArr
=
answerArr
,
answerArr
.
count
==
2
{
for
i
in
0
...
1
{
let
answerBtn
=
self
.
viewWithTag
(
answerBaseTag
+
i
)
as!
UIButton
let
item
=
answerArr
[
i
]
answerBtn
.
setTitle
(
item
.
title
,
for
:
.
normal
)
updateAnswerButton
(
answerBtn
,
item
.
isSelect
)
}
}
else
{
// 重置所有答案状态
for
i
in
0
...
1
{
let
answerBtn
=
self
.
viewWithTag
(
answerBaseTag
+
i
)
as!
UIButton
answerBtn
.
setTitle
(
""
,
for
:
.
normal
)
updateAnswerButton
(
answerBtn
,
false
)
}
}
}
}
// 更新答案按钮选中状态
func
updateAnswerButton
(
_
btn
:
UIButton
,
_
isSelect
:
Bool
)
{
btn
.
layer
.
borderColor
=
(
isSelect
?
btnTitleSelectColor
:
.
clear
)
.
cgColor
btn
.
setTitleColor
((
isSelect
?
btnTitleSelectColor
:
btnTitleDefaultColor
),
for
:
.
normal
)
btn
.
backgroundColor
=
(
isSelect
?
btnBgSelectColor
:
btnBgDefaultColor
)
}
lazy
var
answer1Btn
:
UIButton
=
{
let
btn
=
UIButton
()
btn
.
setTitle
(
""
,
for
:
.
normal
)
btn
.
titleLabel
?
.
font
=
UIFont
.
PFSCR
(
ofSize
:
14
)
btn
.
setTitleColor
(
btnTitleDefaultColor
,
for
:
.
normal
)
btn
.
backgroundColor
=
btnBgDefaultColor
btn
.
layer
.
cornerRadius
=
btnHeight
/
2.0
btn
.
layer
.
masksToBounds
=
true
btn
.
layer
.
borderWidth
=
1
btn
.
layer
.
borderColor
=
UIColor
.
clear
.
cgColor
btn
.
tag
=
answerBaseTag
btn
.
addTarget
(
self
,
action
:
#selector(
didClickResponseBtn(btn:)
)
,
for
:
.
touchUpInside
)
return
btn
}()
lazy
var
answer2Btn
:
UIButton
=
{
let
btn
=
UIButton
()
btn
.
setTitle
(
""
,
for
:
.
normal
)
btn
.
titleLabel
?
.
font
=
UIFont
.
PFSCR
(
ofSize
:
14
)
btn
.
setTitleColor
(
btnTitleDefaultColor
,
for
:
.
normal
)
btn
.
backgroundColor
=
btnBgDefaultColor
btn
.
layer
.
cornerRadius
=
btnHeight
/
2.0
btn
.
layer
.
masksToBounds
=
true
btn
.
layer
.
borderWidth
=
1
btn
.
layer
.
borderColor
=
UIColor
.
clear
.
cgColor
btn
.
tag
=
answerBaseTag
+
1
btn
.
addTarget
(
self
,
action
:
#selector(
didClickResponseBtn(btn:)
)
,
for
:
.
touchUpInside
)
return
btn
}()
required
init
?(
coder
:
NSCoder
)
{
super
.
init
(
coder
:
coder
)
}
override
init
(
style
:
UITableViewCell
.
CellStyle
,
reuseIdentifier
:
String
?)
{
super
.
init
(
style
:
style
,
reuseIdentifier
:
reuseIdentifier
)
setupUI
()
}
func
setupUI
()
{
self
.
selectionStyle
=
.
none
contentView
.
addSubview
(
answer1Btn
)
contentView
.
addSubview
(
answer2Btn
)
answer1Btn
.
snp
.
makeConstraints
{
make
in
make
.
size
.
equalTo
(
CGSize
(
width
:
btnWidth
,
height
:
btnHeight
))
make
.
left
.
equalToSuperview
()
.
offset
(
16
)
make
.
centerY
.
equalToSuperview
()
}
answer2Btn
.
snp
.
makeConstraints
{
make
in
make
.
size
.
equalTo
(
CGSize
(
width
:
btnWidth
,
height
:
btnHeight
))
make
.
left
.
equalTo
(
answer1Btn
.
snp
.
right
)
.
offset
(
10
)
make
.
centerY
.
equalTo
(
answer1Btn
)
}
}
@objc
func
didClickResponseBtn
(
btn
:
UIButton
)
{
let
selectIndex
=
btn
.
tag
-
answerBaseTag
if
let
resultArr
=
answerArr
,
resultArr
.
count
==
2
{
for
i
in
0
...
1
{
let
item
=
resultArr
[
i
]
item
.
isSelect
=
(
i
==
selectIndex
)
}
answerArr
=
resultArr
if
let
answerBlock
=
answerBlock
{
answerBlock
(
resultArr
,
selectIndex
)
}
}
}
}
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