From 1d7d1c05c84ab281be3e8b8cdf45110f63417c49 Mon Sep 17 00:00:00 2001 From: Karlcarlo Date: Tue, 8 Sep 2026 03:54:32 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B55=E5=BC=A0=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E5=8D=A1=E6=8C=89identifier=E8=B7=B3=E5=B7=B2=E4=B8=8A?= =?UTF-8?q?=E6=9E=B6=E5=BA=94=E7=94=A8(=E5=B8=A6=E8=BA=AB=E4=BB=BD),=20?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E6=97=A7beian=E5=9F=9F=E5=90=8D=E8=A3=B8?= =?UTF-8?q?=E8=B7=B3=20(v26090735)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 10 +++++----- js/app.js | 24 +++++++++++++++--------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/index.html b/index.html index 7ae4da1..8b7076f 100644 --- a/index.html +++ b/index.html @@ -6,8 +6,8 @@ 妈妈盒子 · 孕育陪伴 - - + + @@ -1773,8 +1773,8 @@ 加载失败/离线时 window.wx 为 undefined,goMall() 会降级为 toast 提示, 不影响应用其余功能。 --> - - -
v26090734
+ + +
v26090735
diff --git a/js/app.js b/js/app.js index 6dc4f4d..a36a1cc 100644 --- a/js/app.js +++ b/js/app.js @@ -220,6 +220,7 @@ const apps = items .filter(a => a.url && !/wx-h5-demo/i.test(a.url)) /* 排除授权示例 */ .sort((x, y) => (x.seq || 0) - (y.seq || 0) || (x.no || 0) - (y.no || 0)); + apps.forEach(a => { APP_BY_ID[a.identifier] = a; }); /* 供首页工具卡按 identifier 取 URL */ renderAppGrid(apps); }) .catch(function () { /* 拉不到就保留弹层原有占位,不影响其余页面 */ }); @@ -483,16 +484,21 @@ 跳转用 location.href 走**当前标签页**:这个壳是照着原生 App 做的, 新开标签会在微信 / Safari 里堆出一串返回不去的页面;同页跳转的话, 浏览器返回键就是天然的「返回」。 */ + /* 首页五张工具卡 → 已上架应用(identifier 在应用管理维护,后台改 URL 即生效)。 + ⚠️ 不再裸跳旧 beian*.douba.top 域名:统一走 jumpApp 带身份(openid/unionid)。 */ + const MINI_APP_MAP = { + kick: 'taidong', // 数胎动 (1005) + weight: 'yunqitizhong', // 孕期体重管理 (1012) + cal: 'chanjianrili', // 孕检日历 (1009) + curve: 'taiershengzhang', // 生长曲线 (1013) + fweight:'taierguzhong' // 胎儿估重 (1037) + }; + const APP_BY_ID = {}; $$('[data-mini]').forEach(b => b.addEventListener('click', () => { - const map = { kick: '数胎动', weight: '孕期体重', cal: '孕检日历', curve: '生长曲线', fweight: '胎儿估重' }; - const site = { - fweight: 'https://beian1.douba.top/', /* 胎儿估重 */ - weight: 'https://beian2.douba.top/', /* 孕期体重 */ - cal: 'https://beian3.douba.top/' /* 孕检日历 */ - }; - const url = site[b.dataset.mini]; - if (url) { haptic(); location.href = url; return; } - toast('打开「' + map[b.dataset.mini] + '」'); + const map = { kick: '数胎动', weight: '孕期体重', cal: '孕检日历', curve: '生长曲线', fweight: '胎儿估重' }; + const app = APP_BY_ID[MINI_APP_MAP[b.dataset.mini]]; + if (app && app.url) { jumpApp(app.url); return; } + toast('「' + map[b.dataset.mini] + '」即将上线'); })); /* 记一下弹层只保留「全部孕期工具」,不再提供输入框 */