From 2b52f60f40a99c6e0ddfac2317d978d39febf931 Mon Sep 17 00:00:00 2001 From: mike Date: Tue, 27 Oct 2026 15:27:52 +0800 Subject: [PATCH] Update App.jsx via upload script - 2026-10-27 15:27:49 --- App.jsx | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/App.jsx b/App.jsx index d35b0e4..3dcefb5 100644 --- a/App.jsx +++ b/App.jsx @@ -6256,6 +6256,7 @@ function DetailTemplateManager({ templates, setTemplates, products, setProducts, onNotify={onNotify} field="mainImages" max={WEB_MAX_IMAGES} cover label={`主图模板(最多${WEB_MAX_IMAGES}张,建议1000×1000方图,第一张是封面,拖动可调整顺序)`} />
同一系列共用的主图。产品自己上传了网站主图时,这些图接在它后面(合计最多{WEB_MAX_IMAGES}张);没上传时,这组图就是该产品的主图,第一张作列表封面。
+ update(active.id, patch)} /> ) : ( Array.isArray(p.webDetailTemplateIds) && p.webDetailTemplateIds.includes(tpl.id)); + if (imgs.length < 2 || users.length < 1) return null; + const covers = tpl.mainCover || {}; + const coll = new Intl.Collator('zh', { numeric: true }); + const label = (p) => p.name || p.model || '未命名'; + const setCover = (pid, f) => { + const next = { ...covers }; + if (!f || f === imgs[0]) delete next[pid]; else next[pid] = f; + update({ mainCover: next }); + }; + const custom = users.filter(p => covers[p.id] && imgs.includes(covers[p.id])).length; + return ( +
+ 每个型号的主图(已单独设置 {custom} / {users.length}) +
点一张图设为该型号的主图:网站列表封面、产品页第一张,产品自己上传了网站主图也是它排第一。选"默认"就按原来的顺序(产品自己的主图在前,模板图按模板顺序接在后面)。
+
+ {[...users].sort((a, b) => coll.compare(label(a), label(b))).map(p => { + const cur = covers[p.id] && imgs.includes(covers[p.id]) ? covers[p.id] : ''; + const own = Array.isArray(p.webImages) && p.webImages.length > 0; + return ( +
+ {label(p)}{own && (有自有主图)} + + {imgs.map((f, i) => ( + + ))} +
+ ); + })} +
+
+ ); +} + // 模板内容摘要:主图2 · 详情5 · HTML function tplSummary(t) { const parts = [];