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
667cc99d
Commit
667cc99d
authored
Oct 17, 2024
by
Alex朱枝文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
在港续签签证缴费预览文件增加转公链处理
parent
04770ac6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
21 deletions
+25
-21
YHBaseViewModel.swift
galaxy/galaxy/Classes/Base/C/YHBaseViewModel.swift
+12
-12
YHHKVisaRenewalPaymentVC.swift
...saRenewalPayment(续签在港缴费)/C/YHHKVisaRenewalPaymentVC.swift
+8
-7
YHVisaRenewalPayOccupyingSpaceCell.swift
...ayment(续签在港缴费)/V/YHVisaRenewalPayOccupyingSpaceCell.swift
+1
-1
YHResignDocumentDetailViewController.swift
...ment(续签文书管理)/C/YHResignDocumentDetailViewController.swift
+4
-1
No files found.
galaxy/galaxy/Classes/Base/C/YHBaseViewModel.swift
View file @
667cc99d
...
@@ -239,37 +239,37 @@ class YHBaseViewModel {
...
@@ -239,37 +239,37 @@ class YHBaseViewModel {
}
}
// 验证url是否可直接访问
// 验证url是否可直接访问
func
checkUrlIsDirectAccess
(
_
url
:
String
,
callback
:
((
Bool
)
->
())?
)
{
func
checkUrlIsDirectAccess
(
_
url
:
String
,
callback
:
@escaping
(
Bool
)
->
()
)
{
if
url
.
isEmpty
{
guard
!
url
.
isEmpty
,
let
urlToGo
=
URL
(
string
:
url
)
else
{
callback
?
(
true
)
callback
(
true
)
return
return
}
}
let
task
=
URLSession
.
shared
.
dataTask
(
with
:
URL
(
string
:
url
)
!
)
{
let
task
=
URLSession
.
shared
.
dataTask
(
with
:
urlToGo
)
{
(
data
,
response
,
error
)
in
(
data
,
response
,
error
)
in
if
error
!=
nil
{
if
error
!=
nil
{
// url 不可用
// url 不可用
callback
?
(
false
)
callback
(
false
)
return
return
}
}
guard
let
httpResponse
=
response
as?
HTTPURLResponse
else
{
guard
let
httpResponse
=
response
as?
HTTPURLResponse
else
{
// url 不可用
// url 不可用
callback
?
(
false
)
callback
(
false
)
return
return
}
}
if
httpResponse
.
statusCode
==
200
{
if
httpResponse
.
statusCode
==
200
{
// url可用
// url可用
callback
?
(
true
)
callback
(
true
)
}
else
{
}
else
{
// url 不可用
// url 不可用
callback
?
(
false
)
callback
(
false
)
}
}
}
}
task
.
resume
()
task
.
resume
()
}
}
// 传入的url无论是公链还是私链 最后返回一个可用链(私转公失败会返回空)
// 传入的url无论是公链还是私链 最后返回一个可用链(私转公失败会返回空)
func
getRealUsefulUrl
(
_
url
:
String
,
callback
:
((
String
)
->
())?
)
{
func
getRealUsefulUrl
(
_
url
:
String
,
callback
:
@escaping
(
String
)
->
()
)
{
// 判断url是否可以直接访问
// 判断url是否可以直接访问
self
.
checkUrlIsDirectAccess
(
url
)
{
self
.
checkUrlIsDirectAccess
(
url
)
{
isAccess
in
isAccess
in
...
@@ -277,7 +277,7 @@ class YHBaseViewModel {
...
@@ -277,7 +277,7 @@ class YHBaseViewModel {
if
isAccess
{
if
isAccess
{
// url能直接访问
// url能直接访问
DispatchQueue
.
main
.
async
{
DispatchQueue
.
main
.
async
{
callback
?
(
url
)
callback
(
url
)
}
}
return
return
}
}
...
@@ -286,12 +286,12 @@ class YHBaseViewModel {
...
@@ -286,12 +286,12 @@ class YHBaseViewModel {
self
.
getPublicImageUrl
(
url
)
{
success
,
error
in
self
.
getPublicImageUrl
(
url
)
{
success
,
error
in
if
let
successUrl
=
success
{
if
let
successUrl
=
success
{
DispatchQueue
.
main
.
async
{
DispatchQueue
.
main
.
async
{
callback
?
(
successUrl
)
callback
(
successUrl
)
}
}
}
else
{
}
else
{
// 私链转公链失败
// 私链转公链失败
DispatchQueue
.
main
.
async
{
DispatchQueue
.
main
.
async
{
callback
?
(
""
)
callback
(
""
)
}
}
}
}
}
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/Resign(续签)/HongKongVisaRenewalPayment(续签在港缴费)/C/YHHKVisaRenewalPaymentVC.swift
View file @
667cc99d
...
@@ -405,14 +405,15 @@ extension YHHKVisaRenewalPaymentVC {
...
@@ -405,14 +405,15 @@ extension YHHKVisaRenewalPaymentVC {
}
}
private
func
gotoPreview
(
_
urlString
:
String
)
{
private
func
gotoPreview
(
_
urlString
:
String
)
{
guard
let
url
=
URL
(
string
:
urlString
),
UIApplication
.
shared
.
canOpenURL
(
url
)
else
{
YHHUD
.
show
(
.
progress
(
message
:
"加载中..."
))
YHHUD
.
flash
(
message
:
"无法打开链接"
)
viewModel
.
getRealUsefulUrl
(
urlString
)
{
[
weak
self
]
resultUrl
in
return
YHHUD
.
hide
()
guard
let
self
=
self
,
let
url
=
URL
(
string
:
resultUrl
)
else
{
return
}
let
safariViewController
=
SFSafariViewController
(
url
:
url
)
safariViewController
.
dismissButtonStyle
=
.
close
safariViewController
.
modalPresentationStyle
=
.
fullScreen
self
.
present
(
safariViewController
,
animated
:
true
,
completion
:
nil
)
}
}
let
safariViewController
=
SFSafariViewController
(
url
:
url
)
safariViewController
.
dismissButtonStyle
=
.
close
safariViewController
.
modalPresentationStyle
=
.
fullScreen
present
(
safariViewController
,
animated
:
true
,
completion
:
nil
)
}
}
private
func
showTroubleshootingGuideVC
()
{
private
func
showTroubleshootingGuideVC
()
{
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/Resign(续签)/HongKongVisaRenewalPayment(续签在港缴费)/V/YHVisaRenewalPayOccupyingSpaceCell.swift
View file @
667cc99d
...
@@ -28,7 +28,7 @@ class YHVisaRenewalPayOccupyingSpaceCell: YHResignDocumentCell {
...
@@ -28,7 +28,7 @@ class YHVisaRenewalPayOccupyingSpaceCell: YHResignDocumentCell {
make
.
top
.
bottom
.
equalToSuperview
()
make
.
top
.
bottom
.
equalToSuperview
()
make
.
left
.
equalToSuperview
()
.
offset
(
16
)
make
.
left
.
equalToSuperview
()
.
offset
(
16
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
16
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
16
)
make
.
height
.
equalTo
(
height
)
make
.
height
.
equalTo
(
height
)
.
priority
(
.
high
)
}
}
}
}
}
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/Resign(续签)/ResignDocumentManagement(续签文书管理)/C/YHResignDocumentDetailViewController.swift
View file @
667cc99d
...
@@ -482,8 +482,11 @@ extension YHResignDocumentDetailViewController {
...
@@ -482,8 +482,11 @@ extension YHResignDocumentDetailViewController {
// 全部是私域链接,转公域处理
// 全部是私域链接,转公域处理
if
let
urlString
=
model
?
.
url
{
if
let
urlString
=
model
?
.
url
{
YHHUD
.
show
(
.
progress
(
message
:
"加载中..."
))
YHHUD
.
show
(
.
progress
(
message
:
"加载中..."
))
self
.
viewModel
.
getPublicImageUrl
(
urlString
)
{
success
,
error
in
self
.
viewModel
.
getPublicImageUrl
(
urlString
)
{
[
weak
self
]
success
,
error
in
YHHUD
.
hide
()
YHHUD
.
hide
()
guard
let
self
=
self
else
{
return
}
if
let
success
=
success
,
let
url
=
URL
(
string
:
success
)
{
if
let
success
=
success
,
let
url
=
URL
(
string
:
success
)
{
self
.
previewFile
(
url
)
self
.
previewFile
(
url
)
}
else
if
let
error
=
error
{
}
else
if
let
error
=
error
{
...
...
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