"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.templatesService = exports.TemplatesService = void 0; class TemplatesService { // 模板数据 templates = [ // 广告营销 { id: 1, name: '产品推广', category: '广告营销', content: '【{{product}}】限时优惠!{{feature1}}、{{feature2}},立即购买享折扣!', description: '用于产品宣传推广' }, { id: 2, name: '活动邀请', category: '广告营销', content: '诚邀您参加{{event}}!{{time}}开始,{{location}},期待与您相见!', description: '邀请用户参加活动' }, { id: 3, name: '促销公告', category: '广告营销', content: '🎉{{discount}}优惠进行中!{{product}}直降{{price}},名额有限,先到先得!', description: '促销活动宣传' }, // 知识付费 { id: 4, name: '课程介绍', category: '知识付费', content: '{{course}}课程招生中!由{{teacher}}主讲,{{content}},报名即送{{gift}}!', description: '在线课程推广' }, { id: 5, name: '知识分享', category: '知识付费', content: '今日分享:{{topic}}。{{point1}}。{{point2}}。关注我们获取更多干货!', description: '知识内容分享' }, { id: 6, name: '电子书推广', category: '知识付费', content: '《{{book}}》免费领取!{{description}},立即下载开启阅读之旅!', description: '电子书营销' }, // 短视频 { id: 7, name: '剧情脚本', category: '短视频', content: '【剧情】{{scene}}:{{character}}:{{dialogue}}', description: '短视频剧情文案' }, { id: 8, name: '口播脚本', category: '短视频', content: '大家好,我是{{name}}!今天给大家介绍{{topic}}。{{content}}。喜欢记得点赞关注!', description: '真人出镜口播' }, { id: 9, name: '种草推荐', category: '短视频', content: '姐妹们!{{product}}真的绝了!{{experience}},我用了{{time}}效果{{result}}!', description: '好物推荐文案' }, // 企业宣传 { id: 10, name: '公司介绍', category: '企业宣传', content: '{{company}}成立于{{year}}年,专注于{{industry}}。我们提供{{service}},联系电话:{{phone}}', description: '企业简介' }, { id: 11, name: '招聘宣传', category: '企业宣传', content: '【招聘】{{company}}诚聘{{position}}!要求:{{requirement}},待遇:{{benefit}},欢迎投递简历!', description: '招聘信息' }, { id: 12, name: '品牌故事', category: '企业宣传', content: '{{brand}}的诞生源于{{origin}}。{{story}}。这就是我们的初心与坚持。', description: '品牌文化宣传' }, // 日常生活 { id: 13, name: '生日祝福', category: '日常生活', content: '🎂生日快乐!愿你{{wish1}},{{wish2}}。新的一岁,万事胜意!', description: '生日祝福语' }, { id: 14, name: '节日问候', category: '日常生活', content: '{{festival}}到!祝你{{greeting}}!{{detail}}', description: '节日祝福' }, { id: 15, name: '日常分享', category: '日常生活', content: '今日份{{topic}}:{{content}}。{{feeling}}', description: '日常记录分享' }, // 新闻资讯 { id: 16, name: '新闻播报', category: '新闻资讯', content: '各位观众晚上好!今天是{{date}},以下是今日要闻:{{news1}};{{news2}};{{news3}}。', description: '新闻播报稿' }, { id: 17, name: '热点解读', category: '新闻资讯', content: '【热点】{{event}}引发关注。{{analysis}}。对此,你怎么看?', description: '热点事件分析' }, { id: 18, name: '行业报告', category: '新闻资讯', content: '{{industry}}行业动态:{{trend}}。数据显示{{data}}。预计{{prediction}}。', description: '行业分析报告' }, ]; // 分类列表 categories = ['广告营销', '知识付费', '短视频', '企业宣传', '日常生活', '新闻资讯']; /** * 获取所有分类 */ getCategories() { return this.categories; } /** * 获取模板分类列表 */ getTemplateCategories() { return this.categories.map(cat => ({ name: cat, count: this.templates.filter(t => t.category === cat).length })); } /** * 获取所有模板 */ getTemplates() { return this.templates; } /** * 按分类获取模板 */ getTemplatesByCategory(category) { if (!category) return this.templates; return this.templates.filter(t => t.category === category); } /** * 获取单个模板 */ getTemplateById(id) { return this.templates.find(t => t.id === id); } /** * 创建模板 */ createTemplate(data) { const newTemplate = { id: this.templates.length + 1, ...data, }; this.templates.push(newTemplate); return newTemplate; } /** * 更新模板 */ updateTemplate(id, data) { const index = this.templates.findIndex(t => t.id === id); if (index === -1) return null; this.templates[index] = { ...this.templates[index], ...data }; return this.templates[index]; } /** * 删除模板 */ deleteTemplate(id) { const index = this.templates.findIndex(t => t.id === id); if (index === -1) return false; this.templates.splice(index, 1); return true; } } exports.TemplatesService = TemplatesService; exports.templatesService = new TemplatesService();