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] + '」即将上线'); })); /* 记一下弹层只保留「全部孕期工具」,不再提供输入框 */