fix: sidebar mobile responsive and footer link clickability

This commit is contained in:
zetaloop
2026-02-20 20:36:27 +08:00
parent ebdf56a361
commit ed3858cff3
10 changed files with 86 additions and 86 deletions
+2
View File
@@ -6,7 +6,9 @@ export default function AccountLayout({ children }: { children: React.ReactNode
<div className="flex min-h-screen flex-col"> <div className="flex min-h-screen flex-col">
<Header /> <Header />
<div className="flex flex-1"> <div className="flex flex-1">
<div className="hidden md:block">
<AccountSidebar /> <AccountSidebar />
</div>
<main className="flex-1 p-6">{children}</main> <main className="flex-1 p-6">{children}</main>
</div> </div>
</div> </div>
+1 -11
View File
@@ -6,20 +6,10 @@ 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 { Progress } from "@/components/ui/progress" import { Progress } from "@/components/ui/progress"
import { statusLabels } from "@/lib/constants"
import { mockOrders, mockPlayers, mockServices, mockShops } from "@/lib/mock-data" import { mockOrders, mockPlayers, mockServices, mockShops } from "@/lib/mock-data"
import { useAuthStore } from "@/store/auth" import { useAuthStore } from "@/store/auth"
const statusLabels: Record<string, string> = {
pending_payment: "待支付",
pending_accept: "待接单",
in_progress: "进行中",
pending_close: "待结单",
pending_review: "待评价",
disputed: "争议中",
completed: "已完成",
cancelled: "已取消",
}
export default function DashboardPage() { export default function DashboardPage() {
const { currentRole } = useAuthStore() const { currentRole } = useAuthStore()
const isOwner = currentRole === "owner" const isOwner = currentRole === "owner"
+2
View File
@@ -6,7 +6,9 @@ export default function DashboardLayout({ children }: { children: React.ReactNod
<div className="flex min-h-screen flex-col"> <div className="flex min-h-screen flex-col">
<Header /> <Header />
<div className="flex flex-1"> <div className="flex flex-1">
<div className="hidden md:block">
<DashboardSidebar /> <DashboardSidebar />
</div>
<main className="flex-1 p-6">{children}</main> <main className="flex-1 p-6">{children}</main>
</div> </div>
</div> </div>
+1 -6
View File
@@ -4,14 +4,9 @@ import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"
import { Badge } from "@/components/ui/badge" import { Badge } from "@/components/ui/badge"
import { Button } from "@/components/ui/button" import { Button } from "@/components/ui/button"
import { Card, CardContent, CardFooter, CardHeader } from "@/components/ui/card" import { Card, CardContent, CardFooter, CardHeader } from "@/components/ui/card"
import { roleLabels } from "@/lib/constants"
import { mockPosts } from "@/lib/mock-data" import { mockPosts } from "@/lib/mock-data"
const roleLabels: Record<string, string> = {
consumer: "消费者",
player: "打手",
owner: "店主",
}
export default function CommunityPage() { export default function CommunityPage() {
return ( return (
<div className="container mx-auto py-8 px-4 max-w-2xl"> <div className="container mx-auto py-8 px-4 max-w-2xl">
+1 -6
View File
@@ -8,14 +8,9 @@ import { Button } from "@/components/ui/button"
import { Card, CardContent, CardHeader } from "@/components/ui/card" import { Card, CardContent, CardHeader } from "@/components/ui/card"
import { Separator } from "@/components/ui/separator" import { Separator } from "@/components/ui/separator"
import { Textarea } from "@/components/ui/textarea" import { Textarea } from "@/components/ui/textarea"
import { roleLabels } from "@/lib/constants"
import { mockComments, mockOrders, mockPosts } from "@/lib/mock-data" import { mockComments, mockOrders, mockPosts } from "@/lib/mock-data"
const roleLabels: Record<string, string> = {
consumer: "消费者",
player: "打手",
owner: "店主",
}
export default async function PostDetailPage({ params }: { params: Promise<{ id: string }> }) { export default async function PostDetailPage({ params }: { params: Promise<{ id: string }> }) {
const { id } = await params const { id } = await params
const post = mockPosts.find((p) => p.id === id) const post = mockPosts.find((p) => p.id === id)
+1 -11
View File
@@ -14,20 +14,10 @@ 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 { statusLabels } from "@/lib/constants"
import { mockChatSessions, 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> = {
pending_payment: "待支付",
pending_accept: "待接单",
in_progress: "进行中",
pending_close: "待结单",
pending_review: "待评价",
disputed: "争议中",
completed: "已完成",
cancelled: "已取消",
}
const statusSteps: OrderStatus[] = [ const statusSteps: OrderStatus[] = [
"pending_payment", "pending_payment",
"pending_accept", "pending_accept",
+2
View File
@@ -122,5 +122,7 @@
} }
body { body {
@apply bg-background text-foreground; @apply bg-background text-foreground;
font-family:
var(--font-geist-sans), "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
} }
} }
+9 -3
View File
@@ -30,9 +30,15 @@ export function Footer() {
<div> <div>
<h3 className="font-semibold text-sm mb-3"></h3> <h3 className="font-semibold text-sm mb-3"></h3>
<nav className="flex flex-col gap-2 text-sm text-muted-foreground"> <nav className="flex flex-col gap-2 text-sm text-muted-foreground">
<span></span> <Link href="#" className="hover:text-foreground transition-colors">
<span></span>
<span></span> </Link>
<Link href="#" className="hover:text-foreground transition-colors">
</Link>
<Link href="#" className="hover:text-foreground transition-colors">
</Link>
</nav> </nav>
</div> </div>
<div> <div>
+18
View File
@@ -0,0 +1,18 @@
import type { OrderStatus } from "./types"
export const statusLabels: Record<OrderStatus, string> = {
pending_payment: "待支付",
pending_accept: "待接单",
in_progress: "进行中",
pending_close: "待结单",
pending_review: "待评价",
disputed: "争议中",
completed: "已完成",
cancelled: "已取消",
}
export const roleLabels: Record<string, string> = {
consumer: "消费者",
player: "打手",
owner: "店主",
}
+47 -47
View File
@@ -20,7 +20,7 @@ export const mockUsers: User[] = [
{ {
id: "u1", id: "u1",
username: "xm_2003", username: "xm_2003",
nickname: "小明同学", nickname: "小明",
avatar: "/avatars/u1.jpg", avatar: "/avatars/u1.jpg",
role: "consumer", role: "consumer",
phone: "138****1234", phone: "138****1234",
@@ -59,7 +59,7 @@ export const mockUsers: User[] = [
{ {
id: "u5", id: "u5",
username: "甜甜酱w", username: "甜甜酱w",
nickname: "甜甜", nickname: "甜甜",
avatar: "/avatars/u5.jpg", avatar: "/avatars/u5.jpg",
role: "player", role: "player",
bio: "主辅和原神日常,社恐但不摆烂", bio: "主辅和原神日常,社恐但不摆烂",
@@ -323,11 +323,11 @@ export const mockReviews: Review[] = [
id: "r1", id: "r1",
orderId: "ord2", orderId: "ord2",
fromUserId: "u1", fromUserId: "u1",
fromUserName: "小明同学", fromUserName: "小明",
fromUserAvatar: "/avatars/u1.jpg", fromUserAvatar: "/avatars/u1.jpg",
toUserId: "u4", toUserId: "u4",
rating: 5, rating: 5,
content: "报点很清楚,基本不用猜人在哪,打着挺舒服", content: "报点很快,架枪位也会提前说。中间崩了一把,后面拉回来了。",
sealed: false, sealed: false,
createdAt: "2025-02-15T13:00:00", createdAt: "2025-02-15T13:00:00",
}, },
@@ -339,7 +339,7 @@ export const mockReviews: Review[] = [
fromUserAvatar: "/avatars/u4.jpg", fromUserAvatar: "/avatars/u4.jpg",
toUserId: "u1", toUserId: "u1",
rating: 4, rating: 4,
content: "听指挥,节奏跟得上", content: "人挺好沟通,听指令,不会乱冲。",
sealed: false, sealed: false,
createdAt: "2025-02-15T13:30:00", createdAt: "2025-02-15T13:30:00",
}, },
@@ -347,23 +347,23 @@ export const mockReviews: Review[] = [
id: "r3", id: "r3",
orderId: "ord1", orderId: "ord1",
fromUserId: "u1", fromUserId: "u1",
fromUserName: "小明同学", fromUserName: "小明",
fromUserAvatar: "/avatars/u1.jpg", fromUserAvatar: "/avatars/u1.jpg",
toUserId: "u2", toUserId: "u2",
rating: 4, rating: 4,
content: "思路是有的,就是中间回消息慢了两次", content: "整体可以,第二把他家里来电话断了几分钟,后面补回来了。",
sealed: true, sealed: true,
createdAt: "2025-02-18T20:00:00", createdAt: "2025-02-19T00:05:00",
}, },
{ {
id: "r4", id: "r4",
orderId: "ord5", orderId: "ord5",
fromUserId: "u1", fromUserId: "u1",
fromUserName: "小明同学", fromUserName: "小明",
fromUserAvatar: "/avatars/u1.jpg", fromUserAvatar: "/avatars/u1.jpg",
toUserId: "u2", toUserId: "u2",
rating: 5, rating: 5,
content: "补位真稳,最后一把逆风翻了", content: "补位确实稳。最后一把逆风翻了,爽。",
sealed: false, sealed: false,
createdAt: "2025-02-08T22:40:00", createdAt: "2025-02-08T22:40:00",
}, },
@@ -375,7 +375,7 @@ export const mockReviews: Review[] = [
fromUserAvatar: "/avatars/u2.jpg", fromUserAvatar: "/avatars/u2.jpg",
toUserId: "u1", toUserId: "u1",
rating: 4, rating: 4,
content: "配合不错,输一也没", content: "配合OK,心态稳,输一也没甩锅。",
sealed: false, sealed: false,
createdAt: "2025-02-08T22:45:00", createdAt: "2025-02-08T22:45:00",
}, },
@@ -383,11 +383,11 @@ export const mockReviews: Review[] = [
id: "r6", id: "r6",
orderId: "ord6", orderId: "ord6",
fromUserId: "u1", fromUserId: "u1",
fromUserName: "小明同学", fromUserName: "小明",
fromUserAvatar: "/avatars/u1.jpg", fromUserAvatar: "/avatars/u1.jpg",
toUserId: "u5", toUserId: "u5",
rating: 3, rating: 3,
content: "日常都了,但比说好的晚了一点", content: "日常都了,就是比我想的晚半小时。",
sealed: false, sealed: false,
createdAt: "2025-02-06T20:40:00", createdAt: "2025-02-06T20:40:00",
}, },
@@ -395,11 +395,11 @@ export const mockReviews: Review[] = [
id: "r7", id: "r7",
orderId: "ord6", orderId: "ord6",
fromUserId: "u5", fromUserId: "u5",
fromUserName: "甜甜", fromUserName: "甜甜",
fromUserAvatar: "/avatars/u5.jpg", fromUserAvatar: "/avatars/u5.jpg",
toUserId: "u1", toUserId: "u1",
rating: 4, rating: 4,
content: "需求说得很清楚,沟通省心", content: "需求给得清楚,省事。",
sealed: false, sealed: false,
createdAt: "2025-02-06T20:46:00", createdAt: "2025-02-06T20:46:00",
}, },
@@ -407,11 +407,11 @@ export const mockReviews: Review[] = [
id: "r8", id: "r8",
orderId: "ord7", orderId: "ord7",
fromUserId: "u1", fromUserId: "u1",
fromUserName: "小明同学", fromUserName: "小明",
fromUserAvatar: "/avatars/u1.jpg", fromUserAvatar: "/avatars/u1.jpg",
toUserId: "u4", toUserId: "u4",
rating: 5, rating: 5,
content: "这把节奏太快了 爽", content: "节奏飞快,枪很硬。就是我跟得有点累哈哈。",
sealed: false, sealed: false,
createdAt: "2025-02-04T00:20:00", createdAt: "2025-02-04T00:20:00",
}, },
@@ -423,7 +423,7 @@ export const mockReviews: Review[] = [
fromUserAvatar: "/avatars/u4.jpg", fromUserAvatar: "/avatars/u4.jpg",
toUserId: "u1", toUserId: "u1",
rating: 5, rating: 5,
content: "上手快,基本不用多说", content: "上手快,喊点就能到。",
sealed: false, sealed: false,
createdAt: "2025-02-04T00:25:00", createdAt: "2025-02-04T00:25:00",
}, },
@@ -434,8 +434,8 @@ export const mockDisputes: Dispute[] = [
id: "d1", id: "d1",
orderId: "ord4", orderId: "ord4",
initiatorId: "u1", initiatorId: "u1",
initiatorName: "小明同学", initiatorName: "小明",
reason: "中途掉线后一直没回来,约好的上星数量没打完", reason: "中途掉线后一直没回来,约好的上星数量没打完",
evidence: ["/evidence/d1-1.jpg", "/evidence/d1-2.jpg"], evidence: ["/evidence/d1-1.jpg", "/evidence/d1-2.jpg"],
status: "reviewing", status: "reviewing",
createdAt: "2025-02-12T10:00:00", createdAt: "2025-02-12T10:00:00",
@@ -448,10 +448,10 @@ export const mockChatSessions: ChatSession[] = [
type: "order", type: "order",
orderId: "ord1", orderId: "ord1",
participants: [ participants: [
{ id: "u1", name: "小明同学", avatar: "/avatars/u1.jpg" }, { id: "u1", name: "小明", avatar: "/avatars/u1.jpg" },
{ id: "u2", name: "老李", avatar: "/avatars/u2.jpg" }, { id: "u2", name: "老李", avatar: "/avatars/u2.jpg" },
], ],
lastMessage: "今晚8点开始可以吗", lastMessage: "行,20:00开",
lastMessageAt: "2025-02-18T18:30:00", lastMessageAt: "2025-02-18T18:30:00",
unreadCount: 2, unreadCount: 2,
readonly: false, readonly: false,
@@ -460,10 +460,10 @@ export const mockChatSessions: ChatSession[] = [
id: "chat2", id: "chat2",
type: "consultation", type: "consultation",
participants: [ participants: [
{ id: "u1", name: "小明同学", avatar: "/avatars/u1.jpg" }, { id: "u1", name: "小明", avatar: "/avatars/u1.jpg" },
{ id: "u5", name: "甜甜", avatar: "/avatars/u5.jpg" }, { id: "u5", name: "甜甜", avatar: "/avatars/u5.jpg" },
], ],
lastMessage: "周末能接两把吗", lastMessage: "周末能接吗",
lastMessageAt: "2025-02-19T15:00:00", lastMessageAt: "2025-02-19T15:00:00",
unreadCount: 0, unreadCount: 0,
readonly: false, readonly: false,
@@ -473,10 +473,10 @@ export const mockChatSessions: ChatSession[] = [
type: "order", type: "order",
orderId: "ord2", orderId: "ord2",
participants: [ participants: [
{ id: "u1", name: "小明同学", avatar: "/avatars/u1.jpg" }, { id: "u1", name: "小明", avatar: "/avatars/u1.jpg" },
{ id: "u4", name: "阿辰", avatar: "/avatars/u4.jpg" }, { id: "u4", name: "阿辰", avatar: "/avatars/u4.jpg" },
], ],
lastMessage: "gg 改天再打", lastMessage: "下次再组",
lastMessageAt: "2025-02-15T12:30:00", lastMessageAt: "2025-02-15T12:30:00",
unreadCount: 0, unreadCount: 0,
readonly: true, readonly: true,
@@ -488,7 +488,7 @@ export const mockChatMessages: ChatMessage[] = [
id: "msg1", id: "msg1",
sessionId: "chat1", sessionId: "chat1",
senderId: "u1", senderId: "u1",
senderName: "小明同学", senderName: "小明",
senderAvatar: "/avatars/u1.jpg", senderAvatar: "/avatars/u1.jpg",
type: "system", type: "system",
content: "订单创建成功", content: "订单创建成功",
@@ -501,17 +501,17 @@ export const mockChatMessages: ChatMessage[] = [
senderName: "老李", senderName: "老李",
senderAvatar: "/avatars/u2.jpg", senderAvatar: "/avatars/u2.jpg",
type: "text", type: "text",
content: "在的,今晚能开。你想几把", content: "在,能打。你想几把",
createdAt: "2025-02-18T14:36:00", createdAt: "2025-02-18T14:36:00",
}, },
{ {
id: "msg3", id: "msg3",
sessionId: "chat1", sessionId: "chat1",
senderId: "u1", senderId: "u1",
senderName: "小明同学", senderName: "小明",
senderAvatar: "/avatars/u1.jpg", senderAvatar: "/avatars/u1.jpg",
type: "text", type: "text",
content: "今晚8点开始可以吗", content: "8点开行不",
createdAt: "2025-02-18T18:30:00", createdAt: "2025-02-18T18:30:00",
}, },
{ {
@@ -521,7 +521,7 @@ export const mockChatMessages: ChatMessage[] = [
senderName: "老李", senderName: "老李",
senderAvatar: "/avatars/u2.jpg", senderAvatar: "/avatars/u2.jpg",
type: "text", type: "text",
content: "行 8点我拉你", content: "行,到点我拉你",
createdAt: "2025-02-18T18:32:00", createdAt: "2025-02-18T18:32:00",
}, },
] ]
@@ -531,10 +531,10 @@ export const mockPosts: Post[] = [
id: "p1", id: "p1",
author: mockUsers[0], author: mockUsers[0],
authorRole: "consumer", authorRole: "consumer",
title: "CS2上分记录", title: "CS2上分体验分享",
content: "昨晚阿辰打了两小时,节奏很快,报点特别清楚。虽然也输了一把,但整体体验不错。", content: "昨晚阿辰打了三把,前两把顺,第三把差点翻车。总体值这个价。",
images: ["/posts/p1-1.jpg"], images: ["/posts/p1-1.jpg"],
tags: ["CS2", "上分"], tags: ["CS2", "上分", "好评"],
linkedOrderId: "ord2", linkedOrderId: "ord2",
likeCount: 42, likeCount: 42,
commentCount: 8, commentCount: 8,
@@ -546,7 +546,7 @@ export const mockPosts: Post[] = [
id: "p2", id: "p2",
author: mockUsers[1], author: mockUsers[1],
authorRole: "player", authorRole: "player",
title: "新赛季LOL上分思路", title: "新赛季英雄联盟上分攻略",
content: "新赛季改动有点多,先别急着硬冲分。前10分钟别乱接团,先稳住发育。", content: "新赛季改动有点多,先别急着硬冲分。前10分钟别乱接团,先稳住发育。",
images: [], images: [],
tags: ["英雄联盟", "攻略", "新赛季"], tags: ["英雄联盟", "攻略", "新赛季"],
@@ -560,10 +560,10 @@ export const mockPosts: Post[] = [
id: "p3", id: "p3",
author: mockUsers[4], author: mockUsers[4],
authorRole: "player", authorRole: "player",
title: "原神4.5版本代肝开放", title: "原神4.5版本日常代肝服务上线",
content: "这版本活动确实多,没空上线的话我可以帮你把委托和体力清掉,做完会回传截图。", content: "新活动有点肝,没空的话我可以帮清日常,做完发截图。",
images: ["/posts/p3-1.jpg", "/posts/p3-2.jpg"], images: ["/posts/p3-1.jpg", "/posts/p3-2.jpg"],
tags: ["原神", "代肝"], tags: ["原神", "代肝", "新版本"],
likeCount: 67, likeCount: 67,
commentCount: 12, commentCount: 12,
liked: false, liked: false,
@@ -577,7 +577,7 @@ export const mockComments: Comment[] = [
id: "c1", id: "c1",
postId: "p1", postId: "p1",
author: mockUsers[3], author: mockUsers[3],
content: "谢了 下次继续冲 💪", content: "收到,下次继续",
likeCount: 15, likeCount: 15,
liked: false, liked: false,
createdAt: "2025-02-16T11:00:00", createdAt: "2025-02-16T11:00:00",
@@ -586,7 +586,7 @@ export const mockComments: Comment[] = [
id: "c2", id: "c2",
postId: "p1", postId: "p1",
author: mockUsers[4], author: mockUsers[4],
content: "他报点是真的快,我也常跟他排", content: "他枪法确实硬,不过脾气也直哈哈",
likeCount: 8, likeCount: 8,
liked: false, liked: false,
createdAt: "2025-02-16T12:00:00", createdAt: "2025-02-16T12:00:00",
@@ -595,7 +595,7 @@ export const mockComments: Comment[] = [
id: "c3", id: "c3",
postId: "p2", postId: "p2",
author: mockUsers[0], author: mockUsers[0],
content: "这条有用,照着打舒服多了", content: "我照着打了两把,确实有用",
likeCount: 5, likeCount: 5,
liked: true, liked: true,
createdAt: "2025-02-14T10:00:00", createdAt: "2025-02-14T10:00:00",
@@ -607,7 +607,7 @@ export const mockNotifications: Notification[] = [
id: "n1", id: "n1",
type: "order", type: "order",
title: "订单已接单", title: "订单已接单",
content: "老李接单,记得按时上线", content: "老李接单了,去聊天里约时间就行",
read: false, read: false,
link: "/order/ord1", link: "/order/ord1",
createdAt: "2025-02-18T14:35:00", createdAt: "2025-02-18T14:35:00",
@@ -616,7 +616,7 @@ export const mockNotifications: Notification[] = [
id: "n2", id: "n2",
type: "order", type: "order",
title: "争议处理中", title: "争议处理中",
content: "你发起的订单争议正在审核", content: "你提交的订单争议已进入审核",
read: true, read: true,
link: "/dispute/ord4", link: "/dispute/ord4",
createdAt: "2025-02-12T10:05:00", createdAt: "2025-02-12T10:05:00",
@@ -624,8 +624,8 @@ export const mockNotifications: Notification[] = [
{ {
id: "n3", id: "n3",
type: "community", type: "community",
title: "帖子获赞", title: "帖子获得点赞",
content: "「CS2上分记录」收到了42个赞", content: "你的帖子「CS2上分体验分享」又多了42个赞",
read: false, read: false,
link: "/post/p1", link: "/post/p1",
createdAt: "2025-02-17T20:00:00", createdAt: "2025-02-17T20:00:00",
@@ -634,7 +634,7 @@ export const mockNotifications: Notification[] = [
id: "n4", id: "n4",
type: "system", type: "system",
title: "平台公告", title: "平台公告",
content: "春节活动已上线,首页可以直接领券", content: "春节活动 2 月 3 日上线,活动页明天开放。",
read: true, read: true,
createdAt: "2025-02-01T00:00:00", createdAt: "2025-02-01T00:00:00",
}, },