diff --git a/app/(order)/order/[id]/page.tsx b/app/(order)/order/[id]/page.tsx index f2302fa..88c103e 100644 --- a/app/(order)/order/[id]/page.tsx +++ b/app/(order)/order/[id]/page.tsx @@ -9,7 +9,7 @@ import { statusLabels } from "@/lib/constants" import { mockChatSessions, mockOrders, mockReviews } from "@/lib/mock" import type { OrderStatus } from "@/lib/types" -const statusSteps: OrderStatus[] = [ +const normalStatusSteps: OrderStatus[] = [ "pending_payment", "pending_accept", "in_progress", @@ -18,6 +18,16 @@ const statusSteps: OrderStatus[] = [ "completed", ] +const disputedStatusSteps: OrderStatus[] = [ + "pending_payment", + "pending_accept", + "in_progress", + "pending_close", + "disputed", +] + +const cancelledStatusSteps: OrderStatus[] = ["pending_payment", "pending_accept", "cancelled"] + export default async function OrderDetailPage({ params }: { params: Promise<{ id: string }> }) { const { id } = await params const order = mockOrders.find((o) => o.id === id) @@ -25,6 +35,12 @@ export default async function OrderDetailPage({ params }: { params: Promise<{ id const reviews = mockReviews.filter((r) => r.orderId === id) const chatSession = mockChatSessions.find((s) => s.orderId === id) + const statusSteps = + order.status === "disputed" + ? disputedStatusSteps + : order.status === "cancelled" + ? cancelledStatusSteps + : normalStatusSteps const currentStepIndex = statusSteps.indexOf(order.status) return ( @@ -42,36 +58,34 @@ export default async function OrderDetailPage({ params }: { params: Promise<{ id {statusLabels[order.status]} - {order.status !== "disputed" && order.status !== "cancelled" && ( - - -
- {statusSteps.map((step, i) => { - const isActive = i <= currentStepIndex - const isCurrent = i === currentStepIndex - return ( -
-
- {isActive ? : i + 1} -
- - {statusLabels[step]} - + + +
+ {statusSteps.map((step, i) => { + const isActive = i <= currentStepIndex + const isCurrent = i === currentStepIndex + return ( +
+
+ {isActive ? : i + 1}
- ) - })} -
- - - )} + + {statusLabels[step]} + +
+ ) + })} +
+ + diff --git a/app/(order)/order/new/page.tsx b/app/(order)/order/new/page.tsx index 6889567..15424db 100644 --- a/app/(order)/order/new/page.tsx +++ b/app/(order)/order/new/page.tsx @@ -166,6 +166,11 @@ export default function NewOrderPage() { 钱包余额: ¥{walletBalance} {walletBalance < totalPrice && (余额不足)} + {walletBalance < totalPrice && ( + + )}
diff --git a/components/order-actions.tsx b/components/order-actions.tsx index 7c59c13..091163c 100644 --- a/components/order-actions.tsx +++ b/components/order-actions.tsx @@ -116,6 +116,21 @@ export default function OrderActions({ )} + + {status === "cancelled" && ( + + )} + + {status === "disputed" && ( + + )}
) }