功能迭代

This commit is contained in:
张锐 committed 2026-11-30 21:14:38 +08:00
1 parent 0b41b03011
commit 148d1297b2
15 files changed
+4705 -99

No files matched your search

+39
View File
@@ -29,6 +29,7 @@ type SectionType =
| "ANNOUNCEMENT"
| "HEADER"
| "HERO"
| "VIDEO"
| "RICH_TEXT"
| "PRODUCTS"
| "PRODUCT_DETAIL"
@@ -42,6 +43,8 @@ type Section = {
subtitle: string;
imageUrl: string;
imageUrls: string[];
/** 视频介绍区块的视频地址。 */
videoUrl: string;
/** 首页轮播区域占浏览器可视高度的百分比。 */
heroHeight: HeroHeight;
buttonText: string;
@@ -89,6 +92,7 @@ const labels: Record<SectionType, string> = {
ANNOUNCEMENT: "公告栏",
HEADER: "导航栏",
HERO: "轮播横幅",
VIDEO: "视频介绍",
RICH_TEXT: "富文本",
PRODUCTS: "产品展示",
PRODUCT_DETAIL: "产品详情",
@@ -143,6 +147,7 @@ function createSection(type: SectionType): Section {
: "",
imageUrl: "",
imageUrls: [],
videoUrl: "",
heroHeight: "80",
buttonText: type === "HERO" ? "Explore Products" : "",
buttonUrl: type === "HERO" ? "/products" : "",
@@ -585,6 +590,22 @@ function PreviewSection({
{item.subtitle ||
"Add your English introduction, advantages or service description here."}
</p>
{item.imageUrl && <img src={item.imageUrl} alt={item.title} />}
</section>
);
if (item.type === "VIDEO")
return (
<section className="pv-video" style={style} onClick={onSelect}>
<div>
<span>OUR FACTORY</span>
<h2>{item.title || "Built for reliable garden tool supply"}</h2>
<p>{item.subtitle}</p>
</div>
{item.videoUrl ? (
<video controls preload="metadata" src={item.videoUrl} />
) : (
<div className="pv-video-placeholder">请配置英文介绍视频 URL</div>
)}
</section>
);
if (item.type === "PRODUCTS" || item.type === "CONTENT")
@@ -871,6 +892,24 @@ function SectionSettings({
</Field>
</>
)}
{item.type === "VIDEO" && (
<Field label="视频 URL">
<input
value={item.videoUrl || ""}
onChange={(e) => onChange({ videoUrl: e.target.value })}
placeholder="https://...mp4"
/>
</Field>
)}
{item.type === "RICH_TEXT" && (
<Field label="展示图片 URL">
<input
value={item.imageUrl || ""}
onChange={(e) => onChange({ imageUrl: e.target.value })}
placeholder="https://...jpg"
/>
</Field>
)}
{item.type === "CONTENT" && (
<Field label="内容来源">
<select
+3564 -60
View File
File diff suppressed because it is too large. Load diff