fix(pages): adapt all pages to backend-aligned types

Replace removed fields with available data sources throughout UI:
- order pages: use service.title instead of consumer/player names
- chat: look up sender from session.participants, remove readonly
- community: simplify post cards, keep pinned icon
- post detail: keep pinned/linkedOrderId display
- shop rules: use string commissionValue
- dashboard: parse string amounts for income display
- dispute/review: remove initiator/avatar references
This commit is contained in:
zetaloop
2026-04-23 21:15:28 +08:00
parent 12284290cc
commit 4d8877f588
17 changed files with 153 additions and 238 deletions
+3 -9
View File
@@ -5,7 +5,7 @@ import { Badge } from "@/components/ui/badge"
import { Card, CardContent } from "@/components/ui/card"
import { listChatSessions } from "@/lib/api"
import { useAuthStore } from "@/store/auth"
import { Lock, MessageSquare } from "lucide-react"
import { MessageSquare } from "lucide-react"
import Link from "next/link"
import { useEffect, useState } from "react"
@@ -45,24 +45,18 @@ export default function ChatListPage() {
<CardContent className="flex items-center gap-3 p-4">
<Avatar className="h-10 w-10">
<AvatarImage src={other.avatar} />
<AvatarFallback>{other.name[0]}</AvatarFallback>
<AvatarFallback>{other.nickname[0]}</AvatarFallback>
</Avatar>
<div className="flex-1 min-w-0">
<div className="flex items-center gap-2">
<span className="text-sm font-medium">{other.name}</span>
<span className="text-sm font-medium">{other.nickname}</span>
<Badge variant="outline" className="text-[10px] px-1.5 py-0">
{session.type === "order" ? "订单" : "咨询"}
</Badge>
{session.readonly && <Lock className="h-3 w-3 text-muted-foreground" />}
</div>
<p className="text-xs text-muted-foreground truncate">{session.lastMessage}</p>
</div>
<div className="flex flex-col items-end gap-1 shrink-0">
{session.lastMessageAt && (
<span className="text-[10px] text-muted-foreground">
{new Date(session.lastMessageAt).toLocaleDateString("zh-CN")}
</span>
)}
{session.unreadCount > 0 && (
<Badge className="h-4 min-w-4 px-1 flex items-center justify-center text-[10px]">
{session.unreadCount}