From 3473ecbf2be9672b10a3d02c0633707eeec2cb42 Mon Sep 17 00:00:00 2001 From: jacobxu666 Date: Wed, 5 Aug 2026 23:25:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=A9=E5=AD=90=E7=AB=AF=E5=8D=95=E8=AF=8D?= =?UTF-8?q?=E5=85=A5=E5=8F=A3=E6=94=B9=E4=B8=8E=E8=AF=AD=E6=B3=95=E4=B8=80?= =?UTF-8?q?=E8=87=B4=E7=9A=84=E7=AA=81=E5=87=BA=E6=B8=90=E5=8F=98=E5=8D=A1?= =?UTF-8?q?(=E6=98=BE=E7=A4=BA=E5=B7=B2=E7=82=B9=E4=BA=AE=E5=A4=A9?= =?UTF-8?q?=E6=95=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 (1M context) --- src/app/kid/page.tsx | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/src/app/kid/page.tsx b/src/app/kid/page.tsx index c3c5d44..85e567a 100644 --- a/src/app/kid/page.tsx +++ b/src/app/kid/page.tsx @@ -1,7 +1,10 @@ -import { BookOpen, Flame } from "lucide-react"; +import { BookOpen, Flame, Languages } from "lucide-react"; import Link from "next/link"; import { redirect } from "next/navigation"; +import { and, eq, sql } from "drizzle-orm"; import { BackgroundBlobs } from "@/components/background-blobs"; +import { db } from "@/db"; +import { wordProgress } from "@/db/schema"; import { cn } from "@/lib/utils"; import { SUBJECT_ORDER, subjectMeta } from "@/lib/subjects"; import { todayStr } from "@/lib/dates"; @@ -31,6 +34,13 @@ export default async function KidPage() { const gGoal = gPoints.find((p) => !gPassed.has(p.pointId)); const gDone = gPassed.size; + // 单词入口:已点亮天数 + const [wd] = await db + .select({ n: sql`COUNT(*)` }) + .from(wordProgress) + .where(and(eq(wordProgress.childUserId, user.id), eq(wordProgress.passed, true))); + const wDone = wd.n; + return (
@@ -63,16 +73,20 @@ export default async function KidPage() { -
- -
- 🔤 -
-

单词打卡

-

每天 15 词,发音/详情/跟读/检测

-
+ +
+
+
- +
+

英语单词 · 已点亮 {wDone} 天

+

每天 15 词,发音/跟读/检测

+
+ → +
+ + +
📝