From 151fabe8c20710311160cb489d88c00fef10899d Mon Sep 17 00:00:00 2001 From: zetaloop Date: Sat, 25 Apr 2026 20:12:23 +0800 Subject: [PATCH] feat(ui): refine public detail pages --- app/(main)/player/[id]/page.tsx | 70 ++++++++++++++++++++------------- app/(main)/post/[id]/page.tsx | 4 +- app/(main)/shop/[id]/page.tsx | 65 ++++++++++++++++++++++++------ 3 files changed, 97 insertions(+), 42 deletions(-) diff --git a/app/(main)/player/[id]/page.tsx b/app/(main)/player/[id]/page.tsx index 7c428ab..eb000ba 100644 --- a/app/(main)/player/[id]/page.tsx +++ b/app/(main)/player/[id]/page.tsx @@ -10,10 +10,12 @@ import { CardHeader, CardTitle, } from "@/components/ui/card" +import { EmptyState } from "@/components/ui/empty-state" import { Separator } from "@/components/ui/separator" +import { StatusBadge } from "@/components/ui/status-badge" import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs" import { getPlayerById, listReviewsByTargetUser, listServicesByPlayer } from "@/lib/api" -import { CheckCircle, Clock, MapPin, MessageSquare, ShoppingBag, Star } from "lucide-react" +import { Clock, Gamepad2, MapPin, MessageSquare, ShoppingBag, Star } from "lucide-react" import Link from "next/link" import { notFound } from "next/navigation" @@ -34,7 +36,7 @@ export default async function PlayerDetailPage({ params }: { params: Promise<{ i
- + {player.user.nickname[0]} @@ -45,16 +47,26 @@ export default async function PlayerDetailPage({ params }: { params: Promise<{ i

{player.user.nickname} - - {player.status === "available" ? "可接单" : "忙碌中"} - + {player.status === "available" + ? "可接单" + : player.status === "busy" + ? "忙碌中" + : "离线"} +

-
- +
+ {player.rating}
@@ -75,11 +87,13 @@ export default async function PlayerDetailPage({ params }: { params: Promise<{ i
-
-

- {player.user.bio || "这个打手很懒,什么都没写~"} -

-
+ {player.user.bio ? ( +
+

{player.user.bio}

+
+ ) : ( + + )}
{player.tags.map((tag) => ( @@ -103,7 +117,9 @@ export default async function PlayerDetailPage({ params }: { params: Promise<{ i
- {service.gameName} + + {service.gameName} +
¥{service.price}{" "} @@ -140,8 +156,12 @@ export default async function PlayerDetailPage({ params }: { params: Promise<{ i ))} {playerServices.length === 0 && ( -
-

暂无服务

+
+
)}
@@ -166,21 +186,20 @@ export default async function PlayerDetailPage({ params }: { params: Promise<{ i {new Date(review.createdAt).toLocaleDateString()}
-
+
{[1, 2, 3, 4, 5].map((star) => ( ))}

{review.content}

{review.sealed && ( -
- - 平台认证评价 -
+ + 平台认证评价 + )}
@@ -188,10 +207,7 @@ export default async function PlayerDetailPage({ params }: { params: Promise<{ i )) ) : ( -
- -

暂无评价

-
+ )}
diff --git a/app/(main)/post/[id]/page.tsx b/app/(main)/post/[id]/page.tsx index 302edc3..135e631 100644 --- a/app/(main)/post/[id]/page.tsx +++ b/app/(main)/post/[id]/page.tsx @@ -27,7 +27,7 @@ export default async function PostDetailPage({ params }: { params: Promise<{ id: 返回社区 - +
@@ -76,7 +76,7 @@ export default async function PostDetailPage({ params }: { params: Promise<{ id:
- + 关联订单

点击查看订单详情

diff --git a/app/(main)/shop/[id]/page.tsx b/app/(main)/shop/[id]/page.tsx index 920ade2..8bd578a 100644 --- a/app/(main)/shop/[id]/page.tsx +++ b/app/(main)/shop/[id]/page.tsx @@ -3,6 +3,7 @@ import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar" import { Badge } from "@/components/ui/badge" import { Button } from "@/components/ui/button" import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" +import { EmptyState } from "@/components/ui/empty-state" import { Separator } from "@/components/ui/separator" import { getShopById, listPlayersByShop, listReviews, listServices } from "@/lib/api" import { getShopSections } from "@/lib/domain/shop-template" @@ -61,8 +62,8 @@ export default async function ShopPage({ params }: PageProps) {

{shop.name}

{shop.description}

-
- +
+ {shop.rating} 评分
@@ -103,7 +104,16 @@ export default async function ShopPage({ params }: PageProps) { ) case "announcements": - if (shop.announcements.length === 0) return null + if (shop.announcements.length === 0) { + return ( + + ) + } return ( @@ -126,7 +136,16 @@ export default async function ShopPage({ params }: PageProps) { ) case "services": - if (shopServices.length === 0) return null + if (shopServices.length === 0) { + return ( + + ) + } return (

@@ -138,7 +157,9 @@ export default async function ShopPage({ params }: PageProps) {
- {service.gameName} + + {service.gameName} +
¥{service.price} /{service.unit} @@ -168,7 +189,16 @@ export default async function ShopPage({ params }: PageProps) { ) case "players": - if (shopPlayers.length === 0) return null + if (shopPlayers.length === 0) { + return ( + + ) + } return (

@@ -188,18 +218,18 @@ export default async function ShopPage({ params }: PageProps) {

{player.user.nickname}

- - {player.rating} + + {player.rating} {player.totalOrders}单
@@ -220,7 +250,16 @@ export default async function ShopPage({ params }: PageProps) { ) case "reviews": - if (shopReviews.length === 0) return null + if (shopReviews.length === 0) { + return ( + + ) + } return (

@@ -246,7 +285,7 @@ export default async function ShopPage({ params }: PageProps) { key={`star-${star}`} className={`w-3 h-3 ${ star <= review.rating - ? "fill-yellow-500 text-yellow-500" + ? "fill-warning text-warning" : "text-muted-foreground" }`} />