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
16a454d6
Commit
16a454d6
authored
Feb 27, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS
into develop
parents
de00e5cd
cd55137a
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
238 additions
and
88 deletions
+238
-88
YHInformationPerfectListVC.swift
...telligentService(服务中心)/C/YHInformationPerfectListVC.swift
+1
-0
YHServiceCenterMainViewController.swift
...ntService(服务中心)/C/YHServiceCenterMainViewController.swift
+46
-0
YHMainApplicantInformationViewController.swift
...(主申请人信息)/C/YHMainApplicantInformationViewController.swift
+2
-1
YHMainInformationModel.swift
...plicantInformation(主申请人信息)/M/YHMainInformationModel.swift
+39
-39
YHImagePickerView.swift
...ainApplicantInformation(主申请人信息)/V/YHImagePickerView.swift
+69
-29
YHMainInformationCardTableViewCell.swift
...mation(主申请人信息)/V/YHMainInformationCardTableViewCell.swift
+1
-1
YHMainApplicantInformationViewModel.swift
...tion(主申请人信息)/VM/YHMainApplicantInformationViewModel.swift
+15
-11
YHSelectCountryViewModel.swift
...cantInformation(主申请人信息)/VM/YHSelectCountryViewModel.swift
+2
-1
YHServiceCenterMainViewModel.swift
...ligentService(服务中心)/VM/YHServiceCenterMainViewModel.swift
+12
-1
YHLoginViewModel.swift
...alaxy/Classes/Modules/Login(登录)/VM/YHLoginViewModel.swift
+5
-3
YHMyViewController.swift
...alaxy/Classes/Modules/Mine(我的)/C/YHMyViewController.swift
+1
-0
YHAllApiName.swift
galaxy/galaxy/Classes/Tools/NetWork/YHAllApiName.swift
+13
-2
YHNetRequest.swift
galaxy/galaxy/Classes/Tools/NetWork/YHNetRequest.swift
+32
-0
No files found.
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/C/YHInformationPerfectListVC.swift
View file @
16a454d6
...
...
@@ -325,6 +325,7 @@ extension YHInformationPerfectListVC : UITableViewDelegate,UITableViewDataSource
if
indexPath
.
row
==
0
{
//主申请人信息
let
vc
=
YHMainApplicantInformationViewController
()
vc
.
orderId
=
orderId
??
0
navigationController
?
.
pushViewController
(
vc
)
}
else
if
indexPath
.
row
==
1
{
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/C/YHServiceCenterMainViewController.swift
View file @
16a454d6
...
...
@@ -34,6 +34,12 @@ class YHServiceCenterMainViewController: YHBaseViewController {
return
view
}()
private
func
loginOp
()
{
let
vc
=
UINavigationController
(
rootVC
:
YHPhoneLoginViewController
())
vc
.
modalPresentationStyle
=
.
custom
self
.
navigationController
?
.
present
(
vc
,
animated
:
true
)
}
var
homeTableView
:
UITableView
=
{
let
tableView
=
UITableView
(
frame
:
.
zero
,
style
:
.
grouped
)
...
...
@@ -55,12 +61,25 @@ class YHServiceCenterMainViewController: YHBaseViewController {
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
super
.
viewWillAppear
(
animated
)
if
YHLoginManager
.
shared
.
isLogin
()
==
false
{
loginTipsView
.
isHidden
=
false
noDataView
.
isHidden
=
true
homeTableView
.
isHidden
=
true
}
else
{
loginTipsView
.
isHidden
=
true
}
loadData
()
}
}
extension
YHServiceCenterMainViewController
{
func
loadData
()
{
if
YHLoginManager
.
shared
.
isLogin
()
==
false
{
return
}
self
.
serviceCenterMainReqVM
.
getContactList
{
success
,
error
in
if
success
==
true
{
...
...
@@ -75,6 +94,7 @@ extension YHServiceCenterMainViewController {
}
else
{
self
.
homeTableView
.
isHidden
=
false
self
.
noDataView
.
isHidden
=
true
self
.
loginTipsView
.
isHidden
=
true
}
self
.
homeTableView
.
reloadData
()
}
...
...
@@ -84,6 +104,10 @@ extension YHServiceCenterMainViewController {
gk_navTitle
=
"服务中心"
gk_navBarAlpha
=
1.0
loginTipsView
.
clickLoginBtnCallBackBlock
=
{
self
.
loginOp
()
}
view
.
addSubview
(
topBkg
)
topBkg
.
snp
.
makeConstraints
{
make
in
make
.
top
.
left
.
right
.
equalToSuperview
()
...
...
@@ -116,6 +140,13 @@ extension YHServiceCenterMainViewController {
self
.
homeTableView
.
isHidden
=
true
self
.
noDataView
.
isHidden
=
false
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
loginSuccess
)
,
name
:
YhConstant
.
YhNotification
.
didLoginSuccessNotifiction
,
object
:
nil
)
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
logoutSuccess
)
,
name
:
YhConstant
.
YhNotification
.
didLogoutSuccessNotifiction
,
object
:
nil
)
}
}
...
...
@@ -170,3 +201,18 @@ extension YHServiceCenterMainViewController : UITableViewDelegate,UITableViewDat
self
.
navigationController
?
.
pushViewController
(
vc
)
}
}
extension
YHServiceCenterMainViewController
{
@objc
func
loginSuccess
()
{
printLog
(
"登录成功,进行相应的 UI刷新操作"
)
loadData
()
}
@objc
func
logoutSuccess
()
{
loginTipsView
.
isHidden
=
false
noDataView
.
isHidden
=
true
self
.
homeTableView
.
isHidden
=
true
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/MainApplicantInformation(主申请人信息)/C/YHMainApplicantInformationViewController.swift
View file @
16a454d6
...
...
@@ -16,6 +16,7 @@ class YHMainApplicantInformationViewController: YHBaseViewController {
var
viewModel
:
YHMainApplicantInformationViewModel
!
var
dataSource
:
[
YHSectionItemModel
]?
var
isShowPrompt
:
Bool
=
false
var
orderId
:
Int
=
0
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
...
...
@@ -27,7 +28,7 @@ class YHMainApplicantInformationViewController: YHBaseViewController {
}
func
getData
()
{
viewModel
.
requestMainInformation
(
"
133969
"
)
{[
weak
self
]
success
,
error
in
viewModel
.
requestMainInformation
(
"
\(
orderId
)
"
)
{[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
self
.
stepView
.
currentIndex
=
self
.
viewModel
.
mainModel
.
step
??
0
self
.
updateDataSource
()
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/MainApplicantInformation(主申请人信息)/M/YHMainInformationModel.swift
View file @
16a454d6
...
...
@@ -10,55 +10,55 @@ 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
?
var
id
:
Int
?
=
0
var
order_id
:
String
?
=
""
var
nationality
:
String
?
=
""
var
is_handled
:
Int
?
=
0
var
username
:
String
?
=
""
var
used_name
:
String
?
=
""
var
birthday
:
String
?
=
""
var
age
:
String
?
=
""
var
birth_place_aboard
:
Int
?
=
0
var
sex
:
Int
?
=
0
var
married
:
Int
?
=
0
var
mobile
:
String
?
=
""
var
email
:
String
?
=
""
var
address_aboard
:
Int
?
=
0
var
has_hk_id
:
Int
?
=
0
var
hk_id_number
:
String
?
=
""
var
step
:
Int
?
=
0
var
surname
:
String
?
=
""
var
is_live_oversea_year
:
Int
?
=
0
var
username_pinyin
:
YHUserNameModel
?
=
YHUserNameModel
()
var
birth_place
:
YHAddressModel
?
=
YHAddressModel
()
var
address
:
YHAddressModel
?
=
YHAddressModel
()
var
certificates
:
YHCertificatesModels
?
=
YHCertificatesModels
()
}
struct
YHUserNameModel
:
SmartCodable
{
var
family_name
:
String
?
var
given_name
:
String
?
var
family_name
:
String
?
=
""
var
given_name
:
String
?
=
""
}
struct
YHAddressModel
:
SmartCodable
{
var
area
:
[
String
]?
var
country
:
String
?
var
details
:
String
?
var
foreign
:
String
?
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
?
var
hk_macao_pass
:
YHCertificatesModel
?
=
YHCertificatesModel
()
var
passport
:
YHCertificatesModel
?
=
YHCertificatesModel
()
var
cn_identity_card
:
YHCertificatesModel
?
=
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
?
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 @
16a454d6
...
...
@@ -206,47 +206,87 @@ extension YHImagePickerView: UIGestureRecognizerDelegate {
extension
YHImagePickerView
:
UINavigationControllerDelegate
,
UIImagePickerControllerDelegate
{
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()
// }
uploadImage
(
image
:
image
)
self
.
dismiss
()
}
else
{
printLog
(
"pick image wrong"
)
}
// 收回图库选择界面
picker
.
dismiss
(
animated
:
true
,
completion
:
nil
)
}
func
imagePickerControllerDidCancel
(
_
picker
:
UIImagePickerController
)
{
}
//原生上传
func
uploadImage
(
imageURL
:
URL
)
{
let
url
=
URL
(
string
:
"https://test-comserver.galaxy-immi.com/oss/upload/storage"
)
!
// 设置上传接口地址
var
request
=
URLRequest
(
url
:
url
)
request
.
httpMethod
=
"POST"
do
{
let
imageData
=
try
Data
(
contentsOf
:
imageURL
)
// 读取要上传的图片数据
//将选择的图片保存到Document目录下
let
fileManager
=
FileManager
.
default
let
rootPath
=
NSSearchPathForDirectoriesInDomains
(
.
documentDirectory
,
.
userDomainMask
,
true
)[
0
]
as
String
let
filePath
=
"
\(
rootPath
)
/pickedimage.jpg"
let
imageData
=
image
.
jpegData
(
compressionQuality
:
1.0
)
fileManager
.
createFile
(
atPath
:
filePath
,
contents
:
imageData
,
attributes
:
nil
)
//上传图片
if
(
fileManager
.
fileExists
(
atPath
:
filePath
)){
//取得NSURL
let
imageURL
=
URL
(
fileURLWithPath
:
filePath
)
let
boundary
=
UUID
()
.
uuidString
// 生成随机边界字符串
request
.
setValue
(
"multipart/form-data; boundary=
\(
boundary
)
"
,
forHTTPHeaderField
:
"Content-Type"
)
request
.
addValue
(
"4001001"
,
forHTTPHeaderField
:
"businessCode"
)
//使用Alamofire上传
var
body
=
""
body
+=
"--
\(
boundary
)\r\n
"
body
+=
"Content-Disposition: form-data; name=
\"
file
\"
; filename=
\"
image.jpg
\"\r\n
"
// 根据需求修改文件名称
body
+=
"Content-Type: image/jpeg
\r\n\r\n
"
// 根据实际情况指定正确的MIME类型
if
let
data
=
imageData
.
base64EncodedString
(
options
:
.
lineLength76Characters
)
.
addingPercentEncoding
(
withAllowedCharacters
:
CharacterSet
.
alphanumerics
)
{
let
encodedBody
=
body
+
"
\r\n
"
+
data
+
"
\r\n
"
+
"--"
+
boundary
+
"--"
guard
let
postData
=
encodedBody
.
data
(
using
:
String
.
Encoding
.
utf8
)
else
{
return
}
AF
.
upload
(
imageURL
,
to
:
"https://test-comserver.galaxy-immi.com/oss/upload/storage"
)
.
responseString
{
response
in
switch
response
.
result
{
case
.
success
(
let
value
):
print
(
"Success:
\(
value
)
"
)
case
.
failure
(
let
error
):
break
request
.
httpBody
=
postData
let
task
=
URLSession
.
shared
.
dataTask
(
with
:
request
)
{
(
data
,
response
,
error
)
in
if
let
error
=
error
{
print
(
"Error:
\(
error
)
"
)
}
else
if
let
httpResponse
=
response
as?
HTTPURLResponse
{
switch
httpResponse
.
statusCode
{
case
200
..<
300
:
if
let
data
=
data
{
let
string
=
String
(
data
:
data
,
encoding
:
.
utf8
)
}
print
(
"Upload successful."
)
default
:
print
(
"Failed to upload the image with status code:
\(
httpResponse
.
statusCode
)
"
)
}
}
}
else
{
printLog
(
"pick image wrong"
)
}
// 收回图库选择界面
picker
.
dismiss
(
animated
:
true
,
completion
:
nil
)
task
.
resume
()
}
}
catch
{
print
(
"Error reading image file:
\(
error
)
"
)
}
}
func
imagePickerControllerDidCancel
(
_
picker
:
UIImagePickerController
)
{
// Alamofire上传
func
uploadImage
(
image
:
UIImage
)
{
// 获取图片的二进制数据
guard
let
imageData
=
image
.
jpegData
(
compressionQuality
:
1
)
else
{
return
}
let
boundary
=
UUID
()
.
uuidString
let
headers
:
HTTPHeaders
=
[
"Content-type"
:
"multipart/form-data; boundary=
\(
boundary
)
"
,
"businessCode"
:
"4001001"
]
// 创建MultipartFormData对象
var
multipartFormData
=
MultipartFormData
()
}
// 将图片添加到multipartFormData中
multipartFormData
.
append
(
imageData
,
withName
:
"file"
,
fileName
:
"image.jpg"
,
mimeType
:
"image/jpeg"
)
// 发送POST请求
let
uploadRequest
=
AF
.
upload
(
multipartFormData
:
multipartFormData
,
to
:
"https://test-comserver.galaxy-immi.com/oss/upload/storage"
,
headers
:
headers
)
uploadRequest
.
responseString
(
completionHandler
:
{
string
in
printLog
(
"
\n
网络请求已返回 string=
\(
string
)
"
)
})
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/MainApplicantInformation(主申请人信息)/V/YHMainInformationCardTableViewCell.swift
View file @
16a454d6
...
...
@@ -133,7 +133,7 @@ class YHMainInformationCardTableViewCell: UITableViewCell {
frontLabel
=
{
let
label
=
UILabel
()
label
.
font
=
UIFont
.
PFSC_R
(
ofSize
:
12
)
label
.
textColor
=
UIColor
.
contentBkg
Color
label
.
textColor
=
UIColor
.
subText
Color
label
.
textAlignment
=
.
center
return
label
}()
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/MainApplicantInformation(主申请人信息)/VM/YHMainApplicantInformationViewModel.swift
View file @
16a454d6
...
...
@@ -7,6 +7,7 @@
//
import
UIKit
import
SmartCodable
enum
YHSaveType
:
Int
{
case
save
=
0
...
...
@@ -93,8 +94,8 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
}
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
item6
=
YHItemModel
(
id
:
.
id27
,
isNeed
:
true
,
title
:
"性别"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
"
\(
mainModel
.
sex
??
0
)
"
,
type
:
.
sex
)
let
item7
=
YHItemModel
(
id
:
.
id28
,
isNeed
:
true
,
title
:
"婚姻状况"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
"
\(
mainModel
.
married
??
0
)
"
,
type
:
.
marry
,
isShowPrompts
:
isShowPrompt
)
var
item555
=
item5
if
mainModel
.
birth_place_aboard
==
1
{
item555
=
item55
...
...
@@ -185,9 +186,9 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
case
.
id26
:
mainModel
.
birth_place
?
.
area
=
item
.
value
case
.
id27
:
mainModel
.
sex
=
item
.
value
?
.
first
mainModel
.
sex
=
item
.
value
?
.
first
?
.
int
case
.
id28
:
mainModel
.
married
=
item
.
value
?
.
first
mainModel
.
married
=
item
.
value
?
.
first
?
.
int
case
.
id29
:
mainModel
.
mobile
=
item
.
message
case
.
id30
:
...
...
@@ -207,8 +208,11 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
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
// /infoflow/order-information/get_information?order_id=9402
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
OrderInformation
.
getInformation
// let strUrl = "http://192.168.25.48:18088/" + YHAllApiName.OrderInformation.getInformation
let
params
:
[
String
:
Any
]
=
[
"order_id"
:
orderID
]
let
_
=
YHNetRequest
.
getRequest
(
url
:
strUrl
,
params
:
params
)
{
[
weak
self
]
json
,
code
in
//1. json字符串 转 对象
guard
let
self
=
self
else
{
return
}
guard
let
model
=
NetBaseModel
.
deserialize
(
dict
:
json
)
else
{
...
...
@@ -293,7 +297,7 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
"hk_macao_pass"
:
hkID
,
"passport"
:
passport
]
]
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
"frontend/order-information/update_information"
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
)
...
...
@@ -354,14 +358,14 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
let
birth_place_aboard
=
mainModel
.
birth_place_aboard
??
0
let
birth_place_area
=
mainModel
.
birth_place
?
.
area
??
[]
let
birth_place_foreign
=
mainModel
.
birth_place
?
.
foreign
??
""
let
sex
=
mainModel
.
sex
??
""
let
married
=
mainModel
.
married
??
""
let
sex
=
mainModel
.
sex
??
0
let
married
=
mainModel
.
married
??
0
let
mobile
=
mainModel
.
mobile
??
""
let
email
=
mainModel
.
email
??
""
let
has_hk_id
=
mainModel
.
has_hk_id
??
0
let
hk_id_numbe
=
mainModel
.
hk_id_number
??
""
if
birth_place_aboard
==
1
{
if
username
.
count
!=
0
&&
birthday
.
count
!=
0
&&
birth_place_foreign
.
count
!=
0
&&
sex
.
count
!=
0
&&
married
.
count
!=
0
&&
mobile
.
count
!=
0
&&
email
.
count
!=
0
{
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
{
return
true
...
...
@@ -375,7 +379,7 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
return
false
}
}
else
{
if
username
.
count
!=
0
&&
birthday
.
count
!=
0
&&
birth_place_area
.
count
!=
0
&&
sex
.
count
!=
0
&&
married
.
count
!=
0
&&
mobile
.
count
!=
0
&&
email
.
count
!=
0
{
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
{
return
true
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/MainApplicantInformation(主申请人信息)/VM/YHSelectCountryViewModel.swift
View file @
16a454d6
...
...
@@ -14,7 +14,8 @@ class YHSelectCountryViewModel: NSObject {
}
func
requestCountry
(
_
key
:
String
,
callBackBlock
:
@escaping
(
_
success
:
[
YHCountryMessage
?]?,
_
error
:
YHErrorModel
?)
->
())
{
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
"frontend/country?keyword=
\(
key
)
"
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
OrderInformation
.
countryInformation
+
"?keyword =
\(
key
)
"
YHNetRequest
.
getRequest
(
url
:
strUrl
)
{
[
weak
self
]
json
,
code
in
//1. json字符串 转 对象
guard
let
self
=
self
else
{
return
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/VM/YHServiceCenterMainViewModel.swift
View file @
16a454d6
...
...
@@ -186,11 +186,14 @@ extension YHServiceCenterMainViewModel {
callBackBlock
(
false
,
nil
)
return
}
if
model
.
code
==
200
{
informationFillStepModel
=
resultModel
myInfoFillStep
=
resultModel
.
step
let
arr
=
[
1
,
2
,
3
,
4
,
5
,
6
]
let
target
=
myInfoFillStep
//for test hjl 待填写的项目
let
target
=
myInfoFillStep
for
item
in
arr
{
let
model
=
YHInformationPerfectModel
()
model
.
type
=
item
...
...
@@ -215,6 +218,14 @@ extension YHServiceCenterMainViewModel {
}
callBackBlock
(
true
,
nil
)
}
else
{
let
error
:
YHErrorModel
=
YHErrorModel
(
errorCode
:
Int32
(
model
.
code
),
errorMsg
:
model
.
msg
)
self
.
arrInfoFillStep
=
[]
informationFillStepModel
=
nil
}
}
failBlock
:
{
err
in
self
.
arrInfoFillStep
=
[]
self
.
informationFillStepModel
=
nil
...
...
galaxy/galaxy/Classes/Modules/Login(登录)/VM/YHLoginViewModel.swift
View file @
16a454d6
...
...
@@ -49,10 +49,11 @@ extension YHLoginViewModel {
func
login
(
phone
:
String
,
code
:
String
,
callBackBlock
:
@escaping
(
_
success
:
Bool
,
_
error
:
YHErrorModel
?)
->
())
{
let
params
:
[
String
:
Any
]
=
[
"mobile"
:
phone
,
"sms_code"
:
code
,
"channel"
:
"app"
,
"client"
:
"super_app"
]
let
strUrl
=
"http://test.api.diymanager.galaxy-immi.com/"
+
"auth/login"
// let strUrl = "http://192.168.34.106:18088/" + "auth/login"
let
strUrl
=
"http://test.api.diymanager.galaxy-immi.com/"
+
"infoflow/auth/login"
// http:test.api.diymanager.galaxy-immi.com/infoflow/auth/login
// let strUrl = "http://192.168.34.106:18088/" + "infoflow/auth/login"
let
_
=
YHNetRequest
.
postRequest
(
url
:
strUrl
,
params
:
params
)
{[
weak
self
]
json
,
code
in
//1. json字符串 转 对象
guard
let
self
=
self
else
{
return
}
...
...
@@ -62,6 +63,7 @@ extension YHLoginViewModel {
callBackBlock
(
false
,
error
)
return
}
printLog
(
model
)
let
dic
=
model
.
data
?
.
peel
guard
let
resultModel
=
YHUserModel
.
deserialize
(
dict
:
dic
as?
[
AnyHashable
:
Any
])
else
{
let
error
:
YHErrorModel
=
YHErrorModel
(
errorCode
:
-
1
,
errorMsg
:
"数据解析不成功"
)
...
...
galaxy/galaxy/Classes/Modules/Mine(我的)/C/YHMyViewController.swift
View file @
16a454d6
...
...
@@ -155,6 +155,7 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
}
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
if
(
indexPath
.
row
>=
items
.
count
)
{
return
}
if
!
checkLogin
()
{
...
...
galaxy/galaxy/Classes/Tools/NetWork/YHAllApiName.swift
View file @
16a454d6
...
...
@@ -37,9 +37,11 @@ class YHAllApiName {
static
let
scoreDetailApi
=
"frontend/order-assessment/score_detail"
//获取其他资料填写信息
static
let
otherInfoFillApi
=
"frontend/order/getOrderOtherInformation"
// static let otherInfoFillApi = "frontend/order/getOrderOtherInformation"
static
let
otherInfoFillApi
=
"infoflow/order/getOrderOtherInformation"
//保存其他资料信息
static
let
updateOtherInfoApi
=
"frontend/order/updateOrderOtherInformation"
// static let updateOtherInfoApi = "frontend/order/updateOrderOtherInformation"
static
let
updateOtherInfoApi
=
"infoflow/order/updateOrderOtherInformation"
}
...
...
@@ -103,4 +105,13 @@ class YHAllApiName {
// static let updateBasicInfoApi = "frontend/basics/update_basics"
static
let
updateBasicInfoApi
=
"infoflow/basics/update_basics"
}
struct
OrderInformation
{
//主申请人获取信息
static
let
getInformation
=
"infoflow/order-information/get_information"
// 主申请人信息更新
static
let
updateInformation
=
"infoflow/order-information/update_information"
// 主申请人国家信息
static
let
countryInformation
=
"infoflow/country"
}
}
galaxy/galaxy/Classes/Tools/NetWork/YHNetRequest.swift
View file @
16a454d6
...
...
@@ -171,6 +171,32 @@ class YHNetRequest: NSObject {
return
httpRequest
}
///开始请求
func
uploadRequest
(
_
headers
:
HTTPHeaders
,
_
image
:
UIImage
)
->
Request
?
{
guard
YHNetworkStatusManager
.
shared
.
isNetWorkOK
==
true
else
{
YHHUD
.
flash
(
message
:
"网络异常"
)
return
httpRequest
}
guard
let
imageData
=
image
.
jpegData
(
compressionQuality
:
1
)
else
{
return
httpRequest
}
var
multipartFormData
=
MultipartFormData
()
// 将图片添加到multipartFormData中
multipartFormData
.
append
(
imageData
,
withName
:
"file"
,
fileName
:
"image.jpg"
,
mimeType
:
"image/jpeg"
)
// 发送POST请求
let
uploadRequest
=
AF
.
upload
(
multipartFormData
:
multipartFormData
,
to
:
"https://test-comserver.galaxy-immi.com/oss/upload/storage"
,
headers
:
headers
)
uploadRequest
.
responseString
(
completionHandler
:
{
string
in
#if DEBUG
printLog
(
"
\n
网络请求已返回 string=
\(
string
)
"
)
#endif
self
.
completeHandle
(
string
:
string
)
})
return
uploadRequest
}
/// 请求response完成处理
func
completeHandle
(
string
:
AFDataResponse
<
String
>
)
{
let
responseResult
=
string
.
result
...
...
@@ -206,6 +232,7 @@ class YHNetRequest: NSObject {
let
dittt
=
self
.
handleJsonObjectNullValue
(
serverDict
)
suclock
(
dittt
as?
[
String
:
Any
]
??
[:],
statusCode
)
// suclock(serverDict, statusCode)
}
else
{
guard
let
errorBlock
=
self
.
failure
else
{
return
}
...
...
@@ -260,4 +287,9 @@ extension YHNetRequest {
printLog
(
"
\n
发起请求的URL是===> url =
\(
url
)
"
)
return
YHNetRequest
()
.
url
(
url
)
.
requestType
(
.
post
)
.
params
(
params
)
.
success
(
successBlock
)
.
failed
(
failBlock
)
.
startRequest
()
}
class
func
uplaodRequest
(
url
:
String
,
headers
:
HTTPHeaders
,
image
:
UIImage
,
successBlock
:
SuccessHandlerType
!
,
failBlock
:
FailureHandlerType
!
)
->
Request
?
{
printLog
(
"
\n
发起请求的URL是===> url =
\(
url
)
"
)
return
YHNetRequest
()
.
url
(
url
)
.
success
(
successBlock
)
.
failed
(
failBlock
)
.
uploadRequest
(
headers
,
image
)
}
}
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