Files
wx-h5-demo/miniapp/scenario3-home-bug.js

23 lines
882 B
JavaScript
Raw Permalink 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-反面(❌ 复现线上 bug):写死分享首页
// 路径:/pages/demo/home.js
// ------------------------------------------------------------
// 用途:扮演「小程序首页」。H5 点「❌ 复现旧 bug」会 postMessage + navigateBack,
// 退回本页;此时用户点右上角「···」转发,触发的是本页的 onShareAppMessage。
// 本页故意写死 path: '/pages/demo/home' 且忽略 options.webViewUrl ——
// 接收者点开卡片就落到本页(= 线上「分享后跳首页」的现象)。
Page({
data: {},
goWebview() {
wx.navigateTo({ url: '/pages/demo/share-webview' });
},
// ❌ 反面:写死首页、不带 H5 地址(旧版 pages/index/index.vue 的写法)
onShareAppMessage() {
return {
title: '兜爸心选 · 首页(bug 复现)',
path: '/pages/demo/home'
};
}
});