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:
@@ -38,7 +38,7 @@ export default async function PostDetailPage({ params }: { params: Promise<{ id:
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="font-medium">{post.author.nickname}</span>
|
||||
<Badge variant="outline" className="text-[10px] px-1.5 py-0">
|
||||
{roleLabels[post.authorRole]}
|
||||
{roleLabels[post.author.role]}
|
||||
</Badge>
|
||||
{post.pinned && <Pin className="h-3 w-3 text-muted-foreground" />}
|
||||
</div>
|
||||
@@ -62,18 +62,6 @@ export default async function PostDetailPage({ params }: { params: Promise<{ id:
|
||||
</div>
|
||||
)}
|
||||
|
||||
{post.linkedOrderId && (
|
||||
<Link href={`/order/${post.linkedOrderId}`}>
|
||||
<div className="rounded-lg border bg-muted/30 p-3 text-sm hover:bg-muted/50 transition-colors">
|
||||
<div className="flex items-center gap-2 mb-1">
|
||||
<Star className="h-3.5 w-3.5 text-yellow-500" />
|
||||
<span className="font-medium">关联订单</span>
|
||||
</div>
|
||||
<p className="text-muted-foreground text-xs">点击查看订单详情</p>
|
||||
</div>
|
||||
</Link>
|
||||
)}
|
||||
|
||||
{post.tags.length > 0 && (
|
||||
<div className="flex flex-wrap gap-1">
|
||||
{post.tags.map((tag) => (
|
||||
@@ -84,6 +72,18 @@ export default async function PostDetailPage({ params }: { params: Promise<{ id:
|
||||
</div>
|
||||
)}
|
||||
|
||||
{post.linkedOrderId ? (
|
||||
<Link href={`/order/${post.linkedOrderId}`}>
|
||||
<div className="rounded-lg border bg-muted/30 p-3 text-sm hover:bg-muted/50 transition-colors">
|
||||
<div className="flex items-center gap-2 mb-1">
|
||||
<Star className="h-3.5 w-3.5 text-yellow-500" />
|
||||
<span className="font-medium">关联订单</span>
|
||||
</div>
|
||||
<p className="text-muted-foreground text-xs">点击查看订单详情</p>
|
||||
</div>
|
||||
</Link>
|
||||
) : null}
|
||||
|
||||
<div className="flex items-center gap-4 text-sm text-muted-foreground pt-2">
|
||||
<PostLikeButton
|
||||
postId={post.id}
|
||||
|
||||
@@ -78,13 +78,11 @@ export default function NewPostPage() {
|
||||
|
||||
createPost({
|
||||
author: user,
|
||||
authorRole: currentRole,
|
||||
title: data.title,
|
||||
content: data.content,
|
||||
images: Array.from({ length: imageCount }).map(() => "/posts/p1-1.jpg"),
|
||||
tags: selectedTags,
|
||||
linkedOrderId: effectivePostType === "show_order" ? selectedOrderId : undefined,
|
||||
quotedPostId: effectivePostType === "quote" ? selectedQuotePostId : undefined,
|
||||
})
|
||||
|
||||
router.push("/community")
|
||||
@@ -131,7 +129,7 @@ export default function NewPostPage() {
|
||||
<SelectContent>
|
||||
{availableOrders.map((order) => (
|
||||
<SelectItem key={order.id} value={order.id}>
|
||||
{order.service.title} · {order.playerName}
|
||||
{order.service.title}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
|
||||
Reference in New Issue
Block a user