fix: broken route links — dispute notification, chat hardcoding, dead sidebar link
This commit is contained in:
@@ -13,7 +13,7 @@ import { Badge } from "@/components/ui/badge"
|
|||||||
import { Button } from "@/components/ui/button"
|
import { Button } from "@/components/ui/button"
|
||||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
|
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
|
||||||
import { Separator } from "@/components/ui/separator"
|
import { Separator } from "@/components/ui/separator"
|
||||||
import { mockOrders, mockReviews } from "@/lib/mock-data"
|
import { mockChatSessions, mockOrders, mockReviews } from "@/lib/mock-data"
|
||||||
import type { OrderStatus } from "@/lib/types"
|
import type { OrderStatus } from "@/lib/types"
|
||||||
|
|
||||||
const statusLabels: Record<OrderStatus, string> = {
|
const statusLabels: Record<OrderStatus, string> = {
|
||||||
@@ -42,6 +42,7 @@ export default async function OrderDetailPage({ params }: { params: Promise<{ id
|
|||||||
if (!order) notFound()
|
if (!order) notFound()
|
||||||
|
|
||||||
const reviews = mockReviews.filter((r) => r.orderId === id)
|
const reviews = mockReviews.filter((r) => r.orderId === id)
|
||||||
|
const chatSession = mockChatSessions.find((s) => s.orderId === id)
|
||||||
const currentStepIndex = statusSteps.indexOf(order.status)
|
const currentStepIndex = statusSteps.indexOf(order.status)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -204,9 +205,9 @@ export default async function OrderDetailPage({ params }: { params: Promise<{ id
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
<div className="flex gap-2 flex-wrap">
|
<div className="flex gap-2 flex-wrap">
|
||||||
{(order.status === "in_progress" || order.status === "pending_close") && (
|
{(order.status === "in_progress" || order.status === "pending_close") && chatSession && (
|
||||||
<Button asChild>
|
<Button asChild>
|
||||||
<Link href={`/chat/chat1`}>
|
<Link href={`/chat/${chatSession.id}`}>
|
||||||
<MessageSquare className="mr-1 h-4 w-4" />
|
<MessageSquare className="mr-1 h-4 w-4" />
|
||||||
聊天
|
聊天
|
||||||
</Link>
|
</Link>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { Badge } from "@/components/ui/badge"
|
|||||||
import { Button } from "@/components/ui/button"
|
import { Button } from "@/components/ui/button"
|
||||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
|
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
|
||||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"
|
||||||
import { mockOrders } from "@/lib/mock-data"
|
import { mockChatSessions, mockOrders } from "@/lib/mock-data"
|
||||||
import type { OrderStatus } from "@/lib/types"
|
import type { OrderStatus } from "@/lib/types"
|
||||||
import { cn } from "@/lib/utils"
|
import { cn } from "@/lib/utils"
|
||||||
import { useAuthStore } from "@/store/auth"
|
import { useAuthStore } from "@/store/auth"
|
||||||
@@ -101,14 +101,18 @@ export default function OrderListPage() {
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex gap-2">
|
<div className="flex gap-2">
|
||||||
{order.status === "in_progress" && (
|
{order.status === "in_progress" &&
|
||||||
<Button variant="outline" size="sm" asChild>
|
(() => {
|
||||||
<Link href={`/chat/chat1`}>
|
const session = mockChatSessions.find((s) => s.orderId === order.id)
|
||||||
<MessageSquare className="mr-1 h-3.5 w-3.5" />
|
return session ? (
|
||||||
聊天
|
<Button variant="outline" size="sm" asChild>
|
||||||
</Link>
|
<Link href={`/chat/${session.id}`}>
|
||||||
</Button>
|
<MessageSquare className="mr-1 h-3.5 w-3.5" />
|
||||||
)}
|
聊天
|
||||||
|
</Link>
|
||||||
|
</Button>
|
||||||
|
) : null
|
||||||
|
})()}
|
||||||
{order.status === "completed" && (
|
{order.status === "completed" && (
|
||||||
<Button variant="outline" size="sm">
|
<Button variant="outline" size="sm">
|
||||||
<RefreshCw className="mr-1 h-3.5 w-3.5" />
|
<RefreshCw className="mr-1 h-3.5 w-3.5" />
|
||||||
|
|||||||
@@ -1,14 +1,6 @@
|
|||||||
"use client"
|
"use client"
|
||||||
|
|
||||||
import {
|
import { Gamepad2, LayoutDashboard, ListOrdered, Palette, Store, Users } from "lucide-react"
|
||||||
Gamepad2,
|
|
||||||
LayoutDashboard,
|
|
||||||
ListOrdered,
|
|
||||||
Palette,
|
|
||||||
Settings2,
|
|
||||||
Store,
|
|
||||||
Users,
|
|
||||||
} from "lucide-react"
|
|
||||||
import Link from "next/link"
|
import Link from "next/link"
|
||||||
import { usePathname } from "next/navigation"
|
import { usePathname } from "next/navigation"
|
||||||
import { cn } from "@/lib/utils"
|
import { cn } from "@/lib/utils"
|
||||||
@@ -25,7 +17,6 @@ const ownerLinks = [
|
|||||||
{ href: "/dashboard/shop", label: "店铺管理", icon: Store },
|
{ href: "/dashboard/shop", label: "店铺管理", icon: Store },
|
||||||
{ href: "/dashboard/shop/employees", label: "员工管理", icon: Users },
|
{ href: "/dashboard/shop/employees", label: "员工管理", icon: Users },
|
||||||
{ href: "/dashboard/shop/templates", label: "模板编辑", icon: Palette },
|
{ href: "/dashboard/shop/templates", label: "模板编辑", icon: Palette },
|
||||||
{ href: "/dashboard/settings", label: "店铺设置", icon: Settings2 },
|
|
||||||
]
|
]
|
||||||
|
|
||||||
export function DashboardSidebar() {
|
export function DashboardSidebar() {
|
||||||
|
|||||||
+1
-1
@@ -496,7 +496,7 @@ export const mockNotifications: Notification[] = [
|
|||||||
title: "争议处理中",
|
title: "争议处理中",
|
||||||
content: "你发起的订单争议正在审核中",
|
content: "你发起的订单争议正在审核中",
|
||||||
read: true,
|
read: true,
|
||||||
link: "/dispute/d1",
|
link: "/dispute/ord4",
|
||||||
createdAt: "2025-02-12T10:05:00",
|
createdAt: "2025-02-12T10:05:00",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user