chore: 入库生产基线(2026-10-26 工作树快照)

- 含首页壳/容器页/授权页/分享图/首页配置等此前未入库的在途改动
- 新增未跟踪的 pages/index/mall.vue(第 5 个 tabBar 页,pages.json 已引用)
- 排除本地备份文件(*.bak* / *.origin-bak)

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-26 17:07:49 +08:00
parent 91f1ee849c
commit b45a190a59
14 changed files with 4116 additions and 2446 deletions

View File

@@ -217,18 +217,24 @@ export default {
// onShareTimeline(朋友圈)拿不到 webViewUrl 时唯一的同步手段,
// 也修掉首页壳换应用后沿用上一个应用分享图的问题。
const href = m.href || '';
// 诊断日志(过滤关键字 enter-app):这条**不是实时**的 ——
// 微信把 web-view 的 postMessage 攒到「后退 / 组件销毁 / 分享 / 复制链接」才派发,
// 所以它出现的时间点通常晚于用户实际换应用;宫格换应用后宿主就是靠它才知道当前在哪。
console.log('[enter-app] 宿主收到 H5 location 上报(延迟派发)href=' + href);
// ⚠️ 顺序:先落 H5 上报的标题,再 resolveShareCard ——
// 后者只在标题来源不是 'h5' 时才用 box_app 反查标题覆盖,顺序反了会白上报。
if (m.title) { this.shareTitle = m.title; this.shareSummary = m.summary || ''; this.shareTitleSource = 'h5'; }
if (href) {
this.shareHref = href;
if (typeof this.resolveShareCard === 'function') this.resolveShareCard(href);
}
if (m.title) { this.shareTitle = m.title; this.shareSummary = m.summary || ''; }
// H5 给了图就以 H5 为准(仅当前应用;换应用会被 syncShareCardTarget 清掉)
if (m.imageUrl) this._applyShareImage(m.imageUrl, 'h5', href || this.shareHref);
break;
}
case 'share':
// title / imageUrl / href 各自独立处理,单个字段缺失不影响其它
if (m.title) { this.shareTitle = m.title; this.shareSummary = m.summary || ''; }
if (m.title) { this.shareTitle = m.title; this.shareSummary = m.summary || ''; this.shareTitleSource = 'h5'; }
if (m.href) this.shareHref = m.href;
if (m.imageUrl) this._applyShareImage(m.imageUrl, 'h5', m.href);
// 小程序无法用代码拉起分享面板,只能引导用户点右上角
@@ -256,6 +262,7 @@ export default {
case 'setTitle':
if (m.title) {
this.shareTitle = m.title;
this.shareTitleSource = 'h5'; // H5 明确设的标题 → 后续反查不覆盖
uni.setNavigationBarTitle({ title: m.title });
}
break;
@@ -318,7 +325,7 @@ export default {
uni.removeStorageSync('__AUTH_RESULT__');
/* backUrl 优先:H5 发起授权时经 navigateTo query 带上的当前地址
(确定性通道,不依赖 postMessage 派发时机);旧版 H5 没有 backUrl
时回退到入参基址(shareHref || webUrl || MAMA_HOME)。 */
时回退到入参基址(shareHref || webUrl || 生效首页地址)。 */
const back = (res.backUrl && String(res.backUrl).split('#')[0]) || '';
const base = back || baseUrl;
if (!base) return '';
@@ -336,7 +343,7 @@ export default {
const openid = this._hostOpenid();
if (!openid) return uni.showToast({ title: '未获得 openid,请先登录', icon: 'none' });
/* 面板回传基址:requestProfile 消息带的 href 优先(确定性),没有才用调用处
传入的 baseUrl(shareHref || webUrl || MAMA_HOME)。清掉已用值,
传入的 baseUrl(shareHref || webUrl || 生效首页地址)。清掉已用值,
避免下次面板在没有新消息 href 时复用旧地址。 */
const base = (this._panelBaseUrl && String(this._panelBaseUrl).split('#')[0]) || baseUrl;
this._panelBaseUrl = '';