Files
mama-box/topic/zhichang/index.html

399 lines
24 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!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>孕妈产后复工 · 职场维权指南</title>
<!-- 孕期专题 · 职场维权(孕期首页「其他妈妈也在搜」第 5 条)。
2026-10-31 按《孕期专题页统一设计规范 v2》重做:清新、简洁、核心明确;主色 #5B6CFF。
只写全国通用法条(《女职工劳动保护特别规定》《劳动合同法》《妇女权益保障法》《社会保险法》《劳动争议调解仲裁法》),
地方差异一律写「以当地规定为准」。自成一页:不引 app.js;返回兜底走相对路径 ../../ 并带回 search + hash。 -->
<style>
:root{--c:#5B6CFF;--cbg:#EEF0FF;--h:#1F2329;--t:#4E5969;--m:#86909C;--line:#EEF0F3;--sec:#F7F8FA}
*{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;-webkit-overflow-scrolling:touch;overscroll-behavior:none;padding-bottom:calc(28px + env(safe-area-inset-bottom))}
img{display:block;max-width:100%}
button,input{font:inherit;border:0;background:none;color:inherit}
button{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:rgba(255,255,255,0);border-bottom:1px solid transparent;transition:background .2s,border-color .2s}
.bar.on{background:#fff;border-bottom-color:var(--line)}
.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)}
.wrap{padding:0 20px}
/* Hero */
.hero img{width:100%;height:190px;object-fit:cover;object-position:center 30%;border-radius:20px;margin-top:4px}
h1{margin-top:18px;font-size:26px;font-weight:800;line-height:1.3;color:var(--h)}
.ans{margin-top:12px;padding:12px 14px;border-radius:14px;background:var(--cbg);border-left:4px solid var(--c);font-size:16px;font-weight:700;line-height:1.6;color:var(--h)}
/* 个性化提示条 */
.me{display:none;margin-top:12px;align-items:center;gap:8px;padding:9px 12px;border-radius:12px;background:var(--sec);font-size:13px;line-height:1.5;color:var(--t)}
.me.on{display:flex}
.me .ic{color:var(--c);width:18px;height:18px}
.me span{flex:1;min-width:0}
.me button{flex:none;font-size:13px;color:var(--c);font-weight:600}
/* 记住这 3 点 */
.key{margin-top:28px}
h2{font-size:18px;font-weight:700;line-height:1.4;color:var(--h)}
.key ol{list-style:none;margin-top:6px}
.key li{display:flex;gap:14px;align-items:flex-start;padding:12px 0;border-bottom:1px solid var(--line)}
.key li:last-child{border-bottom:0}
.key .no{flex:none;width:26px;font-size:28px;line-height:1.1;font-weight:800;color:var(--c);font-family:Georgia,"Times New Roman",serif}
.key b{display:block;font-size:16px;line-height:1.45}
.key span{display:block;font-size:13px;color:var(--m);line-height:1.5;margin-top:1px}
/* 分节 */
.sec{margin-top:28px;padding:24px 20px;background:var(--sec);scroll-margin-top:48px}
.sec.w{background:#fff}
.sec+.sec{margin-top:0}
.lead{margin-top:4px;font-size:15px;font-weight:700;color:var(--c);line-height:1.6}
/* 三阶段卡 */
.stg{margin-top:12px;padding:14px 16px;border-radius:18px;background:#fff;border:1px solid var(--line);transition:border-color .3s,box-shadow .3s}
.stg.hl{border-color:var(--c);box-shadow:0 0 0 3px rgba(91,108,255,.12)}
.stg .hd{display:flex;align-items:center;gap:8px}
.stg .hd .ic{color:var(--c);width:22px;height:22px}
.stg .hd b{font-size:16px}
.stg .hd small{margin-left:auto;font-size:12.5px;color:var(--m)}
.stg .hd .now{display:none;margin-left:6px;font-size:11.5px;color:#fff;background:var(--c);border-radius:99px;padding:0 8px;line-height:20px}
.stg.hl .hd .now{display:inline-block}
.stg ul{list-style:none;margin-top:6px}
.stg li{position:relative;padding-left:14px;font-size:14.5px;line-height:1.7}
.stg li::before{content:"";position:absolute;left:2px;top:.72em;width:5px;height:5px;border-radius:50%;background:var(--c);opacity:.55}
.stg li b{font-weight:600}
/* 折叠 */
details.fold{margin-top:12px;border-radius:14px;background:#fff;border:1px solid var(--line)}
details.fold summary{list-style:none;display:flex;align-items:center;gap:8px;padding:11px 14px;font-size:14px;font-weight:600;color:var(--h)}
details.fold summary::-webkit-details-marker{display:none}
details.fold summary .ic{width:18px;height:18px;color:var(--c)}
details.fold summary::after{content:"展开";margin-left:auto;font-size:12.5px;font-weight:400;color:var(--m)}
details.fold[open] summary::after{content:"收起"}
details.fold .bd{padding:0 14px 12px;font-size:13.5px;line-height:1.7}
details.fold .bd p+p{margin-top:6px}
/* 计算器 */
.calc{margin-top:12px;padding:16px;border-radius:18px;background:#fff;border:1px solid var(--line)}
.fld+.fld{margin-top:14px}
.lb{display:block;font-size:13.5px;font-weight:600;color:var(--h)}
.hint{display:block;margin-top:4px;font-size:12.5px;color:var(--m);line-height:1.5}
.inp{margin-top:6px;display:block;width:100%;height:44px;padding:0 14px;border-radius:12px;background:var(--sec);border:1px solid var(--line);font-size:15px;color:var(--h);-webkit-appearance:none;appearance:none}
.inp:focus{outline:none;border-color:var(--c)}
.seg{margin-top:6px;display:flex;gap:4px;padding:3px;border-radius:12px;background:var(--sec)}
.seg button{flex:1;min-width:0;height:36px;border-radius:10px;font-size:14px;color:var(--t);white-space:nowrap}
.seg button.on{background:#fff;color:var(--c);font-weight:700;box-shadow:0 1px 4px rgba(0,0,0,.08)}
.stp{margin-top:6px;display:flex;align-items:center;gap:8px}
.stp button{flex:none;width:44px;height:44px;border-radius:12px;border:1px solid var(--c);color:var(--c);font-size:20px;font-weight:600;display:grid;place-items:center}
.stp .inp{margin-top:0;flex:1;min-width:0;text-align:center;font-weight:700}
.stp em{flex:none;font-style:normal;font-size:14px;color:var(--t)}
.res{margin-top:16px;padding:14px;border-radius:14px;background:var(--cbg)}
.res .empty{font-size:14px;color:var(--t);text-align:center}
.res .tot{display:flex;align-items:baseline;gap:6px;color:var(--c)}
.res .tot em{font-style:normal;font-size:36px;line-height:1.1;font-weight:800}
.res .tot span{font-size:15px;font-weight:700}
.res .tot small{margin-left:auto;font-size:12.5px;color:var(--m)}
.res .dt{margin-top:10px;display:grid;grid-template-columns:1fr 1fr;gap:8px}
.res .dt div{padding:8px 10px;border-radius:12px;background:#fff;line-height:1.35}
.res .dt small{display:block;font-size:12.5px;color:var(--m)}
.res .dt b{display:block;margin-top:2px;font-size:15px;white-space:nowrap}
.res .note{margin-top:8px;font-size:12.5px;color:var(--m);line-height:1.5}
/* 维权四步 */
.flow{list-style:none;margin-top:16px;display:grid;grid-template-columns:repeat(4,1fr);gap:4px;position:relative}
.flow::before{content:"";position:absolute;left:12.5%;right:12.5%;top:15px;height:2px;background:#D5DAFF}
.flow li{position:relative;text-align:center}
.flow .n{display:grid;place-items:center;width:32px;height:32px;margin:0 auto;border-radius:50%;background:var(--c);color:#fff;font-weight:800;font-size:15px;box-shadow:0 0 0 4px var(--sec)}
.flow b{display:block;margin-top:8px;font-size:14px;line-height:1.4}
.flow span{display:block;margin-top:3px;font-size:12px;color:var(--m);line-height:1.45}
.flow .lim{color:var(--c);font-weight:600}
.hot{margin-top:16px;display:flex;gap:8px}
.hot a{flex:1;min-width:0;display:flex;align-items:center;gap:8px;padding:10px 12px;border-radius:14px;background:#fff;border:1px solid var(--line);text-decoration:none;color:var(--t);font-size:12.5px;line-height:1.35}
.hot a .ic{color:var(--c)}
.hot a b{display:block;font-size:16px;color:var(--h)}
/* 页底 */
.src{margin:24px 20px 0}
.src ul{list-style:none}
.src li{padding:6px 0;border-top:1px solid var(--line);font-size:12.5px;line-height:1.6;color:var(--t)}
.src li:first-child{border-top:0}
.foot{margin:14px 20px 0;font-size:12px;color:var(--m);text-align:center;line-height:1.6}
.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>
<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-preg" viewBox="0 0 24 24"><circle cx="11" cy="4.5" r="2"/><path d="M10 8.5c-1.5 1.5-2 3.5-2 6V21M11 9.5c3.5 0 6 2 6 4.5s-2 4-5 4h-1M11 21v-3"/></symbol>
<symbol id="i-baby" viewBox="0 0 24 24"><circle cx="12" cy="12.5" r="8.5"/><path d="M9.2 11.5h.01M14.8 11.5h.01M9.5 15.2c1.4 1.2 3.6 1.2 5 0M12 4c-1.2 0-1.6 1.2-.8 2"/></symbol>
<symbol id="i-bottle" viewBox="0 0 24 24"><path d="M8 10h8v9a2 2 0 0 1-2 2h-4a2 2 0 0 1-2-2zM9 10V7.5h6V10M10.5 7.5L11 4h2l.5 3.5M8 14h3M8 17h3"/></symbol>
<symbol id="i-cal" viewBox="0 0 24 24"><rect x="3.5" y="5" width="17" height="15.5" rx="3"/><path d="M3.5 10h17M8 3v4M16 3v4"/></symbol>
<symbol id="i-phone" viewBox="0 0 24 24"><path d="M5 4h4l2 5-2.5 1.5a11 11 0 0 0 5 5L15 13l5 2v4a1 1 0 0 1-1 1A16 16 0 0 1 4 5a1 1 0 0 1 1-1z"/></symbol>
<symbol id="i-plus" viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="M12 8v8M8 12h8"/></symbol>
<symbol id="i-coin" viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="M9 8l3 4 3-4M12 12v5M9 13h6M9 15.5h6"/></symbol>
<symbol id="i-book" viewBox="0 0 24 24"><path d="M5 19.5v-15A1.5 1.5 0 0 1 6.5 3H19v15H6.5A1.5 1.5 0 0 0 5 19.5 1.5 1.5 0 0 0 6.5 21H19M9 7.5h6"/></symbol>
<symbol id="i-pin" viewBox="0 0 24 24"><path d="M12 21s-6.5-5.5-6.5-11a6.5 6.5 0 0 1 13 0c0 5.5-6.5 11-6.5 11z"/><circle cx="12" cy="10" r="2.3"/></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>
<div class="wrap">
<section class="hero">
<img src="img/hero.webp" alt="职场妈妈抱着宝宝站在办公室窗前">
<h1>孕妈产后复工,<br>职场维权指南</h1>
<div class="ans">孕期、产期、哺乳期,单位不能因此辞退你、降你工资。</div>
<div class="me" id="me"><svg class="ic"><use href="#i-pin" xlink:href="#i-pin"/></svg><span id="meT"></span><button id="meGo">去看</button></div>
</section>
<section class="key">
<h2>记住这 3 点</h2>
<ol>
<li><span class="no">1</span><div><b>产假不少于 98 天</b><span>难产、多胞胎另加,各省还有奖励假</span></div></li>
<li><span class="no">2</span><div><b>产检算上班时间</b><span>不扣工资,也不算请假</span></div></li>
<li><span class="no">3</span><div><b>每天 1 小时哺乳时间</b><span>宝宝 1 岁内,多 1 个宝宝多 1 小时</span></div></li>
</ol>
</section>
</div>
<!-- 1 三个阶段 -->
<section class="sec" id="s1">
<h2>三个阶段的保护</h2>
<p class="lead">不得降薪、不得辞退,合同到期也要顺延。</p>
<article class="stg fade" id="stA">
<div class="hd"><svg class="ic"><use href="#i-preg" xlink:href="#i-preg"/></svg><b>孕期</b><span class="now">你在这里</span><small>怀孕上班</small></div>
<ul>
<li>产检时间<b>计入劳动时间</b></li>
<li>干不了原岗位,凭医院证明可减量或调岗</li>
<li>满 7 个月,<b>不加班、不排夜班</b></li>
</ul>
</article>
<article class="stg fade" id="stB">
<div class="hd"><svg class="ic"><use href="#i-baby" xlink:href="#i-baby"/></svg><b>产假</b><span class="now">你在这里</span><small>至少 98 天</small></div>
<ul>
<li>98 天,其中<b>产前可休 15 天</b></li>
<li>难产 +15 天,每多 1 个宝宝 +15 天</li>
<li>各省奖励假另加,以当地规定为准</li>
</ul>
</article>
<article class="stg fade" id="stC">
<div class="hd"><svg class="ic"><use href="#i-bottle" xlink:href="#i-bottle"/></svg><b>哺乳期</b><span class="now">你在这里</span><small>宝宝 1 岁内</small></div>
<ul>
<li>每天<b>1 小时哺乳时间</b>,在上班时间内</li>
<li>不加班、不排夜班</li>
<li>合同到期,<b>顺延到哺乳期结束</b></li>
</ul>
</article>
<details class="fold">
<summary><svg class="ic"><use href="#i-plus" xlink:href="#i-plus"/></svg>还有这些也受保护</summary>
<div class="bd">
<p><b>流产假:</b>怀孕未满 4 个月 15 天,满 4 个月 42 天。</p>
<p><b>晋升:</b>不得因怀孕、生育、哺乳限制晋职、晋级、评职称。</p>
<p><b>调岗降薪:</b>改岗位、薪酬须协商一致并书面确认。</p>
<p><b>违法辞退:</b>可要求继续履行合同,或主张经济补偿 2 倍的赔偿金。严重违纪等情形除外。</p>
</div>
</details>
</section>
<!-- 2 产假计算器 -->
<section class="sec w" id="s2">
<h2>我的产假怎么算</h2>
<p class="lead">98 天是底线,加上本省天数才是你能休的。</p>
<div class="calc fade">
<div class="fld">
<label class="lb" for="cDue">预产期</label>
<input class="inp" id="cDue" type="date">
</div>
<div class="fld">
<span class="lb">是否难产</span>
<div class="seg" id="cHard"><button data-v="0" class="on">否</button><button data-v="1">是 +15 天</button></div>
</div>
<div class="fld">
<span class="lb">几胞胎</span>
<div class="seg" id="cMulti"><button data-v="1" class="on">单胎</button><button data-v="2">双胞胎</button><button data-v="3">三胞胎</button></div>
</div>
<div class="fld">
<span class="lb">本省可延长天数</span>
<div class="stp"><button id="cMinus" aria-label="减少">-</button><input class="inp" id="cLocal" type="number" inputmode="numeric" min="0" max="365" value="0"><em>天</em><button id="cPlus" aria-label="增加">+</button></div>
<span class="hint">各省不同,可问单位人事或当地人社;不确定先填 0</span>
</div>
<div class="res" id="cRes"></div>
</div>
</section>
<!-- 3 维权 -->
<section class="sec" id="s3">
<h2>被劝退、降薪怎么办</h2>
<p class="lead">别签「自愿离职」,先留证据。</p>
<ol class="flow fade">
<li><span class="n">1</span><b>留证据</b><span>聊天、工资条截图备份</span></li>
<li><span class="n">2</span><b>书面沟通</b><span>邮件写明诉求</span></li>
<li><span class="n">3</span><b>监察投诉</b><span>找当地人社劳动监察</span></li>
<li><span class="n">4</span><b>劳动仲裁</b><span class="lim">时效 1 年</span><span>不收费</span></li>
</ol>
<div class="hot">
<a href="tel:12333"><svg class="ic"><use href="#i-phone" xlink:href="#i-phone"/></svg><div><b>12333</b>人社热线</div></a>
<a href="tel:12338"><svg class="ic"><use href="#i-phone" xlink:href="#i-phone"/></svg><div><b>12338</b>妇女维权热线</div></a>
</div>
<details class="fold">
<summary><svg class="ic"><use href="#i-coin" xlink:href="#i-coin"/></svg>产假期间,钱怎么发?</summary>
<div class="bd">
<p><b>交了生育保险:</b>由生育保险基金发生育津贴,按单位上年度职工月平均工资计发。</p>
<p><b>没交:</b>单位按你产假前的工资发。</p>
<p>津贴低于原工资要不要补差,以当地规定为准。</p>
</div>
</details>
</section>
<details class="fold src">
<summary><svg class="ic"><use href="#i-book" xlink:href="#i-book"/></svg>参考来源</summary>
<div class="bd"><ul>
<li>《女职工劳动保护特别规定》第 5~10 条:不得因三期降薪辞退;孕期减量、产检计入劳动时间、7 个月以上不加班不排夜班;98 天产假及难产、多胞胎、流产假;生育津贴;哺乳时间与设施</li>
<li>《劳动合同法》第 35、42、45、48、87 条:变更合同须书面协商;三期内不得依第 40、41 条解除;合同期满顺延至三期结束;违法解除继续履行或 2 倍赔偿金</li>
<li>《妇女权益保障法》(2022 年修订)第 48 条:不得因怀孕、产假、哺乳降低工资福利,限制晋职、晋级、评职称,辞退或解除合同</li>
<li>《社会保险法》第 53~56 条:生育保险待遇含生育医疗费用和生育津贴</li>
<li>《劳动争议调解仲裁法》第 27、53 条:仲裁时效 1 年,自知道或应当知道权利被侵害之日起算;仲裁不收费</li>
<li>计算器:98 天 + 难产 15 天 + 每多 1 个宝宝 15 天 + 本省天数,按预产期前 15 天起休估算;实际以分娩日期、单位审批及当地规定(含节假日是否顺延、剖宫产是否按难产)为准</li>
</ul></div>
</details>
<p class="foot">本页为法律常识整理,不构成法律意见。</p>
</div>
<script>
(function () {
'use strict';
var $ = function (s) { return document.querySelector(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;
});
/* 顶栏:滚动后白底细线 */
var bar = $('#bar');
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' });
}
/* ---------- 产假计算器 ---------- */
function pad(n) { return (n < 10 ? '0' : '') + n; }
function iso(d) { return d.getFullYear() + '-' + pad(d.getMonth() + 1) + '-' + pad(d.getDate()); }
function parseDay(s) { var m = /^(\d{4})-(\d{1,2})-(\d{1,2})/.exec(s || ''); return m ? new Date(+m[1], +m[2] - 1, +m[3]) : null; }
function addDays(d, n) { return new Date(d.getFullYear(), d.getMonth(), d.getDate() + n); } /* 按日历日加,避开夏令时 */
function cn(d) { return d.getFullYear() + '年' + (d.getMonth() + 1) + '月' + d.getDate() + '日'; }
function segVal(id) { var b = document.querySelector('#' + id + ' .on'); return b ? +b.dataset.v : 0; }
[].forEach.call(document.querySelectorAll('.seg'), function (s) {
s.addEventListener('click', function (e) {
var b = e.target.closest('button'); if (!b) return;
[].forEach.call(s.children, function (x) { x.classList.toggle('on', x === b); });
calc();
});
});
var loc = $('#cLocal');
function localDays() { var v = parseInt(loc.value, 10); return isNaN(v) || v < 0 ? 0 : Math.min(v, 365); }
$('#cMinus').addEventListener('click', function () { loc.value = Math.max(0, localDays() - 1); calc(); });
$('#cPlus').addEventListener('click', function () { loc.value = Math.min(365, localDays() + 1); calc(); });
loc.addEventListener('input', calc);
loc.addEventListener('blur', function () { loc.value = localDays(); calc(); });
$('#cDue').addEventListener('input', calc);
$('#cDue').addEventListener('change', calc);
/* 国家 = 98 + 难产 15 + (胎数-1)×15;合计 = 国家 + 本省;
起休 = 预产期前 15 天(pre=0 则预产期当天);最后一天 = 起休 + 合计 - 1;返岗 = 起休 + 合计 */
function compute(due, hard, multi, local, pre) {
if (pre === undefined) pre = 1;
var nat = 98 + (hard ? 15 : 0) + (multi - 1) * 15;
var total = nat + local;
var start = addDays(due, pre ? -15 : 0);
return { nat: nat, total: total, start: start, last: addDays(start, total - 1), back: addDays(start, total) };
}
window.__leaveCalc = compute; /* 自查用 */
function calc() {
var box = $('#cRes'), due = parseDay($('#cDue').value);
if (!due) { box.innerHTML = '<div class="empty">填上预产期,马上帮你算</div>'; return; }
var r = compute(due, segVal('cHard'), segVal('cMulti') || 1, localDays(), 1);
box.innerHTML =
'<div class="tot"><em id="rTotal">' + r.total + '</em><span>天产假</span><small>国家规定 ' + r.nat + ' 天</small></div>' +
'<div class="dt"><div><small>开始休</small><b id="rStart">' + cn(r.start) + '</b></div>' +
'<div><small>返岗日</small><b id="rBack">' + cn(r.back) + '</b></div></div>' +
'<p class="note">按预产期前 15 天起休估算,以实际分娩日为准。</p>';
}
calc();
/* ---------- 按孕周点亮阶段 + 预填预产期 ---------- */
function mark(stage, t, target) {
var el = document.getElementById(stage); if (el) el.classList.add('hl');
$('#meT').textContent = t;
$('#meGo').onclick = function () { go(target || stage); };
$('#me').classList.add('on');
}
if (openid) {
var base = '/api/mp/public/mama-box/';
fetch(base + 'profile?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 || !p.dueDate) return;
var d = parseDay(p.dueDate), inp = $('#cDue');
if (d && !inp.value) { inp.value = iso(d); calc(); }
}).catch(function () {});
fetch(base + '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;
/* 先判产后(产后返回体 week 也是 null) */
if (p.postpartum) mark('stC', '宝宝出生了,重点看哺乳期的保护');
else if (p.week != null && !p.empty) {
var w = p.week;
if (w >= 28) mark('stA', '孕 ' + w + ' 周,已满 7 个月:不加班,算算产假', 's2');
else mark('stA', '孕 ' + w + ' 周,先看孕期的保护');
}
}).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: .1 });
[].forEach.call(document.querySelectorAll('.fade'), function (el) { io.observe(el); });
} else [].forEach.call(document.querySelectorAll('.fade'), 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>