- {imgs.length > 0 && (
-
-
详情图片
- {imgs.map((f, i) => {
- const on = !(e.images || []).includes(f);
- return (
-
- );
- })}
-
- )}
- {blocks.length > 0 && (
-
- HTML 片段
- {blocks.map((b, i) => {
- const on = !(e.blocks || []).includes(b.id);
- return ;
- })}
-
- )}
- {hasHtml && (
-
- HTML 内容
-
-
- )}
+ {mains.length > 0 && (
+
+
主图
+ {defBtn(!e.main, () => setCat(p.id, 'main', null))}
+ {mains.map((f, i) => {
+ const k = e.main ? e.main.indexOf(f) : i, on = !e.main || k >= 0;
+ return (
+
+ );
+ })}
+ {e.main && !e.main.length &&
不用模板主图}
+
+ )}
+ {imgs.length > 0 && (
+
+
详情图片
+ {defBtn(!e.images, () => setCat(p.id, 'images', null))}
+ {imgs.map((f, i) => {
+ const on = !e.images || e.images.includes(f);
+ return (
+
+ );
+ })}
+ {e.images && !e.images.length &&
不用详情图片}
+
+ )}
+ {blocks.length > 0 && (
+
+ HTML 片段
+ {defBtn(!e.blocks, () => setCat(p.id, 'blocks', null))}
+ {blocks.map(b => {
+ const on = !e.blocks || e.blocks.includes(b.id);
+ const n = (tpl.detailHtml || []).findIndex(x => x.id === b.id) + 1;
+ return ;
+ })}
+
+ )}
+ {hasHtml && (
+
+ HTML 内容
+ {defBtn(typeof e.html !== 'boolean', () => setCat(p.id, 'html', null))}
+ {(() => {
+ const on = e.html !== false, isDef = typeof e.html !== 'boolean';
+ return ;
+ })()}
)}