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
cf51837d
Commit
cf51837d
authored
Sep 26, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// H5处理
parent
c842c62e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
3 deletions
+19
-3
YHHomeBannerView.swift
.../galaxy/Classes/Modules/Home(首页)/V/YHHomeBannerView.swift
+5
-1
YHServiceBannerView.swift
...ules/IntelligentService(服务中心)/V/YHServiceBannerView.swift
+7
-2
String+Extension.swift
galaxy/galaxy/Classes/Tools/Extention/String+Extension.swift
+7
-0
No files found.
galaxy/galaxy/Classes/Modules/Home(首页)/V/YHHomeBannerView.swift
View file @
cf51837d
...
@@ -139,7 +139,11 @@ extension YHHomeBannerView: FSPagerViewDataSource, FSPagerViewDelegate {
...
@@ -139,7 +139,11 @@ extension YHHomeBannerView: FSPagerViewDataSource, FSPagerViewDelegate {
if
let
myToken
=
YHLoginManager
.
shared
.
userModel
?
.
token
{
if
let
myToken
=
YHLoginManager
.
shared
.
userModel
?
.
token
{
token
=
myToken
token
=
myToken
}
}
let
url
=
model
.
skip_url
+
"?param="
+
token
var
url
=
model
.
skip_url
+
"?param="
+
token
let
urlHasParam
=
String
.
hasQueryParameters
(
urlString
:
model
.
skip_url
)
if
urlHasParam
{
url
=
model
.
skip_url
+
"¶m="
+
token
}
printLog
(
"url:
\(
url
)
"
)
printLog
(
"url:
\(
url
)
"
)
let
vc
=
YHHomeWebViewController
()
let
vc
=
YHHomeWebViewController
()
vc
.
url
=
url
vc
.
url
=
url
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/V/YHServiceBannerView.swift
View file @
cf51837d
...
@@ -123,12 +123,17 @@ extension YHServiceBannerView: FSPagerViewDataSource, FSPagerViewDelegate {
...
@@ -123,12 +123,17 @@ extension YHServiceBannerView: FSPagerViewDataSource, FSPagerViewDelegate {
if
model
.
skip_url
.
isEmpty
==
false
{
if
model
.
skip_url
.
isEmpty
==
false
{
switch
model
.
skip_type
{
switch
model
.
skip_type
{
case
1
:
//跳转H5
case
1
:
//跳转H5
let
vc
=
YHHomeWebViewController
()
var
token
=
""
var
token
=
""
if
let
myToken
=
YHLoginManager
.
shared
.
userModel
?
.
token
{
if
let
myToken
=
YHLoginManager
.
shared
.
userModel
?
.
token
{
token
=
myToken
token
=
myToken
}
}
let
url
=
model
.
skip_url
+
"?param="
+
token
var
url
=
model
.
skip_url
+
"?param="
+
token
let
urlHasParam
=
String
.
hasQueryParameters
(
urlString
:
model
.
skip_url
)
if
urlHasParam
{
url
=
model
.
skip_url
+
"¶m="
+
token
}
printLog
(
"url:
\(
url
)
"
)
let
vc
=
YHHomeWebViewController
()
vc
.
url
=
url
vc
.
url
=
url
self
.
parentViewController
?
.
navigationController
?
.
pushViewController
(
vc
)
self
.
parentViewController
?
.
navigationController
?
.
pushViewController
(
vc
)
case
2
:
//跳转APP内Tab
case
2
:
//跳转APP内Tab
...
...
galaxy/galaxy/Classes/Tools/Extention/String+Extension.swift
View file @
cf51837d
...
@@ -19,6 +19,13 @@ func isEmptyString(_ string: String?) -> Bool {
...
@@ -19,6 +19,13 @@ func isEmptyString(_ string: String?) -> Bool {
extension
String
{
extension
String
{
static
func
hasQueryParameters
(
urlString
:
String
)
->
Bool
{
if
let
url
=
URL
(
string
:
urlString
)
{
return
url
.
query
!=
nil
&&
!
url
.
query
!.
isEmpty
}
return
false
}
static
func
randomAlphaNumericStringT
(
_
length
:
Int
)
->
String
{
static
func
randomAlphaNumericStringT
(
_
length
:
Int
)
->
String
{
let
letters
=
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
let
letters
=
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
let
randomString
=
(
0
..<
length
)
.
map
{
_
in
String
(
letters
.
randomElement
()
!
)
}
.
reduce
(
""
,
+
)
let
randomString
=
(
0
..<
length
)
.
map
{
_
in
String
(
letters
.
randomElement
()
!
)
}
.
reduce
(
""
,
+
)
...
...
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