Files
xin-school-taro/src/mock/reviews.ts
T
2026-07-10 20:14:43 +08:00

112 lines
4.6 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import type { Review } from '@/types/shop'
/** 商家-评价映射(key=shopId */
export const shopReviews: Record<string, Review[]> = {
s1: [
{
id: 'r1', author: { name: '小王同学', avatar: 'https://picsum.photos/seed/u1/100/100' },
rating: 5, time: '2 小时前', content: '味道正宗,骨汤浓郁,配送也很快,包装完好,下次还会再点!',
images: [
'https://picsum.photos/seed/rv1/200/200',
'https://picsum.photos/seed/rv2/200/200',
],
dishes: ['招牌骨汤麻辣烫', '麻辣牛肉串'],
},
{
id: 'r2', author: { name: '匿名用户', avatar: 'https://picsum.photos/seed/u2/100/100' },
rating: 4, time: '昨天', content: '份量挺足的,价格也合理,麻酱香味很浓。',
dishes: ['牛百叶', '土豆片'],
},
{
id: 'r3', author: { name: '李同学', avatar: 'https://picsum.photos/seed/u3/100/100' },
rating: 5, time: '3 天前', content: '室友推荐的,确实不错,辣度可以自由选。',
},
],
s2: [
{
id: 'r4', author: { name: '王同学', avatar: 'https://picsum.photos/seed/u4/100/100' },
rating: 5, time: '1 小时前', content: '鸡腿肉很嫩,酱香浓郁,米饭再加一份才过瘾。',
images: ['https://picsum.photos/seed/rv3/200/200'],
dishes: ['黄焖鸡腿肉(小份)'],
},
{
id: 'r5', author: { name: '张同学', avatar: 'https://picsum.photos/seed/u5/100/100' },
rating: 4, time: '昨天', content: '份量足,送达也快,酸梅汤也好喝。',
},
],
s3: [
{
id: 'r6', author: { name: '陈同学', avatar: 'https://picsum.photos/seed/u6/100/100' },
rating: 5, time: '30 分钟前', content: '朋友过生日订的,榴莲千层真的绝绝子,奶油不腻!',
images: [
'https://picsum.photos/seed/rv4/200/200',
'https://picsum.photos/seed/rv5/200/200',
'https://picsum.photos/seed/rv6/200/200',
],
dishes: ['榴莲千层蛋糕(6寸)'],
},
{
id: 'r7', author: { name: '刘同学', avatar: 'https://picsum.photos/seed/u7/100/100' },
rating: 5, time: '2 天前', content: '蛋挞很香,酥皮层次分明。',
dishes: ['葡式蛋挞(4 个)'],
},
],
s4: [
{
id: 'r8', author: { name: '周同学', avatar: 'https://picsum.photos/seed/u8/100/100' },
rating: 5, time: '10 分钟前', content: '波霸 Q 弹,茶底清淡,甜度可以自由选太赞了。',
dishes: ['波霸奶茶(中杯)'],
},
{
id: 'r9', author: { name: '吴同学', avatar: 'https://picsum.photos/seed/u9/100/100' },
rating: 4, time: '5 小时前', content: '送货快,包装也结实,奶盖略甜。',
},
],
s5: [
{
id: 'r10', author: { name: '钱同学', avatar: 'https://picsum.photos/seed/u10/100/100' },
rating: 5, time: '20 分钟前', content: '宿舍楼下的便利店太方便了,深夜还能送泡面。',
images: ['https://picsum.photos/seed/rv7/200/200'],
dishes: ['康师傅红烧牛肉面', '可口可乐(330ml'],
},
{
id: 'r11', author: { name: '孙同学', avatar: 'https://picsum.photos/seed/u11/100/100' },
rating: 4, time: '昨天', content: '送货快,价格合理,商品全。',
},
],
s6: [
{
id: 'r12', author: { name: '郑同学', avatar: 'https://picsum.photos/seed/u12/100/100' },
rating: 5, time: '1 小时前', content: '半夜发烧送的药,骑手很负责,还特别交代了服用方法。',
dishes: ['布洛芬缓释胶囊'],
},
],
s7: [
{
id: 'r13', author: { name: '冯同学', avatar: 'https://picsum.photos/seed/u13/100/100' },
rating: 5, time: '15 分钟前', content: '水果很新鲜,芒果超甜,切盒也很新鲜。',
images: [
'https://picsum.photos/seed/rv8/200/200',
'https://picsum.photos/seed/rv9/200/200',
],
dishes: ['水果切盒(大)', '海南金煌芒(1 个)'],
},
],
s8: [
{
id: 'r14', author: { name: '蒋同学', avatar: 'https://picsum.photos/seed/u14/100/100' },
rating: 5, time: '40 分钟前', content: '校园店出餐快,套餐价格比店里便宜。',
dishes: ['香辣鸡腿堡套餐'],
},
{
id: 'r15', author: { name: '魏同学', avatar: 'https://picsum.photos/seed/u15/100/100' },
rating: 4, time: '昨天', content: '薯条有点凉了,不过整体还可以。',
},
],
}
/** 获取某店铺的评价列表 */
export function getShopReviews(shopId: string): Review[] {
return shopReviews[shopId] || []
}