预产期占位改为锚定输入框垂直居中, 修复 iOS webview 下错位 (v26090730)

This commit is contained in:
2026-09-08 03:16:28 +08:00
parent 8f78f5b433
commit 915459f21a
2 changed files with 11 additions and 8 deletions

View File

@@ -6,8 +6,8 @@
<meta name="theme-color" content="#F4593C">
<meta name="apple-mobile-web-app-capable" content="yes">
<title>妈妈盒子 · 孕育陪伴</title>
<!-- V:26090729 缓存版本标记:改 css/js 时同步 bump 该值,并给下方资源引用加 ?v= 以强制 webview 刷新子资源 -->
<link rel="stylesheet" href="mama-box.css?v=26090729">
<!-- V:26090730 缓存版本标记:改 css/js 时同步 bump 该值,并给下方资源引用加 ?v= 以强制 webview 刷新子资源 -->
<link rel="stylesheet" href="mama-box.css?v=26090730">
<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
</head>
<body>
@@ -1748,7 +1748,9 @@
默认值不写死在标记里 —— 由 JS 按「打开这一刻 + 3 个月」现算 -->
<!-- 原生 date 空值时是一片空白(不支持 placeholder),叠一层文字占位:
有值由 JS 隐藏(fillProfileForm / pgDue change 都会调 syncDuePh) -->
<label class="fld fld-date"><span>预产期</span><input id="pgDue" type="date"><span class="date-ph" id="pgDuePh">- 年 - 月 - 日</span></label>
<label class="fld fld-date"><span>预产期</span>
<span class="due-box"><input id="pgDue" type="date"><span class="date-ph" id="pgDuePh">- 年 - 月 - 日</span></span>
</label>
<div class="fld-row">
<!-- 孕周/天数由预产期自动算出,打开时按档案回填;新用户留空并锁定 -->
<label class="fld"><span>当前孕周</span><input id="pgWeek" type="number" min="0" max="42" placeholder="—" disabled></label>
@@ -1771,8 +1773,8 @@
加载失败/离线时 window.wx 为 undefined,goMall() 会降级为 toast 提示,
不影响应用其余功能。 -->
<script src="js/app.js?v=26090729"></script>
<!-- 页面版本号(排查 webview 缓存):底部会显示 v26090729 -->
<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">v26090729</div>
<script src="js/app.js?v=26090730"></script>
<!-- 页面版本号(排查 webview 缓存):底部会显示 v26090730 -->
<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">v26090730</div>
</body>
</html>

View File

@@ -2654,5 +2654,6 @@ a.skip:focus{left:16px;top:16px}
.empty-guide .eg-btn:active{transform:scale(.97)}
/* 预产期 date 输入的空值占位(原生 date 不支持 placeholder) */
.fld-date{position:relative}
.fld-date .date-ph{position:absolute;left:16px;bottom:14px;font-size:14px;color:#C9B7AC;pointer-events:none;display:block}
.fld-date .due-box{position:relative;display:block}
/* 占位锚定输入框本身并垂直居中 —— 各内核 date 输入框高度不一,锚 label 底部会错位 */
.fld-date .date-ph{position:absolute;left:16px;top:50%;transform:translateY(-50%);font-size:14px;color:#C9B7AC;pointer-events:none;display:block;line-height:1}