Files
youle_app_ios_v2/docs
joywayerandClaude Opus 4.7 33574a1cc2 Design §3.7:补 WKUIDelegate alert / confirm 2 项接口
覆盖契约 §4.3 H5 alert(msg) / confirm(msg) 触发原生弹窗的硬约束。

WKWebView 默认行为是直接吞掉 H5 的 alert/confirm 不弹任何窗口,必须实现
WKUIDelegate 才有响应。不实现的代价:H5 业务里 alert("登录失败")
之类的提示用户完全看不见,业务哑火无可视化报错。

§3.7 实现骨架:
  - runJavaScriptAlertPanelWithMessage → UIAlertController .alert,
    标题 appDisplayName,单"确定"按钮,completionHandler() 必须调一次
  - runJavaScriptConfirmPanelWithMessage → "取消"/"确定" 两按钮,
    completionHandler(false/true) 必须调一次
  - 接入点:bridgedWebView.webView.uiDelegate = self 在 viewDidLoad
    与 navigationDelegate 一起设置

§3.7.1 与 msext 4 维度差异表(标题来源 / 按钮顺序 / 样式 / 并发)+
明示"未实现导致的现象"提醒,方便 1.17 真机联调时排查。

至此契约 §3 + §附录 A + §4.3 共 51 项接口(22 异步 handler + 15 反向 callback
+ 3 弹层 polyfill + 9 同步 getter polyfill + 2 WKUIDelegate)的 Design 实现
骨架全部覆盖完整。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-22 07:33:33 +08:00
..
2026-06-21 19:39:22 +08:00