Files
wx-h5-demo/miniapp/scenario3-share-webview.wxml

12 lines
782 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!-- 场景3(✅ 正确):web-view 承载 H5 + 分享深链
路径:/pages/demo/share-webview
用法:把本页并入小程序并在 app.json 注册(路径 /pages/demo/share-webview)。
验证:
小程序「首页」→ 进本页 → H5 点 ②「正确分享」→ 停留本页 →
点右上角「···」转发 → 接收者打开的是同一个 H5 地址(含 hash 标记),不是首页。
说明:深链在 scenario3-share-webview.js 的 onShareAppMessage(options) 里
用 options.webViewUrl 拼出;H5 只负责 postMessage 标题/图。 -->
<web-view wx:if="{{url}}" src="{{url}}" bindmessage="onMessage"></web-view>
<view wx:else style="padding:40rpx;text-align:center;color:#A79C95">正在加载 H5…</view>