B 三件:周报打印入口+手机端三屏+知识点自动归类(235 测试)
This commit is contained in:
@@ -101,6 +101,7 @@ h1{font-size:22px;margin:0 0 4px}
|
||||
|
||||
.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
|
||||
.grid2{display:grid;grid-template-columns:1.55fr 1fr;gap:14px;align-items:start}
|
||||
.four{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
|
||||
.stat{padding:16px 16px 14px}
|
||||
.stat .k{font-size:12px;color:var(--muted)}
|
||||
.stat .v{font-size:26px;font-weight:700;margin:6px 0 2px;letter-spacing:.5px}
|
||||
@@ -261,6 +262,45 @@ td .t{font-family:"Consolas",monospace;font-size:13.5px}
|
||||
.grid2{grid-template-columns:1fr}
|
||||
}
|
||||
|
||||
/* ---------- 手机:侧栏变底部导航,三屏可用(今日训练 / 周报 / 错题本) ---------- */
|
||||
@media (max-width:760px){
|
||||
.app{display:block;height:auto;overflow:visible}
|
||||
/* 侧栏整体下沉成底部 tab 栏 */
|
||||
.side{
|
||||
position:fixed;left:0;right:0;bottom:0;top:auto;width:auto;flex:0 0 auto;
|
||||
flex-direction:row;padding:6px 6px 8px;border-right:0;border-top:1px solid var(--line);
|
||||
background:rgba(255,253,247,.97);backdrop-filter:blur(8px);z-index:70;
|
||||
box-shadow:0 -8px 22px rgba(90,70,50,.10);
|
||||
}
|
||||
.side .logo,.side .scene,.side .foot{display:none}
|
||||
/* 底部只留六个常按的:工作台 / 今日训练 / 拍照入库 / 错题本 / 周报 / 设置 */
|
||||
.nav a[data-v="plan"],.nav a[data-v="analysis"],.nav a[data-v="grad"],
|
||||
.nav a[data-v="careless"],.nav a[data-v="kids"]{display:none}
|
||||
.nav{flex-direction:row;justify-content:space-between;gap:0;flex:1;overflow:visible;padding:0}
|
||||
.nav a{flex:1;flex-direction:column;gap:3px;padding:6px 2px;font-size:10.5px;white-space:nowrap;border-radius:12px}
|
||||
.nav a svg{width:19px;height:19px;flex:none}
|
||||
.nav .badge{margin-left:0}
|
||||
.main{height:100dvh;overflow:hidden}
|
||||
.top{height:52px;flex:0 0 52px;padding:0 12px;gap:8px}
|
||||
.top .search{display:none}
|
||||
.scroll{padding:14px 12px 96px}
|
||||
h1{font-size:20px}
|
||||
h2{font-size:16px}
|
||||
.grid2,.train{grid-template-columns:1fr}
|
||||
.rail{order:3}
|
||||
.four{grid-template-columns:1fr 1fr}
|
||||
/* 错题本:手机上收掉「错因/下次复习」两列,只留题目+状态,避免每个字竖排 */
|
||||
#wrongTable th:nth-child(3),#wrongTable td:nth-child(3),
|
||||
#wrongTable th:nth-child(5),#wrongTable td:nth-child(5){display:none}
|
||||
table{font-size:12.5px}
|
||||
th,td{padding:10px 6px;white-space:nowrap}
|
||||
.answer{flex-wrap:wrap}
|
||||
.answer .unit{flex:1 0 100%;margin-left:2px}
|
||||
#pet{display:none!important}
|
||||
.exdlg{width:100%;max-width:none;border-radius:16px 16px 0 0;padding:18px 16px}
|
||||
.mask{align-items:flex-end}
|
||||
}
|
||||
|
||||
/* ================= 宠物:墨兽 ================= */
|
||||
#pet{position:fixed;left:20px;bottom:14px;width:168px;z-index:60;user-select:none}
|
||||
#pet[hidden]{display:none}
|
||||
@@ -681,7 +721,7 @@ td .t{font-family:"Consolas",monospace;font-size:13.5px}
|
||||
<b style="font-size:13.5px">这道题之后会发生什么</b>
|
||||
<span style="margin-left:auto;font-size:11.5px;color:#A2958A">四步,不需要你做任何额外操作</span>
|
||||
</div>
|
||||
<div style="display:grid;grid-template-columns:repeat(4,1fr);gap:10px">
|
||||
<div class="four">
|
||||
<div style="background:#FBF6EC;border-radius:10px;padding:11px 12px">
|
||||
<div style="font-size:11px;color:var(--ochre);font-weight:700">今天</div>
|
||||
<div style="font-size:12.5px;color:#3A342E;line-height:1.7;margin-top:4px">答错的话,明天同一时间再来一次</div>
|
||||
@@ -786,6 +826,10 @@ td .t{font-family:"Consolas",monospace;font-size:13.5px}
|
||||
<section class="view" id="v-weekly" hidden>
|
||||
<h1>周日那张纸</h1>
|
||||
<p class="sub">A5 一张,留答题区、答案可折叠、有家长签字栏。可以交给老师。</p>
|
||||
<div style="display:flex;gap:10px;flex-wrap:wrap;margin:14px 0 16px">
|
||||
<button class="primary" id="weeklyPrint">打开可打印版(A5)</button>
|
||||
<button class="ghost" id="weeklyReload">刷新本周数字</button>
|
||||
</div>
|
||||
<div class="grid2">
|
||||
<div class="card"><div class="hd"><b>本周数字</b></div><div class="bd" id="weeklyNums"></div></div>
|
||||
<div class="card"><div class="hd"><b>预览</b><span class="pill g">A5</span></div>
|
||||
@@ -2061,7 +2105,29 @@ function renderWeekly() {
|
||||
<span>家长签字:______</span><span>孩子的话:____________</span>
|
||||
</div>
|
||||
</div>
|
||||
<p style="font-size:11.5px;color:var(--muted);margin:10px 0 0">点打印即可出 A5;打印入口在小程序「周日那张纸」。</p>`;
|
||||
<p style="font-size:11.5px;color:var(--muted);margin:10px 0 0">点上面「打开可打印版」→ 在新窗口里按 Ctrl+P 就能印 A5;也可以直接存成 PDF。</p>`;
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开服务端生成的 A5 周报。
|
||||
* 打印页在 /api/print/weekly,用的是 query token(和 CSV 导出同一套白名单),
|
||||
* 所以这里要把 token 拼上去——这正是之前「功能有、入口没有」的那一段。
|
||||
*/
|
||||
function onWeeklyPrint() {
|
||||
if (!S.token || S.demo) {
|
||||
toast("演示模式没有真实周报;接上后端(登录后)才能打印");
|
||||
return;
|
||||
}
|
||||
const q = new URLSearchParams({ child_id: S.cid, token: S.token });
|
||||
window.open(API + "/api/print/weekly?" + q.toString(), "_blank");
|
||||
}
|
||||
|
||||
async function onWeeklyReload() {
|
||||
if (S.demo) { toast("演示数据不刷新"); return; }
|
||||
const w = await api("/api/report/weekly?child_id=" + S.cid).catch(() => null);
|
||||
if (w) S.weekly = w;
|
||||
renderWeekly();
|
||||
toast("已刷新");
|
||||
}
|
||||
|
||||
function weekNo() { const d = new Date(); const s = new Date(d.getFullYear(), 0, 1); return Math.ceil(((d - s) / 86400000 + s.getDay() + 1) / 7); }
|
||||
@@ -2112,6 +2178,8 @@ function show(v) {
|
||||
}
|
||||
|
||||
document.getElementById("btnSubmit").addEventListener("click", submit);
|
||||
document.getElementById("weeklyPrint").addEventListener("click", onWeeklyPrint);
|
||||
document.getElementById("weeklyReload").addEventListener("click", onWeeklyReload);
|
||||
document.getElementById("qInput").addEventListener("keydown", e => { if (e.key === "Enter") submit(); });
|
||||
document.getElementById("btnNext").addEventListener("click", nextQ);
|
||||
document.getElementById("btnPrev").addEventListener("click", () => { if (S.idx > 0) { S.idx--; renderTrain(); renderSheet(); } });
|
||||
|
||||
Reference in New Issue
Block a user