/* ============================================================ * 「越用越好用」偏好学习 * ocStore 持久化到 localStorage:发品次数、沉淀的偏好、最近一次配置。 * ============================================================ */ const OC_KEY = 'fliggy_oc' export function loadOC() { try { return JSON.parse(localStorage.getItem(OC_KEY) || 'null') || { count: 0, prefs: [], last: null } } catch { return { count: 0, prefs: [], last: null } } } export function saveOC(store) { try { localStorage.setItem(OC_KEY, JSON.stringify(store)) } catch { /* 演示环境忽略 */ } } /** 成长等级:Lv.1 通用模板 → Lv.2 风格匹配 → Lv.3 爆款复刻 */ export function ocLevelInfo(store) { if (store.count >= 10) return { name: 'Lv.3 爆款复刻', next: '已解锁:自动复用您的历史爆款结构与定价', pct: 100 } if (store.count >= 3) return { name: 'Lv.2 风格匹配', next: `再用 ${10 - store.count} 次解锁「Lv.3 爆款复刻」`, pct: (store.count / 10) * 100 } return { name: 'Lv.1 通用模板', next: `再用 ${3 - store.count} 次解锁「Lv.2 风格匹配」(生成将贴合您的风格)`, pct: (store.count / 10) * 100 } } /** 每次发品沉淀的偏好条目 */ export function buildPrefs(destShort, days, type, theme) { return [ `${destShort}路线偏好:${days}${type}`, `「${theme}」人群文案风格`, '纯玩无购物话术偏好', '平季低于市场 5% 定价策略', '首月立减冲榜促销习惯' ] }