fix: 修复开发/测试包模拟进度被易班同步覆盖的问题
进度模拟面板写入 puzzleStore 后,App 启动时易班同步会将其覆盖; 现在在同步完成后按 sessionStorage 中保存的模式重放模拟进度, 确保测试包的"到达某故居/全流程完成"调试入口生效。 同时纳入近期未提交的页面、组件、资源与环境变量改动。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
6d40e19346
commit
49ecabbf3a
155 files changed
+1956
-724
No files matched your search
@@ -3,15 +3,6 @@ import { PUZZLE_RESIDENCES } from './puzzleResidences'
|
||||
|
||||
export type PuzzleProgress = Record<string, Set<number>>
|
||||
|
||||
const BUILD_UNLOCK_ALL = import.meta.env.VITE_PROGRESS_UNLOCK_ALL === 'true'
|
||||
const UNLOCK_ALL_STORAGE_KEY = 'debug:progression-unlock-all'
|
||||
|
||||
const isUnlockAllEnabled = () => {
|
||||
if (!BUILD_UNLOCK_ALL) return false
|
||||
if (typeof window === 'undefined') return true
|
||||
return window.sessionStorage.getItem(UNLOCK_ALL_STORAGE_KEY) !== 'false'
|
||||
}
|
||||
|
||||
const getResidenceIndex = (residence: string) =>
|
||||
PUZZLE_RESIDENCES.findIndex((item) => item.residence === residence)
|
||||
|
||||
@@ -33,13 +24,10 @@ export const isResidenceStarted = (residence: string, puzzles: PuzzleProgress) =
|
||||
}
|
||||
|
||||
export const isResidenceComplete = (residence: string, puzzles: PuzzleProgress) => {
|
||||
if (isUnlockAllEnabled()) return true
|
||||
return arePiecesUnlocked(residence, puzzles, getConfiguredPieceIds(residence))
|
||||
}
|
||||
|
||||
export const isResidenceUnlocked = (residence: string, puzzles: PuzzleProgress) => {
|
||||
if (isUnlockAllEnabled()) return true
|
||||
|
||||
const index = getResidenceIndex(residence)
|
||||
if (index === 0) return true
|
||||
if (index < 0) return false
|
||||
@@ -62,8 +50,6 @@ export const isMenuModuleStarted = (moduleName: string, puzzles: PuzzleProgress)
|
||||
}
|
||||
|
||||
export const isMenuModuleComplete = (moduleName: string, puzzles: PuzzleProgress) => {
|
||||
if (isUnlockAllEnabled()) return true
|
||||
|
||||
const residences = PUZZLE_RESIDENCES.filter((item) => item.moduleName === moduleName)
|
||||
if (residences.length === 0) return false
|
||||
return residences.every((item) => isResidenceComplete(item.residence, puzzles))
|
||||
@@ -79,14 +65,6 @@ const getPieceIdsByRoute = (residence: string, routePrefix: string) => {
|
||||
}
|
||||
|
||||
export const getResidenceStageUnlocks = (residence: string, puzzles: PuzzleProgress) => {
|
||||
if (isUnlockAllEnabled()) {
|
||||
return {
|
||||
dialogueUnlocked: true,
|
||||
reflectionUnlocked: true,
|
||||
internalizationUnlocked: true,
|
||||
}
|
||||
}
|
||||
|
||||
const residenceUnlocked = isResidenceUnlocked(residence, puzzles)
|
||||
|
||||
return {
|
||||
|
||||
+29
-29
@@ -26,7 +26,7 @@ export const puzzleDataConfig: Record<string, Record<number, PuzzlePieceData>> =
|
||||
},
|
||||
// 碎片2
|
||||
2: {
|
||||
title: '陈云就读 青浦县立乙种商业学校',
|
||||
title: '陈云就读\n青浦县立乙种商业学校',
|
||||
detailImage: 'chenyun/details/2',
|
||||
route: 'place2',
|
||||
},
|
||||
@@ -38,7 +38,7 @@ export const puzzleDataConfig: Record<string, Record<number, PuzzlePieceData>> =
|
||||
},
|
||||
// 碎片4
|
||||
4: {
|
||||
title: '陈云在 上海商务印书馆当学徒',
|
||||
title: '陈云在\n上海商务印书馆当学徒',
|
||||
detailImage: 'chenyun/details/4',
|
||||
route: 'place3',
|
||||
},
|
||||
@@ -50,19 +50,19 @@ export const puzzleDataConfig: Record<string, Record<number, PuzzlePieceData>> =
|
||||
},
|
||||
// 碎片6
|
||||
6: {
|
||||
title: '陈云被选为 中央政治局委员、常委',
|
||||
title: '陈云被选为\n中央政治局委员、常委',
|
||||
detailImage: 'chenyun/details/6',
|
||||
route: 'place4',
|
||||
},
|
||||
// 碎片7
|
||||
7: {
|
||||
title: '陈云任 西北财经办事处副主任',
|
||||
title: '陈云任\n西北财经办事处副主任',
|
||||
detailImage: 'chenyun/details/7',
|
||||
route: 'place5',
|
||||
},
|
||||
// 碎片8
|
||||
8: {
|
||||
title: '陈云主持 陕甘宁边区财政工作',
|
||||
title: '陈云主持\n陕甘宁边区财政工作',
|
||||
detailImage: 'chenyun/details/8',
|
||||
route: 'place5',
|
||||
},
|
||||
@@ -80,7 +80,7 @@ export const puzzleDataConfig: Record<string, Record<number, PuzzlePieceData>> =
|
||||
},
|
||||
// 碎片11
|
||||
11: {
|
||||
title: '陈云起草的关于发展国民 经济“一五”计划报告的手稿',
|
||||
title: '陈云起草的关于发展\n国民经济“一五”计划\n报告的手稿',
|
||||
detailImage: 'chenyun/details/11',
|
||||
route: 'place8',
|
||||
},
|
||||
@@ -110,7 +110,7 @@ export const puzzleDataConfig: Record<string, Record<number, PuzzlePieceData>> =
|
||||
},
|
||||
// 碎片16
|
||||
16: {
|
||||
title: '陈云精神',
|
||||
title: '陈云给青年的精神指引',
|
||||
detailImage: 'chenyun/details/16',
|
||||
route: 'internalization',
|
||||
},
|
||||
@@ -148,7 +148,7 @@ export const puzzleDataConfig: Record<string, Record<number, PuzzlePieceData>> =
|
||||
},
|
||||
// 碎片6
|
||||
6: {
|
||||
title: '职业教育 和中华职业学校',
|
||||
title: '职业教育\n和中华职业学校',
|
||||
detailImage: 'huangyanpei/details/6',
|
||||
route: 'place4',
|
||||
},
|
||||
@@ -172,7 +172,7 @@ export const puzzleDataConfig: Record<string, Record<number, PuzzlePieceData>> =
|
||||
},
|
||||
// 碎片10
|
||||
10: {
|
||||
title: '黄炎培与荣氏兄弟 合作工人教育',
|
||||
title: '黄炎培与荣氏兄弟\n合作工人教育',
|
||||
detailImage: 'huangyanpei/details/10',
|
||||
route: 'place4',
|
||||
},
|
||||
@@ -196,7 +196,7 @@ export const puzzleDataConfig: Record<string, Record<number, PuzzlePieceData>> =
|
||||
},
|
||||
// 碎片14
|
||||
14: {
|
||||
title: '黄炎培对浦东中学 新生的教导',
|
||||
title: '黄炎培对浦东中学\n新生的教导',
|
||||
detailImage: 'huangyanpei/details/14',
|
||||
route: 'reflection2',
|
||||
},
|
||||
@@ -225,7 +225,7 @@ export const puzzleDataConfig: Record<string, Record<number, PuzzlePieceData>> =
|
||||
route: 'place1',
|
||||
},
|
||||
3: {
|
||||
title: '《申报》刊登孙中山就职 临时大总统消息',
|
||||
title: '《申报》刊登孙中山就职\n临时大总统消息',
|
||||
detailImage: 'sunzhongshan/details/3',
|
||||
route: 'place1',
|
||||
},
|
||||
@@ -260,7 +260,7 @@ export const puzzleDataConfig: Record<string, Record<number, PuzzlePieceData>> =
|
||||
route: 'place3',
|
||||
},
|
||||
10: {
|
||||
title: '中国国民党第一次 全国代表大会宣言',
|
||||
title: '中国国民党第一次\n全国代表大会宣言',
|
||||
detailImage: 'sunzhongshan/details/10',
|
||||
route: 'place3',
|
||||
},
|
||||
@@ -285,7 +285,7 @@ export const puzzleDataConfig: Record<string, Record<number, PuzzlePieceData>> =
|
||||
route: 'reflection3',
|
||||
},
|
||||
15: {
|
||||
title: '振兴中华对新时代 青年的意义',
|
||||
title: '振兴中华对新时代\n青年的意义',
|
||||
detailImage: 'sunzhongshan/details/15',
|
||||
route: 'internalization',
|
||||
},
|
||||
@@ -297,7 +297,7 @@ export const puzzleDataConfig: Record<string, Record<number, PuzzlePieceData>> =
|
||||
},
|
||||
luxun: {
|
||||
1: {
|
||||
title: '鲁迅1927年南下 广州时的照片',
|
||||
title: '鲁迅1927年南下\n广州时的照片',
|
||||
detailImage: 'luxun/details/1',
|
||||
route: 'place1',
|
||||
},
|
||||
@@ -414,7 +414,7 @@ export const puzzleDataConfig: Record<string, Record<number, PuzzlePieceData>> =
|
||||
route: 'place3',
|
||||
},
|
||||
8: {
|
||||
title: '毛泽东签发的两份 中共四大通知',
|
||||
title: '毛泽东签发的两份\n中共四大通知',
|
||||
detailImage: 'maozedong/details/8',
|
||||
route: 'place4',
|
||||
},
|
||||
@@ -526,7 +526,7 @@ export const puzzleDataConfig: Record<string, Record<number, PuzzlePieceData>> =
|
||||
route: 'place6',
|
||||
},
|
||||
14: {
|
||||
title: '唱国家一定要站起来',
|
||||
title: '唱国歌一定要站起来',
|
||||
detailImage: 'nieer/details/14',
|
||||
route: 'reflection',
|
||||
},
|
||||
@@ -543,7 +543,7 @@ export const puzzleDataConfig: Record<string, Record<number, PuzzlePieceData>> =
|
||||
},
|
||||
zhangleping: {
|
||||
1: {
|
||||
title: '童年的回忆 (张乐平,1983)',
|
||||
title: '童年的回忆\n(张乐平,1983)',
|
||||
detailImage: 'zhangleping/details/1',
|
||||
route: 'place1',
|
||||
},
|
||||
@@ -553,17 +553,17 @@ export const puzzleDataConfig: Record<string, Record<number, PuzzlePieceData>> =
|
||||
route: 'place1',
|
||||
},
|
||||
3: {
|
||||
title: '穷凶极恶的结果 (张乐平,1937)',
|
||||
title: '穷凶极恶的结果\n(张乐平,1937)',
|
||||
detailImage: 'zhangleping/details/3',
|
||||
route: 'place2',
|
||||
},
|
||||
4: {
|
||||
title: '长沙大火前夕 张乐平在街头墙上挥笔作画',
|
||||
title: '长沙大火前夕\n张乐平在街头墙上挥笔作画',
|
||||
detailImage: 'zhangleping/details/4',
|
||||
route: 'place2',
|
||||
},
|
||||
5: {
|
||||
title: '侵略者的坟墓 (张乐平,1938)',
|
||||
title: '侵略者的坟墓\n(张乐平,1938)',
|
||||
detailImage: 'zhangleping/details/5',
|
||||
route: 'place2',
|
||||
},
|
||||
@@ -645,7 +645,7 @@ export const puzzleDataConfig: Record<string, Record<number, PuzzlePieceData>> =
|
||||
route: 'place2',
|
||||
},
|
||||
5: {
|
||||
title: '上海申新第九纺织厂门楼(1933年旧照)',
|
||||
title: '上海申新第九纺织厂门楼\n(1933年旧照)',
|
||||
detailImage: 'rongdesheng/details/5',
|
||||
route: 'place2',
|
||||
},
|
||||
@@ -655,22 +655,22 @@ export const puzzleDataConfig: Record<string, Record<number, PuzzlePieceData>> =
|
||||
route: 'place2',
|
||||
},
|
||||
7: {
|
||||
title: '国际劳工局赞美申新三纺织厂劳工自治区',
|
||||
title: '国际劳工局赞美\n申新三纺织厂劳工自治区',
|
||||
detailImage: 'rongdesheng/details/7',
|
||||
route: 'place2',
|
||||
},
|
||||
8: {
|
||||
title: '上海申新一厂和八厂于1937年被日本飞机炸毁',
|
||||
title: '上海申新一厂和八厂于\n1937年被日本飞机炸毁',
|
||||
detailImage: 'rongdesheng/details/8',
|
||||
route: 'place3',
|
||||
},
|
||||
9: {
|
||||
title: '《人报》报道 乐农氏再度捐助面粉一万包',
|
||||
title: '《人报》报道\n乐农氏再度捐助面粉一万包',
|
||||
detailImage: 'rongdesheng/details/9',
|
||||
route: 'place3',
|
||||
},
|
||||
10: {
|
||||
title: '心正思无邪 意诚言必中题字',
|
||||
title: '心正思无邪\n意诚言必中 题字',
|
||||
detailImage: 'rongdesheng/details/10',
|
||||
route: 'place3',
|
||||
},
|
||||
@@ -680,19 +680,19 @@ export const puzzleDataConfig: Record<string, Record<number, PuzzlePieceData>> =
|
||||
route: 'place4',
|
||||
},
|
||||
12: {
|
||||
title: '荣德生拒绝荣氏工业结构外迁的报道',
|
||||
title: '荣德生拒绝荣氏工业结构\n外迁的报道',
|
||||
detailImage: 'rongdesheng/details/12',
|
||||
route: 'place4',
|
||||
},
|
||||
13: {
|
||||
title: '毛泽东主席、陈毅副总理在荣毅仁陪同下,参观公私合营上海申新第九纺织厂',
|
||||
title: '毛泽东主席、陈毅副总理在\n荣毅仁陪同下,参观公私合\n营上海申新第九纺织厂',
|
||||
detailImage: 'rongdesheng/details/13',
|
||||
route: 'place4',
|
||||
},
|
||||
14: {
|
||||
title: '荣德生与张 一九四九年九月,荣德生致函第一届全国政协謇的合影',
|
||||
title: '民生坚守',
|
||||
detailImage: 'rongdesheng/details/14',
|
||||
route: 'place4',
|
||||
route: 'reflection',
|
||||
},
|
||||
15: {
|
||||
title: '坚韧不拔',
|
||||
|
||||
Reference in new issue
Block a user