From 9ee83e35351ae81ff8906b7a832da712e20dee2b Mon Sep 17 00:00:00 2001 From: lixu Date: Thu, 25 Jun 2026 10:08:56 +0000 Subject: [PATCH] =?UTF-8?q?feat(public):=20=E9=A6=96=E9=A1=B5=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E6=9E=81=E7=AE=80=E8=B0=B7=E6=AD=8C=E9=A3=8E=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public-frontend/src/components/Home.tsx | 83 +++++++++++-------------- 1 file changed, 36 insertions(+), 47 deletions(-) diff --git a/public-frontend/src/components/Home.tsx b/public-frontend/src/components/Home.tsx index b3c75be..6969f56 100644 --- a/public-frontend/src/components/Home.tsx +++ b/public-frontend/src/components/Home.tsx @@ -1,10 +1,8 @@ import { useState } from "react"; -import { Search, PlusCircle, ScanBarcode, ShieldCheck, ArrowRight } from "lucide-react"; +import { Search, PlusCircle, ArrowRight } from "lucide-react"; import { api } from "../api"; import type { ProductSummary } from "../types"; -const EXAMPLES = ["可乐", "Nutella", "牛奶", "5449000000996"]; - export default function Home({ onOpen, onContribute, @@ -40,55 +38,46 @@ export default function Home({ return (
-
-
- - 公益 · 开放 · 可溯源 - -

- 天 -

-

- 输入商品名称或条码,检索客观、可溯源的商品资料。人人可查,人人可贡献。 -

+

+ 天 +

-
run(undefined, e)} - className="mx-auto mt-7 flex w-full max-w-2xl flex-col gap-2 sm:flex-row" - > -
- - setQ(e.target.value)} - placeholder="例如:可乐、Nutella、5449000000996" - className="flex-1 bg-transparent py-3.5 outline-none" - /> -
- -
- -
- 试试: - {EXAMPLES.map((ex) => ( - - ))} +
run(undefined, e)} + className="mx-auto mt-8 w-full max-w-xl" + > +
+ + setQ(e.target.value)} + placeholder="搜索商品名称或条码" + className="flex-1 bg-transparent outline-none" + />
-
+ {!searched && ( +
+ +
+ )} +
{error && (