blob: 9caaed71edb634f43bda575e0c0a954df6225214 [file] [log] [blame]
223010144ce05872025-06-08 22:33:28 +08001import type { ArtworkData, Comment } from './types';
2
3// 生成随机时间的工具函数
4const generateRandomDate = (daysAgo: number): string => {
5 const date = new Date();
6 date.setDate(date.getDate() - Math.floor(Math.random() * daysAgo));
7 return date.toLocaleString('zh-CN', {
8 year: 'numeric',
9 month: '2-digit',
10 day: '2-digit',
11 hour: '2-digit',
12 minute: '2-digit'
13 });
14};
15
16// 通用评论数据
17const baseComments: Comment[] = [
18 {
19 id: 'comment_1',
20 content: '这个作品真的很棒!设计思路很新颖,学到了很多东西。',
21 author: '设计爱好者小王',
22 authorId: 'user_wang_001',
23 createdAt: generateRandomDate(3),
24 child: [
25 {
26 id: 'comment_1_1',
27 content: '同感!特别是色彩搭配的部分,很有启发性。',
28 author: '视觉设计师李雷',
29 authorId: 'user_lilei_002',
30 createdAt: generateRandomDate(2),
31 child: [],
32 },
33 {
34 id: 'comment_1_2',
35 content: '确实,作者的审美很在线,期待更多作品!',
36 author: '创意总监韩梅梅',
37 authorId: 'user_hanmeimei_003',
38 createdAt: generateRandomDate(2),
39 child: [
40 {
41 id: 'comment_1_2_1',
42 content: '@创意总监韩梅梅 您说得对,这种风格确实很难得',
43 author: '设计爱好者小王',
44 authorId: 'user_wang_001',
45 createdAt: generateRandomDate(1),
46 child: [],
47 }
48 ],
49 },
50 ],
51 },
52 {
53 id: 'comment_2',
54 content: '技术实现方面有什么特别的难点吗?想了解一下制作过程。',
55 author: '技术控阿明',
56 authorId: 'user_aming_004',
57 createdAt: generateRandomDate(5),
58 child: [],
59 },
60 {
61 id: 'comment_3',
62 content: '看起来很专业,请问这是用什么软件制作的?',
63 author: '新手小白',
64 authorId: 'user_xiaobai_005',
65 createdAt: generateRandomDate(4),
66 child: [
67 {
68 id: 'comment_3_1',
69 content: '从效果来看应该是用Adobe全家桶,主要是PS和AI',
70 author: '软件专家老刘',
71 authorId: 'user_laoliu_006',
72 createdAt: generateRandomDate(3),
73 child: [],
74 }
75 ],
76 },
77 {
78 id: 'comment_4',
79 content: '色彩运用得很巧妙,给人一种很舒服的视觉感受。',
80 author: '色彩搭配师小张',
81 authorId: 'user_xiaozhang_007',
82 createdAt: generateRandomDate(6),
83 child: [],
84 },
85 {
86 id: 'comment_5',
87 content: '作品质量很高,但是感觉在某些细节上还可以再优化一下。',
88 author: '完美主义者',
89 authorId: 'user_perfect_008',
90 createdAt: generateRandomDate(7),
91 child: [
92 {
93 id: 'comment_5_1',
94 content: '能具体说说哪些地方可以优化吗?我也想学习学习',
95 author: '求知者小陈',
96 authorId: 'user_xiaochen_009',
97 createdAt: generateRandomDate(6),
98 child: [],
99 }
100 ],
101 },
102 {
103 id: 'comment_6',
104 content: '已经下载收藏了,感谢分享!🎉',
105 author: '收藏家大佬',
106 authorId: 'user_collector_010',
107 createdAt: generateRandomDate(8),
108 child: [],
109 },
110 {
111 id: 'comment_7',
112 content: '这个风格很适合我正在做的项目,能不能商用呢?',
113 author: '商务合作方',
114 authorId: 'user_business_011',
115 createdAt: generateRandomDate(9),
116 child: [],
117 },
118 {
119 id: 'comment_8',
120 content: '教程什么时候出?期待大神的分享!',
121 author: '学习狂人',
122 authorId: 'user_learner_012',
123 createdAt: generateRandomDate(10),
124 child: [],
125 }
126];
127
128// 作品数据集合
129export const mockArtworks: Record<string, ArtworkData> = {
22301014356527a2025-06-09 17:46:56 +0800130 '1': {
131 artworkId: '1',
223010144ce05872025-06-08 22:33:28 +0800132 artworkCover: 'https://picsum.photos/300/400?random=1',
133 author: '视觉设计师张三',
134 authorId: 'author_zhangsan_001',
135 artworkName: '未来城市概念设计',
136 artworkCategory: '概念设计',
137 comments: [],
138 artworkDescription: `# 未来城市概念设计
139
140这是一个关于2050年智慧城市的概念设计作品。整个设计融合了**可持续发展**、**人工智能**和**绿色科技**的理念。
141
142## 设计理念
143
144- 🌱 **生态友好**:建筑与自然和谐共生
145- 🤖 **智能化**:AI驱动的城市管理系统
146- 🚗 **零排放**:全面电动化的交通系统
147- 🏗️ **模块化**:可扩展的建筑结构
148
149## 技术特点
150
151采用了最新的**参数化设计**方法,通过算法生成建筑形态,确保每个结构都能最大化利用自然光和风能。
152
153*希望这个设计能为未来城市规划提供一些启发。*`,
154 versionList: [
155 {
156 version: '1.0',
157 seedFile: 'magnet:?xt=urn:btih:future_city_v1_0&dn=未来城市v1.0.zip',
158 versionDescription: `## 初始版本 v1.0
159
160### 包含内容
161- 🎨 **高分辨率效果图** (4K)
162- 📐 **CAD源文件** (.dwg)
163- 🖼️ **PSD分层文件**
164- 📄 **设计说明文档**
165
166### 更新说明
167首次发布,包含完整的设计方案和素材文件。`,
168 },
169 {
170 version: '1.1',
171 seedFile: 'magnet:?xt=urn:btih:future_city_v1_1&dn=未来城市v1.1.zip',
172 versionDescription: `## 更新版本 v1.1
173
174### 新增内容
175- 🌃 **夜景渲染图**
176- 🎬 **动画演示视频** (1080p)
177- 🔧 **Blender源文件**
178
179### 修复内容
180- 修复了部分贴图丢失问题
181- 优化了文件结构
182- 添加了英文版说明文档`,
183 },
184 ],
185 usersSeedingCurrently: [
186 { username: '设计师小李', userId: 'user_xiaoli_101' },
187 { username: '建筑师王工', userId: 'user_wanggong_102' },
188 { username: '学生小赵', userId: 'user_xiaozhao_103' },
189 { username: '创意总监', userId: 'user_director_104' },
190 ],
191 usersSeedingHistory: [
22301014356527a2025-06-09 17:46:56 +0800192 { username: '资深下载者', uploadTotal: '156.8GB', userId: 'hist_user_001' },
193 { username: '设计素材库', uploadTotal: '89.2GB', userId: 'hist_user_002' },
194 { username: '创意工作室', uploadTotal: '67.5GB', userId: 'hist_user_003' },
195 { username: '学院资源组', uploadTotal: '45.3GB', userId: 'hist_user_004' },
196 { username: '独立设计师', uploadTotal: '23.7GB', userId: 'hist_user_005' },
223010144ce05872025-06-08 22:33:28 +0800197 ],
198 },
199
22301014356527a2025-06-09 17:46:56 +0800200 '2': {
201 artworkId: '2',
223010144ce05872025-06-08 22:33:28 +0800202 artworkCover: 'https://picsum.photos/300/400?random=2',
203 author: 'UI设计师李四',
204 authorId: 'author_lisi_002',
205 artworkName: '移动应用界面设计套件',
206 artworkCategory: 'UI/UX设计',
207 comments: [],
208 artworkDescription: `# 移动应用界面设计套件
209
210一套完整的移动端UI设计规范和组件库,包含**100+个精美界面**和**500+个设计组件**。
211
212## 包含内容
213
214### 📱 界面设计
215- 登录注册页面
216- 主页和导航
217- 商品展示页面
218- 个人中心
219- 设置页面
220
221### 🎨 设计系统
222- **颜色规范**:主色调、辅助色、状态色
223- **字体系统**:标题、正文、注释文字
224- **图标库**:线性图标、填充图标
225- **组件库**:按钮、输入框、卡片等`,
226 versionList: [
227 {
228 version: '1.0',
229 seedFile: 'magnet:?xt=urn:btih:ui_kit_v1_0&dn=UI设计套件v1.0.zip',
230 versionDescription: `## 基础版本 v1.0
231
232### 核心功能
233- 📱 **50个界面模板**
234- 🎨 **基础组件库**
235- 📋 **设计规范文档**
236- 🎯 **Sketch源文件**`,
237 },
238 ],
239 usersSeedingCurrently: [
240 { username: 'UI设计新手', userId: 'user_ui_newbie_201' },
241 { username: '产品经理小王', userId: 'user_pm_wang_202' },
242 ],
243 usersSeedingHistory: [
22301014356527a2025-06-09 17:46:56 +0800244 { username: 'UI设计公司', uploadTotal: '78.9GB', userId: 'hist_ui_001' },
245 { username: '设计师联盟', uploadTotal: '45.6GB', userId: 'hist_ui_002' },
246 { username: '学习小组', uploadTotal: '23.4GB', userId: 'hist_ui_003' },
223010144ce05872025-06-08 22:33:28 +0800247 ],
248 },
249
22301014356527a2025-06-09 17:46:56 +0800250 '3': {
251 artworkId: '3',
223010144ce05872025-06-08 22:33:28 +0800252 artworkCover: 'https://picsum.photos/300/400?random=6',
253 author: '刘松林',
22301014356527a2025-06-09 17:46:56 +0800254 authorId: '2',
223010144ce05872025-06-08 22:33:28 +0800255 artworkName: 'React组件库开发指南',
256 artworkCategory: '前端开发',
257 comments: [],
258 artworkDescription: `# React组件库开发指南
259
260一套完整的**企业级React组件库**开发教程和源码,包含从设计到发布的完整流程。
261
262## 项目特色
263
264### 🚀 技术栈
265- **React 18** + **TypeScript**
266- **Styled-components** 样式解决方案
267- **Storybook** 组件文档
268- **Jest** + **Testing Library** 测试
269
270### 📦 组件覆盖
271- **基础组件**: Button, Input, Select, Modal等
272- **布局组件**: Grid, Layout, Container等
273- **数据展示**: Table, List, Card, Timeline等`,
274 versionList: [
275 {
276 version: '1.0',
277 seedFile: 'magnet:?xt=urn:btih:react_components_v1_0&dn=React组件库v1.0.zip',
278 versionDescription: `## 基础版本 v1.0
279
280### 核心内容
281- 📚 **完整教程文档** (50+页)
282- 💻 **基础组件源码** (20+个组件)
283- 🧪 **单元测试示例**
284- 📖 **Storybook配置**`,
285 },
286 ],
287 usersSeedingCurrently: [
288 { username: '前端新手小李', userId: 'user_frontend_newbie_601' },
289 { username: 'React爱好者', userId: 'user_react_fan_602' },
290 ],
291 usersSeedingHistory: [
22301014356527a2025-06-09 17:46:56 +0800292 { username: '大厂前端团队', uploadTotal: '567.8GB', userId: 'hist_dev_001' },
293 { username: '开源社区', uploadTotal: '234.5GB', userId: 'hist_dev_002' },
294 { username: '技术培训机构', uploadTotal: '189.7GB', userId: 'hist_dev_003' },
295 ],
296 },
297
298 '4': {
299 artworkId: '4',
300 artworkCover: 'https://picsum.photos/300/400?random=7',
301 author: '3D艺术家王五',
302 authorId: 'author_wangwu_004',
303 artworkName: '机械战士3D模型',
304 artworkCategory: '3D建模',
305 comments: [],
306 artworkDescription: `# 机械战士3D模型
307
308一个高精度的科幻机械战士3D模型,包含完整的材质贴图和动画骨骼系统。
309
310## 模型特点
311
312### 🤖 设计风格
313- 未来科幻风格
314- 硬表面建模技术
315- PBR材质工作流
316- 模块化装备系统
317
318### 📐 技术规格
319- **面数**: 25,000 三角面
320- **贴图分辨率**: 4K PBR贴图组
321- **骨骼系统**: 完整人形骨骼
322- **动画**: 10个基础动作
323
324适用于游戏开发、影视制作和3D打印。`,
325 versionList: [
223010144ce05872025-06-08 22:33:28 +0800326 {
22301014356527a2025-06-09 17:46:56 +0800327 version: '1.0',
328 seedFile: 'magnet:?xt=urn:btih:mech_warrior_v1_0&dn=机械战士v1.0.zip',
329 versionDescription: `## 基础版本 v1.0
330
331### 核心内容
332- 🎯 **高精度3D模型** (.fbx, .obj)
333- 🎨 **4K PBR贴图组**
334- 🦴 **完整骨骼系统**
335- 🎬 **基础动画文件**`,
223010144ce05872025-06-08 22:33:28 +0800336 },
22301014356527a2025-06-09 17:46:56 +0800337 ],
338 usersSeedingCurrently: [
339 { username: '游戏开发者小陈', userId: 'user_gamedev_301' },
340 { username: '3D建模师', userId: 'user_3dmodeler_302' },
341 ],
342 usersSeedingHistory: [
343 { username: '游戏工作室', uploadTotal: '234.5GB', userId: 'hist_3d_001' },
344 { username: '影视特效团队', uploadTotal: '178.3GB', userId: 'hist_3d_002' },
345 { username: '独立开发者', uploadTotal: '98.7GB', userId: 'hist_3d_003' },
346 ],
347 },
348
349 '5': {
350 artworkId: '5',
351 artworkCover: 'https://picsum.photos/300/400?random=8',
352 author: '摄影师赵六',
353 authorId: 'author_zhaoliu_005',
354 artworkName: '城市夜景摄影集',
355 artworkCategory: '摄影作品',
356 comments: [],
357 artworkDescription: `# 城市夜景摄影集
358
359一组精美的城市夜景摄影作品,捕捉了都市夜晚的璀璨光影。
360
361## 作品特色
362
363### 📸 拍摄技法
364- 长曝光技术
365- HDR合成处理
366- 光轨艺术表现
367- 城市建筑几何美学
368
369### 🎨 后期处理
370- **RAW格式**: 无损原始文件
371- **精修版本**: Lightroom + Photoshop
372- **色彩分级**: 电影级调色
373- **分辨率**: 6000x4000像素
374
375包含20张高分辨率摄影作品,适合商业使用和艺术收藏。`,
376 versionList: [
223010144ce05872025-06-08 22:33:28 +0800377 {
22301014356527a2025-06-09 17:46:56 +0800378 version: '1.0',
379 seedFile: 'magnet:?xt=urn:btih:night_city_photos_v1_0&dn=城市夜景v1.0.zip',
380 versionDescription: `## 完整版本 v1.0
381
382### 包含内容
383- 📷 **RAW原始文件** (20张)
384- 🎨 **精修JPG版本** (高分辨率)
385- 📋 **拍摄参数记录**
386- 📍 **拍摄地点信息**`,
223010144ce05872025-06-08 22:33:28 +0800387 },
22301014356527a2025-06-09 17:46:56 +0800388 ],
389 usersSeedingCurrently: [
390 { username: '摄影爱好者小林', userId: 'user_photo_401' },
391 { username: '设计师小美', userId: 'user_designer_402' },
392 ],
393 usersSeedingHistory: [
394 { username: '摄影工作室', uploadTotal: '445.8GB', userId: 'hist_photo_001' },
395 { username: '商业摄影师', uploadTotal: '367.2GB', userId: 'hist_photo_002' },
396 { username: '摄影学院', uploadTotal: '289.1GB', userId: 'hist_photo_003' },
397 ],
398 },
399
400 '6': {
401 artworkId: '6',
402 artworkCover: 'https://picsum.photos/300/400?random=9',
403 author: '插画师孙七',
404 authorId: 'author_sunqi_006',
405 artworkName: '奇幻世界插画系列',
406 artworkCategory: '插画艺术',
407 comments: [],
408 artworkDescription: `# 奇幻世界插画系列
409
410一套充满想象力的奇幻题材插画作品,包含角色设计、场景概念图和完整插图。
411
412## 创作风格
413
414### 🎨 艺术特色
415- 欧美奇幻风格
416- 数字绘画技法
417- 丰富色彩层次
418- 细腻光影表现
419
420### 📚 作品内容
421- **角色设计**: 15个原创角色
422- **场景概念**: 8个奇幻场景
423- **完整插图**: 12张精美插画
424- **线稿资源**: 黑白线稿版本
425
426适合游戏美术、小说封面、卡牌设计等多种用途。`,
427 versionList: [
223010144ce05872025-06-08 22:33:28 +0800428 {
22301014356527a2025-06-09 17:46:56 +0800429 version: '1.0',
430 seedFile: 'magnet:?xt=urn:btih:fantasy_art_v1_0&dn=奇幻插画v1.0.zip',
431 versionDescription: `## 标准版本 v1.0
432
433### 核心内容
434- 🎨 **高分辨率插画** (35张)
435- ✏️ **线稿资源包**
436- 🎯 **PSD分层文件**
437- 📖 **创作过程记录**`,
223010144ce05872025-06-08 22:33:28 +0800438 },
439 ],
22301014356527a2025-06-09 17:46:56 +0800440 usersSeedingCurrently: [
441 { username: '插画学习者', userId: 'user_illustrator_501' },
442 { username: '游戏美术师', userId: 'user_gameart_502' },
443 ],
444 usersSeedingHistory: [
445 { username: '插画师联盟', uploadTotal: '378.9GB', userId: 'hist_art_001' },
446 { username: '游戏美术团队', uploadTotal: '256.4GB', userId: 'hist_art_002' },
447 { username: '艺术学院', uploadTotal: '189.6GB', userId: 'hist_art_003' },
448 ],
223010144ce05872025-06-08 22:33:28 +0800449 },
450};
451
452// 获取指定作品的评论数据
453export const getCommentsForArtwork = (artworkId: string): Comment[] => {
223010144ce05872025-06-08 22:33:28 +0800454 const commentVariations: Record<string, Comment[]> = {
22301014356527a2025-06-09 17:46:56 +0800455 '1': baseComments,
456 '2': baseComments.slice(0, 5).map(comment => ({
223010144ce05872025-06-08 22:33:28 +0800457 ...comment,
458 id: `ui_${comment.id}`,
459 content: comment.content.replace('作品', 'UI套件').replace('设计', '界面设计'),
460 })),
22301014356527a2025-06-09 17:46:56 +0800461 '3': [
223010144ce05872025-06-08 22:33:28 +0800462 {
463 id: 'dev_comment_1',
464 content: '这个组件库的设计思路很棒!TypeScript类型定义特别完善。',
465 author: '前端架构师张工',
466 authorId: 'user_architect_zhang',
467 createdAt: generateRandomDate(2),
468 child: [
469 {
470 id: 'dev_comment_1_1',
471 content: '同感!特别是组件API的设计,很符合React的设计理念。',
472 author: 'React核心开发者',
473 authorId: 'user_react_core',
474 createdAt: generateRandomDate(1),
475 child: [],
476 }
477 ],
478 },
479 {
480 id: 'dev_comment_2',
481 content: '构建配置写得很详细,我们团队已经参考这个搭建了自己的组件库。',
482 author: '技术负责人小刘',
483 authorId: 'user_tech_liu',
484 createdAt: generateRandomDate(3),
485 child: [],
486 },
487 ],
22301014356527a2025-06-09 17:46:56 +0800488 '4': baseComments.slice(0, 4).map(comment => ({
489 ...comment,
490 id: `3d_${comment.id}`,
491 content: comment.content.replace('作品', '3D模型').replace('设计', '建模'),
492 })),
493 '5': baseComments.slice(0, 6).map(comment => ({
494 ...comment,
495 id: `photo_${comment.id}`,
496 content: comment.content.replace('作品', '摄影作品').replace('设计思路', '拍摄技法'),
497 })),
498 '6': baseComments.slice(0, 5).map(comment => ({
499 ...comment,
500 id: `art_${comment.id}`,
501 content: comment.content.replace('作品', '插画').replace('设计', '绘画'),
502 })),
223010144ce05872025-06-08 22:33:28 +0800503 };
504
505 return commentVariations[artworkId] || baseComments;
506};
507
508// 根据作品ID获取作品数据
509export const getArtworkById = (artworkId: string): ArtworkData | null => {
510 const artwork = mockArtworks[artworkId];
511 if (artwork) {
512 return {
513 ...artwork,
514 comments: getCommentsForArtwork(artworkId)
515 };
516 }
517 return null;
518};
519
520// 获取所有作品列表
521export const getAllArtworks = (): ArtworkData[] => {
522 return Object.values(mockArtworks);
523};
524
525// 按分类获取作品
526export const getArtworksByCategory = (category: string): ArtworkData[] => {
527 return Object.values(mockArtworks).filter(artwork => artwork.artworkCategory === category);
528};
529
530// 搜索作品
531export const searchArtworks = (keyword: string): ArtworkData[] => {
532 const lowerKeyword = keyword.toLowerCase();
533 return Object.values(mockArtworks).filter(artwork =>
534 artwork.artworkName.toLowerCase().includes(lowerKeyword) ||
535 artwork.artworkDescription.toLowerCase().includes(lowerKeyword) ||
536 artwork.author.toLowerCase().includes(lowerKeyword) ||
537 artwork.artworkCategory.toLowerCase().includes(lowerKeyword)
538 );
539};