首页5张工具卡按identifier跳已上架应用(带身份), 替换旧beian域名裸跳 (v26090735)
This commit is contained in:
10
index.html
10
index.html
@@ -6,8 +6,8 @@
|
||||
<meta name="theme-color" content="#F4593C">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<title>妈妈盒子 · 孕育陪伴</title>
|
||||
<!-- V:26090734 缓存版本标记:改 css/js 时同步 bump 该值,并给下方资源引用加 ?v= 以强制 webview 刷新子资源 -->
|
||||
<link rel="stylesheet" href="mama-box.css?v=26090734">
|
||||
<!-- V:26090735 缓存版本标记:改 css/js 时同步 bump 该值,并给下方资源引用加 ?v= 以强制 webview 刷新子资源 -->
|
||||
<link rel="stylesheet" href="mama-box.css?v=26090735">
|
||||
<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
@@ -1773,8 +1773,8 @@
|
||||
加载失败/离线时 window.wx 为 undefined,goMall() 会降级为 toast 提示,
|
||||
不影响应用其余功能。 -->
|
||||
|
||||
<script src="js/app.js?v=26090734"></script>
|
||||
<!-- 页面版本号(排查 webview 缓存):底部会显示 v26090734 -->
|
||||
<div id="ver" style="position:fixed;left:0;right:0;bottom:10px;text-align:center;z-index:9999;pointer-events:none;color:#B3A69C;font-size:10px;letter-spacing:.5px">v26090734</div>
|
||||
<script src="js/app.js?v=26090735"></script>
|
||||
<!-- 页面版本号(排查 webview 缓存):底部会显示 v26090735 -->
|
||||
<div id="ver" style="position:fixed;left:0;right:0;bottom:10px;text-align:center;z-index:9999;pointer-events:none;color:#B3A69C;font-size:10px;letter-spacing:.5px">v26090735</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
24
js/app.js
24
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] + '」即将上线');
|
||||
}));
|
||||
|
||||
/* 记一下弹层只保留「全部孕期工具」,不再提供输入框 */
|
||||
|
||||
Reference in New Issue
Block a user