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
9e6e938e
Commit
9e6e938e
authored
Feb 01, 2024
by
pete谢兆麟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
主申请人 获取信息接口
parent
efbbafcd
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
527 additions
and
39 deletions
+527
-39
project.pbxproj
galaxy/galaxy.xcodeproj/project.pbxproj
+16
-0
YHMainApplicantInformationViewController.swift
...ormation/C/YHMainApplicantInformationViewController.swift
+12
-10
YHSelectCountryViewController.swift
...pplicantInformation/C/YHSelectCountryViewController.swift
+237
-0
YHCountryMessage.swift
...ess(流程)/MainApplicantInformation/M/YHCountryMessage.swift
+25
-0
YHItemModel.swift
...eProcess(流程)/MainApplicantInformation/M/YHItemModel.swift
+14
-1
YHMainInformationModel.swift
...)/MainApplicantInformation/M/YHMainInformationModel.swift
+64
-0
YHImagePickerView.swift
...ss(流程)/MainApplicantInformation/V/YHImagePickerView.swift
+0
-1
YHItemView.swift
...ceProcess(流程)/MainApplicantInformation/V/YHItemView.swift
+48
-0
YHMainApplicantInformationViewModel.swift
...tInformation/VM/YHMainApplicantInformationViewModel.swift
+69
-26
YHSelectCountryViewModel.swift
...ainApplicantInformation/VM/YHSelectCountryViewModel.swift
+41
-0
YHNetRequest.swift
galaxy/galaxy/Classes/Tools/NetWork/YHNetRequest.swift
+1
-1
No files found.
galaxy/galaxy.xcodeproj/project.pbxproj
View file @
9e6e938e
...
...
@@ -59,6 +59,10 @@
0468D47B2B68A08600CFB916
/* YHAddressPresentAnimated.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0468D4752B68A08600CFB916
/* YHAddressPresentAnimated.swift */
;
};
0468D47C2B68A08600CFB916
/* YHAddressPickView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0468D4762B68A08600CFB916
/* YHAddressPickView.swift */
;
};
0468D47E2B68CEA200CFB916
/* YHImagePickerView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0468D47D2B68CEA200CFB916
/* YHImagePickerView.swift */
;
};
0468D4802B6914E600CFB916
/* YHSelectCountryViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0468D47F2B6914E600CFB916
/* YHSelectCountryViewController.swift */
;
};
0468D4822B6A2A8500CFB916
/* YHSelectCountryViewModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0468D4812B6A2A8500CFB916
/* YHSelectCountryViewModel.swift */
;
};
0468D4842B6A2F0D00CFB916
/* YHCountryMessage.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0468D4832B6A2F0D00CFB916
/* YHCountryMessage.swift */
;
};
0468D4862B6A41F300CFB916
/* YHMainInformationModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0468D4852B6A41F300CFB916
/* YHMainInformationModel.swift */
;
};
04808C062B4686510056D53C
/* ATAuthSDK.bundle in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04808C042B4686510056D53C
/* ATAuthSDK.bundle */
;
};
04808C082B4686C10056D53C
/* ATAuthSDK_D.framework in Embed Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04808C032B4686510056D53C
/* ATAuthSDK_D.framework */
;
settings
=
{
ATTRIBUTES
=
(
CodeSignOnCopy
,
RemoveHeadersOnCopy
,
);
};
};
049A48A82B49417300D0C641
/* YHAboutUsViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
049A48A72B49417300D0C641
/* YHAboutUsViewController.swift */
;
};
...
...
@@ -254,6 +258,10 @@
0468D4752B68A08600CFB916
/* YHAddressPresentAnimated.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHAddressPresentAnimated.swift
;
sourceTree
=
"<group>"
;
};
0468D4762B68A08600CFB916
/* YHAddressPickView.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHAddressPickView.swift
;
sourceTree
=
"<group>"
;
};
0468D47D2B68CEA200CFB916
/* YHImagePickerView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHImagePickerView.swift
;
sourceTree
=
"<group>"
;
};
0468D47F2B6914E600CFB916
/* YHSelectCountryViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHSelectCountryViewController.swift
;
sourceTree
=
"<group>"
;
};
0468D4812B6A2A8500CFB916
/* YHSelectCountryViewModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHSelectCountryViewModel.swift
;
sourceTree
=
"<group>"
;
};
0468D4832B6A2F0D00CFB916
/* YHCountryMessage.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHCountryMessage.swift
;
sourceTree
=
"<group>"
;
};
0468D4852B6A41F300CFB916
/* YHMainInformationModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHMainInformationModel.swift
;
sourceTree
=
"<group>"
;
};
04808C032B4686510056D53C
/* ATAuthSDK_D.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
path
=
ATAuthSDK_D.framework
;
sourceTree
=
"<group>"
;
};
04808C042B4686510056D53C
/* ATAuthSDK.bundle */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
"wrapper.plug-in"
;
path
=
ATAuthSDK.bundle
;
sourceTree
=
"<group>"
;
};
049A48A72B49417300D0C641
/* YHAboutUsViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHAboutUsViewController.swift
;
sourceTree
=
"<group>"
;
};
...
...
@@ -517,6 +525,7 @@
isa
=
PBXGroup
;
children
=
(
0468D4422B61F76800CFB916
/* YHMainApplicantInformationViewController.swift */
,
0468D47F2B6914E600CFB916
/* YHSelectCountryViewController.swift */
,
);
path
=
C
;
sourceTree
=
"<group>"
;
...
...
@@ -525,6 +534,8 @@
isa
=
PBXGroup
;
children
=
(
0468D44A2B625AAB00CFB916
/* YHItemModel.swift */
,
0468D4832B6A2F0D00CFB916
/* YHCountryMessage.swift */
,
0468D4852B6A41F300CFB916
/* YHMainInformationModel.swift */
,
);
path
=
M
;
sourceTree
=
"<group>"
;
...
...
@@ -549,6 +560,7 @@
isa
=
PBXGroup
;
children
=
(
0468D44E2B634E8A00CFB916
/* YHMainApplicantInformationViewModel.swift */
,
0468D4812B6A2A8500CFB916
/* YHSelectCountryViewModel.swift */
,
);
path
=
VM
;
sourceTree
=
"<group>"
;
...
...
@@ -1229,11 +1241,14 @@
A5ACE9542B4564F7002C94D2
/* YHNavigationController.swift in Sources */
,
A5FD63DF2B6639AD00D1D9DA
/* YHScoreDataModel.swift in Sources */
,
A5ACE95E2B4571BF002C94D2
/* YHHomeViewController.swift in Sources */
,
0468D4842B6A2F0D00CFB916
/* YHCountryMessage.swift in Sources */
,
A5FD63BD2B623C2C00D1D9DA
/* YHInformationPerfectListVC.swift in Sources */
,
041B52932B5E6CBA007EBCEB
/* YHFormItemTitleCell.swift in Sources */
,
0468D4822B6A2A8500CFB916
/* YHSelectCountryViewModel.swift in Sources */
,
041B52952B5E7037007EBCEB
/* YHFormItemAddCell.swift in Sources */
,
A5ACE93D2B4564F7002C94D2
/* UIButton+Extension.swift in Sources */
,
041B528D2B5E58FA007EBCEB
/* YHFormItemDoubleChoiceCell.swift in Sources */
,
0468D4802B6914E600CFB916
/* YHSelectCountryViewController.swift in Sources */
,
A5ACE9292B4564F7002C94D2
/* YHSmsCodeInputView.swift in Sources */
,
A5ACE9452B4564F7002C94D2
/* BsHUDContainerView.swift in Sources */
,
A5ACE93A2B4564F7002C94D2
/* NSAttributedString+Extension.swift in Sources */
,
...
...
@@ -1286,6 +1301,7 @@
A5FD63D82B6603A500D1D9DA
/* YHScoreResultView.swift in Sources */
,
A5ACE9342B4564F7002C94D2
/* YHAllApiName.swift in Sources */
,
A5ACE9502B4564F7002C94D2
/* YhCacheTool.swift in Sources */
,
0468D4862B6A41F300CFB916
/* YHMainInformationModel.swift in Sources */
,
0468D4242B494BEA00CFB916
/* YHCodeResultViewController.swift in Sources */
,
042FBBB92B627C0F00F9DE23
/* YHCertificateInfo.swift in Sources */
,
A5FD63EA2B67D95100D1D9DA
/* YHFamilyMemberViewController.swift in Sources */
,
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/MainApplicantInformation/C/YHMainApplicantInformationViewController.swift
View file @
9e6e938e
...
...
@@ -26,17 +26,19 @@ class YHMainApplicantInformationViewController: YHBaseViewController {
}
func
getData
()
{
if
stepView
.
currentIndex
==
0
{
dataSource
=
viewModel
.
getBaseDataSource
()
}
else
if
stepView
.
currentIndex
==
1
{
dataSource
=
viewModel
.
getIDCardDataSource
()
}
else
if
stepView
.
currentIndex
==
2
{
dataSource
=
viewModel
.
getDocumentInformation
()
}
else
if
stepView
.
currentIndex
==
3
{
dataSource
=
viewModel
.
getDetailDataSource
()
viewModel
.
requestMainInformation
(
"133969"
)
{[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
if
self
.
stepView
.
currentIndex
==
0
{
self
.
dataSource
=
self
.
viewModel
.
getBaseDataSource
()
}
else
if
self
.
stepView
.
currentIndex
==
1
{
self
.
dataSource
=
self
.
viewModel
.
getIDCardDataSource
()
}
else
if
self
.
stepView
.
currentIndex
==
2
{
self
.
dataSource
=
self
.
viewModel
.
getDocumentInformation
()
}
else
if
self
.
stepView
.
currentIndex
==
3
{
self
.
dataSource
=
self
.
viewModel
.
getDetailDataSource
()
}
self
.
tableView
.
reloadData
()
}
tableView
.
reloadData
()
}
func
setView
()
{
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/MainApplicantInformation/C/YHSelectCountryViewController.swift
0 → 100644
View file @
9e6e938e
//
// YHSelectCountryViewController.swift
// galaxy
//
// Created by EDY on 2024/1/30.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
class
YHSelectCountryViewController
:
YHBaseViewController
{
var
searchView
:
UITextField
!
var
flagLabel
:
UILabel
!
var
tableView
:
UITableView
!
var
collectionView
:
UICollectionView
!
var
hotDataSource
=
[
"中国-China"
,
"中国香港-Hong Kong"
,
"中国澳门-Macau"
,
"中国台湾-Taiwan"
,
"新加坡-Singapore"
,
"澳大利亚-Australia"
,
"美国-United States"
]
var
searchDataSource
:
[
YHCountryMessage
]?
var
viewModel
:
YHSelectCountryViewModel
?
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
gk_navTitle
=
"国家/地区"
viewModel
=
YHSelectCountryViewModel
()
setView
()
getData
()
}
func
getData
()
{
tableView
.
reloadData
()
}
func
setView
()
{
view
.
backgroundColor
=
.
white
searchView
=
{
let
searchBar
=
UITextField
()
searchBar
.
placeholder
=
"搜索国家/地区"
searchBar
.
backgroundColor
=
UIColor
(
hex
:
0xf8f9fb
)
searchBar
.
keyboardType
=
.
default
searchBar
.
delegate
=
self
searchBar
.
layer
.
cornerRadius
=
21
searchBar
.
leftView
=
UIView
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
16
,
height
:
42
))
searchBar
.
leftViewMode
=
.
always
return
searchBar
}()
view
.
addSubview
(
searchView
)
searchView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalTo
(
k_Height_NavigationtBarAndStatuBar
+
16
)
make
.
height
.
equalTo
(
42
)
make
.
left
.
equalTo
(
16
)
make
.
right
.
equalTo
(
-
16
)
}
tableView
=
{
let
tableView
=
UITableView
(
frame
:
.
zero
,
style
:
.
plain
)
if
#available(iOS 11.0, *)
{
tableView
.
contentInsetAdjustmentBehavior
=
.
never
}
tableView
.
backgroundColor
=
.
clear
tableView
.
separatorStyle
=
.
none
tableView
.
delegate
=
self
tableView
.
dataSource
=
self
tableView
.
register
(
cellWithClass
:
YHCountryTableViewCell
.
self
)
tableView
.
isHidden
=
true
return
tableView
}()
view
.
addSubview
(
tableView
)
tableView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalTo
(
k_Height_NavigationtBarAndStatuBar
+
78
)
make
.
bottom
.
equalTo
(
-
k_Height_safeAreaInsetsBottom
()
-
64
)
make
.
left
.
right
.
equalTo
(
view
)
}
flagLabel
=
{
let
label
=
UILabel
()
label
.
text
=
"热门国家/地区"
label
.
textColor
=
UIColor
(
hex
:
0x222222
)
label
.
font
=
kFont
(
size
:
14
)
return
label
}()
view
.
addSubview
(
flagLabel
)
flagLabel
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalTo
(
k_Height_NavigationtBarAndStatuBar
+
78
)
make
.
left
.
equalTo
(
21
)
make
.
height
.
equalTo
(
20
)
}
collectionView
=
{
let
layout
=
UICollectionViewFlowLayout
()
layout
.
minimumInteritemSpacing
=
12
// 设置水平间距
layout
.
minimumLineSpacing
=
16
// 设置垂直间距
layout
.
scrollDirection
=
.
vertical
// 初始化UICollectionView对象
let
collection
=
UICollectionView
(
frame
:
CGRect
.
zero
,
collectionViewLayout
:
layout
)
collection
.
dataSource
=
self
collection
.
delegate
=
self
// 注册自定义单元格类型
collection
.
register
(
cellWithClass
:
YHCountryCollectionViewCell
.
self
)
return
collection
}()
view
.
addSubview
(
collectionView
)
collectionView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalTo
(
k_Height_NavigationtBarAndStatuBar
+
114
)
make
.
left
.
equalTo
(
21
)
make
.
right
.
equalTo
(
-
21
)
make
.
bottom
.
equalToSuperview
()
}
}
}
extension
YHSelectCountryViewController
:
UITextFieldDelegate
{
func
textFieldDidChangeSelection
(
_
textField
:
UITextField
)
{
if
textField
.
text
==
""
{
tableView
.
isHidden
=
true
flagLabel
.
isHidden
=
false
collectionView
.
isHidden
=
false
}
else
{
viewModel
?
.
requestCountry
(
textField
.
text
??
""
)
{
[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
self
.
searchDataSource
=
success
as?
[
YHCountryMessage
]
self
.
tableView
.
isHidden
=
false
self
.
flagLabel
.
isHidden
=
true
self
.
collectionView
.
isHidden
=
true
self
.
tableView
.
reloadData
()
}
}
}
}
extension
YHSelectCountryViewController
:
UITableViewDelegate
,
UITableViewDataSource
{
func
tableView
(
_
tableView
:
UITableView
,
numberOfRowsInSection
section
:
Int
)
->
Int
{
return
searchDataSource
?
.
count
??
0
}
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
let
cell
=
tableView
.
dequeueReusableCell
(
withClass
:
YHCountryTableViewCell
.
self
)
let
cn
=
searchDataSource
?[
indexPath
.
row
]
.
name_cn
??
""
let
en
=
searchDataSource
?[
indexPath
.
row
]
.
name_en
??
""
cell
.
titleLabel
.
text
=
cn
+
en
return
cell
}
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
return
44
}
}
extension
YHSelectCountryViewController
:
UICollectionViewDelegate
,
UICollectionViewDataSource
,
UICollectionViewDelegateFlowLayout
{
func
collectionView
(
_
collectionView
:
UICollectionView
,
numberOfItemsInSection
section
:
Int
)
->
Int
{
return
hotDataSource
.
count
}
func
collectionView
(
_
collectionView
:
UICollectionView
,
cellForItemAt
indexPath
:
IndexPath
)
->
UICollectionViewCell
{
let
collectionCell
=
collectionView
.
dequeueReusableCell
(
withClass
:
YHCountryCollectionViewCell
.
self
,
for
:
indexPath
)
collectionCell
.
label
.
text
=
hotDataSource
[
indexPath
.
row
]
return
collectionCell
}
func
collectionView
(
_
collectionView
:
UICollectionView
,
layout
collectionViewLayout
:
UICollectionViewLayout
,
sizeForItemAt
indexPath
:
IndexPath
)
->
CGSize
{
let
string
=
hotDataSource
[
indexPath
.
row
]
let
size
=
(
string
as
NSString
)
.
size
(
withAttributes
:
[
NSAttributedString
.
Key
.
font
:
kFont
(
size
:
13
)])
return
CGSize
(
width
:
size
.
width
+
25
,
height
:
32
)
// 这里可以根据需求设置不同的尺寸
}
}
class
YHCountryCollectionViewCell
:
UICollectionViewCell
{
var
label
:
UILabel
!
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
)
setUpView
()
}
required
init
?(
coder
:
NSCoder
)
{
fatalError
(
"init(coder:) has not been implemented"
)
}
func
setUpView
()
{
label
=
{
let
view
=
UILabel
()
view
.
textAlignment
=
.
center
view
.
font
=
kFont
(
size
:
13
)
view
.
textColor
=
UIColor
(
hex
:
0x222222
)
view
.
backgroundColor
=
UIColor
(
hex
:
0xf8f9fb
)
view
.
layer
.
masksToBounds
=
true
view
.
layer
.
cornerRadius
=
16
return
view
}()
contentView
.
addSubview
(
label
)
label
.
snp
.
makeConstraints
{
make
in
make
.
top
.
bottom
.
right
.
left
.
equalToSuperview
()
}
}
}
class
YHCountryTableViewCell
:
UITableViewCell
{
var
titleLabel
:
UILabel
!
override
func
awakeFromNib
()
{
super
.
awakeFromNib
()
// Initialization code
}
override
func
setSelected
(
_
selected
:
Bool
,
animated
:
Bool
)
{
super
.
setSelected
(
selected
,
animated
:
animated
)
// Configure the view for the selected state
}
required
init
?(
coder
:
NSCoder
)
{
super
.
init
(
coder
:
coder
)
}
override
init
(
style
:
UITableViewCell
.
CellStyle
,
reuseIdentifier
:
String
?)
{
super
.
init
(
style
:
style
,
reuseIdentifier
:
reuseIdentifier
)
selectionStyle
=
.
none
setupUI
()
}
func
setupUI
()
{
titleLabel
=
{
let
label
=
UILabel
()
label
.
font
=
kFont
(
size
:
13
)
label
.
textColor
=
UIColor
(
hex
:
0x222222
)
return
label
}()
contentView
.
addSubview
(
titleLabel
)
titleLabel
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
22
)
make
.
centerY
.
equalToSuperview
()
make
.
height
.
equalTo
(
20
)
}
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/MainApplicantInformation/M/YHCountryMessage.swift
0 → 100644
View file @
9e6e938e
//
// YHCountryModel.swift
// galaxy
//
// Created by EDY on 2024/1/31.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
Foundation
import
SmartCodable
struct
YHCountryMessage
:
SmartCodable
{
var
name_cn
:
String
?
var
name_en
:
String
?
var
code
:
String
?
init
(
name_cn
:
String
?
=
nil
,
name_en
:
String
?
=
nil
,
code
:
String
?
=
nil
)
{
self
.
name_cn
=
name_cn
self
.
name_en
=
name_en
self
.
code
=
code
}
init
()
{
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/MainApplicantInformation/M/YHItemModel.swift
View file @
9e6e938e
...
...
@@ -8,6 +8,17 @@
import
UIKit
enum
YHItemSelectType
:
Int
{
case
normal
=
0
case
address
=
1
case
time
=
2
case
image
=
3
case
id
=
4
case
country
=
5
case
sex
=
6
case
marry
=
7
}
struct
YHItemModel
{
var
isNeed
:
Bool
?
var
title
:
String
?
...
...
@@ -16,8 +27,9 @@ struct YHItemModel {
var
message
:
String
?
var
leftButtonString
:
String
?
var
rightButtonString
:
String
?
var
type
:
YHItemSelectType
?
init
(
isNeed
:
Bool
?
=
nil
,
title
:
String
?
=
nil
,
isUserKeyBoard
:
Bool
?
=
nil
,
prompts
:
String
?
=
nil
,
message
:
String
?
=
nil
,
leftButtonString
:
String
?
=
nil
,
rightButtonString
:
String
?
=
nil
)
{
init
(
isNeed
:
Bool
?
=
nil
,
title
:
String
?
=
nil
,
isUserKeyBoard
:
Bool
?
=
nil
,
prompts
:
String
?
=
nil
,
message
:
String
?
=
nil
,
leftButtonString
:
String
?
=
nil
,
rightButtonString
:
String
?
=
nil
,
type
:
YHItemSelectType
?
=
nil
)
{
self
.
isNeed
=
isNeed
self
.
title
=
title
self
.
isUserKeyBoard
=
isUserKeyBoard
...
...
@@ -25,6 +37,7 @@ struct YHItemModel {
self
.
message
=
message
self
.
leftButtonString
=
leftButtonString
self
.
rightButtonString
=
rightButtonString
self
.
type
=
type
}
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/MainApplicantInformation/M/YHMainInformationModel.swift
0 → 100644
View file @
9e6e938e
//
// YHMainInformationModel.swift
// galaxy
//
// Created by EDY on 2024/1/31.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
Foundation
import
SmartCodable
struct
YHMainInformationModel
:
SmartCodable
{
var
id
:
Int
?
var
order_id
:
String
?
var
nationality
:
String
?
var
is_handled
:
Int
?
var
username
:
String
?
var
used_name
:
String
?
var
birthday
:
String
?
var
age
:
String
?
var
birth_place_aboard
:
Int
?
var
sex
:
String
?
var
married
:
String
?
var
mobile
:
String
?
var
email
:
String
?
var
address_aboard
:
Int
?
var
has_hk_id
:
Int
?
var
hk_id_number
:
String
?
var
step
:
Int
?
var
surname
:
String
?
var
is_live_oversea_year
:
Int
?
var
username_pinyin
:
YHUserNameModel
?
var
birth_place
:
YHAddressModel
?
var
address
:
YHAddressModel
?
var
certificates
:
YHCertificatesModels
?
}
struct
YHUserNameModel
:
SmartCodable
{
var
family_name
:
String
?
var
given_name
:
String
?
}
struct
YHAddressModel
:
SmartCodable
{
var
area
:
[
String
]?
var
country
:
String
?
var
details
:
String
?
var
foreign
:
String
?
}
struct
YHCertificatesModels
:
SmartCodable
{
var
hk_macao_pass
:
YHCertificatesModel
?
var
passport
:
YHCertificatesModel
?
var
cn_identity_card
:
YHCertificatesModel
?
}
struct
YHCertificatesModel
:
SmartCodable
{
var
number
:
String
?
var
issue_at
:
String
?
var
issue_date_start_at
:
String
?
var
issue_date_end_at
:
String
?
var
img_front
:
String
?
var
img_back
:
String
?
var
passport_type
:
String
?
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/MainApplicantInformation/V/YHImagePickerView.swift
View file @
9e6e938e
...
...
@@ -199,7 +199,6 @@ extension YHImagePickerView: UINavigationControllerDelegate, UIImagePickerContro
func
imagePickerController
(
_
picker
:
UIImagePickerController
,
didFinishPickingMediaWithInfo
info
:
[
UIImagePickerController
.
InfoKey
:
Any
])
{
if
let
image
=
info
[
UIImagePickerController
.
InfoKey
.
originalImage
]
as?
UIImage
{
// 将图片显示给UIImageView
if
let
block
=
backImage
{
block
(
image
)
self
.
dismiss
()
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/MainApplicantInformation/V/YHItemView.swift
View file @
9e6e938e
...
...
@@ -9,6 +9,8 @@
import
UIKit
class
YHItemView
:
UIView
{
typealias
Block
=
(
_
model
:
YHItemModel
)
->
()
var
block
:
Block
?
var
titleLabel
:
UILabel
!
var
messageTextField
:
UITextField
!
var
nextStepImageView
:
UIImageView
!
...
...
@@ -45,6 +47,7 @@ class YHItemView: UIView {
messageTextField
=
{
let
textField
=
UITextField
()
textField
.
delegate
=
self
return
textField
}()
addSubview
(
messageTextField
)
...
...
@@ -67,6 +70,7 @@ class YHItemView: UIView {
centerButton
=
{
let
button
=
UIButton
(
type
:
.
custom
)
button
.
addTarget
(
self
,
action
:
#selector(
centerClick
)
,
for
:
.
touchUpInside
)
return
button
}()
addSubview
(
centerButton
)
...
...
@@ -84,6 +88,7 @@ class YHItemView: UIView {
button
.
layer
.
borderWidth
=
1
button
.
layer
.
borderColor
=
UIColor
(
hex
:
0x4487f9
)
.
cgColor
button
.
isSelected
=
true
button
.
addTarget
(
self
,
action
:
#selector(
rightClick
)
,
for
:
.
touchUpInside
)
return
button
}()
addSubview
(
rightButton
)
...
...
@@ -100,6 +105,7 @@ class YHItemView: UIView {
button
.
setTitleColor
(
UIColor
(
hex
:
0x4487f9
),
for
:
.
selected
)
button
.
setTitleColor
(
UIColor
(
hex
:
0x222222
),
for
:
.
normal
)
button
.
layer
.
cornerRadius
=
16
button
.
addTarget
(
self
,
action
:
#selector(
leftClick
)
,
for
:
.
touchUpInside
)
return
button
}()
addSubview
(
leftButton
)
...
...
@@ -147,6 +153,12 @@ class YHItemView: UIView {
leftButton
.
isHidden
=
false
leftButton
.
setTitle
(
dataSource
.
leftButtonString
,
for
:
.
normal
)
nextStepImageView
.
isHidden
=
true
messageTextField
.
isHidden
=
true
if
dataSource
.
message
==
"0"
{
rightClick
()
}
else
{
leftClick
()
}
}
else
{
leftButton
.
isHidden
=
true
}
...
...
@@ -155,8 +167,44 @@ class YHItemView: UIView {
rightButton
.
isHidden
=
false
rightButton
.
setTitle
(
dataSource
.
rightButtonString
,
for
:
.
normal
)
nextStepImageView
.
isHidden
=
true
messageTextField
.
isHidden
=
true
}
else
{
rightButton
.
isHidden
=
true
}
}
@objc
func
rightClick
()
{
rightButton
.
isSelected
=
true
leftButton
.
isSelected
=
false
rightButton
.
layer
.
borderWidth
=
1
rightButton
.
layer
.
borderColor
=
UIColor
(
hex
:
0x4487f9
)
.
cgColor
rightButton
.
backgroundColor
=
UIColor
(
hex
:
0x4487f9
)
.
withAlphaComponent
(
0.08
)
leftButton
.
backgroundColor
=
UIColor
(
hex
:
0xf8f9fb
)
leftButton
.
layer
.
borderWidth
=
0
dataSource
?
.
message
=
"0"
}
@objc
func
leftClick
()
{
leftButton
.
isSelected
=
true
rightButton
.
isSelected
=
false
leftButton
.
layer
.
borderWidth
=
1
leftButton
.
layer
.
borderColor
=
UIColor
(
hex
:
0x4487f9
)
.
cgColor
leftButton
.
backgroundColor
=
UIColor
(
hex
:
0x4487f9
)
.
withAlphaComponent
(
0.08
)
rightButton
.
backgroundColor
=
UIColor
(
hex
:
0xf8f9fb
)
rightButton
.
layer
.
borderWidth
=
0
dataSource
?
.
message
=
"1"
}
@objc
func
centerClick
()
{
}
}
extension
YHItemView
:
UITextFieldDelegate
{
func
textFieldDidEndEditing
(
_
textField
:
UITextField
)
{
dataSource
?
.
message
=
textField
.
text
if
let
block
=
block
{
block
(
dataSource
??
YHItemModel
())
}
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/MainApplicantInformation/VM/YHMainApplicantInformationViewModel.swift
View file @
9e6e938e
...
...
@@ -9,58 +9,78 @@
import
UIKit
class
YHMainApplicantInformationViewModel
:
YHBaseViewModel
{
var
mainModel
:
YHMainInformationModel
=
YHMainInformationModel
()
override
init
()
{
super
.
init
()
}
func
getBaseDataSource
()
->
[
YHSectionItemModel
]
{
let
item
=
YHItemModel
(
isNeed
:
true
,
title
:
"国家/地区"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
)
let
item
=
YHItemModel
(
isNeed
:
true
,
title
:
"国家/地区"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
mainModel
.
nationality
,
type
:
.
country
)
let
section
=
YHSectionItemModel
(
title
:
"国籍"
,
models
:
[
item
])
let
item1
=
YHItemModel
(
isNeed
:
true
,
title
:
"省市地区"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
)
let
item2
=
YHItemModel
(
isNeed
:
true
,
title
:
"详细地址"
,
isUserKeyBoard
:
true
,
prompts
:
"请填写小区、楼栋、单元室等"
)
let
section1
=
YHSectionItemModel
(
title
:
"现居住地址"
,
models
:
[
item
,
item1
,
item2
])
let
item4
=
YHItemModel
(
isNeed
:
true
,
title
:
"国家/地区"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
mainModel
.
address
?
.
country
,
type
:
.
country
)
var
string
=
""
if
let
array
=
mainModel
.
address
?
.
area
{
for
item
in
array
{
string
=
string
+
item
}
}
let
item1
=
YHItemModel
(
isNeed
:
true
,
title
:
"省市地区"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
string
,
type
:
.
address
)
let
item2
=
YHItemModel
(
isNeed
:
true
,
title
:
"详细地址"
,
isUserKeyBoard
:
true
,
prompts
:
"请填写小区、楼栋、单元室等"
,
message
:
mainModel
.
address
?
.
details
)
let
section1
=
YHSectionItemModel
(
title
:
"现居住地址"
,
models
:
[
item4
,
item1
,
item2
])
let
item3
=
YHItemModel
(
isNeed
:
true
,
title
:
"是否办理"
,
isUserKeyBoard
:
false
,
prompts
:
""
,
message
:
nil
,
leftButtonString
:
"是"
,
rightButtonString
:
"否"
)
let
item3
=
YHItemModel
(
isNeed
:
true
,
title
:
"是否办理"
,
isUserKeyBoard
:
false
,
prompts
:
""
,
message
:
"
\(
mainModel
.
has_hk_id
??
0
)
"
,
leftButtonString
:
"是"
,
rightButtonString
:
"否"
)
let
section2
=
YHSectionItemModel
(
title
:
"港澳通行证"
,
models
:
[
item3
])
return
[
section
,
section1
,
section2
]
}
func
getDocumentInformation
()
->
[
YHSectionItemModel
]
{
let
item
=
YHItemModel
(
isNeed
:
true
,
title
:
"身份证号码"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
nil
)
let
item1
=
YHItemModel
(
isNeed
:
true
,
title
:
"签发地"
,
isUserKeyBoard
:
false
,
prompts
:
"请输入"
,
message
:
nil
)
let
item2
=
YHItemModel
(
isNeed
:
true
,
title
:
"签发日期"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
nil
)
let
item3
=
YHItemModel
(
isNeed
:
true
,
title
:
"届满日期"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
nil
)
let
item
=
YHItemModel
(
isNeed
:
true
,
title
:
"身份证号码"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
mainModel
.
certificates
?
.
cn_identity_card
?
.
number
)
let
item1
=
YHItemModel
(
isNeed
:
true
,
title
:
"签发地"
,
isUserKeyBoard
:
false
,
prompts
:
"请输入"
,
message
:
mainModel
.
certificates
?
.
cn_identity_card
?
.
issue_at
)
let
item2
=
YHItemModel
(
isNeed
:
true
,
title
:
"签发日期"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
mainModel
.
certificates
?
.
cn_identity_card
?
.
issue_date_start_at
,
type
:
.
time
)
let
item3
=
YHItemModel
(
isNeed
:
true
,
title
:
"届满日期"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
mainModel
.
certificates
?
.
cn_identity_card
?
.
issue_date_end_at
,
type
:
.
time
)
let
section
=
YHSectionItemModel
(
title
:
"中国身份证"
,
models
:
[
item
,
item1
,
item2
,
item3
])
let
section1
=
YHSectionItemModel
(
title
:
"港澳通行证"
,
models
:
[
item
,
item1
,
item2
,
item3
])
let
item10
=
YHItemModel
(
isNeed
:
true
,
title
:
"身份证号码"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
mainModel
.
certificates
?
.
hk_macao_pass
?
.
number
)
let
item11
=
YHItemModel
(
isNeed
:
true
,
title
:
"签发地"
,
isUserKeyBoard
:
false
,
prompts
:
"请输入"
,
message
:
mainModel
.
certificates
?
.
hk_macao_pass
?
.
issue_at
)
let
item12
=
YHItemModel
(
isNeed
:
true
,
title
:
"签发日期"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
mainModel
.
certificates
?
.
hk_macao_pass
?
.
issue_date_start_at
,
type
:
.
time
)
let
item13
=
YHItemModel
(
isNeed
:
true
,
title
:
"届满日期"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
mainModel
.
certificates
?
.
hk_macao_pass
?
.
issue_date_end_at
,
type
:
.
time
)
let
section1
=
YHSectionItemModel
(
title
:
"港澳通行证"
,
models
:
[
item10
,
item11
,
item12
,
item13
])
let
item4
=
YHItemModel
(
isNeed
:
false
,
title
:
"证件类别"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
nil
)
let
item5
=
YHItemModel
(
isNeed
:
false
,
title
:
"证件号码"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
nil
)
let
item6
=
YHItemModel
(
isNeed
:
false
,
title
:
"签发地"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
nil
)
let
item7
=
YHItemModel
(
isNeed
:
false
,
title
:
"签发日期"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
nil
)
let
item8
=
YHItemModel
(
isNeed
:
false
,
title
:
"届满日期"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
nil
)
let
item4
=
YHItemModel
(
isNeed
:
false
,
title
:
"证件类别"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
mainModel
.
certificates
?
.
passport
?
.
passport_type
,
type
:
.
id
)
let
item5
=
YHItemModel
(
isNeed
:
false
,
title
:
"证件号码"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
mainModel
.
certificates
?
.
passport
?
.
number
)
let
item6
=
YHItemModel
(
isNeed
:
false
,
title
:
"签发地"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
mainModel
.
certificates
?
.
passport
?
.
issue_at
)
let
item7
=
YHItemModel
(
isNeed
:
false
,
title
:
"签发日期"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
mainModel
.
certificates
?
.
passport
?
.
issue_date_start_at
,
type
:
.
time
)
let
item8
=
YHItemModel
(
isNeed
:
false
,
title
:
"届满日期"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
mainModel
.
certificates
?
.
passport
?
.
issue_date_end_at
,
type
:
.
time
)
let
section2
=
YHSectionItemModel
(
title
:
"护照及其他旅行证件(选填)"
,
models
:
[
item4
,
item5
,
item6
,
item7
,
item8
])
return
[
section
,
section1
,
section2
]
}
func
getDetailDataSource
()
->
[
YHSectionItemModel
]
{
let
item
=
YHItemModel
(
isNeed
:
true
,
title
:
"主申请人姓名"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
nil
)
let
item1
=
YHItemModel
(
isNeed
:
false
,
title
:
"曾用名"
,
isUserKeyBoard
:
true
,
prompts
:
"请与户口本一致,若无则不填"
,
message
:
nil
)
let
item2
=
YHItemModel
(
isNeed
:
false
,
title
:
"婚前姓氏"
,
isUserKeyBoard
:
true
,
prompts
:
"如有则填写,仅支持输入字母"
,
message
:
nil
)
let
item3
=
YHItemModel
(
isNeed
:
true
,
title
:
"出生日期"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
nil
)
let
item
=
YHItemModel
(
isNeed
:
true
,
title
:
"主申请人姓名"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
mainModel
.
username
)
let
item1
=
YHItemModel
(
isNeed
:
false
,
title
:
"曾用名"
,
isUserKeyBoard
:
true
,
prompts
:
"请与户口本一致,若无则不填"
,
message
:
mainModel
.
used_name
)
let
item2
=
YHItemModel
(
isNeed
:
false
,
title
:
"婚前姓氏"
,
isUserKeyBoard
:
true
,
prompts
:
"如有则填写,仅支持输入字母"
,
message
:
mainModel
.
surname
)
let
item3
=
YHItemModel
(
isNeed
:
true
,
title
:
"出生日期"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
mainModel
.
birthday
)
let
item4
=
YHItemModel
(
isNeed
:
true
,
title
:
"出生国家/地区"
,
isUserKeyBoard
:
false
,
prompts
:
nil
,
message
:
nil
,
leftButtonString
:
"国内"
,
rightButtonString
:
"国外"
)
let
item5
=
YHItemModel
(
isNeed
:
true
,
title
:
"出生城市"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
nil
)
let
item6
=
YHItemModel
(
isNeed
:
true
,
title
:
"性别"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
nil
)
let
item7
=
YHItemModel
(
isNeed
:
true
,
title
:
"婚姻状况"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
nil
)
var
string
=
""
if
let
array
=
mainModel
.
birth_place
?
.
area
{
for
item
in
array
{
string
=
string
+
item
}
}
let
item5
=
YHItemModel
(
isNeed
:
true
,
title
:
"出生城市"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
string
,
type
:
.
address
)
let
item6
=
YHItemModel
(
isNeed
:
true
,
title
:
"性别"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
mainModel
.
sex
,
type
:
.
sex
)
let
item7
=
YHItemModel
(
isNeed
:
true
,
title
:
"婚姻状况"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
mainModel
.
married
,
type
:
.
marry
)
let
section
=
YHSectionItemModel
(
title
:
"主申请人信息"
,
models
:
[
item
,
item1
,
item2
,
item3
,
item4
,
item5
,
item6
,
item7
])
let
item8
=
YHItemModel
(
isNeed
:
true
,
title
:
"手机号码"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
nil
)
let
item9
=
YHItemModel
(
isNeed
:
true
,
title
:
"电子邮箱"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
n
il
)
let
item8
=
YHItemModel
(
isNeed
:
true
,
title
:
"手机号码"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
mainModel
.
mobile
)
let
item9
=
YHItemModel
(
isNeed
:
true
,
title
:
"电子邮箱"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
mainModel
.
ema
il
)
let
section1
=
YHSectionItemModel
(
title
:
"联系方式"
,
models
:
[
item8
,
item9
])
let
item10
=
YHItemModel
(
isNeed
:
true
,
title
:
"是否办理过"
,
isUserKeyBoard
:
false
,
prompts
:
nil
,
message
:
nil
,
leftButtonString
:
"是"
,
rightButtonString
:
"否"
)
let
item10
=
YHItemModel
(
isNeed
:
true
,
title
:
"是否办理过"
,
isUserKeyBoard
:
false
,
prompts
:
nil
,
message
:
"
\(
mainModel
.
has_hk_id
??
0
)
"
,
leftButtonString
:
"是"
,
rightButtonString
:
"否"
)
let
section2
=
YHSectionItemModel
(
title
:
"香港身份证"
,
models
:
[
item10
])
return
[
section
,
section1
,
section2
]
}
...
...
@@ -72,4 +92,27 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
let
section1
=
YHSectionItemModel
(
title
:
"中国身份证(选填)"
,
models
:
[
item
])
return
[
section
,
section1
]
}
func
requestMainInformation
(
_
orderID
:
String
,
callBackBlock
:
@escaping
(
_
success
:
YHMainInformationModel
?,
_
error
:
YHErrorModel
?)
->
())
{
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
"frontend/order-information/get_information?order_id=
\(
orderID
)
"
let
_
=
YHNetRequest
.
getRequest
(
url
:
strUrl
)
{
[
weak
self
]
json
,
code
in
//1. json字符串 转 对象
guard
let
self
=
self
else
{
return
}
guard
let
model
=
NetBaseModel
.
deserialize
(
dict
:
json
)
else
{
let
error
:
YHErrorModel
=
YHErrorModel
(
errorCode
:
YHErrorCode
.
dictParseError
.
rawValue
,
errorMsg
:
YHErrorCode
.
dictParseError
.
description
())
callBackBlock
(
nil
,
error
)
return
}
let
dic
=
model
.
data
?
.
peel
guard
let
result
=
YHMainInformationModel
.
deserialize
(
dict
:
dic
as?
[
AnyHashable
:
Any
])
else
{
callBackBlock
(
nil
,
nil
)
return
}
self
.
mainModel
=
result
callBackBlock
(
result
,
nil
)
}
failBlock
:
{
err
in
callBackBlock
(
nil
,
err
)
}
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/MainApplicantInformation/VM/YHSelectCountryViewModel.swift
0 → 100644
View file @
9e6e938e
//
// YHSelectCountryViewModel.swift
// galaxy
//
// Created by EDY on 2024/1/31.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
class
YHSelectCountryViewModel
:
NSObject
{
override
init
()
{
super
.
init
()
}
func
requestCountry
(
_
key
:
String
,
callBackBlock
:
@escaping
(
_
success
:
[
YHCountryMessage
?]?,
_
error
:
YHErrorModel
?)
->
())
{
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
"frontend/country?keyword=
\(
key
)
"
YHNetRequest
.
getRequest
(
url
:
strUrl
)
{
[
weak
self
]
json
,
code
in
//1. json字符串 转 对象
guard
let
self
=
self
else
{
return
}
guard
let
model
=
NetBaseModel
.
deserialize
(
dict
:
json
)
else
{
let
error
:
YHErrorModel
=
YHErrorModel
(
errorCode
:
YHErrorCode
.
dictParseError
.
rawValue
,
errorMsg
:
YHErrorCode
.
dictParseError
.
description
())
callBackBlock
([],
error
)
return
}
//// printLog("model 是 ==> \(model)")
let
dic
=
model
.
data
?
.
peel
guard
let
resultArray
=
[
YHCountryMessage
]
.
deserialize
(
array
:
dic
as?
[
Any
])
else
{
callBackBlock
([],
nil
)
return
}
callBackBlock
(
resultArray
,
nil
)
}
failBlock
:
{
err
in
callBackBlock
([],
err
)
}
}
}
galaxy/galaxy/Classes/Tools/NetWork/YHNetRequest.swift
View file @
9e6e938e
...
...
@@ -93,7 +93,7 @@ class YHNetRequest: NSObject {
print
(
"sign =
\(
sign
)
"
)
requestHeader
.
add
(
name
:
"sign"
,
value
:
sign
)
requestHeader
.
add
(
name
:
"token"
,
value
:
"eyJpdiI6I
khLdkJSZlFKeSswZkJMSEM3c3BieVE9PSIsInZhbHVlIjoiQ0h3eXZPeUZUVnZ5VUtDcmRSRDNFbU1IRURRMnowVTFRSmFOWTZlTTlVYUM1eWZRYXJpOE1HXC9xMlM1NytmVHV2dVQzdzRqdEwwU29VTTJSYlNYcWl3UDRjXC9GVHNLSEM5WU1Eb3Y4ZERNd0Z6QmF1RzdUT01EakZoXC80bjJHUXgycUN6U08xZFdnQ3pRT3IyQUxobDZFZTJzMDFOTXZvdmFtOEJBaHV2Z1NTN0Vldk9Yd1d5TE52U2ZUTzJaSEhGRkJBOEpaMnd0REdycHJOU3p2M1NncEtnY2ZMeG5WT01OekdPV0FNb0hvdjErWXNldHlYYjFaelRyRSthTUhyQWtCSlNTdVNBV1lwbVpnM3FpSUxKeWg0QTgrOTZxWEVNcWk5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WJEMzB3ekVFSGFnSXM1b29wWjN3K0Ercmlxd004RzZZMmV0ZktrVHNabFlRMjNrN0p3MTk0TWdpUE16aW5xM0NNamJvNGlrK1Y3bEtXZnJRN0lBZ1ZTdXNzYllEU0p6ZFpYeWxQcEZWcDFqb1h3UEQ0RGdMNVhmUFY0dWI1T2hYSzdWUlVQZWVEbHBrREJNbm5cL3FIM2NmVUp6U1piWXd6WlZSMEFON1Jyc2pyYklXdjMxSVwvQ3QyZlZRWUJIdnNHdkVFcDQwU0s4OTlmWTllYlFDaDBqTTM5emtGdWJ4KytXcUk2NVB4cmlKak5hK0lETUV4ODZvdzRNVXkyZ1o5K05IWk4zbnF4OWpBV0VPSXBFYzYwRm9XdGthWlNzdzI0ajIyaytlUmxTZ1FudUthTGQwWk9McGZvMkdEXC9RbzdiODRGWVZVS01XZ0EyQjlFVW56Mmp3ZkV1RHl5WXlHbzdJRFwvNkFROVQ3K2dscHdVMVlpNHRcL1lmM2Fjek0yNFwvREE9PSIsIm1hYyI6IjBiNjA0MWQ1YWY2OWQwMzdiNmVkZTE3ZmE5MWRjYzI2Yjk4YTNhNTJkZGRiMjMzYTAwZGM2NDkxOTU0MzAzZmY
ifQ=="
)
headers
=
requestHeader
}
...
...
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