Files
life-echo/app-ios/data/mockData.ts

256 lines
7.2 KiB
TypeScript
Raw Normal View History

2026-01-31 21:20:50 +01:00
// Types
export interface Conversation {
id: string;
title: string;
avatarEmoji: string;
lastMessage: string;
timestamp: string;
unreadCount?: number;
}
export interface Message {
id: string;
conversationId: string;
senderType: 'ai' | 'user';
contentType: 'text' | 'image' | 'audio';
content: string;
timestamp: string;
duration?: number; // for audio messages
}
export interface Chapter {
id: string;
number: number;
title: string;
status: 'complete' | 'partial' | 'pending';
pageCount?: number;
content?: string;
}
export interface Memoir {
id: string;
title: string;
subtitle: string;
updatedAt: string;
chapters: Chapter[];
}
export interface UserProfile {
id: string;
nickname: string;
avatarEmoji: string;
planType: 'free' | 'premium';
planLabel: string;
}
export interface SettingItem {
id: string;
icon: string;
label: string;
description?: string;
type: 'arrow' | 'toggle';
value?: boolean;
}
// Mock Conversations
export const mockConversations: Conversation[] = [
{
id: '1',
title: '岁月知己',
2026-01-31 21:20:50 +01:00
avatarEmoji: '📖',
lastMessage: '您想从哪里开始呢?可以聊聊童年...',
timestamp: '刚刚',
},
];
// Mock Messages for conversation 1
export const mockMessages: Message[] = [
{
id: 'm1',
conversationId: '1',
senderType: 'ai',
contentType: 'text',
content: '您好!我是您的岁月知己,很高兴能陪您聊聊往事。😊\n\n您想从哪里开始呢可以聊聊童年、上学时光或者任何您想分享的故事。',
2026-01-31 21:20:50 +01:00
timestamp: '14:30',
},
];
// AI response templates
export const aiResponses: string[] = [
'这个故事真让人感动!😊 能再详细说说当时的场景吗?比如那时候是什么季节?',
'听起来是一段珍贵的回忆呢!那个时候您多大年纪?身边有哪些人陪着您?',
'太有画面感了!这件事对您的人生有什么特别的影响吗?',
'我能感受到您讲述时的情感。这段经历中有没有什么特别难忘的细节?',
'真是有意思的往事!那个年代的生活和现在很不一样吧?能说说当时的日常生活是什么样的吗?',
'您的故事很生动!除了这件事,那个时期还有什么印象深刻的事情吗?',
'这段记忆很宝贵呢。您有没有保留那个时候的照片或者物件?',
'听您这么说,我仿佛也看到了当时的情景。后来这件事有什么后续吗?',
'这是您人生中很重要的一段经历呢。您觉得它塑造了现在的您吗?',
];
// Get random AI response
export const getRandomAIResponse = (): string => {
return aiResponses[Math.floor(Math.random() * aiResponses.length)];
};
// Mock Memoir
export const mockMemoir: Memoir = {
id: '1',
title: '这一生',
subtitle: '我的回忆录',
updatedAt: '2 分钟前',
chapters: [
{
id: 'c1',
number: 1,
title: '童年与家庭',
status: 'complete',
pageCount: 3,
content: `我出生在一个普通的农村家庭那是1955年的深秋。母亲常说我出生的那天院子里的老槐树落了一地金黄的叶子风一吹像是漫天飞舞的蝴蝶。
"日子虽然清苦,但那时候的快乐是最纯粹的。"
`,
},
{
id: 'c2',
number: 2,
title: '上学的日子',
status: 'partial',
pageCount: 2,
content: `村里的小学离家有三里地,每天早上天刚亮,我就背着布书包出门了。书包是母亲用碎布拼的,虽然不好看,但结实耐用。
`,
},
{
id: 'c3',
number: 3,
title: '工作与事业',
status: 'pending',
},
{
id: 'c4',
number: 4,
title: '爱情与婚姻',
status: 'pending',
},
],
};
// Mock User Profile
export const mockUserProfile: UserProfile = {
id: 'u1',
nickname: '李明华',
avatarEmoji: '👤',
planType: 'free',
planLabel: '免费体验版',
};
// Settings Configuration
export const settingsSections = {
payment: {
title: '套餐与付费',
items: [
{
id: 'upgrade',
icon: 'layers-outline',
label: '升级套餐',
description: '解锁完整导出与更多功能',
type: 'arrow' as const,
},
{
id: 'orders',
icon: 'download-outline',
label: '我的订单',
type: 'arrow' as const,
},
],
},
// privacy: {
// title: '数据与隐私',
// items: [
// {
// id: 'export',
// icon: 'cloud-upload-outline',
// label: '导出所有数据',
// type: 'arrow' as const,
// },
// ],
// },
// settings: {
// title: '设置',
// items: [
// {
// id: 'speed',
// icon: 'time-outline',
// label: '语速',
// description: '标准',
// type: 'arrow' as const,
// },
// {
// id: 'largeFont',
// icon: 'text-outline',
// label: '大字模式',
// type: 'toggle' as const,
// value: false,
// },
// {
// id: 'darkMode',
// icon: 'moon-outline',
// label: '夜间模式',
// type: 'toggle' as const,
// value: false,
// },
// ],
// },
help: {
title: '帮助',
items: [
{
id: 'faq',
icon: 'help-circle-outline',
label: '常见问题',
type: 'arrow' as const,
},
{
id: 'feedback',
icon: 'chatbubble-outline',
label: '反馈与客服',
type: 'arrow' as const,
},
{
id: 'about',
icon: 'information-circle-outline',
label: '关于我们',
type: 'arrow' as const,
},
],
},
};
// Helper function to format timestamp
export const formatTimestamp = (date: Date): string => {
const now = new Date();
const diff = now.getTime() - date.getTime();
const minutes = Math.floor(diff / 60000);
const hours = Math.floor(diff / 3600000);
const days = Math.floor(diff / 86400000);
if (minutes < 1) return '刚刚';
if (minutes < 60) return `${minutes}分钟前`;
if (hours < 24) return `${hours}小时前`;
if (days < 7) return `${days}天前`;
return date.toLocaleDateString('zh-CN');
};
// Helper function to get current time string
export const getCurrentTimeString = (): string => {
const now = new Date();
return `${now.getHours().toString().padStart(2, '0')}:${now.getMinutes().toString().padStart(2, '0')}`;
};