189 lines
5.7 KiB
JavaScript
189 lines
5.7 KiB
JavaScript
/**
|
|
* 早安电台 — 模拟数据
|
|
* 12个垂直频道定义 + 动态生成音频内容
|
|
*/
|
|
|
|
/**
|
|
* 频道领域定义
|
|
* icon: 使用 emoji 或 TDesign icon 名称作为图标标识
|
|
* bgColor: 频道品牌色(用于渐变背景)
|
|
* bgColorLight: 浅色版本(用于标签、背景点缀)
|
|
*/
|
|
const DOMAINS = [
|
|
{
|
|
id: 'career',
|
|
name: '职场成长',
|
|
description: '职场沟通、管理技巧、晋升干货',
|
|
tag: '每日3个职场技巧',
|
|
icon: '💼',
|
|
bgColor: '#3B82F6',
|
|
bgColorEnd: '#2563EB',
|
|
bgColorLight: 'rgba(59,130,246,0.1)'
|
|
},
|
|
{
|
|
id: 'tech',
|
|
name: '程序员早报',
|
|
description: '技术资讯、开源动态、编程技巧',
|
|
tag: '每日3条技术简讯',
|
|
icon: '💻',
|
|
bgColor: '#374151',
|
|
bgColorEnd: '#111827',
|
|
bgColorLight: 'rgba(55,65,81,0.1)'
|
|
},
|
|
{
|
|
id: 'ecommerce',
|
|
name: '电商/跨境资讯',
|
|
description: '平台规则、选品技巧、流量玩法',
|
|
tag: '电商人每日必听',
|
|
icon: '🛒',
|
|
bgColor: '#F97316',
|
|
bgColorEnd: '#EA580C',
|
|
bgColorLight: 'rgba(249,115,22,0.1)'
|
|
},
|
|
{
|
|
id: 'finance',
|
|
name: '财经轻资讯',
|
|
description: '股市简讯、理财知识、行业风口',
|
|
tag: '轻松懂财经',
|
|
icon: '📈',
|
|
bgColor: '#EF4444',
|
|
bgColorEnd: '#B91C1C',
|
|
bgColorLight: 'rgba(239,68,68,0.1)'
|
|
},
|
|
{
|
|
id: 'health',
|
|
name: '健康养生',
|
|
description: '晨间养生、饮食建议、作息调理',
|
|
tag: '每日养生小知识',
|
|
icon: '🌿',
|
|
bgColor: '#22C55E',
|
|
bgColorEnd: '#16A34A',
|
|
bgColorLight: 'rgba(34,197,94,0.1)'
|
|
},
|
|
{
|
|
id: 'reading',
|
|
name: '读书文摘',
|
|
description: '书籍摘要、名言解读、阅读感悟',
|
|
tag: '每日一篇读书感悟',
|
|
icon: '📖',
|
|
bgColor: '#D97706',
|
|
bgColorEnd: '#92400E',
|
|
bgColorLight: 'rgba(217,119,6,0.1)'
|
|
},
|
|
{
|
|
id: 'parenting',
|
|
name: '育儿晨读',
|
|
description: '育儿技巧、亲子沟通、启蒙知识',
|
|
tag: '宝妈每日育儿指南',
|
|
icon: '👶',
|
|
bgColor: '#EC4899',
|
|
bgColorEnd: '#DB2777',
|
|
bgColorLight: 'rgba(236,72,153,0.1)'
|
|
},
|
|
{
|
|
id: 'psychology',
|
|
name: '心理学小知识',
|
|
description: '情绪管理、人际关系、心理常识',
|
|
tag: '读懂自己与他人',
|
|
icon: '🧠',
|
|
bgColor: '#8B5CF6',
|
|
bgColorEnd: '#7C3AED',
|
|
bgColorLight: 'rgba(139,92,246,0.1)'
|
|
},
|
|
{
|
|
id: 'english',
|
|
name: '职场英语',
|
|
description: '常用句型、单词积累、口语技巧',
|
|
tag: '每日3句职场英语',
|
|
icon: '🌐',
|
|
bgColor: '#6366F1',
|
|
bgColorEnd: '#4F46E5',
|
|
bgColorLight: 'rgba(99,102,241,0.1)'
|
|
},
|
|
{
|
|
id: 'startup',
|
|
name: '创业干货',
|
|
description: '创业案例、融资动态、运营技巧',
|
|
tag: '创业者每日灵感',
|
|
icon: '🚀',
|
|
bgColor: '#F43F5E',
|
|
bgColorEnd: '#E11D48',
|
|
bgColorLight: 'rgba(244,63,94,0.1)'
|
|
},
|
|
{
|
|
id: 'design',
|
|
name: '设计灵感',
|
|
description: '设计趋势、作品赏析、技巧分享',
|
|
tag: '每日设计灵感',
|
|
icon: '🎨',
|
|
bgColor: '#14B8A6',
|
|
bgColorEnd: '#0D9488',
|
|
bgColorLight: 'rgba(20,184,166,0.1)'
|
|
},
|
|
{
|
|
id: 'speaking',
|
|
name: '职场口才',
|
|
description: '沟通技巧、演讲方法、表达逻辑',
|
|
tag: '提升口才每一天',
|
|
icon: '🎙️',
|
|
bgColor: '#06B6D4',
|
|
bgColorEnd: '#0891B2',
|
|
bgColorLight: 'rgba(6,182,212,0.1)'
|
|
}
|
|
]
|
|
|
|
/**
|
|
* 动态生成模拟音频内容
|
|
* 为每个频道生成最近 5 天的音频记录
|
|
*/
|
|
function generateMockContent() {
|
|
const contents = []
|
|
const today = new Date()
|
|
|
|
DOMAINS.forEach(function (domain) {
|
|
for (var i = 0; i < 5; i++) {
|
|
var d = new Date(today)
|
|
d.setDate(today.getDate() - i)
|
|
var year = d.getFullYear()
|
|
var month = String(d.getMonth() + 1).padStart(2, '0')
|
|
var day = String(d.getDate()).padStart(2, '0')
|
|
var dateStr = year + '-' + month + '-' + day
|
|
|
|
contents.push({
|
|
id: domain.id + '-' + dateStr,
|
|
domainId: domain.id,
|
|
date: dateStr,
|
|
title: i === 0
|
|
? '[今日更新] ' + domain.name + '晨间电台'
|
|
: dateStr + ' ' + domain.name + '往期回顾',
|
|
duration: 60 + Math.floor(Math.random() * 60), // 60~120 秒
|
|
content: '早上好,今天是' + (d.getMonth() + 1) + '月' + d.getDate() + '日。' +
|
|
'欢迎收听' + domain.name + '频道,这里是为您精选的晨间干货内容...\n' +
|
|
'(这里是模拟生成的1分钟左右音频文案内容,包含3个核心知识点和一个金句作为结尾。祝您有美好的一天!)',
|
|
audioUrl: '' // 实际项目中由后端提供
|
|
})
|
|
}
|
|
})
|
|
|
|
return contents
|
|
}
|
|
|
|
const MOCK_AUDIO_CONTENTS = generateMockContent()
|
|
|
|
/**
|
|
* 频道分类映射
|
|
*/
|
|
const DOMAIN_CATEGORIES = {
|
|
'全部': null, // null 表示显示所有
|
|
'职场': ['career', 'english', 'speaking', 'startup'],
|
|
'科技': ['tech', 'design'],
|
|
'生活': ['health', 'parenting', 'reading', 'psychology', 'ecommerce', 'finance']
|
|
}
|
|
|
|
module.exports = {
|
|
DOMAINS,
|
|
MOCK_AUDIO_CONTENTS,
|
|
DOMAIN_CATEGORIES,
|
|
generateMockContent
|
|
}
|