Update public-api.js via upload script - 2026-10-23 14:25:06
This commit is contained in:
parent
5fbe6f8c40
commit
f56c9ada3b
|
|
@ -243,13 +243,13 @@ async function translateTemplateHtml(ai, products) {
|
|||
|
||||
// ===== 网站产品介绍:没手动填英文介绍的产品,由 AI 根据参数自动写一段 =====
|
||||
// 参数变了会重新生成(缓存按参数内容算);手动填了英文介绍就一直用手动的。
|
||||
const TYPE_EN = { '迷你UPS': 'Mini DC UPS', '离线式UPS': 'Offline UPS', '离线式锂电UPS': 'Lithium-ion offline UPS', '在线互动式UPS': 'Line-interactive UPS', '机架式UPS': 'Rack-mount online double-conversion UPS' };
|
||||
const TYPE_EN = { '迷你UPS': 'Mini DC UPS', '离线式UPS': 'Offline UPS', '离线式锂电UPS': 'Lithium-ion offline UPS', '在线互动式UPS': 'Line-interactive UPS', '机架式UPS': 'Rack-mount online double-conversion UPS', '机架式锂电UPS': 'Lithium-ion rack-mount online double-conversion UPS' };
|
||||
const DESC_SKIP = new Set(['model', 'brand', 'category', 'type', 'machineVariant', 'description', 'sale', 'youtube', 'sellingPoints', 'sockets', 'extraSpecs', 'pack']);
|
||||
const SOCKET_EN = { SCHUKO: 'Schuko', NEMA: 'NEMA 5-15', UK: 'BS 1363 (UK)', UNIVERSAL: 'universal', IEC: 'IEC C13', AU: 'Type I (AU/CN)' };
|
||||
function descFacts(p) {
|
||||
const f = { model: p.model };
|
||||
if (TYPE_EN[p.type]) f.type = TYPE_EN[p.type];
|
||||
if (p.type === '机架式UPS' && p.machineVariant) f.variant = /长/.test(p.machineVariant) ? 'Long-run model: no internal batteries, connects to an external battery bank' : 'Standard model with internal batteries';
|
||||
if ((p.type === '机架式UPS' || p.type === '机架式锂电UPS') && p.machineVariant) f.variant = /长/.test(p.machineVariant) ? 'Long-run model: no internal batteries, connects to an external battery bank' : 'Standard model with internal batteries';
|
||||
for (const [k, v] of Object.entries(p)) {
|
||||
if (DESC_SKIP.has(k) || k.startsWith('_') || ['slug', 'images', 'detailImages', 'templateImages', 'templateHtml', 'specI18n'].includes(k)) continue;
|
||||
const en = p.specI18n && p.specI18n[k] && p.specI18n[k].en;
|
||||
|
|
|
|||
Loading…
Reference in New Issue