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
faaae409
Commit
faaae409
authored
Aug 17, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 家庭
parent
a9190c23
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
283 additions
and
6 deletions
+283
-6
YHFamilyInfoUpdateViewController.swift
...oConfirm(家庭信息确认)/C/YHFamilyInfoUpdateViewController.swift
+9
-3
YHIFamilyInfoListCell.swift
...)/FamilyInfoConfirm(家庭信息确认)/V/YHIFamilyInfoListCell.swift
+28
-3
YHInfoItemView.swift
...ate(办证段)/FamilyInfoConfirm(家庭信息确认)/V/YHInfoItemView.swift
+246
-0
No files found.
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/CustomerService/Certificate(办证段)/FamilyInfoConfirm(家庭信息确认)/C/YHFamilyInfoUpdateViewController.swift
View file @
faaae409
...
@@ -196,6 +196,8 @@ class YHFamilyInfoUpdateViewController: YHBaseViewController {
...
@@ -196,6 +196,8 @@ class YHFamilyInfoUpdateViewController: YHBaseViewController {
}
}
let
birthNation
=
"国内"
let
birthNation
=
"国内"
let
options
=
[
YHFamilyInfoOption
(
value
:
"国内"
,
isSelect
:
true
),
YHFamilyInfoOption
(
value
:
"国外"
,
isSelect
:
false
)]
let
birthNationInfo
=
YHFamilyInfoItem
(
id
:
.
birthNation
,
let
birthNationInfo
=
YHFamilyInfoItem
(
id
:
.
birthNation
,
action
:
.
choice
,
action
:
.
choice
,
isMust
:
true
,
isMust
:
true
,
...
@@ -203,13 +205,14 @@ class YHFamilyInfoUpdateViewController: YHBaseViewController {
...
@@ -203,13 +205,14 @@ class YHFamilyInfoUpdateViewController: YHBaseViewController {
detail
:
birthNation
,
detail
:
birthNation
,
previousTitle
:
"原出生国家/地区"
,
previousTitle
:
"原出生国家/地区"
,
previousDetail
:
birthNation
,
previousDetail
:
birthNation
,
options
:
options
,
isEditMode
:
isEditMode
,
isEditMode
:
isEditMode
,
isShowPreviousInfo
:
isShowPreviousInfo
)
isShowPreviousInfo
:
isShowPreviousInfo
)
arr1
.
append
(
birthNationInfo
)
arr1
.
append
(
birthNationInfo
)
let
birthPlace
=
"上海市市辖区"
let
birthPlace
=
"上海市市辖区"
let
birthPlaceInfo
=
YHFamilyInfoItem
(
id
:
.
birthPlace
,
let
birthPlaceInfo
=
YHFamilyInfoItem
(
id
:
.
birthPlace
,
action
:
.
edi
t
,
action
:
.
selec
t
,
isMust
:
true
,
isMust
:
true
,
title
:
"出生地"
,
title
:
"出生地"
,
detail
:
birthPlace
,
detail
:
birthPlace
,
...
@@ -221,7 +224,7 @@ class YHFamilyInfoUpdateViewController: YHBaseViewController {
...
@@ -221,7 +224,7 @@ class YHFamilyInfoUpdateViewController: YHBaseViewController {
let
declareNation
=
"中国-CHINA"
let
declareNation
=
"中国-CHINA"
let
declareNationInfo
=
YHFamilyInfoItem
(
id
:
.
declareNation
,
let
declareNationInfo
=
YHFamilyInfoItem
(
id
:
.
declareNation
,
action
:
.
edi
t
,
action
:
.
selec
t
,
isMust
:
true
,
isMust
:
true
,
title
:
"申报国籍"
,
title
:
"申报国籍"
,
detail
:
declareNation
,
detail
:
declareNation
,
...
@@ -284,7 +287,10 @@ class YHFamilyInfoUpdateViewController: YHBaseViewController {
...
@@ -284,7 +287,10 @@ class YHFamilyInfoUpdateViewController: YHBaseViewController {
arr2
.
append
(
cerIdInfo
)
arr2
.
append
(
cerIdInfo
)
items
.
append
(
contentsOf
:
[
arr1
,
arr2
])
// 信息核实
items
.
append
(
arr1
)
// 递交证件信息
items
.
append
(
arr2
)
self
.
tableView
.
reloadData
()
self
.
tableView
.
reloadData
()
}
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/CustomerService/Certificate(办证段)/FamilyInfoConfirm(家庭信息确认)/V/YHIFamilyInfoListCell.swift
View file @
faaae409
...
@@ -33,6 +33,16 @@ enum YHFamilyInfoActionType: Int {
...
@@ -33,6 +33,16 @@ enum YHFamilyInfoActionType: Int {
case
choice
=
3
// 按钮多项选择
case
choice
=
3
// 按钮多项选择
}
}
class
YHFamilyInfoOption
{
var
value
:
String
=
""
var
isSelect
:
Bool
=
false
init
(
value
:
String
,
isSelect
:
Bool
)
{
self
.
value
=
value
self
.
isSelect
=
isSelect
}
}
class
YHFamilyInfoItem
{
class
YHFamilyInfoItem
{
var
id
:
YHFamilyInfoType
=
.
none
var
id
:
YHFamilyInfoType
=
.
none
var
action
:
YHFamilyInfoActionType
=
.
none
var
action
:
YHFamilyInfoActionType
=
.
none
...
@@ -43,12 +53,13 @@ class YHFamilyInfoItem {
...
@@ -43,12 +53,13 @@ class YHFamilyInfoItem {
var
previousDetail
:
String
=
""
var
previousDetail
:
String
=
""
var
isEditMode
:
Bool
=
false
var
isEditMode
:
Bool
=
false
var
isShowPreviousInfo
:
Bool
=
false
var
isShowPreviousInfo
:
Bool
=
false
var
options
:[
YHFamilyInfoOption
]
=
[]
required
init
()
{
required
init
()
{
}
}
init
(
id
:
YHFamilyInfoType
,
action
:
YHFamilyInfoActionType
,
isMust
:
Bool
,
title
:
String
,
detail
:
String
,
previousTitle
:
String
,
previousDetail
:
String
,
isEditMode
:
Bool
,
isShowPreviousInfo
:
Bool
)
{
init
(
id
:
YHFamilyInfoType
,
action
:
YHFamilyInfoActionType
,
isMust
:
Bool
,
title
:
String
,
detail
:
String
,
previousTitle
:
String
,
previousDetail
:
String
,
options
:[
YHFamilyInfoOption
]
=
[],
isEditMode
:
Bool
,
isShowPreviousInfo
:
Bool
)
{
self
.
id
=
id
self
.
id
=
id
self
.
action
=
action
self
.
action
=
action
self
.
isMust
=
isMust
self
.
isMust
=
isMust
...
@@ -56,6 +67,7 @@ class YHFamilyInfoItem {
...
@@ -56,6 +67,7 @@ class YHFamilyInfoItem {
self
.
detail
=
detail
self
.
detail
=
detail
self
.
previousTitle
=
previousTitle
self
.
previousTitle
=
previousTitle
self
.
previousDetail
=
previousDetail
self
.
previousDetail
=
previousDetail
self
.
options
=
options
self
.
isEditMode
=
isEditMode
self
.
isEditMode
=
isEditMode
self
.
isShowPreviousInfo
=
isShowPreviousInfo
self
.
isShowPreviousInfo
=
isShowPreviousInfo
}
}
...
@@ -154,11 +166,22 @@ class YHIFamilyInfoListCell: UITableViewCell {
...
@@ -154,11 +166,22 @@ class YHIFamilyInfoListCell: UITableViewCell {
func
updateItems
(
_
items
:[
YHFamilyInfoItem
])
{
func
updateItems
(
_
items
:[
YHFamilyInfoItem
])
{
itemsContentView
.
removeSubviews
()
itemsContentView
.
removeSubviews
()
var
lastItemView
:
YHInfoItem
View
?
=
nil
var
lastItemView
:
UI
View
?
=
nil
for
(
index
,
item
)
in
items
.
enumerated
()
{
for
(
index
,
item
)
in
items
.
enumerated
()
{
let
itemView
=
YHInfoItemView
(
frame
:
.
zero
)
var
itemView
:
UIView
?
=
YHInfoItemView
(
frame
:
.
zero
)
if
item
.
action
==
.
choice
{
itemView
=
YHInfoOptionView
(
frame
:
.
zero
)
}
if
let
itemView
=
itemView
as?
YHInfoItemView
{
itemsContentView
.
addSubview
(
itemView
)
itemView
.
updateItem
(
item
)
}
else
if
let
itemView
=
itemView
as?
YHInfoOptionView
{
itemsContentView
.
addSubview
(
itemView
)
itemsContentView
.
addSubview
(
itemView
)
itemView
.
updateItem
(
item
)
itemView
.
updateItem
(
item
)
}
if
let
itemView
=
itemView
{
itemView
.
snp
.
makeConstraints
{
make
in
itemView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
equalTo
(
0
)
make
.
left
.
right
.
equalTo
(
0
)
if
let
lastView
=
lastItemView
{
if
let
lastView
=
lastItemView
{
...
@@ -173,6 +196,8 @@ class YHIFamilyInfoListCell: UITableViewCell {
...
@@ -173,6 +196,8 @@ class YHIFamilyInfoListCell: UITableViewCell {
}
}
lastItemView
=
itemView
lastItemView
=
itemView
}
}
}
self
.
setNeedsLayout
()
self
.
setNeedsLayout
()
self
.
layoutIfNeeded
()
self
.
layoutIfNeeded
()
}
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/CustomerService/Certificate(办证段)/FamilyInfoConfirm(家庭信息确认)/V/YHInfoItemView.swift
View file @
faaae409
...
@@ -9,6 +9,8 @@
...
@@ -9,6 +9,8 @@
import
UIKit
import
UIKit
import
AttributedString
import
AttributedString
// 文字编辑和选择弹窗时使用
class
YHInfoItemView
:
UIView
{
class
YHInfoItemView
:
UIView
{
var
item
:
YHFamilyInfoItem
=
YHFamilyInfoItem
()
var
item
:
YHFamilyInfoItem
=
YHFamilyInfoItem
()
...
@@ -77,6 +79,14 @@ class YHInfoItemView: UIView {
...
@@ -77,6 +79,14 @@ class YHInfoItemView: UIView {
return
label
return
label
}()
}()
// 拉起弹窗用的一行透明的按钮
lazy
var
clickRowBtn
:
UIButton
=
{
let
btn
=
UIButton
()
// btn.backgroundColor = .mainTextColor(alpha: 0.2)
btn
.
addTarget
(
self
,
action
:
#selector(
didSelectSheetBtnClicked
)
,
for
:
.
touchUpInside
)
return
btn
}()
override
init
(
frame
:
CGRect
)
{
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
)
super
.
init
(
frame
:
frame
)
createUI
()
createUI
()
...
@@ -87,15 +97,21 @@ class YHInfoItemView: UIView {
...
@@ -87,15 +97,21 @@ class YHInfoItemView: UIView {
}
}
func
createUI
()
{
func
createUI
()
{
self
.
addSubview
(
lineView
)
self
.
addSubview
(
lineView
)
self
.
addSubview
(
titleLabel
)
self
.
addSubview
(
titleLabel
)
self
.
addSubview
(
detailLabel
)
self
.
addSubview
(
detailLabel
)
self
.
addSubview
(
textField
)
self
.
addSubview
(
textField
)
self
.
addSubview
(
rightBtn
)
self
.
addSubview
(
rightBtn
)
self
.
addSubview
(
previousContentView
)
self
.
addSubview
(
previousContentView
)
self
.
addSubview
(
clickRowBtn
)
previousContentView
.
addSubview
(
previousTitleLabel
)
previousContentView
.
addSubview
(
previousTitleLabel
)
previousContentView
.
addSubview
(
previousDetailLabel
)
previousContentView
.
addSubview
(
previousDetailLabel
)
clickRowBtn
.
snp
.
makeConstraints
{
make
in
make
.
edges
.
equalToSuperview
()
}
lineView
.
snp
.
makeConstraints
{
make
in
lineView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
top
.
equalToSuperview
()
make
.
left
.
right
.
top
.
equalToSuperview
()
make
.
height
.
equalTo
(
0.5
)
make
.
height
.
equalTo
(
0.5
)
...
@@ -153,7 +169,47 @@ class YHInfoItemView: UIView {
...
@@ -153,7 +169,47 @@ class YHInfoItemView: UIView {
textField
.
becomeFirstResponder
()
textField
.
becomeFirstResponder
()
textField
.
text
=
""
textField
.
text
=
""
}
}
}
@objc
func
didSelectSheetBtnClicked
()
{
if
item
.
action
==
.
select
{
if
item
.
id
==
.
marriage
{
YHSheetPickerView
.
show
(
type
:
.
marriage
,
selectTitle
:
item
.
detail
)
{
[
weak
self
]
item
in
guard
let
self
=
self
else
{
return
}
self
.
item
.
detail
=
item
.
title
self
.
detailLabel
.
text
=
item
.
title
}
}
else
if
item
.
id
==
.
birthPlace
{
let
vc
=
YHAddressViewController
()
vc
.
backLocationStringController
=
{
[
weak
self
]
(
string1
,
string2
,
string3
,
string4
)
in
guard
let
self
=
self
else
{
return
}
var
address
=
""
if
!
isEmptyString
(
string2
)
{
address
+=
string2
}
if
!
isEmptyString
(
string3
)
{
address
+=
string3
}
self
.
item
.
detail
=
address
self
.
detailLabel
.
text
=
address
}
UIViewController
.
current
?
.
present
(
vc
,
animated
:
true
)
}
else
if
item
.
id
==
.
declareNation
{
let
vc
=
YHSelectCountryViewController
()
vc
.
backLocationStringController
=
{
(
country
)
in
self
.
item
.
detail
=
country
self
.
detailLabel
.
text
=
country
}
UIViewController
.
current
?
.
navigationController
?
.
pushViewController
(
vc
)
}
}
}
}
func
updateItem
(
_
item
:
YHFamilyInfoItem
)
{
func
updateItem
(
_
item
:
YHFamilyInfoItem
)
{
...
@@ -173,6 +229,9 @@ class YHInfoItemView: UIView {
...
@@ -173,6 +229,9 @@ class YHInfoItemView: UIView {
detailLabel
.
isHidden
=
isTextEdit
detailLabel
.
isHidden
=
isTextEdit
textField
.
isHidden
=
!
isTextEdit
textField
.
isHidden
=
!
isTextEdit
let
isSelectSheet
=
item
.
isEditMode
&&
item
.
action
==
.
select
clickRowBtn
.
isHidden
=
!
isSelectSheet
textField
.
text
=
item
.
detail
textField
.
text
=
item
.
detail
rightBtn
.
isHidden
=
!
item
.
isEditMode
rightBtn
.
isHidden
=
!
item
.
isEditMode
if
item
.
action
==
.
edit
{
if
item
.
action
==
.
edit
{
...
@@ -222,3 +281,190 @@ extension YHInfoItemView: UITextFieldDelegate {
...
@@ -222,3 +281,190 @@ extension YHInfoItemView: UITextFieldDelegate {
return
true
return
true
}
}
}
}
class
YHInfoOptionView
:
UIView
{
var
item
:
YHFamilyInfoItem
=
YHFamilyInfoItem
()
let
btnBaseTag
=
9527
let
btnHeight
=
32.0
let
btnWidth
=
74.0
lazy
var
lineView
:
UIView
=
{
let
view
=
UIView
()
view
.
backgroundColor
=
.
separatorColor
return
view
}()
lazy
var
titleLabel
:
UILabel
=
{
let
label
=
UILabel
()
label
.
font
=
UIFont
.
PFSC_R
(
ofSize
:
14
)
return
label
}()
lazy
var
detailLabel
:
UILabel
=
{
let
label
=
UILabel
()
label
.
numberOfLines
=
0
label
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
14
)
label
.
text
=
"张全蛋"
label
.
textColor
=
UIColor
.
mainTextColor
return
label
}()
lazy
var
optionsView
:
UIView
=
{
let
view
=
UIView
()
return
view
}()
lazy
var
previousContentView
:
UIView
=
{
let
view
=
UIView
()
view
.
layer
.
cornerRadius
=
kCornerRadius6
view
.
backgroundColor
=
UIColor
(
hex
:
0xF8F9FB
)
view
.
clipsToBounds
=
true
return
view
}()
lazy
var
previousTitleLabel
:
UILabel
=
{
let
label
=
UILabel
()
label
.
font
=
UIFont
.
PFSC_R
(
ofSize
:
12
)
label
.
textColor
=
UIColor
.
mainTextColor
(
alpha
:
0.3
)
return
label
}()
lazy
var
previousDetailLabel
:
UILabel
=
{
let
label
=
UILabel
()
label
.
numberOfLines
=
0
label
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
12
)
label
.
textColor
=
UIColor
.
mainTextColor
(
alpha
:
0.3
)
return
label
}()
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
)
createUI
()
}
required
init
?(
coder
:
NSCoder
)
{
fatalError
(
"init(coder:) has not been implemented"
)
}
func
createUI
()
{
self
.
addSubview
(
lineView
)
self
.
addSubview
(
titleLabel
)
self
.
addSubview
(
detailLabel
)
self
.
addSubview
(
optionsView
)
self
.
addSubview
(
previousContentView
)
previousContentView
.
addSubview
(
previousTitleLabel
)
previousContentView
.
addSubview
(
previousDetailLabel
)
lineView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
top
.
equalToSuperview
()
make
.
height
.
equalTo
(
0.5
)
}
titleLabel
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalTo
(
16
)
make
.
left
.
equalTo
(
0
)
make
.
height
.
equalTo
(
20
)
make
.
width
.
equalTo
(
122
)
}
detailLabel
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalTo
(
16
)
make
.
left
.
equalTo
(
titleLabel
.
snp
.
right
)
make
.
right
.
equalTo
(
-
18.0
)
}
optionsView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalTo
(
10
)
make
.
right
.
equalTo
(
-
18
)
make
.
height
.
equalTo
(
32
)
make
.
left
.
equalTo
(
titleLabel
)
}
previousContentView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
equalToSuperview
()
make
.
bottom
.
equalTo
(
-
16
)
make
.
top
.
equalTo
(
detailLabel
.
snp
.
bottom
)
.
offset
(
16
)
}
previousTitleLabel
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
12
)
make
.
top
.
equalTo
(
12
)
make
.
width
.
equalTo
(
110
)
}
previousDetailLabel
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
previousTitleLabel
.
snp
.
right
)
.
offset
(
0
)
make
.
top
.
equalTo
(
12
)
make
.
right
.
equalTo
(
-
18
)
make
.
bottom
.
equalTo
(
-
12
)
}
}
func
updateItem
(
_
item
:
YHFamilyInfoItem
)
{
self
.
item
=
item
// 标题
var
title
:
ASAttributedString
=
.
init
(
"
\(
item
.
title
)
"
,
.
font
(
UIFont
.
PFSC_R
(
ofSize
:
14
)),
.
foreground
(
UIColor
.
mainTextColor
))
// 是否必填
if
item
.
isMust
{
let
mustTag
:
ASAttributedString
=
.
init
(
"*"
,
.
font
(
UIFont
.
PFSC_R
(
ofSize
:
14
)),
.
foreground
(
UIColor
.
failColor
))
title
=
mustTag
+
title
}
titleLabel
.
attributed
.
text
=
title
detailLabel
.
text
=
item
.
detail
detailLabel
.
isHidden
=
item
.
isEditMode
optionsView
.
isHidden
=
!
item
.
isEditMode
optionsView
.
removeSubviews
()
for
(
index
,
option
)
in
item
.
options
.
reversed
()
.
enumerated
()
{
let
btn
=
UIButton
()
btn
.
backgroundColor
=
UIColor
.
init
(
hex
:
0xF8F9FB
)
btn
.
titleLabel
?
.
font
=
.
PFSC_R
(
ofSize
:
13
)
btn
.
setTitle
(
option
.
value
,
for
:
.
normal
)
btn
.
layer
.
cornerRadius
=
self
.
btnHeight
/
2.0
btn
.
clipsToBounds
=
true
btn
.
layer
.
borderWidth
=
option
.
isSelect
?
1.0
:
0.0
btn
.
layer
.
borderColor
=
option
.
isSelect
?
UIColor
.
brandMainColor
.
cgColor
:
nil
btn
.
setTitleColor
(
option
.
isSelect
?
UIColor
.
brandMainColor
:
UIColor
.
init
(
hex
:
0x222222
),
for
:
.
normal
)
btn
.
addTarget
(
self
,
action
:
#selector(
didOptionBtnClicked(_:)
)
,
for
:
.
touchUpInside
)
btn
.
tag
=
btnBaseTag
+
index
optionsView
.
addSubview
(
btn
)
btn
.
snp
.
makeConstraints
{
make
in
let
gap
=
12.0
make
.
right
.
equalTo
(
-
Double
(
index
)
*
(
btnWidth
+
gap
))
make
.
centerY
.
equalToSuperview
()
make
.
size
.
equalTo
(
CGSize
(
width
:
btnWidth
,
height
:
btnHeight
))
}
}
previousTitleLabel
.
text
=
item
.
previousTitle
previousDetailLabel
.
text
=
item
.
previousDetail
previousContentView
.
isHidden
=
!
item
.
isShowPreviousInfo
previousContentView
.
snp
.
remakeConstraints
{
make
in
make
.
left
.
right
.
equalToSuperview
()
make
.
bottom
.
equalTo
(
item
.
isShowPreviousInfo
?
-
16
:
0
)
if
!
item
.
isShowPreviousInfo
{
make
.
height
.
equalTo
(
0
)
}
make
.
top
.
equalTo
(
detailLabel
.
snp
.
bottom
)
.
offset
(
16
)
}
}
@objc
func
didOptionBtnClicked
(
_
sender
:
UIButton
)
{
// tag 是按数组反序index排列的
let
selectIndex
=
(
item
.
options
.
count
-
1
)
-
(
sender
.
tag
-
btnBaseTag
)
if
0
<=
selectIndex
,
selectIndex
<
item
.
options
.
count
{
for
(
index
,
option
)
in
item
.
options
.
enumerated
()
{
let
isSelect
=
(
selectIndex
==
index
)
option
.
isSelect
=
isSelect
if
isSelect
{
item
.
detail
=
option
.
value
}
}
self
.
updateItem
(
item
)
}
}
}
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