setup: shadcn/ui components + type definitions + mock data layer
This commit is contained in:
@@ -0,0 +1,569 @@
|
||||
import type {
|
||||
ChatMessage,
|
||||
ChatSession,
|
||||
Comment,
|
||||
Dispute,
|
||||
Game,
|
||||
Notification,
|
||||
Order,
|
||||
Player,
|
||||
PlayerService,
|
||||
Post,
|
||||
Review,
|
||||
Shop,
|
||||
User,
|
||||
WalletTransaction,
|
||||
} from "./types"
|
||||
|
||||
export const mockUsers: User[] = [
|
||||
{
|
||||
id: "u1",
|
||||
username: "gamer_zhang",
|
||||
nickname: "张小明",
|
||||
avatar: "/avatars/u1.jpg",
|
||||
role: "consumer",
|
||||
phone: "138****1234",
|
||||
bio: "资深游戏玩家",
|
||||
createdAt: "2025-01-15",
|
||||
},
|
||||
{
|
||||
id: "u2",
|
||||
username: "pro_li",
|
||||
nickname: "李大神",
|
||||
avatar: "/avatars/u2.jpg",
|
||||
role: "player",
|
||||
phone: "139****5678",
|
||||
bio: "全国百强打手,擅长MOBA类游戏",
|
||||
createdAt: "2024-11-20",
|
||||
},
|
||||
{
|
||||
id: "u3",
|
||||
username: "boss_wang",
|
||||
nickname: "王老板",
|
||||
avatar: "/avatars/u3.jpg",
|
||||
role: "owner",
|
||||
phone: "137****9012",
|
||||
bio: "电竞工作室负责人",
|
||||
createdAt: "2024-08-10",
|
||||
},
|
||||
{
|
||||
id: "u4",
|
||||
username: "carry_chen",
|
||||
nickname: "陈Carry",
|
||||
avatar: "/avatars/u4.jpg",
|
||||
role: "player",
|
||||
bio: "FPS专精,CS2全球精英",
|
||||
createdAt: "2025-02-01",
|
||||
},
|
||||
{
|
||||
id: "u5",
|
||||
username: "sweet_liu",
|
||||
nickname: "刘甜甜",
|
||||
avatar: "/avatars/u5.jpg",
|
||||
role: "player",
|
||||
bio: "温柔陪玩,擅长辅助位",
|
||||
createdAt: "2025-01-05",
|
||||
},
|
||||
]
|
||||
|
||||
export const mockGames: Game[] = [
|
||||
{ id: "g1", name: "英雄联盟", icon: "🎮", category: "MOBA" },
|
||||
{ id: "g2", name: "王者荣耀", icon: "👑", category: "MOBA" },
|
||||
{ id: "g3", name: "CS2", icon: "🔫", category: "FPS" },
|
||||
{ id: "g4", name: "永劫无间", icon: "⚔️", category: "动作" },
|
||||
{ id: "g5", name: "原神", icon: "🌟", category: "RPG" },
|
||||
{ id: "g6", name: "和平精英", icon: "🪖", category: "FPS" },
|
||||
{ id: "g7", name: "DOTA2", icon: "🛡️", category: "MOBA" },
|
||||
{ id: "g8", name: "无畏契约", icon: "💥", category: "FPS" },
|
||||
]
|
||||
|
||||
export const mockServices: PlayerService[] = [
|
||||
{
|
||||
id: "s1",
|
||||
playerId: "u2",
|
||||
gameId: "g1",
|
||||
gameName: "英雄联盟",
|
||||
title: "英雄联盟上分陪玩",
|
||||
description: "钻石以上段位陪玩,保证胜率60%+",
|
||||
price: 30,
|
||||
unit: "局",
|
||||
rankRange: "钻石-大师",
|
||||
availability: ["周一至周五 19:00-23:00", "周末全天"],
|
||||
},
|
||||
{
|
||||
id: "s2",
|
||||
playerId: "u2",
|
||||
gameId: "g2",
|
||||
gameName: "王者荣耀",
|
||||
title: "王者荣耀代练上星",
|
||||
description: "王者50星以上代练,安全高效",
|
||||
price: 25,
|
||||
unit: "星",
|
||||
rankRange: "王者",
|
||||
availability: ["全天可接"],
|
||||
},
|
||||
{
|
||||
id: "s3",
|
||||
playerId: "u4",
|
||||
gameId: "g3",
|
||||
gameName: "CS2",
|
||||
title: "CS2上分陪玩",
|
||||
description: "全球精英带飞,沟通顺畅",
|
||||
price: 40,
|
||||
unit: "局",
|
||||
rankRange: "黄金-全球精英",
|
||||
availability: ["每天 14:00-24:00"],
|
||||
},
|
||||
{
|
||||
id: "s4",
|
||||
playerId: "u5",
|
||||
gameId: "g1",
|
||||
gameName: "英雄联盟",
|
||||
title: "英雄联盟娱乐陪玩",
|
||||
description: "轻松愉快的游戏体验,不冲分不上头",
|
||||
price: 20,
|
||||
unit: "局",
|
||||
availability: ["周末 10:00-22:00"],
|
||||
},
|
||||
{
|
||||
id: "s5",
|
||||
playerId: "u5",
|
||||
gameId: "g5",
|
||||
gameName: "原神",
|
||||
title: "原神日常代肝",
|
||||
description: "帮你完成每日任务和活动",
|
||||
price: 15,
|
||||
unit: "次",
|
||||
availability: ["全天可接"],
|
||||
},
|
||||
]
|
||||
|
||||
export const mockPlayers: Player[] = [
|
||||
{
|
||||
id: "u2",
|
||||
user: mockUsers[1],
|
||||
rating: 4.8,
|
||||
totalOrders: 1256,
|
||||
completionRate: 0.98,
|
||||
status: "available",
|
||||
games: ["英雄联盟", "王者荣耀"],
|
||||
services: mockServices.filter((s) => s.playerId === "u2"),
|
||||
shopId: "shop1",
|
||||
shopName: "王者电竞工作室",
|
||||
tags: ["MOBA专精", "高胜率", "耐心"],
|
||||
},
|
||||
{
|
||||
id: "u4",
|
||||
user: mockUsers[3],
|
||||
rating: 4.9,
|
||||
totalOrders: 832,
|
||||
completionRate: 0.99,
|
||||
status: "busy",
|
||||
games: ["CS2", "无畏契约"],
|
||||
services: mockServices.filter((s) => s.playerId === "u4"),
|
||||
tags: ["FPS大神", "全球精英", "沟通好"],
|
||||
},
|
||||
{
|
||||
id: "u5",
|
||||
user: mockUsers[4],
|
||||
rating: 4.7,
|
||||
totalOrders: 645,
|
||||
completionRate: 0.97,
|
||||
status: "available",
|
||||
games: ["英雄联盟", "原神"],
|
||||
services: mockServices.filter((s) => s.playerId === "u5"),
|
||||
shopId: "shop1",
|
||||
shopName: "王者电竞工作室",
|
||||
tags: ["温柔陪玩", "辅助专精", "氛围好"],
|
||||
},
|
||||
]
|
||||
|
||||
export const mockShops: Shop[] = [
|
||||
{
|
||||
id: "shop1",
|
||||
owner: mockUsers[2],
|
||||
name: "王者电竞工作室",
|
||||
banner: "/banners/shop1.jpg",
|
||||
description: "专业电竞陪玩工作室,拥有50+签约打手,覆盖主流游戏",
|
||||
rating: 4.8,
|
||||
totalOrders: 5600,
|
||||
playerCount: 12,
|
||||
commissionType: "percentage",
|
||||
commissionValue: 15,
|
||||
allowMultiShop: false,
|
||||
allowIndependentOrders: true,
|
||||
dispatchMode: "manual",
|
||||
announcements: ["新年活动:全场8折优惠!", "招募CS2打手,待遇从优"],
|
||||
templateConfig: {
|
||||
sections: [
|
||||
{ type: "banner", enabled: true, order: 0 },
|
||||
{ type: "intro", enabled: true, order: 1 },
|
||||
{ type: "announcements", enabled: true, order: 2 },
|
||||
{ type: "services", enabled: true, order: 3 },
|
||||
{ type: "players", enabled: true, order: 4 },
|
||||
{ type: "reviews", enabled: true, order: 5 },
|
||||
],
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
export const mockOrders: Order[] = [
|
||||
{
|
||||
id: "ord1",
|
||||
consumerId: "u1",
|
||||
consumerName: "张小明",
|
||||
playerId: "u2",
|
||||
playerName: "李大神",
|
||||
shopId: "shop1",
|
||||
shopName: "王者电竞工作室",
|
||||
service: mockServices[0],
|
||||
status: "in_progress",
|
||||
totalPrice: 90,
|
||||
note: "希望打上分,最好能连赢",
|
||||
createdAt: "2025-02-18T14:30:00",
|
||||
acceptedAt: "2025-02-18T14:35:00",
|
||||
},
|
||||
{
|
||||
id: "ord2",
|
||||
consumerId: "u1",
|
||||
consumerName: "张小明",
|
||||
playerId: "u4",
|
||||
playerName: "陈Carry",
|
||||
service: mockServices[2],
|
||||
status: "completed",
|
||||
totalPrice: 120,
|
||||
createdAt: "2025-02-15T10:00:00",
|
||||
acceptedAt: "2025-02-15T10:05:00",
|
||||
closedAt: "2025-02-15T12:30:00",
|
||||
completedAt: "2025-02-15T12:35:00",
|
||||
},
|
||||
{
|
||||
id: "ord3",
|
||||
consumerId: "u1",
|
||||
consumerName: "张小明",
|
||||
playerId: "u5",
|
||||
playerName: "刘甜甜",
|
||||
shopId: "shop1",
|
||||
shopName: "王者电竞工作室",
|
||||
service: mockServices[3],
|
||||
status: "pending_accept",
|
||||
totalPrice: 60,
|
||||
note: "想轻松玩几把",
|
||||
createdAt: "2025-02-19T20:00:00",
|
||||
},
|
||||
{
|
||||
id: "ord4",
|
||||
consumerId: "u1",
|
||||
consumerName: "张小明",
|
||||
playerId: "u2",
|
||||
playerName: "李大神",
|
||||
shopId: "shop1",
|
||||
shopName: "王者电竞工作室",
|
||||
service: mockServices[1],
|
||||
status: "disputed",
|
||||
totalPrice: 75,
|
||||
createdAt: "2025-02-10T16:00:00",
|
||||
acceptedAt: "2025-02-10T16:10:00",
|
||||
},
|
||||
]
|
||||
|
||||
export const mockReviews: Review[] = [
|
||||
{
|
||||
id: "r1",
|
||||
orderId: "ord2",
|
||||
fromUserId: "u1",
|
||||
fromUserName: "张小明",
|
||||
fromUserAvatar: "/avatars/u1.jpg",
|
||||
toUserId: "u4",
|
||||
rating: 5,
|
||||
content: "陈Carry太强了,三局全赢,沟通也很好!",
|
||||
sealed: false,
|
||||
createdAt: "2025-02-15T13:00:00",
|
||||
},
|
||||
{
|
||||
id: "r2",
|
||||
orderId: "ord2",
|
||||
fromUserId: "u4",
|
||||
fromUserName: "陈Carry",
|
||||
fromUserAvatar: "/avatars/u4.jpg",
|
||||
toUserId: "u1",
|
||||
rating: 5,
|
||||
content: "配合默契的队友,下次再来",
|
||||
sealed: false,
|
||||
createdAt: "2025-02-15T13:30:00",
|
||||
},
|
||||
{
|
||||
id: "r3",
|
||||
orderId: "ord1",
|
||||
fromUserId: "u1",
|
||||
fromUserName: "张小明",
|
||||
fromUserAvatar: "/avatars/u1.jpg",
|
||||
toUserId: "u2",
|
||||
rating: 4,
|
||||
content: "技术很好,就是有时候回复慢了点",
|
||||
sealed: true,
|
||||
createdAt: "2025-02-18T20:00:00",
|
||||
},
|
||||
]
|
||||
|
||||
export const mockDisputes: Dispute[] = [
|
||||
{
|
||||
id: "d1",
|
||||
orderId: "ord4",
|
||||
initiatorId: "u1",
|
||||
initiatorName: "张小明",
|
||||
reason: "打手中途离开游戏,未完成约定的上星数量",
|
||||
evidence: ["/evidence/d1-1.jpg", "/evidence/d1-2.jpg"],
|
||||
status: "reviewing",
|
||||
createdAt: "2025-02-12T10:00:00",
|
||||
},
|
||||
]
|
||||
|
||||
export const mockChatSessions: ChatSession[] = [
|
||||
{
|
||||
id: "chat1",
|
||||
type: "order",
|
||||
orderId: "ord1",
|
||||
participants: [
|
||||
{ id: "u1", name: "张小明", avatar: "/avatars/u1.jpg" },
|
||||
{ id: "u2", name: "李大神", avatar: "/avatars/u2.jpg" },
|
||||
],
|
||||
lastMessage: "今晚8点开始可以吗?",
|
||||
lastMessageAt: "2025-02-18T18:30:00",
|
||||
unreadCount: 2,
|
||||
readonly: false,
|
||||
},
|
||||
{
|
||||
id: "chat2",
|
||||
type: "consultation",
|
||||
participants: [
|
||||
{ id: "u1", name: "张小明", avatar: "/avatars/u1.jpg" },
|
||||
{ id: "u5", name: "刘甜甜", avatar: "/avatars/u5.jpg" },
|
||||
],
|
||||
lastMessage: "请问你周末有空吗?",
|
||||
lastMessageAt: "2025-02-19T15:00:00",
|
||||
unreadCount: 0,
|
||||
readonly: false,
|
||||
},
|
||||
{
|
||||
id: "chat3",
|
||||
type: "order",
|
||||
orderId: "ord2",
|
||||
participants: [
|
||||
{ id: "u1", name: "张小明", avatar: "/avatars/u1.jpg" },
|
||||
{ id: "u4", name: "陈Carry", avatar: "/avatars/u4.jpg" },
|
||||
],
|
||||
lastMessage: "GG,下次再来!",
|
||||
lastMessageAt: "2025-02-15T12:30:00",
|
||||
unreadCount: 0,
|
||||
readonly: true,
|
||||
},
|
||||
]
|
||||
|
||||
export const mockChatMessages: ChatMessage[] = [
|
||||
{
|
||||
id: "msg1",
|
||||
sessionId: "chat1",
|
||||
senderId: "u1",
|
||||
senderName: "张小明",
|
||||
senderAvatar: "/avatars/u1.jpg",
|
||||
type: "system",
|
||||
content: "订单已创建,聊天会话已开启",
|
||||
createdAt: "2025-02-18T14:35:00",
|
||||
},
|
||||
{
|
||||
id: "msg2",
|
||||
sessionId: "chat1",
|
||||
senderId: "u2",
|
||||
senderName: "李大神",
|
||||
senderAvatar: "/avatars/u2.jpg",
|
||||
type: "text",
|
||||
content: "你好!我已接单,请问什么时候方便开始?",
|
||||
createdAt: "2025-02-18T14:36:00",
|
||||
},
|
||||
{
|
||||
id: "msg3",
|
||||
sessionId: "chat1",
|
||||
senderId: "u1",
|
||||
senderName: "张小明",
|
||||
senderAvatar: "/avatars/u1.jpg",
|
||||
type: "text",
|
||||
content: "今晚8点开始可以吗?",
|
||||
createdAt: "2025-02-18T18:30:00",
|
||||
},
|
||||
{
|
||||
id: "msg4",
|
||||
sessionId: "chat1",
|
||||
senderId: "u2",
|
||||
senderName: "李大神",
|
||||
senderAvatar: "/avatars/u2.jpg",
|
||||
type: "text",
|
||||
content: "没问题,到时候见!我的游戏ID是 ProLi#1234",
|
||||
createdAt: "2025-02-18T18:32:00",
|
||||
},
|
||||
]
|
||||
|
||||
export const mockPosts: Post[] = [
|
||||
{
|
||||
id: "p1",
|
||||
author: mockUsers[0],
|
||||
authorRole: "consumer",
|
||||
title: "CS2上分体验分享",
|
||||
content:
|
||||
"找了陈Carry陪玩CS2,三局全赢直接上了全球精英,太爽了!打手技术真的没话说,推荐给大家。",
|
||||
images: ["/posts/p1-1.jpg"],
|
||||
tags: ["CS2", "上分", "好评"],
|
||||
linkedOrderId: "ord2",
|
||||
likeCount: 42,
|
||||
commentCount: 8,
|
||||
liked: false,
|
||||
pinned: false,
|
||||
createdAt: "2025-02-16T10:00:00",
|
||||
},
|
||||
{
|
||||
id: "p2",
|
||||
author: mockUsers[1],
|
||||
authorRole: "player",
|
||||
title: "新赛季英雄联盟上分攻略",
|
||||
content: "新赛季版本变动很大,分享一下我的上分心得。目前胜率最高的英雄是...",
|
||||
images: [],
|
||||
tags: ["英雄联盟", "攻略", "新赛季"],
|
||||
likeCount: 128,
|
||||
commentCount: 35,
|
||||
liked: true,
|
||||
pinned: true,
|
||||
createdAt: "2025-02-14T08:00:00",
|
||||
},
|
||||
{
|
||||
id: "p3",
|
||||
author: mockUsers[4],
|
||||
authorRole: "player",
|
||||
title: "原神4.5版本日常代肝服务上线",
|
||||
content: "新版本活动很多,没时间肝的朋友可以找我,保证每日任务+活动全清。",
|
||||
images: ["/posts/p3-1.jpg", "/posts/p3-2.jpg"],
|
||||
tags: ["原神", "代肝", "新版本"],
|
||||
likeCount: 67,
|
||||
commentCount: 12,
|
||||
liked: false,
|
||||
pinned: false,
|
||||
createdAt: "2025-02-17T14:00:00",
|
||||
},
|
||||
]
|
||||
|
||||
export const mockComments: Comment[] = [
|
||||
{
|
||||
id: "c1",
|
||||
postId: "p1",
|
||||
author: mockUsers[3],
|
||||
content: "感谢好评!下次继续带飞 💪",
|
||||
likeCount: 15,
|
||||
liked: false,
|
||||
createdAt: "2025-02-16T11:00:00",
|
||||
},
|
||||
{
|
||||
id: "c2",
|
||||
postId: "p1",
|
||||
author: mockUsers[4],
|
||||
content: "陈Carry确实厉害,我们工作室的王牌",
|
||||
likeCount: 8,
|
||||
liked: false,
|
||||
createdAt: "2025-02-16T12:00:00",
|
||||
},
|
||||
{
|
||||
id: "c3",
|
||||
postId: "p2",
|
||||
author: mockUsers[0],
|
||||
content: "大神的攻略太有用了,学到了很多",
|
||||
likeCount: 5,
|
||||
liked: true,
|
||||
createdAt: "2025-02-14T10:00:00",
|
||||
},
|
||||
]
|
||||
|
||||
export const mockNotifications: Notification[] = [
|
||||
{
|
||||
id: "n1",
|
||||
type: "order",
|
||||
title: "订单已接单",
|
||||
content: "李大神已接受你的英雄联盟陪玩订单",
|
||||
read: false,
|
||||
link: "/order/ord1",
|
||||
createdAt: "2025-02-18T14:35:00",
|
||||
},
|
||||
{
|
||||
id: "n2",
|
||||
type: "order",
|
||||
title: "争议处理中",
|
||||
content: "你发起的订单争议正在审核中",
|
||||
read: true,
|
||||
link: "/dispute/d1",
|
||||
createdAt: "2025-02-12T10:05:00",
|
||||
},
|
||||
{
|
||||
id: "n3",
|
||||
type: "community",
|
||||
title: "帖子获得点赞",
|
||||
content: "你的帖子「CS2上分体验分享」获得了42个赞",
|
||||
read: false,
|
||||
link: "/post/p1",
|
||||
createdAt: "2025-02-17T20:00:00",
|
||||
},
|
||||
{
|
||||
id: "n4",
|
||||
type: "system",
|
||||
title: "平台公告",
|
||||
content: "聚玩春节活动即将开始,敬请期待!",
|
||||
read: true,
|
||||
createdAt: "2025-02-01T00:00:00",
|
||||
},
|
||||
{
|
||||
id: "n5",
|
||||
type: "community",
|
||||
title: "新评论",
|
||||
content: "陈Carry评论了你的帖子",
|
||||
read: false,
|
||||
link: "/post/p1",
|
||||
createdAt: "2025-02-16T11:00:00",
|
||||
},
|
||||
]
|
||||
|
||||
export const mockTransactions: WalletTransaction[] = [
|
||||
{
|
||||
id: "t1",
|
||||
type: "topup",
|
||||
amount: 500,
|
||||
description: "充值",
|
||||
createdAt: "2025-02-10T10:00:00",
|
||||
},
|
||||
{
|
||||
id: "t2",
|
||||
type: "payment",
|
||||
amount: -120,
|
||||
description: "支付订单 ord2",
|
||||
createdAt: "2025-02-15T10:00:00",
|
||||
},
|
||||
{
|
||||
id: "t3",
|
||||
type: "payment",
|
||||
amount: -90,
|
||||
description: "支付订单 ord1",
|
||||
createdAt: "2025-02-18T14:30:00",
|
||||
},
|
||||
{
|
||||
id: "t4",
|
||||
type: "topup",
|
||||
amount: 200,
|
||||
description: "充值",
|
||||
createdAt: "2025-02-19T09:00:00",
|
||||
},
|
||||
{
|
||||
id: "t5",
|
||||
type: "payment",
|
||||
amount: -60,
|
||||
description: "支付订单 ord3",
|
||||
createdAt: "2025-02-19T20:00:00",
|
||||
},
|
||||
]
|
||||
|
||||
export const currentUser = mockUsers[0]
|
||||
export const walletBalance = 430
|
||||
+194
@@ -0,0 +1,194 @@
|
||||
export type UserRole = "consumer" | "player" | "owner"
|
||||
|
||||
export interface User {
|
||||
id: string
|
||||
username: string
|
||||
nickname: string
|
||||
avatar: string
|
||||
role: UserRole
|
||||
phone?: string
|
||||
bio?: string
|
||||
createdAt: string
|
||||
}
|
||||
|
||||
export interface Game {
|
||||
id: string
|
||||
name: string
|
||||
icon: string
|
||||
category: string
|
||||
}
|
||||
|
||||
export interface PlayerService {
|
||||
id: string
|
||||
playerId: string
|
||||
gameId: string
|
||||
gameName: string
|
||||
title: string
|
||||
description: string
|
||||
price: number
|
||||
unit: string
|
||||
rankRange?: string
|
||||
availability: string[]
|
||||
}
|
||||
|
||||
export interface Player {
|
||||
id: string
|
||||
user: User
|
||||
rating: number
|
||||
totalOrders: number
|
||||
completionRate: number
|
||||
status: "available" | "busy" | "offline"
|
||||
games: string[]
|
||||
services: PlayerService[]
|
||||
shopId?: string
|
||||
shopName?: string
|
||||
tags: string[]
|
||||
}
|
||||
|
||||
export interface Shop {
|
||||
id: string
|
||||
owner: User
|
||||
name: string
|
||||
banner?: string
|
||||
description: string
|
||||
rating: number
|
||||
totalOrders: number
|
||||
playerCount: number
|
||||
commissionType: "fixed" | "percentage"
|
||||
commissionValue: number
|
||||
allowMultiShop: boolean
|
||||
allowIndependentOrders: boolean
|
||||
dispatchMode: "manual" | "auto"
|
||||
announcements: string[]
|
||||
templateConfig: ShopTemplateConfig
|
||||
}
|
||||
|
||||
export interface ShopTemplateConfig {
|
||||
sections: ShopSection[]
|
||||
}
|
||||
|
||||
export interface ShopSection {
|
||||
type: "banner" | "intro" | "services" | "players" | "announcements" | "reviews"
|
||||
enabled: boolean
|
||||
order: number
|
||||
}
|
||||
|
||||
export type OrderStatus =
|
||||
| "pending_payment"
|
||||
| "pending_accept"
|
||||
| "in_progress"
|
||||
| "pending_close"
|
||||
| "pending_review"
|
||||
| "disputed"
|
||||
| "completed"
|
||||
| "cancelled"
|
||||
|
||||
export interface Order {
|
||||
id: string
|
||||
consumerId: string
|
||||
consumerName: string
|
||||
playerId: string
|
||||
playerName: string
|
||||
shopId?: string
|
||||
shopName?: string
|
||||
service: PlayerService
|
||||
status: OrderStatus
|
||||
totalPrice: number
|
||||
note?: string
|
||||
createdAt: string
|
||||
acceptedAt?: string
|
||||
closedAt?: string
|
||||
completedAt?: string
|
||||
}
|
||||
|
||||
export interface Review {
|
||||
id: string
|
||||
orderId: string
|
||||
fromUserId: string
|
||||
fromUserName: string
|
||||
fromUserAvatar: string
|
||||
toUserId: string
|
||||
rating: number
|
||||
content?: string
|
||||
sealed: boolean
|
||||
createdAt: string
|
||||
}
|
||||
|
||||
export interface Dispute {
|
||||
id: string
|
||||
orderId: string
|
||||
initiatorId: string
|
||||
initiatorName: string
|
||||
reason: string
|
||||
evidence: string[]
|
||||
status: "open" | "reviewing" | "resolved" | "appealed"
|
||||
result?: "full_refund" | "full_payment" | "partial_refund"
|
||||
createdAt: string
|
||||
}
|
||||
|
||||
export interface ChatSession {
|
||||
id: string
|
||||
type: "consultation" | "order"
|
||||
orderId?: string
|
||||
participants: { id: string; name: string; avatar: string }[]
|
||||
lastMessage?: string
|
||||
lastMessageAt?: string
|
||||
unreadCount: number
|
||||
readonly: boolean
|
||||
}
|
||||
|
||||
export interface ChatMessage {
|
||||
id: string
|
||||
sessionId: string
|
||||
senderId: string
|
||||
senderName: string
|
||||
senderAvatar: string
|
||||
type: "text" | "image" | "system"
|
||||
content: string
|
||||
createdAt: string
|
||||
}
|
||||
|
||||
export interface Post {
|
||||
id: string
|
||||
author: User
|
||||
authorRole: UserRole
|
||||
title: string
|
||||
content: string
|
||||
images: string[]
|
||||
tags: string[]
|
||||
linkedOrderId?: string
|
||||
quotedPostId?: string
|
||||
likeCount: number
|
||||
commentCount: number
|
||||
liked: boolean
|
||||
pinned: boolean
|
||||
createdAt: string
|
||||
}
|
||||
|
||||
export interface Comment {
|
||||
id: string
|
||||
postId: string
|
||||
author: User
|
||||
content: string
|
||||
likeCount: number
|
||||
liked: boolean
|
||||
createdAt: string
|
||||
}
|
||||
|
||||
export interface Notification {
|
||||
id: string
|
||||
type: "order" | "community" | "system"
|
||||
title: string
|
||||
content: string
|
||||
read: boolean
|
||||
link?: string
|
||||
createdAt: string
|
||||
}
|
||||
|
||||
export interface WalletTransaction {
|
||||
id: string
|
||||
type: "topup" | "payment" | "income" | "withdrawal" | "refund"
|
||||
amount: number
|
||||
description: string
|
||||
createdAt: string
|
||||
}
|
||||
Reference in New Issue
Block a user