378 lines
21 KiB
HTML
378 lines
21 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="zh-CN">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover">
|
||
<meta name="format-detection" content="telephone=no">
|
||
<title>叶酸、DHA、铁、钙要不要补?</title>
|
||
<!-- 孕期专题 · 孕期补剂(孕期首页「其他妈妈也在搜」第 4 条)。
|
||
2026-10-31 按 /tmp/pl/topic-spec.md v2 重做:清新、简洁、核心明确;主色 #2E7CF6。
|
||
只写营养成分,不写品牌和药品名;百分比只出现在页底来源。
|
||
自成一页:不引 app.js;返回回 ../../;跳补水补剂走同源 /yunqi-bushui/yindao/,带 search + hash。 -->
|
||
<style>
|
||
:root{--c:#2E7CF6;--cb:#EAF2FF;--h:#1F2329;--t:#4E5969;--s:#86909C;--bg2:#F7F8FA;--ln:#EEF0F3}
|
||
*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}
|
||
html,body{height:100%;overflow:hidden;background:#fff;color:var(--t);font:15px/1.75 -apple-system,BlinkMacSystemFont,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif}
|
||
#scroll{position:fixed;inset:0;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;overscroll-behavior:none;padding-bottom:calc(28px + env(safe-area-inset-bottom))}
|
||
img{display:block;max-width:100%}
|
||
button{font:inherit;border:0;background:none;color:inherit;cursor:pointer}
|
||
b{color:var(--h)}
|
||
.ic{width:20px;height:20px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
|
||
.hide{position:absolute;width:0;height:0;overflow:hidden}
|
||
|
||
/* 顶栏 */
|
||
.bar{position:sticky;top:0;z-index:20;display:flex;align-items:center;gap:4px;height:48px;padding:0 8px;padding-top:env(safe-area-inset-top);background:transparent;border-bottom:1px solid transparent;transition:background .2s,border-color .2s}
|
||
.bar.on{background:#fff;border-bottom-color:var(--ln)}
|
||
.bar .back{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;color:var(--h)}
|
||
.bar .back .ic{width:22px;height:22px}
|
||
.bar .t{font-weight:600;font-size:16px;color:var(--h)}
|
||
|
||
/* Hero */
|
||
.hero{padding:4px 16px 0}
|
||
.hero img{width:100%;height:180px;object-fit:cover;border-radius:20px;background:var(--cb)}
|
||
.hero h1{margin-top:18px;font-size:26px;font-weight:800;line-height:1.3;color:var(--h)}
|
||
.answer{margin-top:14px;padding:13px 14px 13px 16px;border-radius:14px;background:var(--cb);border-left:4px solid var(--c);font-size:16px;font-weight:700;line-height:1.6;color:var(--h)}
|
||
|
||
/* 区块通用 */
|
||
.blk{margin:32px 16px 0}
|
||
.blk h2{font-size:18px;font-weight:700;line-height:1.4;color:var(--h)}
|
||
.key{margin-top:6px;font-weight:700;color:var(--c)}
|
||
.card{margin-top:12px;background:#fff;border:1px solid var(--ln);border-radius:18px}
|
||
|
||
/* 记住这 3 点 */
|
||
.three{margin:28px 16px 0;padding:16px;border-radius:18px;background:var(--bg2)}
|
||
.three h2{font-size:18px;font-weight:700;color:var(--h)}
|
||
.three ol{list-style:none;margin-top:6px}
|
||
.three li{display:flex;gap:14px;align-items:flex-start;padding:10px 0}
|
||
.three li+li{border-top:1px solid var(--ln)}
|
||
.three .no{flex:none;width:24px;font-size:26px;font-weight:800;line-height:1.1;color:var(--c);font-family:"DIN Alternate","Helvetica Neue",Arial,sans-serif}
|
||
.three b{display:block;font-size:16px;line-height:1.45}
|
||
.three span{display:block;font-size:13px;color:var(--s);line-height:1.6}
|
||
|
||
/* 1 对照表 */
|
||
.tbl{width:100%;border-collapse:collapse;font-size:13.5px;line-height:1.5;table-layout:fixed}
|
||
.tbl th{padding:10px 8px;text-align:left;font-size:12.5px;font-weight:500;color:var(--s);background:var(--bg2)}
|
||
.tbl th:first-child{border-top-left-radius:17px}
|
||
.tbl th:last-child{border-top-right-radius:17px}
|
||
.tbl td{padding:11px 8px;border-top:1px solid var(--ln);vertical-align:top;color:var(--t)}
|
||
.tbl td:first-child{font-weight:700;color:var(--h)}
|
||
.tbl .y{color:var(--c);font-weight:700}
|
||
.tbl col.c1{width:15%}.tbl col.c2{width:24%}.tbl col.c3{width:26%}
|
||
.why{margin-top:10px}
|
||
.why summary{list-style:none;display:inline-flex;align-items:center;gap:4px;font-size:13px;color:var(--c);cursor:pointer}
|
||
.why summary::-webkit-details-marker{display:none}
|
||
.why summary .ic{width:16px;height:16px;transition:transform .2s}
|
||
.why[open] summary .ic{transform:rotate(180deg)}
|
||
.why p{margin-top:6px;font-size:13.5px;line-height:1.7;color:var(--t)}
|
||
|
||
/* 2 横向时间轴 */
|
||
.me{display:none;margin-top:10px;font-size:12.5px;color:var(--c);background:var(--cb);border-radius:99px;padding:4px 12px;width:max-content;max-width:100%}
|
||
.me.on{display:block}
|
||
.tl{position:relative;display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin-top:14px}
|
||
.tl::before{content:"";position:absolute;left:12%;right:12%;top:7px;height:2px;background:var(--ln)}
|
||
.st{position:relative;text-align:center}
|
||
.st .dot{position:relative;display:block;width:16px;height:16px;margin:0 auto;border-radius:50%;background:#fff;border:2px solid #D5DAE1}
|
||
.st b{display:block;margin-top:8px;font-size:13.5px;line-height:1.35;white-space:nowrap;letter-spacing:-.2px}
|
||
.st p{margin-top:4px;padding:8px 6px;border-radius:12px;background:var(--bg2);font-size:12.5px;line-height:1.5;color:var(--t);min-height:62px}
|
||
.st.hl .dot{border-color:var(--c);background:var(--c);box-shadow:0 0 0 4px var(--cb)}
|
||
.st.hl b{color:var(--c)}
|
||
.st.hl p{background:var(--cb);color:var(--h)}
|
||
|
||
/* 3 标签云 */
|
||
.doc{display:flex;gap:12px;align-items:center;margin-top:12px}
|
||
.doc img{flex:none;width:76px;height:76px;border-radius:16px;object-fit:cover}
|
||
.doc p{font-size:14px;color:var(--t);line-height:1.65}
|
||
.tags{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
|
||
.tags span{font-size:13.5px;line-height:1.4;padding:6px 12px;border-radius:99px;background:var(--bg2);color:var(--h);white-space:nowrap}
|
||
|
||
/* 自查 */
|
||
.tool{padding:16px 14px}
|
||
.q+.q{margin-top:14px}
|
||
.q-t{font-size:14.5px;font-weight:700;color:var(--h)}
|
||
.opts{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
|
||
.opt{padding:6px 13px;border-radius:99px;background:var(--bg2);border:1px solid transparent;font-size:13.5px;line-height:1.5;color:var(--t);white-space:nowrap;transition:all .15s}
|
||
.opt.on{background:var(--cb);border-color:var(--c);color:var(--c);font-weight:600}
|
||
.hint{margin-top:14px;font-size:12.5px;color:var(--s)}
|
||
.res{display:none;margin-top:16px;padding-top:14px;border-top:1px solid var(--ln)}
|
||
.res.on{display:block}
|
||
.res h3{font-size:15px;font-weight:700;color:var(--h)}
|
||
.res ul{list-style:none;margin-top:6px}
|
||
.res li{display:flex;gap:10px;align-items:flex-start;padding:8px 0}
|
||
.res li i{flex:none;margin-top:2px;font-style:normal;font-size:12px;line-height:20px;padding:0 8px;border-radius:99px;white-space:nowrap;min-width:52px;text-align:center;background:var(--bg2);color:var(--s)}
|
||
.res li.a i{background:var(--c);color:#fff}
|
||
.res li.t i{background:var(--cb);color:var(--c)}
|
||
.res li b{display:block;font-size:14px;line-height:1.5}
|
||
.res li span{display:block;font-size:12.5px;color:var(--s);line-height:1.55}
|
||
.res-note{margin-top:6px;font-size:12px;color:var(--s)}
|
||
|
||
/* 工具入口 */
|
||
.go{display:flex;gap:12px;align-items:center;padding:14px}
|
||
.go .gi{flex:none;width:44px;height:44px;border-radius:14px;display:grid;place-items:center;background:var(--cb);color:var(--c)}
|
||
.go .gi .ic{width:22px;height:22px}
|
||
.go .gt{flex:1;min-width:0}
|
||
.go b{display:block;font-size:15px;line-height:1.4}
|
||
.go span{display:block;font-size:12.5px;color:var(--s);line-height:1.5}
|
||
.btn{display:flex;align-items:center;justify-content:center;gap:6px;width:100%;height:46px;border-radius:99px;background:var(--c);color:#fff;font-size:15.5px;font-weight:600}
|
||
.btn .ic{width:18px;height:18px}
|
||
.go-wrap{padding:0 14px 14px}
|
||
|
||
/* 来源 */
|
||
.src{margin:32px 16px 0;border-radius:18px;background:var(--bg2)}
|
||
.src summary{list-style:none;padding:13px 16px;font-size:14px;font-weight:600;color:var(--h);display:flex;align-items:center}
|
||
.src summary::-webkit-details-marker{display:none}
|
||
.src summary::after{content:"展开";margin-left:auto;font-size:12px;font-weight:400;color:var(--s)}
|
||
.src[open] summary::after{content:"收起"}
|
||
.src ul{list-style:none;padding:0 16px 12px}
|
||
.src li{padding:8px 0;border-top:1px solid var(--ln);font-size:12.5px;line-height:1.65;color:var(--t)}
|
||
.foot{margin:14px 20px 0;font-size:12px;color:var(--s);text-align:center;line-height:1.7}
|
||
|
||
.fade{opacity:0;transform:translateY(8px);transition:opacity .4s,transform .4s}
|
||
.fade.in{opacity:1;transform:none}
|
||
@media (prefers-reduced-motion:reduce){.fade{opacity:1;transform:none;transition:none}}
|
||
</style>
|
||
</head>
|
||
<body>
|
||
<!-- 单色线性图标,stroke 1.8 -->
|
||
<svg class="hide" aria-hidden="true" xmlns="http://www.w3.org/2000/svg">
|
||
<symbol id="i-back" viewBox="0 0 24 24"><path d="M15 5l-7 7 7 7"/></symbol>
|
||
<symbol id="i-down" viewBox="0 0 24 24"><path d="M6 9l6 6 6-6"/></symbol>
|
||
<symbol id="i-cup" viewBox="0 0 24 24"><path d="M5 8h11v7a5 5 0 0 1-5 5h-1a5 5 0 0 1-5-5zM16 10h1.5a2.5 2.5 0 0 1 0 5H16M8.5 3.5c0 1.5 1 1.5 1 3M12 3.5c0 1.5 1 1.5 1 3"/></symbol>
|
||
<symbol id="i-arrow" viewBox="0 0 24 24"><path d="M5 12h13M13 6.5l5.5 5.5-5.5 5.5"/></symbol>
|
||
</svg>
|
||
|
||
<div id="scroll">
|
||
<header class="bar" id="bar">
|
||
<button class="back" id="back" aria-label="返回"><svg class="ic"><use href="#i-back" xlink:href="#i-back"/></svg></button>
|
||
<span class="t">孕期专题</span>
|
||
</header>
|
||
|
||
<section class="hero">
|
||
<img src="img/hero.webp" alt="孕妈妈坐在窗边,桌上有牛奶、绿叶菜和鱼">
|
||
<h1>叶酸、DHA、铁、钙<br>要不要补?</h1>
|
||
<div class="answer">叶酸要补;钙、铁、DHA 先靠吃,不够再按医生建议补。</div>
|
||
</section>
|
||
|
||
<section class="three fade">
|
||
<h2>记住这 3 点</h2>
|
||
<ol>
|
||
<li><span class="no">1</span><div><b>叶酸 0.4mg/天</b><span>备孕前 3 个月开始,至少吃到孕 12 周</span></div></li>
|
||
<li><span class="no">2</span><div><b>钙铁错开 2 小时</b><span>一起吃会抢吸收,比如铁早上、钙睡前</span></div></li>
|
||
<li><span class="no">3</span><div><b>补剂不是越多越好</b><span>复合维生素和单补别叠加,先算总量</span></div></li>
|
||
</ol>
|
||
</section>
|
||
|
||
<!-- 1 四种营养一张表 -->
|
||
<section class="blk fade" id="s1">
|
||
<h2>四种营养一张表</h2>
|
||
<p class="key">只有叶酸人人要补,其余三样先吃够。</p>
|
||
<div class="card">
|
||
<table class="tbl">
|
||
<colgroup><col class="c1"><col class="c2"><col class="c3"><col></colgroup>
|
||
<thead><tr><th>营养</th><th>要不要补</th><th>每天多少</th><th>先吃什么</th></tr></thead>
|
||
<tbody>
|
||
<tr><td>叶酸</td><td class="y">要补</td><td>0.4mg</td><td>深绿叶菜、豆类</td></tr>
|
||
<tr><td>钙</td><td>先食补</td><td>孕中晚期约 1000mg</td><td>奶、酸奶、豆腐</td></tr>
|
||
<tr><td>铁</td><td>先食补,贫血听医生</td><td>20~29mg,越往后越多</td><td>红肉、动物血,配维 C 果蔬</td></tr>
|
||
<tr><td>DHA</td><td>常吃鱼就不用</td><td>约 200mg</td><td>低汞鱼,每周 2~3 次</td></tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
<details class="why">
|
||
<summary>为什么?<svg class="ic"><use href="#i-down" xlink:href="#i-down"/></svg></summary>
|
||
<p>宝宝神经管在怀孕 3~4 周就闭合,那时很多人还不知道怀孕,而食物里的叶酸怕热易流失,所以要提前补。钙、铁、DHA 从奶、红肉、鱼里吃更全面;植物里的铁吸收差,鲨鱼、旗鱼等大型鱼汞高要少吃。</p>
|
||
</details>
|
||
</section>
|
||
|
||
<!-- 2 按孕周怎么补 -->
|
||
<section class="blk fade" id="s2">
|
||
<h2>按孕周怎么补</h2>
|
||
<p class="key">早期抓叶酸,中期起加上钙、铁、DHA。</p>
|
||
<div class="me" id="me"></div>
|
||
<div class="tl">
|
||
<div class="st" id="stPre"><span class="dot"></span><b>备孕</b><p>开始每天 0.4mg 叶酸</p></div>
|
||
<div class="st" id="stE"><span class="dot"></span><b>孕早期</b><p>叶酸别断,孕吐别硬吃</p></div>
|
||
<div class="st" id="stM"><span class="dot"></span><b>孕中期</b><p>奶加量,常吃鱼和红肉</p></div>
|
||
<div class="st" id="stL"><span class="dot"></span><b>孕晚期·哺乳</b><p>铁需要最多,奶和鱼别断</p></div>
|
||
</div>
|
||
</section>
|
||
|
||
<!-- 3 这些情况先问医生 -->
|
||
<section class="blk fade" id="s3">
|
||
<h2>这些情况先问医生</h2>
|
||
<p class="key">符合任一条,补什么、补多少听医生的。</p>
|
||
<div class="doc">
|
||
<img src="img/doctor.webp" alt="孕妈妈和医生面对面交谈" loading="lazy">
|
||
<p>上面的量只适合一般情况。下面这些人需要量不同,产检时带着问。</p>
|
||
</div>
|
||
<div class="tags">
|
||
<span>贫血</span><span>甲状腺问题</span><span>素食 / 不吃鱼</span><span>双胎 / 多胎</span><span>生过神经管缺陷宝宝</span><span>糖尿病</span><span>长期用药</span><span>在吃复合维生素</span>
|
||
</div>
|
||
</section>
|
||
|
||
<!-- 我的补剂自查 -->
|
||
<section class="blk fade" id="s4">
|
||
<h2>我的补剂自查</h2>
|
||
<p class="key">选 3 个问题,看看该注意什么。</p>
|
||
<div class="card tool" id="tool">
|
||
<div class="q" data-q="stage">
|
||
<div class="q-t">我现在处于</div>
|
||
<div class="opts"><button class="opt" data-v="pre">备孕</button><button class="opt" data-v="e">孕早期</button><button class="opt" data-v="m">孕中期</button><button class="opt" data-v="l">孕晚期</button><button class="opt" data-v="b">哺乳期</button></div>
|
||
</div>
|
||
<div class="q" data-q="milk">
|
||
<div class="q-t">每天喝奶(或酸奶)吗</div>
|
||
<div class="opts"><button class="opt" data-v="2">每天 1~2 杯</button><button class="opt" data-v="1">偶尔喝</button><button class="opt" data-v="0">基本不喝</button></div>
|
||
</div>
|
||
<div class="q" data-q="fish">
|
||
<div class="q-t">每周吃鱼虾几次</div>
|
||
<div class="opts"><button class="opt" data-v="2">2 次以上</button><button class="opt" data-v="1">1 次左右</button><button class="opt" data-v="0">几乎不吃</button></div>
|
||
</div>
|
||
<p class="hint" id="hint">3 题选完自动出结果,只在本机计算</p>
|
||
<div class="res" id="res">
|
||
<h3 id="resT">给你的 3 条建议</h3>
|
||
<ul id="resL"></ul>
|
||
<p class="res-note">仅供参考,补什么、补多少以产检医生意见为准。</p>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
|
||
<!-- 工具入口 -->
|
||
<section class="blk fade">
|
||
<div class="card">
|
||
<div class="go">
|
||
<span class="gi"><svg class="ic"><use href="#i-cup" xlink:href="#i-cup"/></svg></span>
|
||
<div class="gt"><b>补水补剂打卡</b><span>每天吃了没记一笔,不漏吃也不重复</span></div>
|
||
</div>
|
||
<div class="go-wrap"><button class="btn" id="goBushui">去记录<svg class="ic"><use href="#i-arrow" xlink:href="#i-arrow"/></svg></button></div>
|
||
</div>
|
||
</section>
|
||
|
||
<details class="src">
|
||
<summary>参考来源</summary>
|
||
<ul>
|
||
<li>《围受孕期增补叶酸预防神经管缺陷指南(2017)》:无高危因素者从孕前至少 3 个月起每天增补 0.4mg 或 0.8mg 叶酸至孕满 3 个月;高危者由医生定剂量。研究汇总显示可使神经管缺陷风险降低约 50%~70%</li>
|
||
<li>《中国居民膳食指南(2022)》备孕和孕期妇女膳食指南;《中国居民膳食营养素参考摄入量》:孕早、中、晚期铁约 20、24、29mg/天,孕中晚期钙约 1000mg/天;孕期和哺乳期 DHA 约 200mg/天</li>
|
||
<li>中华医学会围产医学分会《妊娠期铁缺乏和缺铁性贫血诊治指南》</li>
|
||
<li>WHO《孕期保健建议:积极的妊娠体验》(2016)</li>
|
||
<li>钙会影响非血红素铁吸收,同时补充建议分开服用;孕期食鱼宜选低汞鱼</li>
|
||
</ul>
|
||
</details>
|
||
<p class="foot">本页为科普参考,不能代替医生诊断。</p>
|
||
</div>
|
||
|
||
<script>
|
||
(function () {
|
||
'use strict';
|
||
var $ = function (s) { return document.querySelector(s); };
|
||
var $$ = function (s, r) { return [].slice.call((r || document).querySelectorAll(s)); };
|
||
function hp(n) { var h = (location.hash.slice(1) || '') + '&' + (location.search.slice(1) || ''); var m = h.match(new RegExp('(?:^|&)' + n + '=([^&]*)')); return m ? decodeURIComponent(m[1]) : ''; }
|
||
var openid = hp('openid');
|
||
var sc = $('#scroll');
|
||
|
||
/* 返回:从首页点进来就 back;直接打开(分享 / 刷新)就回同目录的首页,身份原样带回 */
|
||
$('#back').addEventListener('click', function () {
|
||
if (document.referrer && document.referrer.indexOf(location.host) >= 0 && history.length > 1) history.back();
|
||
else location.href = '../../' + location.search + location.hash;
|
||
});
|
||
|
||
/* 顶栏:滚动后白底 + 细分割线 */
|
||
sc.addEventListener('scroll', function () { $('#bar').classList.toggle('on', sc.scrollTop > 8); }, { passive: true });
|
||
|
||
function go(id) {
|
||
var el = document.getElementById(id); if (!el) return;
|
||
var top = el.getBoundingClientRect().top - sc.getBoundingClientRect().top + sc.scrollTop - 60;
|
||
sc.scrollTo({ top: top, behavior: 'smooth' });
|
||
}
|
||
|
||
/* 补水补剂记录:同源相对路径,带身份 */
|
||
$('#goBushui').addEventListener('click', function () { location.href = '/yunqi-bushui/yindao/' + location.search + location.hash; });
|
||
|
||
/* ---------- 我的补剂自查:3 题,最多 3 条建议 ---------- */
|
||
var ans = { stage: '', milk: '', fish: '' };
|
||
function pick(q, v) {
|
||
$$('.opt', $('.q[data-q="' + q + '"]')).forEach(function (o) { o.classList.toggle('on', o.dataset.v === v); });
|
||
ans[q] = v;
|
||
if (ans.stage && ans.milk && ans.fish) build();
|
||
}
|
||
$$('.q').forEach(function (box) {
|
||
$$('.opt', box).forEach(function (o) {
|
||
o.addEventListener('click', function () {
|
||
var first = !$('#res').classList.contains('on');
|
||
pick(box.dataset.q, o.dataset.v);
|
||
if (first && $('#res').classList.contains('on')) setTimeout(function () { go('res'); }, 60);
|
||
});
|
||
});
|
||
});
|
||
|
||
var TAG = { a: '问医生', t: '加一点', k: '保持' };
|
||
function build() {
|
||
var s = ans.stage, milk = +ans.milk, fish = +ans.fish;
|
||
var later = s === 'm' || s === 'l' || s === 'b';
|
||
var L = [];
|
||
function add(t, b, d) { L.push({ t: t, b: b, d: d }); }
|
||
|
||
if (s === 'pre' || s === 'e') add('t', '叶酸每天 0.4mg,一天别落下', s === 'pre' ? '备孕前 3 个月开始是关键' : '孕早期是神经管发育关键期');
|
||
else if (s === 'b') add('a', '哺乳期叶酸是否继续,问医生', '有的医生会建议继续吃');
|
||
else add('k', '叶酸按医生建议继续吃', '很多医生建议吃到整个孕期');
|
||
|
||
if (milk === 0) add('a', '钙可能不够,问医生要不要补', later ? '孕中晚期和哺乳期每天约需 1000mg' : '先试试酸奶、奶酪、豆腐');
|
||
else if (milk === 1) add('t', '奶加到每天 300~500ml', later ? '偶尔喝时钙容易不足' : '孕中期起钙需要量会增加');
|
||
else add('k', '钙靠喝奶就够,继续保持', '再加点豆腐、深绿叶菜');
|
||
|
||
if (fish === 0) add('a', '问医生是否需要补 DHA', '几乎不吃鱼虾时 DHA 容易不足');
|
||
else if (fish === 1) add('t', '鱼加到每周 2~3 次', '选三文鱼、鳕鱼、鲈鱼等低汞鱼');
|
||
else add('k', 'DHA 吃鱼就够,继续保持', '记得选低汞鱼');
|
||
|
||
var order = { a: 0, t: 1, k: 2 };
|
||
L.sort(function (x, y) { return order[x.t] - order[y.t]; });
|
||
var ul = $('#resL'); ul.innerHTML = '';
|
||
L.slice(0, 3).forEach(function (it) {
|
||
var li = document.createElement('li'); li.className = it.t;
|
||
li.innerHTML = '<i></i><div><b></b><span></span></div>';
|
||
li.querySelector('i').textContent = TAG[it.t];
|
||
li.querySelector('b').textContent = it.b; li.querySelector('span').textContent = it.d;
|
||
ul.appendChild(li);
|
||
});
|
||
$('#hint').style.display = 'none';
|
||
$('#res').classList.add('on');
|
||
}
|
||
|
||
/* 按孕周点亮时间轴,并预选自查的阶段 */
|
||
function mark(stage, txt, v) {
|
||
var el = document.getElementById(stage); if (el) el.classList.add('hl');
|
||
var me = $('#me'); me.textContent = txt; me.classList.add('on');
|
||
if (v && !ans.stage) pick('stage', v);
|
||
}
|
||
if (openid) {
|
||
fetch('/api/mp/public/mama-box/pregnancy?openid=' + encodeURIComponent(openid))
|
||
.then(function (r) { return r.ok ? r.json() : null; })
|
||
.then(function (j) {
|
||
var p = j && j.code === 200 && j.result; if (!p) return;
|
||
if (p.postpartum) mark('stL', '宝宝出生了 · 你在哺乳期', 'b');
|
||
else if (p.week != null && !p.empty) {
|
||
var w = p.week;
|
||
if (w >= 28) mark('stL', '你在孕 ' + w + ' 周 · 孕晚期', 'l');
|
||
else if (w >= 13) mark('stM', '你在孕 ' + w + ' 周 · 孕中期', 'm');
|
||
else mark('stE', '你在孕 ' + w + ' 周 · 孕早期', 'e');
|
||
}
|
||
}).catch(function () {});
|
||
}
|
||
|
||
/* 进场动画(轻) */
|
||
if ('IntersectionObserver' in window) {
|
||
var io = new IntersectionObserver(function (es) { es.forEach(function (e) { if (e.isIntersecting) { e.target.classList.add('in'); io.unobserve(e.target); } }); }, { root: sc, threshold: .08 });
|
||
$$('.fade').forEach(function (el) { io.observe(el); });
|
||
} else $$('.fade').forEach(function (el) { el.classList.add('in'); });
|
||
|
||
/* 禁止下拉回弹:固定外壳 + 容器滚动 + 到顶/到底时拦 touchmove */
|
||
var y0 = 0;
|
||
sc.addEventListener('touchstart', function (e) { y0 = e.touches[0].clientY; }, { passive: true });
|
||
sc.addEventListener('touchmove', function (e) {
|
||
var dy = e.touches[0].clientY - y0;
|
||
if ((sc.scrollTop <= 0 && dy > 0) || (sc.scrollTop + sc.clientHeight >= sc.scrollHeight - 1 && dy < 0)) e.preventDefault();
|
||
}, { passive: false });
|
||
document.addEventListener('touchmove', function (e) { if (!sc.contains(e.target)) e.preventDefault(); }, { passive: false });
|
||
})();
|
||
</script>
|
||
</body>
|
||
</html>
|