diff --git a/docs/Development-Plan.md b/docs/Development-Plan.md index d333845..18cbedd 100644 --- a/docs/Development-Plan.md +++ b/docs/Development-Plan.md @@ -303,9 +303,10 @@ Contract Design Plan(本文档) - 横屏锁定 + statusBar 显示,与契约 §4.2 一致 - **暂不实现**:`webViewWebContentProcessDidTerminate:` 退避 reload(移到 Phase 3 网络层时一并处理) - BuildProject 通过 -- [ ] **1.14.e** WebView 加载完成后淡出 splash - - `webView(_:didFinish:)` 内 `UIView.animate(duration: 0.3)` splash.alpha = 0 → `removeFromSuperview` - - 期间 webView 已渲染好 H5 大厅,无白屏闪烁 +- [x] **1.14.e** WebView 加载完成后淡出 splash + - `webView(_:didFinish:)` 内 `UIView.animate(withDuration: 0.3)` splash.alpha = 0 → completion 内 `splash.removeFromSuperview()` + - 期间 webView 已渲染好 H5 大厅,无白屏闪烁;splash 出 view 层级避免空持有 + - BuildProject 通过 - [ ] **1.15** 实现 `Source/Bridge/Handlers/VibratorHandler.swift` - `register(_ bridge)` 注册 `vibrator` handler → `AudioServicesPlaySystemSound(kSystemSoundID_Vibrate)` + responseCallback `"vibrator"` - [ ] **1.16** `SceneDelegate` → `WebContainerViewController` 作 rootViewController @@ -802,7 +803,7 @@ H5 调 `OpenurlTitleData` 打开弹层 WebView,弹层内 H5 用 `window.settin - [x] 1.14.b LaunchScreen 改启动图(SplashImage 全屏 scaleAspectFill,竖图横屏裁剪折衷) - [x] 1.14.c LobbyZipUpgrader 加 progress 回调(URLSessionDownloadDelegate,0.0…1.0) - [x] 1.14.d WebContainerViewController(SplashOverlay + 16:9 letterbox + 启动流水线 + 三种 alert) -- [ ] 1.14.e WebView didFinish 后淡出 splash +- [x] 1.14.e WebView didFinish 后 0.3s 淡出 splash + removeFromSuperview - [ ] 1.15 VibratorHandler - [ ] 1.16 SceneDelegate → WebContainerViewController - [ ] 1.17 Demo H5 联调 + 真机验证升级路径 diff --git a/ylgamehall/Source/WebView/WebContainerViewController.swift b/ylgamehall/Source/WebView/WebContainerViewController.swift index 7210200..93ca307 100644 --- a/ylgamehall/Source/WebView/WebContainerViewController.swift +++ b/ylgamehall/Source/WebView/WebContainerViewController.swift @@ -223,9 +223,13 @@ public final class WebContainerViewController: UIViewController { extension WebContainerViewController: WKNavigationDelegate { public func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { - // Phase 1.14.d 阶段:直接隐藏 splash(无动画) - // Phase 1.14.e 将替换为 UIView.animate(0.3) 淡出 + removeFromSuperview - splash.isHidden = true + // H5 大厅已经渲染完毕,此时把 splash 从 0.3s 内淡出再 removeFromSuperview, + // 避免黑屏闪烁也避免后续 superview 再持有这层不必要的视图。 + UIView.animate(withDuration: 0.3, animations: { [weak self] in + self?.splash.alpha = 0 + }, completion: { [weak self] _ in + self?.splash.removeFromSuperview() + }) } }