撤回孩子端单词页网格;家长端跟读录音列表改一行多个(换行排布)

- 撤回 word-day 网格改动,恢复原卡片布局
- 家长端"单词跟读录音"(课程管理+学习概览)改为圆角标签自动换行,
  一行多个,每个含单词+播放按钮

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
jacobxu666
2026-08-05 21:53:01 +08:00
co-authored by Claude Opus 4.8
parent b63ccdfa9e
commit 673d1bc511
3 changed files with 22 additions and 27 deletions
+13 -18
View File
@@ -136,39 +136,34 @@ export function WordDayClient({
<span className="text-xs text-muted-foreground">已学 {learnedSet.size}/{items.length}</span>
</header>
<div className="grid grid-cols-2 gap-2 sm:grid-cols-3">
<div className="space-y-2">
{items.map((it) => {
const done = learnedSet.has(it.word);
return (
<div key={it.word} className="rounded-xl border border-slate-100 bg-white p-2.5 shadow-soft">
<div className="flex items-center gap-1.5">
<button type="button" onClick={() => speak(it.word)} className="shrink-0 text-indigo-600" title="发音">
<Volume2 className="size-4" />
<div key={it.word} className="rounded-xl border border-slate-100 bg-white p-3 shadow-soft">
<div className="flex items-center gap-2">
<button type="button" onClick={() => speak(it.word)} className="text-indigo-600" title="发音">
<Volume2 className="size-5" />
</button>
<button type="button" onClick={() => openDetail(it.word)} className="min-w-0 flex-1 truncate text-left text-sm font-bold text-slate-900">
{it.word}
<button type="button" onClick={() => openDetail(it.word)} className="text-left">
<span className="text-base font-bold text-slate-900">{it.word}</span>
</button>
<span className="ml-1 flex-1 truncate text-sm text-muted-foreground">{it.meaning}</span>
<RecordBtn day={day} word={it.word} />
<button
type="button"
onClick={() => toggleLearn(it.word)}
className={cn(
"flex size-6 shrink-0 items-center justify-center rounded-full border-2",
"flex size-8 shrink-0 items-center justify-center rounded-full border-2",
done ? "border-transparent bg-gradient-to-br from-emerald-400 to-emerald-600 text-white" : "border-slate-300",
)}
title="学会"
>
{done && <Check className="size-3.5" strokeWidth={3} />}
</button>
</div>
<p className="mt-1 truncate text-xs text-muted-foreground">{it.meaning}</p>
<div className="mt-1.5 flex items-center justify-between">
<RecordBtn day={day} word={it.word} />
<button type="button" onClick={() => openDetail(it.word)} className="text-xs text-indigo-600">
详情
{done && <Check className="size-4" strokeWidth={3} />}
</button>
</div>
{open === it.word && (
<div className="mt-2 space-y-1 rounded-lg bg-slate-50 p-2 text-xs">
<div className="mt-2 space-y-1 rounded-lg bg-slate-50 p-2 text-sm">
<p className="text-slate-800">
<span className="font-medium text-indigo-600">释义:</span>
{it.meaning || "见例句"}
@@ -179,7 +174,7 @@ export function WordDayClient({
</p>
<p className="text-slate-700">
<span className="font-medium text-indigo-600">形近词:</span>
{it.similar.map((s) => s.word).join("、") || "无"}
{it.similar.map((s) => `${s.word}(${s.meaning})`).join("、") || "无"}
</p>
</div>
)}