diff --git a/AGENTS.md b/AGENTS.md index 20d2025..77f5236 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -80,6 +80,12 @@ nginx:`root /opt/app` + `Cache-Control: no-cache` + `etag on` —— 缓存靠 ⚠️ 卡是固定高度 bento,只有 kick / weight 有位置放第二行(`.mc-extra`);给 fweight/cal/curve 加第二行前 先重排那笔高度账(`158+10+64=232`,见 `mama-box.css`)。 +12. **⚠️ 第 2 条「不造假数据」的唯一登记例外:首页「此刻,孕妈们在做什么」卡(2026-10-01 起)** + - 内容:该卡的总人数 / 今日三项 / 匿名动态在**模拟阶段**为 box_app 按规则生成的模拟数字(`GET /pulse`,确定性哈希、不落库、不进任何报表)。 + - 决策人:产品负责人(用户本人),2026-10-01 拍板「前期先用模拟数据,要显示人多;正式页先用模拟,真实数据跟上后替换」;已书面告知虚假宣传风险(《反不正当竞争法》第 8 条)。 + - 期限:**最晚 2026-12-31** 复核(≤ 3 个月);真实数据接通后在后台把 `MamaBoxConfig.pulseMode` 改成 `real`(或 `off`),无需发版。 + - 边界:**只限这张卡**。孕期盲盒的数字(已收集、本周开盒人数)一律真实;任何别处都不得引用这里的模拟数字,前端也不得在接口失败时自造数字兜底。 + ## 5. 踩坑 - **不要给别的应用追加 `#openid`**:部分应用自带 hash 路由(如 `/baobao-yingji`),追加 hash 会被当非法路由 → 页面未找到。身份一律走 query(`withIdentity()` 已封装)。 diff --git a/assets/img/0fa71babe9a2.jpg b/assets/img/0fa71babe9a2.jpg new file mode 100644 index 0000000..de856fe Binary files /dev/null and b/assets/img/0fa71babe9a2.jpg differ diff --git a/assets/img/2314f334e4d0.jpg b/assets/img/2314f334e4d0.jpg new file mode 100644 index 0000000..bbda585 Binary files /dev/null and b/assets/img/2314f334e4d0.jpg differ diff --git a/assets/img/2a88a5a7c1c3.jpg b/assets/img/2a88a5a7c1c3.jpg new file mode 100644 index 0000000..9de766d Binary files /dev/null and b/assets/img/2a88a5a7c1c3.jpg differ diff --git a/assets/img/5ae2e7f617e2.jpg b/assets/img/5ae2e7f617e2.jpg new file mode 100644 index 0000000..bf6b2ed Binary files /dev/null and b/assets/img/5ae2e7f617e2.jpg differ diff --git a/assets/img/6a17a98c52b8.jpg b/assets/img/6a17a98c52b8.jpg new file mode 100644 index 0000000..7ee30d1 Binary files /dev/null and b/assets/img/6a17a98c52b8.jpg differ diff --git a/assets/img/6bdabd9eecc5.jpg b/assets/img/6bdabd9eecc5.jpg new file mode 100644 index 0000000..599c9cb Binary files /dev/null and b/assets/img/6bdabd9eecc5.jpg differ diff --git a/assets/img/83f0ab30cf36.jpg b/assets/img/83f0ab30cf36.jpg new file mode 100644 index 0000000..9226a16 Binary files /dev/null and b/assets/img/83f0ab30cf36.jpg differ diff --git a/assets/img/affcfc61f21f.jpg b/assets/img/affcfc61f21f.jpg new file mode 100644 index 0000000..6b3caea Binary files /dev/null and b/assets/img/affcfc61f21f.jpg differ diff --git a/assets/img/b743ed8646d5.jpg b/assets/img/b743ed8646d5.jpg new file mode 100644 index 0000000..e7eb8dc Binary files /dev/null and b/assets/img/b743ed8646d5.jpg differ diff --git a/assets/img/bddd81b7315d.jpg b/assets/img/bddd81b7315d.jpg new file mode 100644 index 0000000..9f4246e Binary files /dev/null and b/assets/img/bddd81b7315d.jpg differ diff --git a/assets/img/c6e9c5612d8e.jpg b/assets/img/c6e9c5612d8e.jpg new file mode 100644 index 0000000..d03c986 Binary files /dev/null and b/assets/img/c6e9c5612d8e.jpg differ diff --git a/assets/img/cceeb3b3f4ef.jpg b/assets/img/cceeb3b3f4ef.jpg new file mode 100644 index 0000000..2976eb5 Binary files /dev/null and b/assets/img/cceeb3b3f4ef.jpg differ diff --git a/assets/img/d41305de1db9.jpg b/assets/img/d41305de1db9.jpg new file mode 100644 index 0000000..db8f395 Binary files /dev/null and b/assets/img/d41305de1db9.jpg differ diff --git a/assets/img/fe00c2bddf9b.jpg b/assets/img/fe00c2bddf9b.jpg new file mode 100644 index 0000000..24cb9af Binary files /dev/null and b/assets/img/fe00c2bddf9b.jpg differ diff --git a/index.html b/index.html index 6f3cd95..8a09d79 100644 --- a/index.html +++ b/index.html @@ -7,7 +7,7 @@
'
+ : '';
+ }
+ /* 卡正面。card = { week, v, size:{name,txt}, say } */
+ function cardFrontHTML(c) {
+ const sz = c.size || babySize(c.week);
+ return '' + (c.say ? '“' + bbEsc(c.say) + '”' : '') + '
' + + '孕期盲盒完全免费,不出售、不需要任何付费。
'; + } + $('#bxChips').addEventListener('click', e => { + const b = e.target.closest('.bx-chip'); + if (!b || bbBusy) return; + bbSel = +b.dataset.w; haptic(); renderBox(); + $('#detailBox .detail-body').scrollTo({ top: 0, behavior: 'smooth' }); + }); + $('#bxGroups').addEventListener('click', e => { + const t = e.target.closest('.bx-t'); + if (!t || bbBusy) return; + if (t.dataset.op) { bbSel = +t.dataset.op; renderBox(); $('#detailBox .detail-body').scrollTo({ top: 0, behavior: 'smooth' }); return; } + const w = +t.dataset.w; + if (!w) return; + /* 卡册里点开一张:大小来自本地 SIZE 表,发育说明取孕期小知识的「宝宝这周」 */ + const c = { week: w, v: t.dataset.v, size: babySize(w), say: '' }; + showReveal(c, null, false); + loadTips().then(() => { const x = TIPS && TIPS[w]; if (x && x.baby && $('#bxReveal').classList.contains('show')) $('#bxDev').textContent = x.baby; }); + }); + $('#bxRuleBtn').addEventListener('click', () => { + const d = $('#bxRules'); d.open = true; + d.scrollIntoView({ behavior: 'smooth', block: 'start' }); + }); + $('#bxBox').addEventListener('click', () => openBox()); + $('#bxOpen').addEventListener('click', () => { + if (bbSel) openBox(); + else if (BB && BB.currentCard) showReveal(BB.currentCard, null, false); + }); + function openBox() { + if (bbBusy || !bbSel) return; + bbBusy = true; haptic(); + const st = $('#bxStage'), btn = $('#bxOpen'), w = bbSel, t0 = Date.now(); + st.classList.add('is-shaking'); + btn.disabled = true; btn.textContent = '正在打开…'; + bbApi('blindbox/open?week=' + w, 'POST').catch(() => null).then(j => { + /* 至少晃 1.3 秒:接口太快时动画一闪而过,没有「拆」的感觉 */ + setTimeout(() => { + st.classList.remove('is-shaking'); + if (!j || j.code !== 200 || !j.result) { + bbBusy = false; btn.disabled = false; btn.textContent = '开启盲盒'; + toast((j && j.message) || '网络开小差了,再试一次'); + if (j && j.code === 400) loadBlindbox(); + return; + } + st.classList.add('is-popping'); + if (navigator.vibrate) navigator.vibrate([12, 40, 18]); + const r = j.result; + bbNew = r.card.week; + setTimeout(() => { showReveal(r.card, r.reward, true); bbBusy = false; }, 420); + loadBlindbox(); // 后台刷新横幅与卡册(翻卡层盖着,用户看不到重绘) + }, Math.max(0, 1300 - (Date.now() - t0))); + }); + } + function burst(flash) { + const box = $('#bxConfetti'); + const C = flash ? ['#FFD66E', '#FF9AD5', '#9ADFFF', '#fff', '#C9B6FF'] : ['#FFD66E', '#FF8A66', '#FFB3C1', '#fff', '#9ED8C0']; + let h = ''; + for (let i = 0; i < (flash ? 44 : 30); i++) { + const a = Math.random() * Math.PI * 2, d = 90 + Math.random() * 170; + h += ''; + } + box.innerHTML = h; + setTimeout(() => { box.innerHTML = ''; }, 1800); + } + /* 翻卡层。fresh=true:刚开出来(彩纸 + 翻面 + 奖励);false:从卡册/舞台查看(直接正面) */ + function showReveal(card, reward, fresh) { + const rv = $('#bxReveal'), c3 = $('#bxCard3d'), flash = card.v === 'flash'; + $('#bxFront').innerHTML = cardFrontHTML(card); + if (!$('#bxBack').firstChild) $('#bxBack').innerHTML = giftSVG() + '兜爸心选 · 孕期盲盒'; + $('#bxTag').textContent = fresh ? (flash ? '✦ 哇!开出了闪卡 ✦' : '新卡 · 孕 ' + card.week + ' 周') : (flash ? '✦ 闪卡 · 孕 ' + card.week + ' 周' : '孕 ' + card.week + ' 周'); + $('#bxDev').textContent = card.dev || ''; + let rw = ''; + if (reward) { + const tj = reward.type === 'taijiao'; + rw = '' + bbEsc(reward.text) + '