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
d08b263e
Commit
d08b263e
authored
Mar 05, 2024
by
pete谢兆麟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
长期按钮添加 时间选择器标题
parent
34134a0f
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
164 additions
and
16 deletions
+164
-16
YHDatePickView.swift
...)/MainApplicantInformation(主申请人信息)/V/YHDatePickView.swift
+14
-8
YHItemView.swift
...s(流程)/MainApplicantInformation(主申请人信息)/V/YHItemView.swift
+101
-2
YHMainApplicantInformationViewModel.swift
...tion(主申请人信息)/VM/YHMainApplicantInformationViewModel.swift
+0
-1
YHOtherInfoFillViewModel.swift
.../OtherInformation(其他信息)/VM/YHOtherInfoFillViewModel.swift
+5
-5
Contents.json
...erviceCenter/主申请人/main_time_normal.imageset/Contents.json
+22
-0
main_time_normal@2x.png
...er/主申请人/main_time_normal.imageset/main_time_normal@2x.png
+0
-0
main_time_normal@3x.png
...er/主申请人/main_time_normal.imageset/main_time_normal@3x.png
+0
-0
Contents.json
...erviceCenter/主申请人/main_time_select.imageset/Contents.json
+22
-0
main_time_select@2x.png
...er/主申请人/main_time_select.imageset/main_time_select@2x.png
+0
-0
main_time_select@3x.png
...er/主申请人/main_time_select.imageset/main_time_select@3x.png
+0
-0
No files found.
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/MainApplicantInformation(主申请人信息)/V/YHDatePickView.swift
View file @
d08b263e
...
...
@@ -38,7 +38,11 @@ class YHDatePickView: UIView {
// 日期分割符 eg: 2024-01-01
static
let
separator
:
String
=
"-"
var
title
:
String
=
""
{
didSet
{
titleLabel
.
text
=
title
}
}
var
type
:
YHDateType
?
{
didSet
{
guard
let
type
=
type
else
{
return
}
...
...
@@ -82,7 +86,7 @@ class YHDatePickView: UIView {
titleLabel
=
{
let
label
=
UILabel
()
label
.
text
=
"选择出生日期"
label
.
text
=
title
label
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
17
)
label
.
textColor
=
UIColor
.
mainTextColor
label
.
textAlignment
=
.
center
...
...
@@ -158,6 +162,7 @@ class YHDatePickView: UIView {
make
.
height
.
equalTo
(
220
)
make
.
right
.
equalTo
(
-
16
)
}
pickerView
.
selectRow
(
100
,
inComponent
:
0
,
animated
:
true
)
}
@objc
private
func
handleTap
(
_
sender
:
AnyObject
?)
{
...
...
@@ -165,10 +170,11 @@ class YHDatePickView: UIView {
dismiss
()
}
static
func
show
(
type
:
YHDateType
,
callBack
:
@escaping
((
String
)
->
Void
))
{
static
func
show
(
type
:
YHDateType
,
title
:
String
?
=
nil
,
callBack
:
@escaping
((
String
)
->
Void
))
{
let
view
=
YHDatePickView
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
KScreenWidth
,
height
:
KScreenHeight
))
view
.
type
=
type
view
.
backDate
=
callBack
view
.
title
=
title
??
""
let
window
=
UIApplication
.
shared
.
yhKeyWindow
()
window
?
.
addSubview
(
view
)
}
...
...
@@ -183,11 +189,11 @@ class YHDatePickView: UIView {
var
date
=
""
switch
type
{
case
.
yyyymmdd
:
date
=
String
(
format
:
"%02ld%@%02ld%@%02ld"
,
(
self
.
currentDateCom
.
year
!
)
-
self
.
pickerView
.
selectedRow
(
inComponent
:
0
),
Self
.
separator
,
self
.
pickerView
.
selectedRow
(
inComponent
:
1
)
+
1
,
Self
.
separator
,
self
.
pickerView
.
selectedRow
(
inComponent
:
2
)
+
1
)
date
=
String
(
format
:
"%02ld%@%02ld%@%02ld"
,
(
self
.
currentDateCom
.
year
!
)
-
self
.
pickerView
.
selectedRow
(
inComponent
:
0
)
+
100
,
Self
.
separator
,
self
.
pickerView
.
selectedRow
(
inComponent
:
1
)
+
1
,
Self
.
separator
,
self
.
pickerView
.
selectedRow
(
inComponent
:
2
)
+
1
)
case
.
yyyymm
:
date
=
String
(
format
:
"%02ld%@%02ld"
,
(
self
.
currentDateCom
.
year
!
)
-
self
.
pickerView
.
selectedRow
(
inComponent
:
0
),
Self
.
separator
,
self
.
pickerView
.
selectedRow
(
inComponent
:
1
)
+
1
)
date
=
String
(
format
:
"%02ld%@%02ld"
,
(
self
.
currentDateCom
.
year
!
)
-
self
.
pickerView
.
selectedRow
(
inComponent
:
0
)
+
100
,
Self
.
separator
,
self
.
pickerView
.
selectedRow
(
inComponent
:
1
)
+
1
)
case
.
yyyy
:
date
=
String
(
format
:
"%02ld"
,
(
self
.
currentDateCom
.
year
!
)
-
self
.
pickerView
.
selectedRow
(
inComponent
:
0
))
date
=
String
(
format
:
"%02ld"
,
(
self
.
currentDateCom
.
year
!
)
-
self
.
pickerView
.
selectedRow
(
inComponent
:
0
)
+
100
)
}
if
self
.
backDate
!=
nil
{
self
.
backDate
!
(
date
)
...
...
@@ -219,7 +225,7 @@ extension YHDatePickView: UIPickerViewDelegate,UIPickerViewDataSource {
}
func
pickerView
(
_
pickerView
:
UIPickerView
,
numberOfRowsInComponent
component
:
Int
)
->
Int
{
if
component
==
0
{
return
1
00
return
2
00
}
else
if
component
==
1
{
return
12
}
else
{
...
...
@@ -267,7 +273,7 @@ extension YHDatePickView: UIPickerViewDelegate,UIPickerViewDataSource {
func
pickerView
(
_
pickerView
:
UIPickerView
,
titleForRow
row
:
Int
,
forComponent
component
:
Int
)
->
String
?
{
if
component
==
0
{
return
"
\(
(
currentDateCom
.
year
!
)
-
row
)
"
return
"
\(
(
currentDateCom
.
year
!
)
-
row
+
100
)
"
}
else
if
component
==
1
{
return
"
\(
row
+
1
)
"
}
else
{
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/MainApplicantInformation(主申请人信息)/V/YHItemView.swift
View file @
d08b263e
...
...
@@ -18,6 +18,7 @@ class YHItemView: UIView {
var
leftButton
:
UIButton
!
var
rightButton
:
UIButton
!
var
showPromptLabel
:
UILabel
!
var
longTimeButton
:
UIButton
!
var
dataSource
:
YHItemModel
?
{
didSet
{
updateAllViews
()
...
...
@@ -50,6 +51,7 @@ class YHItemView: UIView {
textField
.
delegate
=
self
textField
.
textColor
=
UIColor
.
mainTextColor
textField
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
14
)
textField
.
addTarget
(
self
,
action
:
#selector(
textFieldDidChanged
)
,
for
:
.
editingChanged
)
return
textField
}()
addSubview
(
messageTextField
)
...
...
@@ -130,10 +132,51 @@ class YHItemView: UIView {
make
.
height
.
equalTo
(
32
)
make
.
width
.
equalTo
(
74
)
}
longTimeButton
=
{
let
button
=
UIButton
(
type
:
.
custom
)
button
.
setImage
(
UIImage
(
named
:
"main_time_normal"
),
for
:
.
normal
)
button
.
setImage
(
UIImage
(
named
:
"main_time_select"
),
for
:
.
selected
)
button
.
setTitleColor
(
UIColor
.
mainTextColor
,
for
:
.
normal
)
button
.
setTitle
(
"长期"
,
for
:
.
normal
)
button
.
titleLabel
?
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
14
)
button
.
contentHorizontalAlignment
=
.
right
button
.
addTarget
(
self
,
action
:
#selector(
longTimeButtonClick
)
,
for
:
.
touchUpInside
)
button
.
imageEdgeInsets
=
UIEdgeInsets
(
top
:
10
,
left
:
0
,
bottom
:
10
,
right
:
30
)
button
.
isSelected
=
false
return
button
}()
addSubview
(
longTimeButton
)
longTimeButton
.
snp
.
makeConstraints
{
make
in
make
.
right
.
equalToSuperview
()
make
.
centerY
.
equalToSuperview
()
make
.
height
.
equalTo
(
32
)
make
.
width
.
equalTo
(
43
)
}
}
@objc
func
longTimeButtonClick
()
{
longTimeButton
.
isSelected
=
!
longTimeButton
.
isSelected
if
longTimeButton
.
isSelected
{
self
.
dataSource
?
.
message
=
"8888-01-01"
self
.
updateAllViews
()
if
let
block
=
self
.
block
{
block
(
self
.
dataSource
??
YHItemModel
())
}
}
else
{
self
.
dataSource
?
.
message
=
""
self
.
updateAllViews
()
if
let
block
=
self
.
block
{
block
(
self
.
dataSource
??
YHItemModel
())
}
}
}
func
updateAllViews
()
{
guard
let
dataSource
=
dataSource
else
{
return
}
if
dataSource
.
id
==
.
id23
{
messageTextField
.
keyboardType
=
.
asciiCapable
}
if
dataSource
.
isNeed
??
false
{
let
str
=
"*"
+
(
dataSource
.
title
??
""
)
let
attributes
:
[
NSAttributedString
.
Key
:
Any
]
=
[
...
...
@@ -167,6 +210,9 @@ class YHItemView: UIView {
case
.
time
:
break
case
.
image
:
break
case
.
id
:
if
dataSource
.
message
==
"0"
{
messageTextField
.
text
=
""
}
let
arr
=
YHOtherInfoFillViewModel
.
arrIdType
arr
.
forEach
{
item
in
if
item
[
"id"
]
==
dataSource
.
message
{
...
...
@@ -175,6 +221,9 @@ class YHItemView: UIView {
}
case
.
country
:
break
case
.
sex
:
if
dataSource
.
message
==
"0"
{
messageTextField
.
text
=
""
}
let
arr
=
YHOtherInfoFillViewModel
.
arrSex
arr
.
forEach
{
item
in
if
item
[
"id"
]
==
dataSource
.
message
{
...
...
@@ -182,6 +231,9 @@ class YHItemView: UIView {
}
}
case
.
marry
:
if
dataSource
.
message
==
"0"
{
messageTextField
.
text
=
""
}
let
arr
=
YHOtherInfoFillViewModel
.
arrMarry
arr
.
forEach
{
item
in
if
item
[
"id"
]
==
dataSource
.
message
{
...
...
@@ -228,6 +280,33 @@ class YHItemView: UIView {
showPromptLabel
.
isHidden
=
true
}
if
dataSource
.
id
==
.
id11
||
dataSource
.
id
==
.
id15
||
dataSource
.
id
==
.
id20
{
longTimeButton
.
isHidden
=
false
nextStepImageView
.
isHidden
=
true
if
dataSource
.
message
==
"8888-01-01"
{
longTimeButton
.
isSelected
=
true
longTimeButton
.
snp
.
remakeConstraints
{
make
in
make
.
left
.
equalTo
(
messageTextField
.
snp
.
left
)
make
.
centerY
.
equalToSuperview
()
make
.
height
.
equalTo
(
32
)
make
.
width
.
equalTo
(
43
)
}
centerButton
.
isHidden
=
true
messageTextField
.
isHidden
=
true
}
else
{
longTimeButton
.
isSelected
=
false
longTimeButton
.
snp
.
remakeConstraints
{
make
in
make
.
right
.
equalToSuperview
()
make
.
centerY
.
equalToSuperview
()
make
.
height
.
equalTo
(
32
)
make
.
width
.
equalTo
(
43
)
}
centerButton
.
isHidden
=
false
messageTextField
.
isHidden
=
false
}
}
else
{
longTimeButton
.
isHidden
=
true
}
}
func
buttonState
(
isLeft
:
Bool
)
{
...
...
@@ -310,7 +389,17 @@ class YHItemView: UIView {
}
UIViewController
.
current
?
.
present
(
addressPicker
,
animated
:
true
,
completion
:
nil
)
case
.
time
:
YHDatePickView
.
show
(
type
:
.
yyyymmdd
)
{
date
in
var
title
=
""
if
dataSource
?
.
id
==
.
id10
||
dataSource
?
.
id
==
.
id14
||
dataSource
?
.
id
==
.
id19
{
title
=
"请选择签发日期"
}
if
dataSource
?
.
id
==
.
id11
||
dataSource
?
.
id
==
.
id15
||
dataSource
?
.
id
==
.
id20
{
title
=
"请选择届满日期"
}
if
dataSource
?
.
id
==
.
id24
{
title
=
"请选择出生日期"
}
YHDatePickView
.
show
(
type
:
.
yyyymmdd
,
title
:
title
)
{
date
in
// let arr = date.components(separatedBy: YHDatePickView.separator)
// [yyyy, mm, dd] eg ["2024", "01", "20"]
self
.
dataSource
?
.
message
=
date
...
...
@@ -372,6 +461,12 @@ class YHItemView: UIView {
}
}
}
@objc
func
textFieldDidChanged
()
{
if
dataSource
?
.
id
==
.
id23
{
messageTextField
.
text
=
messageTextField
.
text
?
.
uppercased
()
}
}
}
extension
YHItemView
:
UITextFieldDelegate
{
...
...
@@ -380,7 +475,7 @@ extension YHItemView: UITextFieldDelegate {
}
func
textField
(
_
textField
:
UITextField
,
shouldChangeCharactersIn
range
:
NSRange
,
replacementString
string
:
String
)
->
Bool
{
let
newText
=
(
textField
.
text
!
as
NSString
)
.
replacingCharacters
(
in
:
range
,
with
:
string
)
var
newText
=
(
textField
.
text
!
as
NSString
)
.
replacingCharacters
(
in
:
range
,
with
:
string
)
if
(
dataSource
?
.
id
==
.
id9
||
dataSource
?
.
id
==
.
id21
||
dataSource
?
.
id
==
.
id22
||
dataSource
?
.
id
==
.
id23
)
&&
newText
.
count
>
30
{
return
false
}
...
...
@@ -401,6 +496,10 @@ extension YHItemView: UITextFieldDelegate {
return
false
}
if
dataSource
?
.
id
==
.
id23
{
newText
=
newText
.
uppercased
()
}
var
data
=
dataSource
??
YHItemModel
()
data
.
message
=
newText
if
let
block
=
block
{
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/MainApplicantInformation(主申请人信息)/VM/YHMainApplicantInformationViewModel.swift
View file @
d08b263e
...
...
@@ -481,7 +481,6 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
let
area
=
mainModel
.
address
.
area
let
details
=
mainModel
.
address
.
details
let
foreign
=
mainModel
.
address
.
foreign
let
is_handled
=
mainModel
.
is_handled
guard
nationality
.
count
>
0
else
{
return
false
}
guard
country
.
count
>
0
else
{
return
false
}
if
country
.
contains
(
"中国"
)
{
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/OtherInformation(其他信息)/VM/YHOtherInfoFillViewModel.swift
View file @
d08b263e
...
...
@@ -301,19 +301,19 @@ class YHOtherInfoFillViewModel: YHBaseViewModel {
static
let
arrMarry
:
[[
String
:
String
]]
=
[
[
"title"
:
"已婚"
,
"id"
:
"
0
"
"id"
:
"
1
"
],
[
"title"
:
"未婚"
,
"id"
:
"
1
"
"id"
:
"
2
"
],
[
"title"
:
"离婚"
,
"id"
:
"
2
"
"id"
:
"
3
"
],
[
"title"
:
"分居"
,
"id"
:
"
3
"
"id"
:
"
4
"
],
[
"title"
:
"丧偶"
,
"id"
:
"
4
"
"id"
:
"
5
"
]
]
}
...
...
galaxy/galaxy/Res/Assets.xcassets/ServiceCenter/主申请人/main_time_normal.imageset/Contents.json
0 → 100644
View file @
d08b263e
{
"images"
:
[
{
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"filename"
:
"main_time_normal@2x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"2x"
},
{
"filename"
:
"main_time_normal@3x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"3x"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
galaxy/galaxy/Res/Assets.xcassets/ServiceCenter/主申请人/main_time_normal.imageset/main_time_normal@2x.png
0 → 100644
View file @
d08b263e
523 Bytes
galaxy/galaxy/Res/Assets.xcassets/ServiceCenter/主申请人/main_time_normal.imageset/main_time_normal@3x.png
0 → 100644
View file @
d08b263e
816 Bytes
galaxy/galaxy/Res/Assets.xcassets/ServiceCenter/主申请人/main_time_select.imageset/Contents.json
0 → 100644
View file @
d08b263e
{
"images"
:
[
{
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"filename"
:
"main_time_select@2x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"2x"
},
{
"filename"
:
"main_time_select@3x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"3x"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
galaxy/galaxy/Res/Assets.xcassets/ServiceCenter/主申请人/main_time_select.imageset/main_time_select@2x.png
0 → 100644
View file @
d08b263e
752 Bytes
galaxy/galaxy/Res/Assets.xcassets/ServiceCenter/主申请人/main_time_select.imageset/main_time_select@3x.png
0 → 100644
View file @
d08b263e
1.12 KB
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