diff --git a/app/(order)/order/[id]/page.tsx b/app/(order)/order/[id]/page.tsx index a6eb401..f1f65ff 100644 --- a/app/(order)/order/[id]/page.tsx +++ b/app/(order)/order/[id]/page.tsx @@ -1,9 +1,10 @@ "use client" import OrderActions from "@/components/order-actions" -import { Badge } from "@/components/ui/badge" import { Card, CardContent, 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 { getOrderById, listChatSessions, listReviewsByOrder } from "@/lib/api" import { ORDER_ACCEPT_TIMEOUT_MS, ORDER_CLOSE_TIMEOUT_MS } from "@/lib/config/demo-timers" import { statusLabels } from "@/lib/constants" @@ -31,6 +32,19 @@ const disputedStatusSteps: OrderStatus[] = [ const cancelledStatusSteps: OrderStatus[] = ["pending_payment", "pending_accept", "cancelled"] +type OrderStatusBadgeVariant = "success" | "warning" | "info" | "neutral" | "destructive" + +const statusVariants: Record = { + pending_payment: "warning", + pending_accept: "info", + in_progress: "success", + pending_close: "info", + pending_review: "info", + disputed: "destructive", + completed: "success", + cancelled: "neutral", +} + export default function OrderDetailPage({ params }: { params: Promise<{ id: string }> }) { const { id } = use(params) const [sessions, setSessions] = useState>>([]) @@ -114,14 +128,16 @@ export default function OrderDetailPage({ params }: { params: Promise<{ id: stri if (loading) { return ( -
加载中...
+
+ +
) } if (!order) { return ( -
- 订单不存在 +
+
) } @@ -162,10 +178,12 @@ export default function OrderDetailPage({ params }: { params: Promise<{ id: stri

订单详情

- {statusLabels[order.status]} + + {statusLabels[order.status]} +
- +
{statusSteps.map((step, i) => { @@ -176,10 +194,10 @@ export default function OrderDetailPage({ params }: { params: Promise<{ id: stri
{isActive ? : i + 1} @@ -195,12 +213,12 @@ export default function OrderDetailPage({ params }: { params: Promise<{ id: stri {timeoutHint && ( - + {timeoutHint} )} - + 服务信息 @@ -240,7 +258,7 @@ export default function OrderDetailPage({ params }: { params: Promise<{ id: stri - + 时间线 @@ -252,14 +270,14 @@ export default function OrderDetailPage({ params }: { params: Promise<{ id: stri
{order.acceptedAt && (
- + 接单时间: {new Date(order.acceptedAt).toLocaleString("zh-CN")}
)} {order.completedAt && (
- + 完成时间: {new Date(order.completedAt).toLocaleString("zh-CN")}
@@ -268,7 +286,7 @@ export default function OrderDetailPage({ params }: { params: Promise<{ id: stri {reviews.length > 0 && ( - + 评价 @@ -281,7 +299,7 @@ export default function OrderDetailPage({ params }: { params: Promise<{ id: stri {[1, 2, 3, 4, 5].map((star) => ( ))}
diff --git a/app/(order)/order/new/page.tsx b/app/(order)/order/new/page.tsx index 62800d3..f6f5195 100644 --- a/app/(order)/order/new/page.tsx +++ b/app/(order)/order/new/page.tsx @@ -3,6 +3,7 @@ import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar" import { Button } from "@/components/ui/button" import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" +import { EmptyState } from "@/components/ui/empty-state" import { Input } from "@/components/ui/input" import { Label } from "@/components/ui/label" import { Separator } from "@/components/ui/separator" @@ -94,14 +95,16 @@ export default function NewOrderPage() { if (loading) { return ( -
加载中...
+
+ +
) } if (!service || !player) { return ( -
- 服务不存在 +
+
) } @@ -110,20 +113,23 @@ export default function NewOrderPage() { if (submitted) { return ( -
- -

下单成功

-

- 订单已创建,等待打手接单。你可以在订单列表中查看进度。 -

-
- - -
+
+ + + +
+ } + />
) } @@ -141,7 +147,7 @@ export default function NewOrderPage() {

确认下单

- + 服务信息 @@ -181,7 +187,7 @@ export default function NewOrderPage() { - + 订单信息 @@ -211,7 +217,7 @@ export default function NewOrderPage() { - + 支付信息 diff --git a/app/(order)/review/[id]/page.tsx b/app/(order)/review/[id]/page.tsx index 4aa403f..eec15d5 100644 --- a/app/(order)/review/[id]/page.tsx +++ b/app/(order)/review/[id]/page.tsx @@ -2,6 +2,7 @@ import { Button } from "@/components/ui/button" import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" +import { EmptyState } from "@/components/ui/empty-state" import { Label } from "@/components/ui/label" import { Textarea } from "@/components/ui/textarea" import { getOrderById, listReviewsByOrder } from "@/lib/api" @@ -54,14 +55,16 @@ export default function ReviewPage({ params }: { params: Promise<{ id: string }> if (loading) { return ( -
加载中...
+
+ +
) } if (!order) { return ( -
- 订单不存在 +
+
) } @@ -71,38 +74,51 @@ export default function ReviewPage({ params }: { params: Promise<{ id: string }> if (order.status !== "pending_review") { return ( -
-

当前阶段不可评价

-

仅待评价状态的订单可以提交评价。

- - 返回订单详情 - +
+ + 返回订单详情 + + } + />
) } if (hasSubmitted && !isRevealed) { return ( -
- -

评价已提交

-

等待对方提交评价中

-

双方都提交评价后将同时揭晓

- - 返回订单详情 - +
+ + 返回订单详情 + + } + />
) } if (hasSubmitted && isRevealed) { return ( -
-

评价已揭晓

-

双方评价已同步公开,可在订单详情查看。

- - 返回订单详情 - +
+ + 返回订单详情 + + } + />
) } @@ -117,7 +133,7 @@ export default function ReviewPage({ params }: { params: Promise<{ id: string }> 返回订单 - + 评价服务

{order.service.title}

@@ -138,8 +154,8 @@ export default function ReviewPage({ params }: { params: Promise<{ id: string }> @@ -158,7 +174,7 @@ export default function ReviewPage({ params }: { params: Promise<{ id: string }> />
-
+
评价采用密封机制:你的评价将在双方都提交后同时揭晓。