| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219 |
- // ==============================================================================
- // 乳酸菌 v2 · Ch1 成人乳酸菌素片 · 品类机会(Step 2)
- // ==============================================================================
- // 1.1 成人乳酸菌素片 VOC 全景 · 平台×情感×主题
- // 1.2 成人品类机会点 · 竞品差异化空白
- // 1.3 品类核心机会提炼 · 可向儿童迁移的信号
- // ==============================================================================
- const LA = require('./lactic-analyze.js');
- const C = require('./lactic-components.js');
- // 去掉 #tag 段,只保留正文文本
- const stripTags = s => String(s || '').replace(/#[^\s#]+/g, '').trim();
- const { BRAND, esc, renderSectionHead, renderVocCard, renderVocGrid,
- renderStatStrip, renderBarChart, renderCompareTable, renderInsightHero,
- renderFindingCard, renderDecisionList, renderTagCloud } = C;
- // ============================================================
- // 1.1 成人 VOC 全景
- // ============================================================
- function renderSub1({ chapter: c, subIdx, sub, slideNum, slideTotal, data, meta }) {
- const items = data?.items || [];
- // 筛选成人乳酸菌素片相关 VOC(排除明确儿童关键词)
- const childKw = /儿童|宝宝|小孩|婴儿|幼儿|妈咪|3岁|6岁|12岁/i;
- const adultKw = /乳酸菌素片|整肠生|培菲康|金双岐|肠炎宁/i;
- const adultItems = items.filter(it => {
- const txt = `${it.keyword || ''} ${it.product || ''} ${it.content || ''}`;
- return adultKw.test(txt) && !childKw.test(it.keyword || '');
- });
- // 情感分布
- const sentiments = {};
- adultItems.forEach(it => {
- const s = it.sentiment || 'neutral';
- sentiments[s] = (sentiments[s] || 0) + 1;
- });
- // 主题提取
- const topicMap = {
- '腹泻/拉肚子': /腹泻|拉肚子|拉稀|闹肚子/i,
- '便秘/排便': /便秘|排便|通便|大便/i,
- '消化不良/胃胀': /消化|胃胀|不消化|积食/i,
- '菌群失调': /菌群|微生态|失调|紊乱/i,
- '抗生素后调理': /抗生素|消炎药|抗菌/i,
- '口味/剂型': /口味|好吃|难吃|咀嚼|奶片/i,
- '安全性/副作用': /安全|副作用|无害|放心/i,
- '效果/见效': /有效|管用|见效|好转|没用|没效/i,
- };
- const topicStats = Object.entries(topicMap).map(([name, re]) => ({
- label: name,
- value: adultItems.filter(it => re.test(it.content || '')).length,
- color: BRAND.WARM_ORANGE,
- })).sort((a, b) => b.value - a.value);
- // 成人 VOC 证据卡(stripTags 去掉 #tag 后再匹配,避免纯 hashtag 帖入选)
- const probioticRe = /益生菌|乳酸菌|肠道|便秘|腹泻|消化|菌群|活菌|拉肚子|肠胃|调理|双歧|鼠李糖/i;
- const substantiveAdult = adultItems.filter(it => stripTags(it.content).length >= 30 && probioticRe.test(stripTags(it.content)));
- const adultEvidence = LA.getEvidence(substantiveAdult, { top: 4, seed: 11, minChars: 20 });
- return `<section class="report-section" id="${c.key}-${subIdx}" data-tone="${c.tone}" data-slide-num="${slideNum}/${slideTotal}">
- <div class="section-inner">
- ${renderSectionHead({
- eyebrow: `${c.num}.${subIdx} · ADULT VOC LANDSCAPE`,
- title: sub,
- subtitle: '王总要求:"先看一下这些成人整个乳酸菌素片用药的 VOC"',
- color: c.color,
- })}
- ${renderStatStrip([
- { num: adultItems.length, label: '成人相关 VOC', color: c.color },
- { num: sentiments.positive || 0, label: '好评', color: BRAND.JIANG_GREEN },
- { num: sentiments.negative || 0, label: '差评', color: BRAND.CORAL },
- { num: sentiments.conflicted || 0, label: '矛盾', color: BRAND.WARM_ORANGE },
- ])}
- <div style="margin-top:24px;">
- ${renderBarChart(topicStats.slice(0, 8), { accent: c.color, title: '成人乳酸菌素片 VOC 主题分布', height: 280 })}
- </div>
- <div style="margin-top:24px;">
- <div class="text-mono text-xs" style="color:${c.color}; letter-spacing:0.15em; margin-bottom:14px; font-weight:700;">成人 VOC 原声卡片</div>
- ${renderVocGrid(adultEvidence, { columns: 2, accent: c.color })}
- </div>
- ${renderFindingCard({
- icon: '💡',
- title: '成人 VOC 全景:腹泻和消化不良是两大核心痛点',
- body: '成人乳酸菌素片的使用场景集中在 <strong>腹泻调理</strong> 和 <strong>消化不良</strong>,其次是抗生素后的菌群恢复。这些需求在儿童场景中同样存在——为 Step 3 的机会迁移奠定基础。',
- accent: c.color,
- })}
- </div>
- </section>`;
- }
- // ============================================================
- // 1.2 成人品类机会点 · 竞品差异化空白
- // ============================================================
- function renderSub2({ chapter: c, subIdx, sub, slideNum, slideTotal, data, meta }) {
- const items = data?.items || [];
- // 竞品对比数据
- const competitors = [
- { name: '整肠生(地衣芽孢杆菌)', type: '药品', strength: '医生信任高', weakness: '胶囊剂型、儿童难用', opportunity: '成人主战场,儿童缺位' },
- { name: '培菲康(双歧杆菌三联活菌)', type: '药品', strength: '三菌协同', weakness: '需冷链、价格高', opportunity: '冷链痛点可突破' },
- { name: '金双岐(双歧杆菌)', type: '药品', strength: '品牌老、渠道广', weakness: '剂型老旧', opportunity: '品牌老化留出空间' },
- { name: '妈咪爱(枯草杆菌+肠球菌)', type: '药品', strength: '儿童第一心智', weakness: '散剂喂药难', opportunity: '剂型可突破' },
- { name: '合生元益生菌', type: '食品', strength: '营销强、口碑好', weakness: '非药品无功效背书', opportunity: 'OTC 身份差异化' },
- { name: '万益蓝益生菌', type: '食品', strength: '网红种草', weakness: '价格贵、效果争议', opportunity: '性价比空间' },
- ];
- return `<section class="report-section" id="${c.key}-${subIdx}" data-tone="${c.tone}" data-slide-num="${slideNum}/${slideTotal}">
- <div class="section-inner">
- ${renderSectionHead({
- eyebrow: `${c.num}.${subIdx} · COMPETITOR GAP`,
- title: sub,
- subtitle: '成人市场竞品格局 × 差异化空白分析',
- color: c.color,
- })}
- ${renderCompareTable({
- title: '成人肠道微生态竞品矩阵',
- headers: ['产品', '身份', '核心优势', '核心弱点', '乳酸菌素片机会'],
- rows: competitors.map(cp => [
- { html: `<strong>${esc(cp.name)}</strong>`, bold: true },
- cp.type,
- cp.strength,
- { html: `<span style="color:${BRAND.CORAL};">${esc(cp.weakness)}</span>`, color: BRAND.CORAL },
- { html: `<span style="color:${BRAND.JIANG_GREEN};">${esc(cp.opportunity)}</span>`, color: BRAND.JIANG_GREEN },
- ]),
- accent: c.color,
- })}
- ${renderInsightHero({
- eyebrow: 'GAP ANALYSIS',
- title: '成人市场三大差异化空白',
- subtitle: `
- <strong style="color:${BRAND.JIANG_GREEN};">① 非冷链便携</strong>:培菲康/亿活需冷链,乳酸菌素片常温保存(王总纠正:妈咪爱也不用冷链,25°C 以下即可)<br/>
- <strong style="color:${BRAND.JIANG_GREEN};">② OTC 药品信任 + 食品级体验</strong>:合生元/万益蓝是食品无功效背书,整肠生是药品但体验差——乳酸菌素片可以两头占<br/>
- <strong style="color:${BRAND.JIANG_GREEN};">③ 咀嚼片剂型</strong>:奶片口感 + 不用水 + 孩子爱吃——这是从成人向儿童迁移的核心武器
- `,
- color: c.color,
- })}
- ${renderDecisionList([
- '乳酸菌素片的核心差异化 = <strong>OTC 药品身份 + 咀嚼片剂型 + 常温保存</strong>',
- '成人市场竞争激烈但格局分散——没有绝对龙头',
- '成人→儿童的迁移桥梁:咀嚼片剂型天然适配儿童',
- '关注妈咪爱"不用冷链"这个特性——不是我们的独有优势',
- ], { accent: c.color, title: 'DECISION · 品类机会判断' })}
- </div>
- </section>`;
- }
- // ============================================================
- // 1.3 品类核心机会提炼
- // ============================================================
- function renderSub3({ chapter: c, subIdx, sub, slideNum, slideTotal, data, meta }) {
- const items = data?.items || [];
- // 找成人 VOC 中暗含儿童信号的
- const childSignal = items.filter(it => {
- const kw = it.keyword || '';
- const childKw = /儿童|宝宝|小孩|妈咪/i;
- if (childKw.test(kw)) return false; // 排除本身就是儿童关键词的
- const content = it.content || '';
- return /小孩|宝宝|孩子|女儿|儿子|闺女|给娃/i.test(content);
- });
- const childProbRe = /益生菌|乳酸菌|肠|便秘|消化|积食|拉肚|吸收|喂药|抗生素/i;
- const substSignal = (childSignal.length > 0 ? childSignal : items)
- .filter(it => stripTags(it.content).length >= 30 && childProbRe.test(stripTags(it.content)));
- const signalEvidence = LA.getEvidence(substSignal, { top: 3, seed: 17, minChars: 20 });
- return `<section class="report-section" id="${c.key}-${subIdx}" data-tone="${c.tone}" data-slide-num="${slideNum}/${slideTotal}">
- <div class="section-inner">
- ${renderSectionHead({
- eyebrow: `${c.num}.${subIdx} · OPPORTUNITY DISTILL`,
- title: sub,
- subtitle: '从成人品类机会中提炼可向儿童迁移的核心信号',
- color: c.color,
- })}
- <div style="display:grid; grid-template-columns:repeat(3, 1fr); gap:18px;">
- ${[
- { title: '肠道日常调理', desc: '成人市场最大需求:腹泻/便秘/消化不良的日常调理。儿童同样存在,且家长更焦虑。', migrable: true, color: BRAND.JIANG_GREEN },
- { title: '抗生素后恢复', desc: '成人用抗生素后补菌群。儿童生病用抗生素更频繁,家长更担心副作用。', migrable: true, color: BRAND.LACTIC_MINT },
- { title: '口味/便携需求', desc: '成人对口味不太在意,但咀嚼片"像奶片"的特性天然适合儿童。', migrable: true, color: BRAND.SKY_BLUE },
- ].map(item => `
- <div style="padding:22px; background:${item.color}08; border:1px solid ${item.color}33; border-radius:var(--radius-md);">
- <div style="display:flex; justify-content:space-between; align-items:center; margin-bottom:10px;">
- <div class="text-mono text-xs" style="color:${item.color}; font-weight:700;">${esc(item.title)}</div>
- ${item.migrable ? `<span style="padding:2px 8px; background:${BRAND.JIANG_GREEN}15; color:${BRAND.JIANG_GREEN}; border-radius:10px; font-size:0.66rem; font-weight:700;">✓ 可迁移</span>` : ''}
- </div>
- <div style="color:var(--text-1); font-size:0.86rem; line-height:1.65;">${esc(item.desc)}</div>
- </div>`).join('')}
- </div>
- ${childSignal.length > 0 ? `
- <div style="margin-top:24px;">
- <div class="text-mono text-xs" style="color:${BRAND.BERRY_PINK}; letter-spacing:0.15em; margin-bottom:14px; font-weight:700;">
- 成人 VOC 中的儿童信号 · ${childSignal.length} 条含"孩子/宝宝/女儿/儿子"
- </div>
- ${renderVocGrid(signalEvidence, { columns: 3, accent: BRAND.BERRY_PINK, compact: true })}
- </div>` : `
- <div style="margin-top:24px; padding:20px; background:${BRAND.BERRY_PINK}08; border:1px dashed ${BRAND.BERRY_PINK}44; border-radius:var(--radius-md); text-align:center;">
- <div style="color:${BRAND.BERRY_PINK}; font-size:0.88rem;">成人 VOC 中儿童信号较少——这将在 Ch2 通过专门的儿童 VOC 补充</div>
- </div>`}
- ${renderFindingCard({
- icon: '🔄',
- title: '向 Ch2 传递:三条可迁移机会',
- body: '① <strong>肠道日常调理</strong>(最大需求·直接可迁移)→ ② <strong>抗生素后恢复</strong>(儿童更高频)→ ③ <strong>咀嚼片剂型优势</strong>(天然适配儿童)。Ch2 将验证这些机会在儿童端的真实需求强度。',
- accent: BRAND.BERRY_PINK,
- })}
- </div>
- </section>`;
- }
- module.exports = { renderSub1, renderSub2, renderSub3 };
|