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
35738883
Commit
35738883
authored
Jan 16, 2025
by
DavidHuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、支持商品分享 的链接跳转 商品详情
parent
2ba1839f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
78 additions
and
3 deletions
+78
-3
AppDelegate.swift
galaxy/galaxy/AppDelegate.swift
+27
-3
YHJsApi.swift
...galaxy/Classes/Modules/InteractionH5(与H5交互)/YHJsApi.swift
+51
-0
No files found.
galaxy/galaxy/AppDelegate.swift
View file @
35738883
...
@@ -84,7 +84,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate {
...
@@ -84,7 +84,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate {
if
arrItems
.
count
>
0
{
if
arrItems
.
count
>
0
{
if
let
type
=
arrItems
[
"type"
]
as?
String
,
let
iType
=
Int
(
type
)
{
if
let
type
=
arrItems
[
"type"
]
as?
String
,
let
iType
=
Int
(
type
)
{
if
iType
==
1
{
if
iType
==
1
{
//跳转
//跳转
直播
DispatchQueue
.
main
.
asyncAfter
(
deadline
:
.
now
()
+
0.25
)
{
DispatchQueue
.
main
.
asyncAfter
(
deadline
:
.
now
()
+
0.25
)
{
if
!
YHLoginManager
.
shared
.
isLogin
()
{
if
!
YHLoginManager
.
shared
.
isLogin
()
{
printLog
(
"需要登录"
)
printLog
(
"需要登录"
)
...
@@ -111,10 +111,34 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate {
...
@@ -111,10 +111,34 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate {
}
}
}
}
}
}
else
{
else
if
iType
==
4
{
//跳转商品详情
DispatchQueue
.
main
.
asyncAfter
(
deadline
:
.
now
()
+
0.25
)
{
// - 获取它对应的参数
if
let
goodsId
=
arrItems
[
"id"
]
as?
String
{
NotificationCenter
.
default
.
post
(
name
:
YhConstant
.
YhNotification
.
closeShareUIInLiveRoomNotifiction
,
object
:
nil
)
var
url
=
YHBaseUrlManager
.
shared
.
curH5URL
()
+
"superAppBridge.html#/goods/sales-detail"
+
"?id=
\(
goodsId
)
"
if
YHLoginManager
.
shared
.
isLogin
()
{
let
token
=
YHLoginManager
.
shared
.
h5Token
url
=
url
+
"¶m="
+
token
}
var
tUrl
=
url
if
!
url
.
contains
(
"navigationH="
)
{
tUrl
=
url
+
"?navigationH=
\(
k_Height_NavigationtBarAndStatuBar
)
"
if
url
.
contains
(
"?"
)
{
tUrl
=
url
+
"&navigationH=
\(
k_Height_NavigationtBarAndStatuBar
)
"
}
}
let
vc
=
YHH5WebViewVC
()
vc
.
url
=
tUrl
vc
.
isHideNavigationBar
=
false
UIViewController
.
current
?
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
}
}
else
{
printLog
(
"未处理的类型
\(
iType
)
"
)
printLog
(
"未处理的类型
\(
iType
)
"
)
}
}
}
}
}
}
...
...
galaxy/galaxy/Classes/Modules/InteractionH5(与H5交互)/YHJsApi.swift
View file @
35738883
...
@@ -671,6 +671,57 @@ extension YHJsApi {
...
@@ -671,6 +671,57 @@ extension YHJsApi {
let
shareH5Describe
:
String
=
jsonObject
[
"ShareH5Describe"
]
as?
String
??
""
let
shareH5Describe
:
String
=
jsonObject
[
"ShareH5Describe"
]
as?
String
??
""
let
shareH5Url
:
String
=
jsonObject
[
"ShareH5Url"
]
as?
String
??
""
let
shareH5Url
:
String
=
jsonObject
[
"ShareH5Url"
]
as?
String
??
""
let
contentUrl
:
String
=
jsonObject
[
"ContentUrl"
]
as?
String
??
""
let
contentUrl
:
String
=
jsonObject
[
"ContentUrl"
]
as?
String
??
""
let
realUrl
:
String
=
shareH5Url
.
replacingOccurrences
(
ofPattern
:
"#"
,
withTemplate
:
""
)
// var realUrl : String = "https://test-hklife.galaxy-immi.com/superAppBridge.html/goods/sales-detail?id=73"
if
!
realUrl
.
isEmpty
{
if
let
url
=
URL
(
string
:
realUrl
)
{
let
components
=
URLComponents
(
url
:
url
,
resolvingAgainstBaseURL
:
false
)
if
let
queryItems
=
components
?
.
queryItems
{
var
arrItems
:
[
String
:
Any
]
=
[:]
for
item
in
queryItems
{
if
let
value
=
item
.
value
{
arrItems
.
updateValue
(
value
,
forKey
:
item
.
name
)
}
}
if
!
arrItems
.
keys
.
isEmpty
{
let
id
:
String
=
arrItems
[
"id"
]
as?
String
??
""
let
shareYinheID
:
String
=
arrItems
[
"shareYinheID"
]
as?
String
??
""
print
(
id
)
print
(
shareYinheID
)
let
tParam
=
[
"id"
:
id
,
"shareYinheID"
:
shareYinheID
]
YHShareManager
.
shared
.
createMutilShareShortUrl
(
type
:
4
,
param
:
tParam
)
{
shortUrl
,
error
in
if
let
url
=
shortUrl
{
let
tmpT
=
url
.
base64Encoded
??
""
//对deepLink使用 base64编码
var
oldUrl
=
shareH5Url
if
oldUrl
.
contains
(
"?"
)
{
oldUrl
=
oldUrl
+
"&appDeepLink=
\(
tmpT
)
"
}
else
{
oldUrl
=
oldUrl
+
"?appDeepLink=
\(
tmpT
)
"
}
DispatchQueue
.
main
.
async
{
YHShareAlertView
.
show
(
image
:
contentUrl
,
title
:
shareH5Title
,
subMessage
:
shareH5Describe
,
linkUrl
:
oldUrl
,
isLive
:
false
)
}
return
}
DispatchQueue
.
main
.
async
{
YHShareAlertView
.
show
(
image
:
contentUrl
,
title
:
shareH5Title
,
subMessage
:
shareH5Describe
,
linkUrl
:
shareH5Url
,
isLive
:
false
)
}
return
}
return
}
}
}
}
YHShareAlertView
.
show
(
image
:
contentUrl
,
title
:
shareH5Title
,
subMessage
:
shareH5Describe
,
linkUrl
:
shareH5Url
,
isLive
:
false
)
YHShareAlertView
.
show
(
image
:
contentUrl
,
title
:
shareH5Title
,
subMessage
:
shareH5Describe
,
linkUrl
:
shareH5Url
,
isLive
:
false
)
}
else
{
}
else
{
printLog
(
"ddddd"
)
printLog
(
"ddddd"
)
...
...
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