新增首页封面轮播装修组件

This commit is contained in:
张锐 committed 2026-11-26 00:01:04 +08:00
1 parent 12979c9600
commit 8a93a95d42
3 files changed
+18 -4

No files matched your search

+7 -2
View File
@@ -39,6 +39,7 @@ type Section = {
title: string;
subtitle: string;
imageUrl: string;
imageUrls: string[];
buttonText: string;
buttonUrl: string;
sourceType: string;
@@ -121,6 +122,7 @@ function createSection(type: SectionType): Section {
? "Industrial products and project-proven solutions for global B2B customers."
: "",
imageUrl: "",
imageUrls: [],
buttonText: type === "HERO" ? "Explore Products" : "",
buttonUrl: type === "HERO" ? "/products" : "",
sourceType: type === "CONTENT" ? "CASE" : "",
@@ -507,8 +509,8 @@ function PreviewSection({
className="pv-hero"
style={{
...style,
backgroundImage: item.imageUrl
? `linear-gradient(90deg,rgba(0,0,0,.65),rgba(0,0,0,.1)),url(${item.imageUrl})`
backgroundImage: (item.imageUrls?.[0] || item.imageUrl)
? `linear-gradient(90deg,rgba(0,0,0,.65),rgba(0,0,0,.1)),url(${item.imageUrls?.[0] || item.imageUrl})`
: undefined,
}}
onClick={onSelect}
@@ -723,6 +725,9 @@ function SectionSettings({
onChange={(e) => onChange({ imageUrl: e.target.value })}
/>
</Field>
<Field label="轮播图片 URL(每行一张)">
<textarea rows={4} value={(item.imageUrls || []).join("\n")} onChange={(e) => onChange({ imageUrls: e.target.value.split(/\r?\n/).map((value) => value.trim()).filter(Boolean) })} placeholder="https://..." />
</Field>
<Field label="按钮文案">
<input
value={item.buttonText}