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
04073955
Commit
04073955
authored
Aug 20, 2025
by
DavidHuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
处理 wkwebview 内部跳转的问题
parent
d7625505
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
92 additions
and
11 deletions
+92
-11
project.pbxproj
galaxy/galaxy.xcodeproj/project.pbxproj
+14
-11
yinheReplayExt.xcscheme
....xcodeproj/xcshareddata/xcschemes/yinheReplayExt.xcscheme
+1
-0
YHH5WebViewVC.swift
.../Classes/Modules/InteractionH5(与H5交互)/YHH5WebViewVC.swift
+72
-0
YHMyNewViewController.swift
...xy/Classes/Modules/Mine(我的)/C/YHMyNewViewController.swift
+5
-0
No files found.
galaxy/galaxy.xcodeproj/project.pbxproj
View file @
04073955
...
...
@@ -3,7 +3,7 @@
archiveVersion
=
1
;
classes
=
{
};
objectVersion
=
7
0
;
objectVersion
=
7
7
;
objects
=
{
/* Begin PBXBuildFile section */
...
...
@@ -2645,7 +2645,7 @@
/* End PBXFileReference section */
/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */
043F0ED92E02A60C003354EB
/*
PBXFileSystemSynchronizedBuildFileExceptionS
et */
=
{
043F0ED92E02A60C003354EB
/*
Exceptions for "yinheReplayExt" folder in "yinheReplayExt" targ
et */
=
{
isa
=
PBXFileSystemSynchronizedBuildFileExceptionSet
;
membershipExceptions
=
(
Info.plist
,
...
...
@@ -2655,7 +2655,18 @@
/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */
/* Begin PBXFileSystemSynchronizedRootGroup section */
043F0ECD2E02A60C003354EB
/* yinheReplayExt */
=
{
isa
=
PBXFileSystemSynchronizedRootGroup
;
exceptions
=
(
043F0ED92E02A60C003354EB
/* PBXFileSystemSynchronizedBuildFileExceptionSet */
,
);
explicitFileTypes
=
{};
explicitFolders
=
();
path
=
yinheReplayExt
;
sourceTree
=
"<group>"
;
};
043F0ECD2E02A60C003354EB
/* yinheReplayExt */
=
{
isa
=
PBXFileSystemSynchronizedRootGroup
;
exceptions
=
(
043F0ED92E02A60C003354EB
/* Exceptions for "yinheReplayExt" folder in "yinheReplayExt" target */
,
);
explicitFileTypes
=
{
};
explicitFolders
=
(
);
path
=
yinheReplayExt
;
sourceTree
=
"<group>"
;
};
/* End PBXFileSystemSynchronizedRootGroup section */
/* Begin PBXFrameworksBuildPhase section */
...
...
@@ -7238,14 +7249,10 @@
inputFileListPaths
=
(
"${PODS_ROOT}/Target Support Files/Pods-galaxy/Pods-galaxy-frameworks-${CONFIGURATION}-input-files.xcfilelist"
,
);
inputPaths
=
(
);
name
=
"[CP] Embed Pods Frameworks"
;
outputFileListPaths
=
(
"${PODS_ROOT}/Target Support Files/Pods-galaxy/Pods-galaxy-frameworks-${CONFIGURATION}-output-files.xcfilelist"
,
);
outputPaths
=
(
);
runOnlyForDeploymentPostprocessing
=
0
;
shellPath
=
/bin/sh
;
shellScript
=
"\"${PODS_ROOT}/Target Support Files/Pods-galaxy/Pods-galaxy-frameworks.sh\"\n"
;
...
...
@@ -7259,14 +7266,10 @@
inputFileListPaths
=
(
"${PODS_ROOT}/Target Support Files/Pods-galaxy/Pods-galaxy-resources-${CONFIGURATION}-input-files.xcfilelist"
,
);
inputPaths
=
(
);
name
=
"[CP] Copy Pods Resources"
;
outputFileListPaths
=
(
"${PODS_ROOT}/Target Support Files/Pods-galaxy/Pods-galaxy-resources-${CONFIGURATION}-output-files.xcfilelist"
,
);
outputPaths
=
(
);
runOnlyForDeploymentPostprocessing
=
0
;
shellPath
=
/bin/sh
;
shellScript
=
"\"${PODS_ROOT}/Target Support Files/Pods-galaxy/Pods-galaxy-resources.sh\"\n"
;
...
...
galaxy/galaxy.xcodeproj/xcshareddata/xcschemes/yinheReplayExt.xcscheme
View file @
04073955
...
...
@@ -74,6 +74,7 @@
savedToolIdentifier =
""
useCustomWorkingDirectory =
"NO"
debugDocumentVersioning =
"YES"
askForAppToLaunch =
"Yes"
launchAutomaticallySubstyle =
"2"
>
<BuildableProductRunnable
runnableDebuggingMode =
"0"
>
...
...
galaxy/galaxy/Classes/Modules/InteractionH5(与H5交互)/YHH5WebViewVC.swift
View file @
04073955
...
...
@@ -11,6 +11,7 @@ import UIKit
import
dsBridge
import
Photos
import
Kingfisher
import
SafariServices
/*
快速测评 及 其他与H5交互的界面
...
...
@@ -547,6 +548,77 @@ extension YHH5WebViewVC {
func
webView
(
_
webView
:
WKWebView
,
didFailProvisionalNavigation
navigation
:
WKNavigation
!
,
withError
error
:
Error
)
{
printLog
(
"
\(
error
.
localizedDescription
)
"
)
}
func
webView
(
_
webView
:
WKWebView
,
decidePolicyFor
navigationAction
:
WKNavigationAction
,
decisionHandler
:
@escaping
(
WKNavigationActionPolicy
)
->
Void
)
{
// WKWebView intercepts the redirection by default. Enable the redirection in the following ways.
// Operations such as opening Safari
printLog
(
"navigationAction.request.url = "
)
printLog
(
navigationAction
.
request
.
url
)
guard
let
url
=
navigationAction
.
request
.
url
else
{
decisionHandler
(
.
cancel
)
printLog
(
"decisionHandler(.cancel)"
)
return
}
let
absoluteString
=
url
.
absoluteString
printLog
(
"navigationAction.request.URL.absoluteString=====>
\(
absoluteString
)
"
)
if
absoluteString
==
"about:blank"
{
decisionHandler
(
.
cancel
)
return
}
if
!
(
absoluteString
.
hasPrefix
(
"https://"
)
||
absoluteString
.
hasPrefix
(
"http://"
))
{
if
absoluteString
.
hasPrefix
(
"alipayconnect://"
)
||
absoluteString
.
hasPrefix
(
"alipayhk://"
)
{
self
.
openApp
(
with
:
url
)
decisionHandler
(
.
allow
)
return
}
else
if
absoluteString
.
hasPrefix
(
"alipay://"
)
{
self
.
openApp
(
with
:
url
)
decisionHandler
(
.
allow
)
//fort test hjl 需要测试
return
}
}
decisionHandler
(
.
allow
)
}
// 辅助方法 - 显示消息
private
func
showMessage
(
_
message
:
String
)
{
// 替换原来的 MBProgressHUD
// 这里可以使用你偏好的提示框方案,比如:
// 方案1: 使用系统 Alert
let
alert
=
UIAlertController
(
title
:
nil
,
message
:
message
,
preferredStyle
:
.
alert
)
present
(
alert
,
animated
:
true
)
DispatchQueue
.
main
.
asyncAfter
(
deadline
:
.
now
()
+
2.0
)
{
alert
.
dismiss
(
animated
:
true
)
}
// 方案2: 如果使用 MBProgressHUD
// MBProgressHUD.showAdded(to: self.view, animated: true)
// let hud = MBProgressHUD.showAdded(to: self.view, animated: true)
// hud.mode = .text
// hud.label.text = message
// hud.hide(animated: true, afterDelay: 2.0)
}
// 辅助方法 - 打开应用
private
func
openApp
(
with
url
:
URL
?)
{
guard
let
url
=
url
else
{
return
}
if
UIApplication
.
shared
.
canOpenURL
(
url
)
{
UIApplication
.
shared
.
open
(
url
,
options
:
[:],
completionHandler
:
nil
)
}
else
{
//
// if let tmpUrl = URL(string: "https://global.alipay.com/281002040090chyp7RdGg5AHvg49BXCv4Igh&pspName=ALIPAY_CN") {
let
safariViewController
=
SFSafariViewController
(
url
:
url
)
safariViewController
.
dismissButtonStyle
=
.
close
safariViewController
.
modalPresentationStyle
=
.
fullScreen
UIViewController
.
current
?
.
present
(
safariViewController
,
animated
:
true
,
completion
:
nil
)
// }
}
}
}
// MARK: - h5实现的接口
...
...
galaxy/galaxy/Classes/Modules/Mine(我的)/C/YHMyNewViewController.swift
View file @
04073955
...
...
@@ -7,6 +7,7 @@
//
import
UIKit
import
SafariServices
enum
YHFunctionGroupType
:
Int
{
case
none
=
0
...
...
@@ -302,6 +303,10 @@ class YHMyNewViewController: YHBaseViewController {
if
!
checkLogin
()
{
return
}
let
vc
=
YHMySettingViewController
()
self
.
navigationController
?
.
pushViewController
(
vc
)
// let vc = YHH5WebViewVC()
// vc.url = "http://192.168.34.113:10301/superAppBridge.html#/order/antom-pay?id=1864¶m=eyJhbGbolyFeciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NTc0NzI5MzAsImkiOjQyMzgxNzEzODcwNzAyMSwidSI6IumTtuays-mbhuWboiIsInIiOiJzdXBlcl9hcHAifQ.Phsg13OfN5XJ0cLe759U2W0hH1iTZeneimgTlnouPcg"
// self.navigationController?.pushViewController(vc)
}
}
...
...
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