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
df3949cc
Commit
df3949cc
authored
Mar 01, 2024
by
pete谢兆麟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
字段校验
parent
8d3e8913
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
100 additions
and
60 deletions
+100
-60
YHMainApplicantInformationViewController.swift
...(主申请人信息)/C/YHMainApplicantInformationViewController.swift
+19
-10
YHItemModel.swift
...(流程)/MainApplicantInformation(主申请人信息)/M/YHItemModel.swift
+3
-1
YHItemView.swift
...s(流程)/MainApplicantInformation(主申请人信息)/V/YHItemView.swift
+21
-1
YHMainApplicantInformationViewModel.swift
...tion(主申请人信息)/VM/YHMainApplicantInformationViewModel.swift
+57
-48
No files found.
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/MainApplicantInformation(主申请人信息)/C/YHMainApplicantInformationViewController.swift
View file @
df3949cc
...
...
@@ -93,27 +93,36 @@ class YHMainApplicantInformationViewController: YHBaseViewController {
guard
let
self
=
self
else
{
return
}
if
self
.
viewModel
.
isCanNext
(
self
.
stepView
.
currentIndex
)
{
self
.
stepView
.
currentIndex
=
self
.
stepView
.
currentIndex
+
1
self
.
viewModel
.
updateMainInformation
(
.
submit
,
self
.
orderId
)
{[
weak
self
]
success
in
self
.
viewModel
.
updateMainInformation
(
.
submit
,
self
.
orderId
)
{[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
self
.
isShowPrompt
=
false
self
.
stepView
.
currentIndex
=
self
.
stepView
.
currentIndex
if
self
.
stepView
.
currentIndex
==
self
.
stepView
.
dataSource
?
.
count
{
YHHUD
.
flash
(
message
:
"提交成功"
)
self
.
navigationController
?
.
popViewController
()
if
let
error
=
error
{
YHHUD
.
flash
(
message
:
error
.
errorMsg
)
}
else
{
self
.
updateDataSource
()
self
.
isShowPrompt
=
false
self
.
stepView
.
currentIndex
=
self
.
stepView
.
currentIndex
if
self
.
stepView
.
currentIndex
==
self
.
stepView
.
dataSource
?
.
count
{
YHHUD
.
flash
(
message
:
"提交成功"
)
self
.
navigationController
?
.
popViewController
()
}
else
{
self
.
updateDataSource
()
}
}
}
}
else
{
self
.
isShowPrompt
=
true
self
.
updateDataSource
()
YHHUD
.
flash
(
message
:
"
请完善信息
"
)
YHHUD
.
flash
(
message
:
"
您还有信息未填写
"
)
}
}
bottom
.
saveBlock
=
{
[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
self
.
viewModel
.
updateMainInformation
(
.
save
,
self
.
orderId
)
{[
weak
self
]
success
in
guard
let
self
=
self
else
{
return
}
self
.
viewModel
.
updateMainInformation
(
.
save
,
self
.
orderId
)
{[
weak
self
]
success
,
error
in
guard
let
_
=
self
else
{
return
}
if
let
error
=
error
{
YHHUD
.
flash
(
message
:
error
.
errorMsg
)
}
else
{
YHHUD
.
flash
(
message
:
"保存成功"
)
}
}
}
return
bottom
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/MainApplicantInformation(主申请人信息)/M/YHItemModel.swift
View file @
df3949cc
...
...
@@ -70,8 +70,9 @@ struct YHItemModel {
var
type
:
YHItemSelectType
?
var
value
:
[
String
]?
var
isShowPrompts
:
Bool
?
var
alertMessage
:
String
?
init
(
id
:
YHItemID
?
=
nil
,
isNeed
:
Bool
?
=
nil
,
title
:
String
?
=
nil
,
isUserKeyBoard
:
Bool
?
=
nil
,
prompts
:
String
?
=
nil
,
message
:
String
?
=
nil
,
leftButtonString
:
String
?
=
nil
,
rightButtonString
:
String
?
=
nil
,
type
:
YHItemSelectType
?
=
nil
,
value
:
[
String
]?
=
nil
,
isShowPrompts
:
Bool
?
=
nil
)
{
init
(
id
:
YHItemID
?
=
nil
,
isNeed
:
Bool
?
=
nil
,
title
:
String
?
=
nil
,
isUserKeyBoard
:
Bool
?
=
nil
,
prompts
:
String
?
=
nil
,
message
:
String
?
=
nil
,
leftButtonString
:
String
?
=
nil
,
rightButtonString
:
String
?
=
nil
,
type
:
YHItemSelectType
?
=
nil
,
value
:
[
String
]?
=
nil
,
isShowPrompts
:
Bool
?
=
nil
,
alertMessage
:
String
?
=
nil
)
{
self
.
id
=
id
self
.
isNeed
=
isNeed
self
.
title
=
title
...
...
@@ -83,6 +84,7 @@ struct YHItemModel {
self
.
type
=
type
self
.
value
=
value
self
.
isShowPrompts
=
isShowPrompts
self
.
alertMessage
=
alertMessage
}
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/MainApplicantInformation(主申请人信息)/V/YHItemView.swift
View file @
df3949cc
...
...
@@ -155,7 +155,7 @@ class YHItemView: UIView {
}
messageTextField
.
placeholder
=
dataSource
.
prompts
messageTextField
.
text
=
dataSource
.
message
showPromptLabel
.
text
=
"
\(
dataSource
.
prompts
??
""
)
"
+
"
\(
dataSource
.
title
??
""
)
"
showPromptLabel
.
text
=
dataSource
.
alertMessage
if
dataSource
.
isUserKeyBoard
??
false
{
nextStepImageView
.
isHidden
=
true
centerButton
.
isHidden
=
true
...
...
@@ -381,6 +381,26 @@ 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
)
if
(
dataSource
?
.
id
==
.
id9
||
dataSource
?
.
id
==
.
id21
||
dataSource
?
.
id
==
.
id22
||
dataSource
?
.
id
==
.
id23
)
&&
newText
.
count
>
30
{
return
false
}
if
(
dataSource
?
.
id
==
.
id4
||
dataSource
?
.
id
==
.
id32
||
dataSource
?
.
id
==
.
id13
||
dataSource
?
.
id
==
.
id18
||
dataSource
?
.
id
==
.
id32
)
&&
newText
.
count
>
100
{
return
false
}
if
(
dataSource
?
.
id
==
.
id12
||
dataSource
?
.
id
==
.
id17
||
dataSource
?
.
id
==
.
id30
)
&&
newText
.
count
>
50
{
return
false
}
if
(
dataSource
?
.
id
==
.
id8
)
&&
newText
.
count
>
20
{
return
false
}
if
(
dataSource
?
.
id
==
.
id29
||
dataSource
?
.
id
==
.
id35
)
&&
newText
.
count
>
18
{
return
false
}
var
data
=
dataSource
??
YHItemModel
()
data
.
message
=
newText
if
let
block
=
block
{
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/MainApplicantInformation(主申请人信息)/VM/YHMainApplicantInformationViewModel.swift
View file @
df3949cc
...
...
@@ -23,23 +23,22 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
}
func
getBaseDataSource
(
_
isShowPrompt
:
Bool
)
->
[
YHSectionItemModel
]
{
let
item
=
YHItemModel
(
id
:
.
id1
,
isNeed
:
true
,
title
:
"国家/地区"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
mainModel
.
nationality
,
type
:
.
country
,
isShowPrompts
:
isShowPrompt
)
let
item
=
YHItemModel
(
id
:
.
id1
,
isNeed
:
true
,
title
:
"国家/地区"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
mainModel
.
nationality
,
type
:
.
country
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请选择国家/地区"
)
let
section
=
YHSectionItemModel
(
title
:
"国籍"
,
models
:
[
item
])
let
item4
=
YHItemModel
(
id
:
.
id2
,
isNeed
:
true
,
title
:
"国家/地区"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
mainModel
.
address
.
country
,
type
:
.
country
,
isShowPrompts
:
isShowPrompt
)
let
item4
=
YHItemModel
(
id
:
.
id2
,
isNeed
:
true
,
title
:
"国家/地区"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
mainModel
.
address
.
country
,
type
:
.
country
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请选择国家/地区"
)
var
string
=
""
let
array
=
mainModel
.
address
.
area
for
item
in
array
{
string
=
string
+
item
}
let
item1
=
YHItemModel
(
id
:
.
id3
,
isNeed
:
true
,
title
:
"省市地区"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
string
,
type
:
.
address
,
isShowPrompts
:
isShowPrompt
)
let
item2
=
YHItemModel
(
id
:
.
id4
,
isNeed
:
true
,
title
:
"详细地址"
,
isUserKeyBoard
:
true
,
prompts
:
"请填写小区、楼栋、单元室等"
,
message
:
mainModel
.
address
.
details
,
isShowPrompts
:
isShowPrompt
)
let
item11
=
YHItemModel
(
id
:
.
id32
,
isNeed
:
true
,
title
:
"详细地址"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
mainModel
.
address
.
foreign
,
isShowPrompts
:
isShowPrompt
)
let
item22
=
YHItemModel
(
id
:
.
id33
,
isNeed
:
true
,
title
:
"是否在海外居住一年及以上"
,
isUserKeyBoard
:
false
,
prompts
:
""
,
message
:
"
\(
mainModel
.
is_live_oversea_year
)
"
,
leftButtonString
:
"是"
,
rightButtonString
:
"否"
,
isShowPrompts
:
isShowPrompt
)
let
item1
=
YHItemModel
(
id
:
.
id3
,
isNeed
:
true
,
title
:
"省市地区"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
string
,
type
:
.
address
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请选择省市地区"
)
let
item2
=
YHItemModel
(
id
:
.
id4
,
isNeed
:
true
,
title
:
"详细地址"
,
isUserKeyBoard
:
true
,
prompts
:
"请填写小区、楼栋、单元室等"
,
message
:
mainModel
.
address
.
details
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请填写小区、楼栋、单元室等"
)
let
item11
=
YHItemModel
(
id
:
.
id32
,
isNeed
:
true
,
title
:
"详细地址"
,
isUserKeyBoard
:
true
,
prompts
:
"请填写国外居住地"
,
message
:
mainModel
.
address
.
foreign
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请填写国外居住地"
)
let
item22
=
YHItemModel
(
id
:
.
id33
,
isNeed
:
true
,
title
:
"是否在海外居住一年及以上"
,
isUserKeyBoard
:
false
,
prompts
:
""
,
message
:
"
\(
mainModel
.
is_live_oversea_year
)
"
,
leftButtonString
:
"是"
,
rightButtonString
:
"否"
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请选择是否在海外居住满1年及以上"
)
let
section1
=
YHSectionItemModel
(
title
:
"现居住地址"
,
models
:
[
item4
,
item1
,
item2
])
let
section11
=
YHSectionItemModel
(
title
:
"现居住地址"
,
models
:
[
item4
,
item11
,
item22
])
let
item3
=
YHItemModel
(
id
:
.
id5
,
isNeed
:
true
,
title
:
"是否办理"
,
isUserKeyBoard
:
false
,
prompts
:
""
,
message
:
"
\(
mainModel
.
has_hk_id
)
"
,
leftButtonString
:
"是"
,
rightButtonString
:
"否"
,
isShowPrompts
:
isShowPrompt
)
let
item3
=
YHItemModel
(
id
:
.
id5
,
isNeed
:
true
,
title
:
"是否办理"
,
isUserKeyBoard
:
false
,
prompts
:
""
,
message
:
"
\(
mainModel
.
is_handled
)
"
,
leftButtonString
:
"是"
,
rightButtonString
:
"否"
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请选择是否办理过港澳通行证"
)
let
section2
=
YHSectionItemModel
(
title
:
"港澳通行证"
,
models
:
[
item3
])
let
addressCountry
=
mainModel
.
address
.
country
if
addressCountry
.
contains
(
"中国"
)
{
...
...
@@ -55,23 +54,24 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
if
nationality
.
contains
(
"中国"
)
{
flag
=
true
}
let
item
=
YHItemModel
(
id
:
.
id8
,
isNeed
:
flag
,
title
:
"身份证号码"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
mainModel
.
certificates
.
cn_identity_card
.
number
,
isShowPrompts
:
isShowPrompt
)
let
item1
=
YHItemModel
(
id
:
.
id9
,
isNeed
:
flag
,
title
:
"签发地"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
mainModel
.
certificates
.
cn_identity_card
.
issue_at
,
isShowPrompts
:
isShowPrompt
)
let
item2
=
YHItemModel
(
id
:
.
id10
,
isNeed
:
flag
,
title
:
"签发日期"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
mainModel
.
certificates
.
cn_identity_card
.
issue_date_start_at
,
type
:
.
time
,
isShowPrompts
:
isShowPrompt
)
let
item3
=
YHItemModel
(
id
:
.
id11
,
isNeed
:
flag
,
title
:
"届满日期"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
mainModel
.
certificates
.
cn_identity_card
.
issue_date_end_at
,
type
:
.
time
,
isShowPrompts
:
isShowPrompt
)
let
item
=
YHItemModel
(
id
:
.
id8
,
isNeed
:
flag
,
title
:
"身份证号码"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
mainModel
.
certificates
.
cn_identity_card
.
number
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请输入正确的身份证号码"
)
let
item1
=
YHItemModel
(
id
:
.
id9
,
isNeed
:
flag
,
title
:
"签发地"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
mainModel
.
certificates
.
cn_identity_card
.
issue_at
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请输入签发地"
)
let
item2
=
YHItemModel
(
id
:
.
id10
,
isNeed
:
flag
,
title
:
"签发日期"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
mainModel
.
certificates
.
cn_identity_card
.
issue_date_start_at
,
type
:
.
time
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请选择签发日期"
)
let
item3
=
YHItemModel
(
id
:
.
id11
,
isNeed
:
flag
,
title
:
"届满日期"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
mainModel
.
certificates
.
cn_identity_card
.
issue_date_end_at
,
type
:
.
time
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请选择届满日期"
)
let
section
=
YHSectionItemModel
(
title
:
"中国身份证"
,
models
:
[
item
,
item1
,
item2
,
item3
])
let
item10
=
YHItemModel
(
id
:
.
id12
,
isNeed
:
true
,
title
:
"旅行证件号码"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
mainModel
.
certificates
.
hk_macao_pass
.
number
,
isShowPrompts
:
isShowPrompt
)
let
item11
=
YHItemModel
(
id
:
.
id13
,
isNeed
:
true
,
title
:
"签发地"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
mainModel
.
certificates
.
hk_macao_pass
.
issue_at
,
isShowPrompts
:
isShowPrompt
)
let
item12
=
YHItemModel
(
id
:
.
id14
,
isNeed
:
true
,
title
:
"签发日期"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
mainModel
.
certificates
.
hk_macao_pass
.
issue_date_start_at
,
type
:
.
time
,
isShowPrompts
:
isShowPrompt
)
let
item13
=
YHItemModel
(
id
:
.
id15
,
isNeed
:
true
,
title
:
"届满日期"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
mainModel
.
certificates
.
hk_macao_pass
.
issue_date_end_at
,
type
:
.
time
,
isShowPrompts
:
isShowPrompt
)
let
item10
=
YHItemModel
(
id
:
.
id12
,
isNeed
:
true
,
title
:
"旅行证件号码"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
mainModel
.
certificates
.
hk_macao_pass
.
number
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请输入旅行证件号码"
)
let
item11
=
YHItemModel
(
id
:
.
id13
,
isNeed
:
true
,
title
:
"签发地"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
mainModel
.
certificates
.
hk_macao_pass
.
issue_at
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请输入签发地"
)
let
item12
=
YHItemModel
(
id
:
.
id14
,
isNeed
:
true
,
title
:
"签发日期"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
mainModel
.
certificates
.
hk_macao_pass
.
issue_date_start_at
,
type
:
.
time
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请选择签发日期"
)
let
item13
=
YHItemModel
(
id
:
.
id15
,
isNeed
:
true
,
title
:
"届满日期"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
mainModel
.
certificates
.
hk_macao_pass
.
issue_date_end_at
,
type
:
.
time
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请选择届满日期"
)
let
section1
=
YHSectionItemModel
(
title
:
"港澳通行证"
,
models
:
[
item10
,
item11
,
item12
,
item13
])
let
item4
=
YHItemModel
(
id
:
.
id16
,
isNeed
:
!
flag
,
title
:
"证件类别"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
mainModel
.
certificates
.
passport
.
passport_type
,
type
:
.
id
,
isShowPrompts
:
isShowPrompt
)
let
item5
=
YHItemModel
(
id
:
.
id17
,
isNeed
:
!
flag
,
title
:
"证件号码"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
mainModel
.
certificates
.
passport
.
number
,
isShowPrompts
:
isShowPrompt
)
let
item6
=
YHItemModel
(
id
:
.
id18
,
isNeed
:
!
flag
,
title
:
"签发地"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
mainModel
.
certificates
.
passport
.
issue_at
,
isShowPrompts
:
isShowPrompt
)
let
item7
=
YHItemModel
(
id
:
.
id19
,
isNeed
:
!
flag
,
title
:
"签发日期"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
mainModel
.
certificates
.
passport
.
issue_date_start_at
,
type
:
.
time
,
isShowPrompts
:
isShowPrompt
)
let
item8
=
YHItemModel
(
id
:
.
id20
,
isNeed
:
!
flag
,
title
:
"届满日期"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
mainModel
.
certificates
.
passport
.
issue_date_end_at
,
type
:
.
time
,
isShowPrompts
:
isShowPrompt
)
let
item4
=
YHItemModel
(
id
:
.
id16
,
isNeed
:
!
flag
,
title
:
"证件类别"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
mainModel
.
certificates
.
passport
.
passport_type
,
type
:
.
id
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请选择件类别"
)
let
item5
=
YHItemModel
(
id
:
.
id17
,
isNeed
:
!
flag
,
title
:
"证件号码"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
mainModel
.
certificates
.
passport
.
number
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请输入证件号码"
)
let
item6
=
YHItemModel
(
id
:
.
id18
,
isNeed
:
!
flag
,
title
:
"签发地"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
mainModel
.
certificates
.
passport
.
issue_at
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请输入签发地"
)
let
item7
=
YHItemModel
(
id
:
.
id19
,
isNeed
:
!
flag
,
title
:
"签发日期"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
mainModel
.
certificates
.
passport
.
issue_date_start_at
,
type
:
.
time
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请选择签发日期"
)
let
item8
=
YHItemModel
(
id
:
.
id20
,
isNeed
:
!
flag
,
title
:
"届满日期"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
mainModel
.
certificates
.
passport
.
issue_date_end_at
,
type
:
.
time
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请选择届满日期"
)
var
section2String
=
""
if
flag
{
section2String
=
"护照及其他旅行证件(选填)"
...
...
@@ -87,33 +87,33 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
}
func
getDetailDataSource
(
_
isShowPrompt
:
Bool
)
->
[
YHSectionItemModel
]
{
let
item
=
YHItemModel
(
id
:
.
id21
,
isNeed
:
true
,
title
:
"主申请人姓名"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
mainModel
.
username
,
isShowPrompts
:
isShowPrompt
)
let
item
=
YHItemModel
(
id
:
.
id21
,
isNeed
:
true
,
title
:
"主申请人姓名"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
mainModel
.
username
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请输入主申请人姓名"
)
let
item1
=
YHItemModel
(
id
:
.
id22
,
isNeed
:
false
,
title
:
"曾用名"
,
isUserKeyBoard
:
true
,
prompts
:
"请与户口本一致,若无则不填"
,
message
:
mainModel
.
used_name
,
isShowPrompts
:
isShowPrompt
)
let
item2
=
YHItemModel
(
id
:
.
id23
,
isNeed
:
false
,
title
:
"婚前姓氏"
,
isUserKeyBoard
:
true
,
prompts
:
"如有则填写,仅支持输入字母"
,
message
:
mainModel
.
surname
,
isShowPrompts
:
isShowPrompt
)
let
item3
=
YHItemModel
(
id
:
.
id24
,
isNeed
:
true
,
title
:
"出生日期"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
mainModel
.
birthday
,
type
:
.
time
,
isShowPrompts
:
isShowPrompt
)
let
item4
=
YHItemModel
(
id
:
.
id25
,
isNeed
:
true
,
title
:
"出生国家/地区"
,
isUserKeyBoard
:
false
,
prompts
:
nil
,
message
:
"
\(
mainModel
.
birth_place_aboard
)
"
,
leftButtonString
:
"国外"
,
rightButtonString
:
"国内"
,
isShowPrompts
:
isShowPrompt
)
let
item3
=
YHItemModel
(
id
:
.
id24
,
isNeed
:
true
,
title
:
"出生日期"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
mainModel
.
birthday
,
type
:
.
time
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请选择出生日期"
)
let
item4
=
YHItemModel
(
id
:
.
id25
,
isNeed
:
true
,
title
:
"出生国家/地区"
,
isUserKeyBoard
:
false
,
prompts
:
nil
,
message
:
"
\(
mainModel
.
birth_place_aboard
)
"
,
leftButtonString
:
"国外"
,
rightButtonString
:
"国内"
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请选择出生国家/地区"
)
var
string
=
""
let
array
=
mainModel
.
birth_place
.
area
for
item
in
array
{
string
=
string
+
item
}
let
item5
=
YHItemModel
(
id
:
.
id26
,
isNeed
:
true
,
title
:
"出生城市"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
string
,
type
:
.
address
,
isShowPrompts
:
isShowPrompt
)
let
item55
=
YHItemModel
(
id
:
.
id34
,
isNeed
:
true
,
title
:
"出生城市"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
mainModel
.
birth_place
.
foreign
,
isShowPrompts
:
isShowPrompt
)
let
item6
=
YHItemModel
(
id
:
.
id27
,
isNeed
:
true
,
title
:
"性别"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
"
\(
mainModel
.
sex
)
"
,
type
:
.
sex
)
let
item7
=
YHItemModel
(
id
:
.
id28
,
isNeed
:
true
,
title
:
"婚姻状况"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
"
\(
mainModel
.
married
)
"
,
type
:
.
marry
,
isShowPrompts
:
isShowPrompt
)
let
item5
=
YHItemModel
(
id
:
.
id26
,
isNeed
:
true
,
title
:
"出生城市"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
string
,
type
:
.
address
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请选择出生城市;"
)
let
item55
=
YHItemModel
(
id
:
.
id34
,
isNeed
:
true
,
title
:
"出生城市"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
mainModel
.
birth_place
.
foreign
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请输入出生城市"
)
let
item6
=
YHItemModel
(
id
:
.
id27
,
isNeed
:
true
,
title
:
"性别"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
"
\(
mainModel
.
sex
)
"
,
type
:
.
sex
,
alertMessage
:
"请选择性别"
)
let
item7
=
YHItemModel
(
id
:
.
id28
,
isNeed
:
true
,
title
:
"婚姻状况"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
"
\(
mainModel
.
married
)
"
,
type
:
.
marry
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请选择婚姻状况"
)
var
item555
=
item5
if
mainModel
.
birth_place_aboard
==
1
{
item555
=
item55
}
let
section
=
YHSectionItemModel
(
title
:
"主申请人信息"
,
models
:
[
item
,
item1
,
item2
,
item3
,
item4
,
item555
,
item6
,
item7
])
let
item8
=
YHItemModel
(
id
:
.
id29
,
isNeed
:
true
,
title
:
"手机号码"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
mainModel
.
mobile
,
isShowPrompts
:
isShowPrompt
)
let
item9
=
YHItemModel
(
id
:
.
id30
,
isNeed
:
true
,
title
:
"电子邮箱"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
mainModel
.
email
,
isShowPrompts
:
isShowPrompt
)
let
item8
=
YHItemModel
(
id
:
.
id29
,
isNeed
:
true
,
title
:
"手机号码"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
mainModel
.
mobile
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请输入手机号码"
)
let
item9
=
YHItemModel
(
id
:
.
id30
,
isNeed
:
true
,
title
:
"电子邮箱"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
mainModel
.
email
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请输入电子邮箱"
)
let
section1
=
YHSectionItemModel
(
title
:
"联系方式"
,
models
:
[
item8
,
item9
])
let
item10
=
YHItemModel
(
id
:
.
id31
,
isNeed
:
true
,
title
:
"是否办理过"
,
isUserKeyBoard
:
false
,
prompts
:
nil
,
message
:
"
\(
mainModel
.
has_hk_id
)
"
,
leftButtonString
:
"是"
,
rightButtonString
:
"否"
,
isShowPrompts
:
isShowPrompt
)
let
item11
=
YHItemModel
(
id
:
.
id35
,
isNeed
:
true
,
title
:
"香港身份证号码"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
mainModel
.
hk_id_number
,
isShowPrompts
:
isShowPrompt
)
let
item10
=
YHItemModel
(
id
:
.
id31
,
isNeed
:
true
,
title
:
"是否办理过"
,
isUserKeyBoard
:
false
,
prompts
:
nil
,
message
:
"
\(
mainModel
.
has_hk_id
)
"
,
leftButtonString
:
"是"
,
rightButtonString
:
"否"
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请选择"
)
let
item11
=
YHItemModel
(
id
:
.
id35
,
isNeed
:
true
,
title
:
"香港身份证号码"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
mainModel
.
hk_id_number
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请输入香港身份证号码"
)
let
section2
=
YHSectionItemModel
(
title
:
"香港身份证"
,
models
:
[
item10
])
let
section22
=
YHSectionItemModel
(
title
:
"香港身份证"
,
models
:
[
item10
,
item11
])
var
section222
=
section2
...
...
@@ -148,7 +148,7 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
case
.
id4
:
mainModel
.
address
.
details
=
item
.
message
??
""
case
.
id5
:
mainModel
.
has_hk_i
d
=
item
.
value
?
.
first
?
.
int
??
0
mainModel
.
is_handle
d
=
item
.
value
?
.
first
?
.
int
??
0
case
.
id6
:
printLog
(
"1"
)
case
.
id7
:
...
...
@@ -292,20 +292,24 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
let
_
=
YHNetRequest
.
getRequest
(
url
:
strUrl
)
{
[
weak
self
]
json
,
code
in
//1. json字符串 转 对象
guard
let
self
=
self
else
{
return
}
let
dic
=
json
.
data
guard
let
result
=
YHMainInformationModel
.
deserialize
(
from
:
dic
as?
Dictionary
)
else
{
callBackBlock
(
nil
,
nil
)
return
if
json
.
code
==
200
{
let
dic
=
json
.
data
guard
let
result
=
YHMainInformationModel
.
deserialize
(
from
:
dic
as?
Dictionary
)
else
{
callBackBlock
(
nil
,
nil
)
return
}
self
.
mainModel
=
result
callBackBlock
(
result
,
nil
)
}
else
{
let
error
:
YHErrorModel
=
YHErrorModel
(
errorCode
:
Int32
(
json
.
code
),
errorMsg
:
json
.
msg
)
callBackBlock
(
nil
,
error
)
}
self
.
mainModel
=
result
callBackBlock
(
result
,
nil
)
}
failBlock
:
{
err
in
callBackBlock
(
nil
,
err
)
}
}
func
updateMainInformation
(
_
saveType
:
YHSaveType
,
_
orderID
:
Int
,
callBackBlock
:
@escaping
(
_
success
:
Bool
)
->
())
{
func
updateMainInformation
(
_
saveType
:
YHSaveType
,
_
orderID
:
Int
,
callBackBlock
:
@escaping
(
_
success
:
Bool
,
_
error
:
YHErrorModel
?
)
->
())
{
var
type
=
""
if
saveType
==
.
save
{
type
=
"save"
...
...
@@ -372,10 +376,15 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
// let strUrl = "http://192.168.25.48:18088/" + YHAllApiName.OrderInformation.updateInformation
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
OrderInformation
.
updateInformation
let
_
=
YHNetRequest
.
postRequest
(
url
:
strUrl
,
params
:
params
)
{
[
weak
self
]
json
,
code
in
guard
let
self
=
self
else
{
return
}
callBackBlock
(
true
)
guard
let
_
=
self
else
{
return
}
if
json
.
code
==
200
{
callBackBlock
(
true
,
nil
)
}
else
{
let
error
:
YHErrorModel
=
YHErrorModel
(
errorCode
:
Int32
(
json
.
code
),
errorMsg
:
json
.
msg
)
callBackBlock
(
false
,
error
)
}
}
failBlock
:
{
err
in
callBackBlock
(
false
)
callBackBlock
(
false
,
err
)
}
}
...
...
@@ -388,7 +397,7 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
"businessCode"
:
"4001001"
]
let
_
=
YHNetRequest
.
uplaodRequest
(
url
:
strUrl
,
headers
:
headers
,
image
:
image
)
{
[
weak
self
]
json
,
code
in
guard
let
self
=
self
else
{
return
}
guard
let
_
=
self
else
{
return
}
if
json
.
code
==
200
{
callBackBlock
(
json
.
data
as?
String
,
nil
)
}
else
{
...
...
@@ -405,7 +414,7 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
let
strUrl
=
"https://test-comserver.galaxy-immi.com/oss/storage/convertToPublicURL"
+
"?fileUrl=
\(
url
)
"
let
_
=
YHNetRequest
.
getRequest
(
url
:
strUrl
)
{
[
weak
self
]
json
,
code
in
//1. json字符串 转 对象
guard
let
self
=
self
else
{
return
}
guard
let
_
=
self
else
{
return
}
if
json
.
code
==
200
{
callBackBlock
(
json
.
data
as?
String
,
nil
)
}
else
{
...
...
@@ -538,7 +547,7 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
if
birth_place_aboard
==
1
{
if
username
.
count
!=
0
&&
birthday
.
count
!=
0
&&
birth_place_foreign
.
count
!=
0
&&
mobile
.
count
!=
0
&&
email
.
count
!=
0
{
if
has_hk_id
==
1
{
if
hk_id_numbe
.
count
!=
0
{
if
hk_id_numbe
.
isHKIdentityCardNumber
()
{
return
true
}
else
{
return
false
...
...
@@ -552,7 +561,7 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
}
else
{
if
username
.
count
!=
0
&&
birthday
.
count
!=
0
&&
birth_place_area
.
count
!=
0
&&
mobile
.
count
!=
0
&&
email
.
count
!=
0
{
if
has_hk_id
==
1
{
if
hk_id_numbe
.
count
!=
0
{
if
hk_id_numbe
.
isHKIdentityCardNumber
()
{
return
true
}
else
{
return
false
...
...
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