Files
shanghai-residences/src/components/letter/LetterToRongdesheng.tsx
T
zhongyidian f5f36f75b5 feat: add puzzle residence configuration and reflection progress logic
- Introduced `puzzleResidences.ts` to define puzzle residence configurations including properties like display name, position, and puzzle availability.
- Added `reflectionProgress.ts` to manage badge unlocking logic based on place completion, including functions to determine unlocked badges and video sources for scenes.
2026-04-27 11:49:30 +08:00

104 lines
3.3 KiB
TypeScript

import LetterTemplate, { type LetterFieldConfig } from './LetterTemplate'
export interface LetterToRongdeshengProps {
visible?: boolean
onClose?: () => void
onSubmit?: (values: string[]) => void
onAnimationEnd?: () => void
audioSrc?: string
showVideo?: boolean
videoSrc?: string
replyImageSrc?: string
replyVideoSrc?: string
}
const commonSelectField: LetterFieldConfig = {
type: 'select',
placeholder: '请选择',
fitContent: false,
className: '!w-[120px] !min-w-[120px] shrink-0 px-0',
options: [
{ value: '国家', label: '国家' },
{ value: '个人', label: '个人' },
],
}
const letterContent = `敬爱的荣德生先生:
您好!
我是____专业的学生。今天,我怀着崇敬的心情参观了您的旧居,了解了您从钱庄学徒到“面粉大王”“纺织巨子”的传奇一生,读懂了您“____”的初心与担当。您在民族危亡时的气节、在艰难时局中的坚守、在事业成功后的奉献,都让我深受震撼。
作为新时代青年学生,我会在专业学习中____,像您当年那样钻研实业、精益求精,练就过硬的专业本领;树立正确的财富观和事业观;未来无论从事什么工作,都要把助力____发展放在首位,将个人理想与民族复兴紧密结合;面对困难与挑战时,我会以您为榜样,____,敢于攻坚克难,用自己的专业能力为中国式现代化建设贡献青春力量!
站在新时代的起点,我一定铭记您的精神,勤学苦练、笃行实干,让实业报国的种子在心中扎根,让奋斗成为青春最亮丽的底色,努力成为一名有理想、有本领、有担当的新时代青年!`
const fields: Record<number, LetterFieldConfig> = {
0: {
type: 'input',
maxLength: 12,
widthClassName: 'w-[120px]',
readOnlyFallback: '计算机',
},
1: {
type: 'input',
maxLength: 16,
widthClassName: 'w-[120px]',
correctValue: '实业救国',
readOnlyFallback: '实业救国',
hints: {
error: '“实业救国”是荣德生先生一生坚守的初心,也是他毕生践行的信念。',
},
},
2: {
type: 'input',
maxLength: 12,
widthClassName: 'w-[120px]',
readOnlyFallback: '努力',
},
3: {
...commonSelectField,
correctValue: '国家',
readOnlyFallback: '国家',
hints: {
error: '青年学生应该将个人理想融入国家发展之中。请你再想想吧!',
},
},
4: {
type: 'input',
maxLength: 12,
widthClassName: 'w-[120px]',
readOnlyFallback: '',
},
}
const LetterToRongdesheng = ({
visible = false,
onClose,
onSubmit,
onAnimationEnd,
audioSrc = 'audio/letter/7走向复兴.mp3',
showVideo = true,
videoSrc = 'video/letter/neihua_jixin.mp4',
replyImageSrc = 'components/letter/点击信详情-荣德生',
replyVideoSrc = 'video/letter/rongdesheng_gaizhang.mp4',
}: LetterToRongdeshengProps) => {
return (
<LetterTemplate
visible={visible}
onClose={onClose}
onSubmit={onSubmit}
onAnimationEnd={onAnimationEnd}
title="写给荣德生先生的信"
letterContent={letterContent}
fields={fields}
audioSrc={audioSrc}
showVideo={showVideo}
videoSrc={videoSrc}
replyVideoSrc={replyVideoSrc}
replyImageSrc={replyImageSrc}
/>
)
}
export default LetterToRongdesheng