From bb93977396201f8bcdce0c428a8daa2ba160f6cb Mon Sep 17 00:00:00 2001 From: tone <3341154833@qq.com> Date: Sat, 26 Apr 2025 21:59:05 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=B5=84=E6=BA=90=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/resource/components/ResourceCard.tsx | 48 +++++++++++++++++++ tone-page-web/app/resource/page.tsx | 46 +++++++----------- tone-page-web/lib/types/resource.ts | 14 ++++++ 3 files changed, 78 insertions(+), 30 deletions(-) create mode 100644 tone-page-web/app/resource/components/ResourceCard.tsx create mode 100644 tone-page-web/lib/types/resource.ts diff --git a/tone-page-web/app/resource/components/ResourceCard.tsx b/tone-page-web/app/resource/components/ResourceCard.tsx new file mode 100644 index 0000000..35e0af3 --- /dev/null +++ b/tone-page-web/app/resource/components/ResourceCard.tsx @@ -0,0 +1,48 @@ +import { Card, CardContent } from "@/components/ui/card"; +import { Resource } from "@/lib/types/resource"; +import { cn } from "@/lib/utils"; +import Image from "next/image"; + +interface ResourceCardProps { + resource: Resource; + key: string; +} + +export function ResourceCard({ resource, key }: ResourceCardProps) { + return ( + + + +
+
+ 资源图片 +
+
+
{resource.title}
+
{resource.description}
+
+ { + resource.tags.map((tag) => ( +
{tag.name}
+ )) + } +
+
+
+
+
+
+ ) +} \ No newline at end of file diff --git a/tone-page-web/app/resource/page.tsx b/tone-page-web/app/resource/page.tsx index a18ebd8..6c514c2 100644 --- a/tone-page-web/app/resource/page.tsx +++ b/tone-page-web/app/resource/page.tsx @@ -3,6 +3,7 @@ import { CardContent, } from "@/components/ui/card"; import Image from "next/image"; +import { ResourceCard } from "./components/ResourceCard"; export default function Resources() { return ( @@ -13,36 +14,21 @@ export default function Resources() { ,继续使用或浏览表示您接受协议条款。

- { - [0, 1, 2, 3, 4, 5].map(() => ( - - - -
-
- 资源图片 -
-
-
Title 666 66 666 66
-
你好这是一段随机文本,你好这是一段随机文本,你好这是一段随机文本,
-
-
第三方来源
-
-
-
-
-
-
- )) - } +
) diff --git a/tone-page-web/lib/types/resource.ts b/tone-page-web/lib/types/resource.ts new file mode 100644 index 0000000..813968b --- /dev/null +++ b/tone-page-web/lib/types/resource.ts @@ -0,0 +1,14 @@ +export type TagType = { + id: string; + name: string; + color: string; +} + +export interface Resource { + id: string; + title: string; + description: string; + imageUrl: string; + link: string; + tags: TagType[]; +} \ No newline at end of file