feat:碎片完善
This commit is contained in:
1 parent
ec7e8e2bd2
commit
046501705f
74 files changed
+1602
-172
No files matched your search
@@ -0,0 +1,138 @@
|
||||
/**
|
||||
* 拼图碎片数据配置
|
||||
* 存储每个碎片的标题、场景图片等数据
|
||||
*/
|
||||
|
||||
export interface PuzzlePieceData {
|
||||
/** 碎片标题 */
|
||||
title: string;
|
||||
/** 对应的场景图片路径(相对于 puzzle/ 目录) */
|
||||
detailImage: string;
|
||||
// 对应的场景路由
|
||||
route: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 每个故居的拼图碎片数据配置
|
||||
* 格式:{ residence: { pieceId: PuzzlePieceData } }
|
||||
*/
|
||||
export const puzzleDataConfig: Record<
|
||||
string,
|
||||
Record<number, PuzzlePieceData>
|
||||
> = {
|
||||
chenyun: {
|
||||
// 碎片1 - 示例数据,请根据实际情况修改
|
||||
1: {
|
||||
title: "水乡少年·艰率成长",
|
||||
detailImage: "chenyun/details/1",
|
||||
route: "place1",
|
||||
},
|
||||
// 碎片2
|
||||
2: {
|
||||
title: "陈云就读 青浦县乙种商业学校",
|
||||
detailImage: "chenyun/details/2",
|
||||
route: "place2",
|
||||
},
|
||||
// 碎片3
|
||||
3: {
|
||||
title: "陈云就读颜安小学",
|
||||
detailImage: "chenyun/details/3",
|
||||
route: "place2",
|
||||
},
|
||||
// 碎片4
|
||||
4: {
|
||||
title: "陈云在 上海商务印书馆当学徒",
|
||||
detailImage: "chenyun/details/4",
|
||||
route: "place3",
|
||||
},
|
||||
// 碎片5
|
||||
5: {
|
||||
title: "陈云加入中国共产党",
|
||||
detailImage: "chenyun/details/5",
|
||||
route: "place3",
|
||||
},
|
||||
// 碎片6
|
||||
6: {
|
||||
title: "陈云被选为 中央政治局委员、常委",
|
||||
detailImage: "chenyun/details/6",
|
||||
route: "place4",
|
||||
},
|
||||
// 碎片7
|
||||
7: {
|
||||
title: "陈云任 西北财经办事处副主任",
|
||||
detailImage: "chenyun/details/7",
|
||||
route: "place5",
|
||||
},
|
||||
// 碎片8
|
||||
8: {
|
||||
title: "陈云主持 陕甘宁边区财政工作",
|
||||
detailImage: "chenyun/details/8",
|
||||
route: "place5",
|
||||
},
|
||||
// 碎片9
|
||||
9: {
|
||||
title: "恢复时期·经济奠基",
|
||||
detailImage: "chenyun/details/9",
|
||||
route: "place6",
|
||||
},
|
||||
// 碎片10
|
||||
10: {
|
||||
title: "银元之战",
|
||||
detailImage: "chenyun/details/10",
|
||||
route: "place7",
|
||||
},
|
||||
// 碎片11
|
||||
11: {
|
||||
title: '陈云起草的关于发展国民 经济"一五"计划报告的手稿',
|
||||
detailImage: "chenyun/details/11",
|
||||
route: "place8",
|
||||
},
|
||||
// 碎片12
|
||||
12: {
|
||||
title: "陈云赴宝钢考察",
|
||||
detailImage: "chenyun/details/12",
|
||||
route: "place9",
|
||||
},
|
||||
// 碎片13
|
||||
13: {
|
||||
title: "体悟·银元之战",
|
||||
detailImage: "chenyun/details/13",
|
||||
route: "reflection",
|
||||
},
|
||||
// 碎片14
|
||||
14: {
|
||||
title: "体悟·米棉之战",
|
||||
detailImage: "chenyun/details/14",
|
||||
route: "reflection",
|
||||
},
|
||||
// 碎片15
|
||||
15: {
|
||||
title: "陈云经济思想的核心内容",
|
||||
detailImage: "chenyun/details/15",
|
||||
route: "internalization",
|
||||
},
|
||||
// 碎片16
|
||||
16: {
|
||||
title: "陈云精神",
|
||||
detailImage: "chenyun/details/16",
|
||||
route: "internalization",
|
||||
},
|
||||
},
|
||||
// 后续可以添加其他故居的数据
|
||||
// sunzhongshan: { ... },
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取碎片的数据配置
|
||||
* @param residence 故居名称
|
||||
* @param pieceId 碎片ID
|
||||
* @returns 碎片数据,如果不存在则返回默认值
|
||||
*/
|
||||
export const getPuzzlePieceData = (
|
||||
residence: string,
|
||||
pieceId: number
|
||||
): PuzzlePieceData | null => {
|
||||
const residenceConfig = puzzleDataConfig[residence];
|
||||
const pieceData = residenceConfig?.[pieceId];
|
||||
return pieceData || null;
|
||||
};
|
||||
Reference in new issue
Block a user