商品以及商品详情

This commit is contained in:
liu
2026-07-10 20:14:43 +08:00
parent c25cf0e8b3
commit 3022990ea1
93 changed files with 4576 additions and 1008 deletions
+343
View File
@@ -0,0 +1,343 @@
import type { Article, ForumSubCategory } from '@/types/article'
/** 论坛帖子(数据复用 Article 类型,category='forum'subCategory 区分板块) */
export const forumPosts: Article[] = [
// ===== 校园生活 =====
{
id: 'f1',
title: '学校南门新开了一家手打柠檬茶,超好喝!',
excerpt: '今天路过南门发现新开了一家柠檬茶店,买了一杯鸭屎香柠檬茶,8 块一杯,茶底是现煮的,柠檬也是现切,酸甜度刚好,强烈推荐给大家!',
source: '吃货小张',
sourceAvatar: 'https://picsum.photos/seed/av1/100/100',
time: '10 分钟前',
readCount: 234,
commentCount: 18,
likeCount: 56,
images: [
'https://picsum.photos/seed/lemon1/300/300',
'https://picsum.photos/seed/lemon2/300/300',
],
type: 'image-text',
category: 'forum',
subCategory: 'life',
},
{
id: 'f2',
title: '求问校运会的时间和报名方式',
excerpt: '请问今年校运会什么时候开始?在哪里报名呢?看学院群里发的通知好像错过了,有同学知道吗?',
source: '新生小李',
sourceAvatar: 'https://picsum.photos/seed/av2/100/100',
time: '1 小时前',
readCount: 89,
commentCount: 12,
likeCount: 8,
images: [],
type: 'text',
category: 'forum',
subCategory: 'life',
},
{
id: 'f3',
title: '分享一下我的毕业旅行 vlog 拍摄地',
excerpt: '毕业季到了,跟室友去了一趟川西,沿途的风景真的美哭了!把推荐的几个人少的拍摄点整理了一下,需要的学弟学妹可以参考。',
source: '应届毕业生',
sourceAvatar: 'https://picsum.photos/seed/av3/100/100',
time: '3 小时前',
readCount: 567,
commentCount: 45,
likeCount: 178,
images: [
'https://picsum.photos/seed/travel1/300/300',
'https://picsum.photos/seed/travel2/300/300',
'https://picsum.photos/seed/travel3/300/300',
],
type: 'image-grid',
category: 'forum',
subCategory: 'life',
},
{
id: 'f4',
title: '校园里的流浪猫越来越多了,建议学校组织救助',
excerpt: '每天去图书馆都能看到几只流浪猫,有的还很瘦。希望学校能联系相关公益组织,做一次集中的绝育和疫苗。',
source: '爱猫人士',
sourceAvatar: 'https://picsum.photos/seed/av4/100/100',
time: '昨天',
readCount: 412,
commentCount: 67,
likeCount: 234,
images: [],
type: 'text',
category: 'forum',
subCategory: 'life',
},
// ===== 学习交流 =====
{
id: 'f5',
title: '高等数学期末复习资料分享(含思维导图)',
excerpt: '整理了高数老师上课的全部重点,配上思维导图和典型例题,有需要的同学可以下载,祝大家期末都能 90+!',
source: '数学学霸',
sourceAvatar: 'https://picsum.photos/seed/av5/100/100',
time: '20 分钟前',
readCount: 1023,
commentCount: 89,
likeCount: 567,
images: [],
type: 'text',
category: 'forum',
subCategory: 'study',
},
{
id: 'f6',
title: '求推荐计算机专业研究生导师',
excerpt: '本人是计科大三学生,绩点 3.6,想考研但对导师方向不太了解。请问有没有熟悉图像处理和 CV 方向的老师推荐?',
source: '考研小白',
sourceAvatar: 'https://picsum.photos/seed/av6/100/100',
time: '2 小时前',
readCount: 256,
commentCount: 34,
likeCount: 28,
images: [],
type: 'text',
category: 'forum',
subCategory: 'study',
},
{
id: 'f7',
title: '英语六级备考经验贴,2 个月从 420 到 568',
excerpt: '我英语底子一般,经过 2 个月的系统复习,最终六级 568 分。把我的复习方法、资料和刷题技巧全部分享出来。',
source: '六级过儿',
sourceAvatar: 'https://picsum.photos/seed/av7/100/100',
time: '4 小时前',
readCount: 892,
commentCount: 56,
likeCount: 312,
images: [
'https://picsum.photos/seed/english1/300/300',
'https://picsum.photos/seed/english2/300/300',
],
type: 'image-text',
category: 'forum',
subCategory: 'study',
},
{
id: 'f8',
title: '高数线代答疑群,有问题来问',
excerpt: '我们几个同学建了一个数学答疑群,有不会的题目可以发出来互相讨论。群里 200 多人,气氛活跃,不收任何费用。',
source: '数学小组',
sourceAvatar: 'https://picsum.photos/seed/av8/100/100',
time: '2 天前',
readCount: 456,
commentCount: 23,
likeCount: 89,
images: [],
type: 'text',
category: 'forum',
subCategory: 'study',
},
// ===== 失物招领 =====
{
id: 'f9',
title: '【寻物】昨天图书馆丢失蓝色保温杯',
excerpt: '昨天上午在三楼自习室落下一个蓝色的 Stanley 保温杯,杯身贴了一张小熊贴纸。有同学看到请联系本人,必有重谢!',
source: '焦急的小王',
sourceAvatar: 'https://picsum.photos/seed/av9/100/100',
time: '30 分钟前',
readCount: 178,
commentCount: 14,
likeCount: 12,
images: [
'https://picsum.photos/seed/cup1/300/300',
],
type: 'image-text',
category: 'forum',
subCategory: 'lost-found',
},
{
id: 'f10',
title: '【招领】在操场捡到一串钥匙',
excerpt: '昨天晚上在西操场跑步时捡到一串钥匙,大概 3-4 把,带一个蓝色的小熊挂件。有丢失的同学可以私信我核对信息。',
source: '好心的同学',
sourceAvatar: 'https://picsum.photos/seed/av10/100/100',
time: '5 小时前',
readCount: 92,
commentCount: 8,
likeCount: 15,
images: [
'https://picsum.photos/seed/keys1/300/300',
],
type: 'image-text',
category: 'forum',
subCategory: 'lost-found',
},
{
id: 'f11',
title: '【寻物】一卡通不见了,应该在教学楼附近',
excerpt: '今天中午在第二教学楼附近丢了一张一卡通,名字是张三,学号 2021****。如果捡到请联系 138****1234,必有红包感谢!',
source: '张三同学',
sourceAvatar: 'https://picsum.photos/seed/av11/100/100',
time: '昨天',
readCount: 134,
commentCount: 11,
likeCount: 6,
images: [],
type: 'text',
category: 'forum',
subCategory: 'lost-found',
},
{
id: 'f12',
title: '【招领】食堂捡到一部黑色手机',
excerpt: '今天中午在第二食堂二楼捡到一部黑色 iPhone,已经交给食堂前台保管了。失主可以凭锁屏密码前往认领。',
source: '值班阿姨',
sourceAvatar: 'https://picsum.photos/seed/av12/100/100',
time: '2 天前',
readCount: 245,
commentCount: 19,
likeCount: 34,
images: [],
type: 'text',
category: 'forum',
subCategory: 'lost-found',
},
// ===== 二手交易 =====
{
id: 'f13',
title: '出 9 成新 iPad Air 564G 太空灰,附原装保护壳',
excerpt: '去年 9 月购入,平常只用来记笔记和看剧,9 成新无磕碰。原价 4799,现 3200 出,送原装保护壳和钢化膜,可面交验机。',
source: '毕业学姐',
sourceAvatar: 'https://picsum.photos/seed/av13/100/100',
time: '15 分钟前',
readCount: 678,
commentCount: 42,
likeCount: 89,
images: [
'https://picsum.photos/seed/ipad1/300/300',
'https://picsum.photos/seed/ipad2/300/300',
'https://picsum.photos/seed/ipad3/300/300',
],
type: 'image-grid',
category: 'forum',
subCategory: 'secondhand',
},
{
id: 'f14',
title: '便宜出考研政治英语资料一套',
excerpt: '今年考研上岸,低价出政治英语全套复习资料,包含肖四肖八、考研真相等,原价 500 多,现在 80 元打包出。',
source: '上岸学长',
sourceAvatar: 'https://picsum.photos/seed/av14/100/100',
time: '1 小时前',
readCount: 312,
commentCount: 26,
likeCount: 45,
images: [],
type: 'text',
category: 'forum',
subCategory: 'secondhand',
},
{
id: 'f15',
title: '出 9 成新小米手环 8,黑色',
excerpt: '用了 2 个月,9 成新,功能正常,配 2 根表带。原价 239,现 100 元,可小刀。',
source: '数码爱好者',
sourceAvatar: 'https://picsum.photos/seed/av15/100/100',
time: '3 小时前',
readCount: 89,
commentCount: 7,
likeCount: 12,
images: [
'https://picsum.photos/seed/band1/300/300',
],
type: 'image-text',
category: 'forum',
subCategory: 'secondhand',
},
{
id: 'f16',
title: '毕业出闲置:台灯、收纳盒、衣架、教材等',
excerpt: '马上要搬走了,处理一批闲置物品:台灯、桌面收纳盒、晾衣架、几本教材、瑜伽垫等,价格都很便宜,列表如图。',
source: '毕业生小陈',
sourceAvatar: 'https://picsum.photos/seed/av16/100/100',
time: '昨天',
readCount: 567,
commentCount: 31,
likeCount: 67,
images: [
'https://picsum.photos/seed/items1/300/300',
'https://picsum.photos/seed/items2/300/300',
],
type: 'image-text',
category: 'forum',
subCategory: 'secondhand',
},
// ===== 树洞 =====
{
id: 'f17',
title: '今天答辩终于过了,谢谢我的导师',
excerpt: '从开题到答辩,整整一年时间。中间崩溃过很多次,每次都想放弃。今天终于听到"同意授予学位"那句话,眼泪当场就下来了。',
source: '匿名',
sourceAvatar: 'https://picsum.photos/seed/av17/100/100',
time: '1 小时前',
readCount: 1245,
commentCount: 156,
likeCount: 678,
images: [],
type: 'text',
category: 'forum',
subCategory: 'tree-hole',
},
{
id: 'f18',
title: '大学四年最遗憾的事',
excerpt: '快毕业了,回想这四年最遗憾的事,应该是没有好好谈一场恋爱吧。每天都在图书馆和实验室之间两点一线,错过了很多。',
source: '匿名',
sourceAvatar: 'https://picsum.photos/seed/av18/100/100',
time: '5 小时前',
readCount: 2345,
commentCount: 234,
likeCount: 1234,
images: [],
type: 'text',
category: 'forum',
subCategory: 'tree-hole',
},
{
id: 'f19',
title: '谢谢那个在雨天给我撑伞的陌生人',
excerpt: '今天下午在图书馆门口突然下暴雨,我正发愁怎么回去,一个不认识的学姐默默走过来,把伞塞到我手里说"你先用",然后自己跑进了雨里。',
source: '温暖的小事',
sourceAvatar: 'https://picsum.photos/seed/av19/100/100',
time: '昨天',
readCount: 1567,
commentCount: 198,
likeCount: 892,
images: [],
type: 'text',
category: 'forum',
subCategory: 'tree-hole',
},
{
id: 'f20',
title: '家里出了点事,最近压力很大',
excerpt: '不想发朋友圈,怕爸妈看到担心。在这里发泄一下吧。最近真的太累了,每天晚上都睡不着,但又不敢跟同学说。',
source: '匿名',
sourceAvatar: 'https://picsum.photos/seed/av20/100/100',
time: '2 天前',
readCount: 789,
commentCount: 87,
likeCount: 345,
images: [],
type: 'text',
category: 'forum',
subCategory: 'tree-hole',
},
]
/** 按子分类过滤论坛帖子 */
export function getForumPostsBySubCategory(sub: ForumSubCategory | 'all'): Article[] {
if (sub === 'all') return forumPosts
return forumPosts.filter((p) => p.subCategory === sub)
}