记一下弹窗压到半屏以内:标题一行、今天卡合成一条、宫格5列;修关闭弹窗阴影漏到屏幕底部 (v26100182)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
13
index.html
13
index.html
@@ -7,7 +7,7 @@
|
|||||||
<meta name="mobile-web-app-capable" content="yes">
|
<meta name="mobile-web-app-capable" content="yes">
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
<title>兜爸心选 · 孕育陪伴</title>
|
<title>兜爸心选 · 孕育陪伴</title>
|
||||||
<!-- V:26100181 缓存版本标记:改 css/js 时同步 bump 该值(与 js/app.js 的 VER 同源),静态资源按 mtime 走 ETag 自动刷新 -->
|
<!-- V:26100182 缓存版本标记:改 css/js 时同步 bump 该值(与 js/app.js 的 VER 同源),静态资源按 mtime 走 ETag 自动刷新 -->
|
||||||
<link rel="stylesheet" href="mama-box.css">
|
<link rel="stylesheet" href="mama-box.css">
|
||||||
<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
|
<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
|
||||||
<!-- 共享助手:授权/跳商城/位置上报(分享卡片同步,见 docs/h5-auth-standard.md 第四节) -->
|
<!-- 共享助手:授权/跳商城/位置上报(分享卡片同步,见 docs/h5-auth-standard.md 第四节) -->
|
||||||
@@ -1550,7 +1550,7 @@
|
|||||||
<!-- ⚠️ 临时隐藏(2026-09-22):「今天已记 N 条」依赖记录/统计功能,尚未实现 -->
|
<!-- ⚠️ 临时隐藏(2026-09-22):「今天已记 N 条」依赖记录/统计功能,尚未实现 -->
|
||||||
<p class="tbd-hide"><span id="noteWhen">—</span> · 今天已记 <b id="todayCount">4</b> 条</p>
|
<p class="tbd-hide"><span id="noteWhen">—</span> · 今天已记 <b id="todayCount">4</b> 条</p>
|
||||||
</div>
|
</div>
|
||||||
<button class="sheet-close" data-sheet="close">✕</button>
|
<button class="sheet-close" data-sheet="close" aria-label="关闭"><svg viewBox="0 0 16 16" width="12" height="12" aria-hidden="true"><path d="M3.5 3.5l9 9M12.5 3.5l-9 9" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg></button>
|
||||||
</div>
|
</div>
|
||||||
<div class="sheet-scroll">
|
<div class="sheet-scroll">
|
||||||
<!-- ⚠️ 临时隐藏整块(2026-09-22):「今天已使用」快捷区 + 下方 .quick-row 的功能还没实现
|
<!-- ⚠️ 临时隐藏整块(2026-09-22):「今天已使用」快捷区 + 下方 .quick-row 的功能还没实现
|
||||||
@@ -1571,15 +1571,14 @@
|
|||||||
① 今天卡:日期 + 孕周 + 一圈「今天记了几项」进度环 + 已记的工具小胶囊;
|
① 今天卡:日期 + 孕周 + 一圈「今天记了几项」进度环 + 已记的工具小胶囊;
|
||||||
② 「先记这件」:今天还没用的前 2 个工具,配一句该做的事(todoLine),大卡可点。
|
② 「先记这件」:今天还没用的前 2 个工具,配一句该做的事(todoLine),大卡可点。
|
||||||
接口没回来 / 访客 → 这两块保持隐藏,只剩副标题 + 宫格(和原来一样)。 -->
|
接口没回来 / 访客 → 这两块保持隐藏,只剩副标题 + 宫格(和原来一样)。 -->
|
||||||
|
<!-- 2026-10-02 二改:用户要求弹窗别超过半屏 → 「今天卡」和「先记这件」合成一条:进度环 + 今天记了几项 + 下一件该做的事(去记),
|
||||||
|
已记的工具改成宫格图标上的小勾。整个弹窗 max-height 50%,工具多了宫格内部滚动。 -->
|
||||||
<div class="sk-today hide" id="skToday">
|
<div class="sk-today hide" id="skToday">
|
||||||
<div class="sk-ring" id="skRing" aria-hidden="true"><svg viewBox="0 0 44 44"><circle cx="22" cy="22" r="18"/><circle class="sk-arc" id="skArc" cx="22" cy="22" r="18"/></svg><b id="skNum">0</b></div>
|
<div class="sk-ring" id="skRing" aria-hidden="true"><svg viewBox="0 0 44 44"><circle cx="22" cy="22" r="18"/><circle class="sk-arc" id="skArc" cx="22" cy="22" r="18"/></svg><b id="skNum">0</b></div>
|
||||||
<div class="sk-tt"><b id="skLine"></b><span id="skDone"></span></div>
|
<div class="sk-tt"><b id="skLine"></b><span id="skDone"></span></div>
|
||||||
|
<button class="sk-go hide" id="skGo" type="button">去记</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="sk-next hide" id="skNext">
|
<div class="apps-head for-all tbd-hide">全部孕期工具 <button class="sec-more" data-toast="共 16 个孕期工具">共 16 个 ›</button></div>
|
||||||
<div class="apps-head">先记这件<span class="sk-hint">花一分钟就好</span></div>
|
|
||||||
<div class="sk-cards" id="skCards"></div>
|
|
||||||
</div>
|
|
||||||
<div class="apps-head for-all">全部孕期工具 <button class="sec-more" data-toast="共 16 个孕期工具">共 16 个 ›</button></div>
|
|
||||||
<div class="apps-grid" id="appsGrid">
|
<div class="apps-grid" id="appsGrid">
|
||||||
<button class="app ripple"><img class="a-ico" src="assets/img/505ace532176.png" alt="" aria-hidden="true">数胎动</button>
|
<button class="app ripple"><img class="a-ico" src="assets/img/505ace532176.png" alt="" aria-hidden="true">数胎动</button>
|
||||||
<button class="app ripple"><img class="a-ico" src="assets/img/8b0f0a53938b.png" alt="" aria-hidden="true">孕期体重</button>
|
<button class="app ripple"><img class="a-ico" src="assets/img/8b0f0a53938b.png" alt="" aria-hidden="true">孕期体重</button>
|
||||||
|
|||||||
50
js/app.js
50
js/app.js
@@ -3,7 +3,7 @@
|
|||||||
(function () {
|
(function () {
|
||||||
'use strict';
|
'use strict';
|
||||||
/* 页面版本号(YYMMDD+序号):显示在「关于兜爸心选」页底部;bump 时同步 head 注释与 ?v= */
|
/* 页面版本号(YYMMDD+序号):显示在「关于兜爸心选」页底部;bump 时同步 head 注释与 ?v= */
|
||||||
var VER = '26100181';
|
var VER = '26100182';
|
||||||
const $ = (s, c) => (c || document).querySelector(s);
|
const $ = (s, c) => (c || document).querySelector(s);
|
||||||
const $$ = (s, c) => Array.from((c || document).querySelectorAll(s));
|
const $$ = (s, c) => Array.from((c || document).querySelectorAll(s));
|
||||||
|
|
||||||
@@ -338,7 +338,7 @@
|
|||||||
⚠️ colorTheme 目前全是 'blue' 颜色名 —— 有图时别拿它当底色,否则清一色蓝。 */
|
⚠️ colorTheme 目前全是 'blue' 颜色名 —— 有图时别拿它当底色,否则清一色蓝。 */
|
||||||
const bg = ico ? 'background:#fff' : 'background:' + (a.colorTheme || appTileColor(name));
|
const bg = ico ? 'background:#fff' : 'background:' + (a.colorTheme || appTileColor(name));
|
||||||
const img = ico ? '<img class="a-ico" src="' + ico + '" alt="" loading="lazy">' : '<span class="a-ico a-ico-letter" style="background:' + bg + '">' + name.slice(0, 1) + '</span>';
|
const img = ico ? '<img class="a-ico" src="' + ico + '" alt="" loading="lazy">' : '<span class="a-ico a-ico-letter" style="background:' + bg + '">' + name.slice(0, 1) + '</span>';
|
||||||
return '<button class="app ripple" data-url="' + encodeURIComponent(a.url) + '" data-id="' + encodeURIComponent(a.identifier || '') + '">' + img + name + '</button>';
|
return '<button class="app ripple" data-url="' + encodeURIComponent(a.url) + '" data-id="' + encodeURIComponent(a.identifier || '') + '">' + img + '<span class="a-n">' + name + '</span></button>';
|
||||||
}).join('');
|
}).join('');
|
||||||
/* 磁贴点击(事件委托,innerHTML 重建后不用重绑) */
|
/* 磁贴点击(事件委托,innerHTML 重建后不用重绑) */
|
||||||
grid.onclick = function (e) {
|
grid.onclick = function (e) {
|
||||||
@@ -4662,12 +4662,12 @@
|
|||||||
sheetPaint = function () {
|
sheetPaint = function () {
|
||||||
const n = new Date(Date.now() + 8 * 3600e3); // 北京时间
|
const n = new Date(Date.now() + 8 * 3600e3); // 北京时间
|
||||||
const wd = '日一二三四五六'[n.getUTCDay()];
|
const wd = '日一二三四五六'[n.getUTCDay()];
|
||||||
const wk = state.week ? '孕 ' + state.week + ' 周' + (state.day ? ' +' + state.day + ' 天' : '') + ' · ' : '';
|
const wk = state.week ? '孕' + state.week + '周' + (state.day ? '+' + state.day + '天' : '') + ' · ' : '';
|
||||||
$('#skSub').textContent = wk + (n.getUTCMonth() + 1) + '月' + n.getUTCDate() + '日 周' + wd;
|
$('#skSub').textContent = wk + (n.getUTCMonth() + 1) + '月' + n.getUTCDate() + '日 周' + wd;
|
||||||
const r = _fpMode === 'rows' || _fpMode === 'guide' ? (_fpData || {}) : null;
|
const r = _fpMode === 'rows' || _fpMode === 'guide' ? (_fpData || {}) : null;
|
||||||
const today = $('#skToday'), next = $('#skNext');
|
const today = $('#skToday'), go = $('#skGo');
|
||||||
today.classList.toggle('hide', !r);
|
today.classList.toggle('hide', !r);
|
||||||
next.classList.add('hide');
|
go.classList.add('hide');
|
||||||
$$('#appsGrid .app').forEach(b => b.classList.remove('is-done'));
|
$$('#appsGrid .app').forEach(b => b.classList.remove('is-done'));
|
||||||
if (!r) return;
|
if (!r) return;
|
||||||
const used = (r.used || []).filter(u => u.appName), unused = r.unused || [];
|
const used = (r.used || []).filter(u => u.appName), unused = r.unused || [];
|
||||||
@@ -4676,36 +4676,22 @@
|
|||||||
$('#skNum').textContent = used.length;
|
$('#skNum').textContent = used.length;
|
||||||
$('#skArc').style.strokeDasharray = (total ? used.length / total * 113.1 : 0).toFixed(1) + ' 113.1';
|
$('#skArc').style.strokeDasharray = (total ? used.length / total * 113.1 : 0).toFixed(1) + ' 113.1';
|
||||||
$('#skLine').textContent = used.length ? '今天已经记了 ' + used.length + ' 项' : '今天还没有记录';
|
$('#skLine').textContent = used.length ? '今天已经记了 ' + used.length + ' 项' : '今天还没有记录';
|
||||||
const done = $('#skDone');
|
/* 宫格里今天用过的工具打个小勾(代替原来那排「已记」小胶囊) */
|
||||||
done.textContent = '';
|
|
||||||
if (used.length) {
|
|
||||||
used.slice(0, 4).forEach(u => { const c = document.createElement('i'); c.textContent = u.appName; done.appendChild(c); });
|
|
||||||
if (used.length > 4) done.append('等 ' + used.length + ' 项');
|
|
||||||
} else done.textContent = '记下一笔,就是' + nm + '今天的第一只小脚丫';
|
|
||||||
/* 宫格里今天用过的工具打个小勾 */
|
|
||||||
const usedIds = new Set(used.map(u => u.identifier).filter(Boolean));
|
const usedIds = new Set(used.map(u => u.identifier).filter(Boolean));
|
||||||
$$('#appsGrid .app').forEach(b => { if (usedIds.has(decodeURIComponent(b.dataset.id || ''))) b.classList.add('is-done'); });
|
$$('#appsGrid .app').forEach(b => { if (usedIds.has(decodeURIComponent(b.dataset.id || ''))) b.classList.add('is-done'); });
|
||||||
/* 先记这件:前 2 个还没用的 */
|
/* 下一件:第一个还没用、且有链接的工具 */
|
||||||
const box = $('#skCards');
|
const done = $('#skDone');
|
||||||
box.innerHTML = '';
|
let nx = null;
|
||||||
unused.slice(0, 2).forEach((u, i) => {
|
for (const u of unused) {
|
||||||
const ident = u.identifier || '', app = ident ? APP_BY_ID[ident] : null;
|
const ident = u.identifier || '', app = ident ? APP_BY_ID[ident] : null;
|
||||||
const href = u.url || (app && app.url) || '';
|
const href = u.url || (app && app.url) || '', name = u.appName || (app && app.name) || '';
|
||||||
const name = u.appName || (app && app.name) || '';
|
if (href && name) { nx = { href, name, id: (app && app.identifier) || ident }; break; }
|
||||||
if (!href || !name) return;
|
}
|
||||||
const [t, d] = todoLine(name);
|
if (nx) {
|
||||||
const logo = (app && (app.logo || app.icon)) || '';
|
done.textContent = '下一件:' + todoLine(nx.name)[0];
|
||||||
const c = document.createElement('button');
|
go.classList.remove('hide');
|
||||||
c.type = 'button';
|
go.onclick = () => jumpApp(nx.href, nx.id);
|
||||||
c.className = 'sk-card ripple c' + i;
|
} else done.textContent = used.length ? '今天要记的都记好啦' : '记下一笔,就是' + nm + '今天的第一只小脚丫';
|
||||||
c.innerHTML = (logo ? '<img alt="" loading="lazy">' : '<span class="sk-l"></span>') + '<b></b><em></em><span class="sk-go">去记 ›</span>';
|
|
||||||
if (logo) c.querySelector('img').src = logo; else c.querySelector('.sk-l').textContent = name.slice(0, 1);
|
|
||||||
c.querySelector('b').textContent = t;
|
|
||||||
c.querySelector('em').textContent = d;
|
|
||||||
c.addEventListener('click', () => jumpApp(href, (app && app.identifier) || ident));
|
|
||||||
box.appendChild(c);
|
|
||||||
});
|
|
||||||
next.classList.toggle('hide', !box.childElementCount);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* 加载中的中性占位(不是假数据):与 index.html 里那条首屏占位同构 */
|
/* 加载中的中性占位(不是假数据):与 index.html 里那条首屏占位同构 */
|
||||||
|
|||||||
32
mama-box.css
32
mama-box.css
@@ -4063,3 +4063,35 @@ a.skip:focus{left:16px;top:16px}
|
|||||||
/* 2026-10-02 用户:入口星星小一点、少一点,别挡住「X周孕妈悄悄话」那行字 —— 星星只放在文字行之间 / 四周空处(见 index.html),不再放大 */
|
/* 2026-10-02 用户:入口星星小一点、少一点,别挡住「X周孕妈悄悄话」那行字 —— 星星只放在文字行之间 / 四周空处(见 index.html),不再放大 */
|
||||||
.we-sky i{transform:scale(1);opacity:.85;filter:drop-shadow(0 0 1.5px rgba(255,255,255,.6))}
|
.we-sky i{transform:scale(1);opacity:.85;filter:drop-shadow(0 0 1.5px rgba(255,255,255,.6))}
|
||||||
@keyframes weTw{0%,100%{opacity:.9;transform:scale(1)}50%{opacity:.2;transform:scale(.55)}}
|
@keyframes weTw{0%,100%{opacity:.9;transform:scale(1)}50%{opacity:.2;transform:scale(.55)}}
|
||||||
|
|
||||||
|
/* ================= 「记一下」弹窗压到半屏以内(2026-10-02 二改)=================
|
||||||
|
用户:「弹出的框尽量别超过 1/2」。标题一行、今天卡合成一条细条、宫格 5 列小图标;工具多了宫格自己滚。 */
|
||||||
|
.sheet{max-height:50%}
|
||||||
|
.sheet-grip{padding:8px 0 2px}
|
||||||
|
.sheet-head{align-items:center;padding:4px 18px 10px 22px}
|
||||||
|
.sheet-head>div{display:flex;align-items:baseline;gap:10px;min-width:0}
|
||||||
|
.sheet-head h2{font-size:19px;letter-spacing:0;flex:none}
|
||||||
|
.sheet-head p.sk-sub{margin:0;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
||||||
|
.sheet-close{width:30px;height:30px;font-size:0}
|
||||||
|
.sheet-scroll{padding:0 16px calc(12px + env(safe-area-inset-bottom))}
|
||||||
|
.sk-today{gap:10px;margin:0 2px 14px;padding:9px 10px 9px 12px;border-radius:16px}
|
||||||
|
.sk-ring{width:36px;height:36px}
|
||||||
|
.sk-ring circle{stroke-width:5}
|
||||||
|
.sk-ring b{font-size:14px}
|
||||||
|
.sk-tt{gap:2px}
|
||||||
|
.sk-tt>b{font-size:14px}
|
||||||
|
.sk-tt>span{display:block;font-size:11.5px;line-height:1.4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
||||||
|
.sk-today .sk-go{flex:none;margin:0;padding:0 14px;height:30px;border-radius:99px;font-size:12.5px;font-weight:700;color:#fff;
|
||||||
|
background:linear-gradient(135deg,#F09A80,#E07560);box-shadow:0 4px 10px rgba(224,117,96,.28)}
|
||||||
|
.sk-today .sk-go.hide{display:none}
|
||||||
|
.sk-today .sk-go:active{transform:scale(.94)}
|
||||||
|
.apps-grid{grid-template-columns:repeat(5,1fr);grid-auto-rows:auto;gap:14px 4px;align-content:start}
|
||||||
|
.apps-grid .app{gap:5px;font-size:11px;min-width:0;line-height:1.25}
|
||||||
|
.apps-grid .app .a-ico{width:42px;height:42px}
|
||||||
|
.apps-grid .a-ico-letter{width:42px;border-radius:14px;font-size:17px}
|
||||||
|
.apps-grid .a-n{display:block;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:10.5px;letter-spacing:-.4px}
|
||||||
|
.apps-grid .app.is-done::after{top:-4px;right:calc(50% - 27px);width:15px;height:15px;background-size:10px}
|
||||||
|
#appsGrid{grid-auto-rows:auto;max-height:none;overflow:visible;padding:6px 0 0}
|
||||||
|
/* 2026-10-02 修:关着的弹窗/弹层都停在屏幕下沿外(translateY(102%)),但向上的 box-shadow 会漏进屏幕底部约 30px,
|
||||||
|
六七个叠起来就是底部一条发灰发糊的带子(压在「记一下」最后一行字和首页底部上)。关着时不要阴影。 */
|
||||||
|
.modal:not(.show),.sheet:not(.show){box-shadow:none!important}
|
||||||
|
|||||||
Reference in New Issue
Block a user