极速成片页面和提炼提示词

This commit is contained in:
Azmat@qq.com
2026-08-24 15:52:05 +08:00
parent 2f5b7304b0
commit 00fc454db7
29 changed files with 1424 additions and 483 deletions
+78
View File
@@ -0,0 +1,78 @@
import { useEffect, useState } from "react";
import { ArrowLeft, Sparkles, Trash2, Upload, WandSparkles } from "lucide-react";
import type { Page } from "./route-config";
export function QuickCreatePage({ onBack }: { onBack: () => void; navigate?: (page: Page) => void }) {
const [name, setName] = useState("");
const [images, setImages] = useState<File[]>([]);
const [preview, setPreview] = useState("");
useEffect(() => {
if (!images[0]) {
setPreview("");
return;
}
const url = URL.createObjectURL(images[0]);
setPreview(url);
return () => URL.revokeObjectURL(url);
}, [images]);
function selectImages(files: FileList | null) {
setImages(Array.from(files || []).slice(0, 9));
}
return (
<div className="quick-create-page">
<header className="project-builder-header quick-create-header">
<div className="project-builder-title">
<button type="button" className="image-back-button" onClick={onBack} aria-label="返回工作台"><ArrowLeft /></button>
<div><h1></h1><p></p></div>
</div>
<div className="project-builder-status"><strong>AI </strong><span>· </span></div>
</header>
<div className="quick-create-shell" id="quickCreateShell">
<section className="quick-create-panel quick-form-panel">
<div className="quick-form-copy">
<h2></h2>
<p>15</p>
</div>
<label className="quick-field">
<span className="quick-field-label"><span></span><small></small></span>
<input className="quick-name-input" autoComplete="off" value={name} onChange={(event) => setName(event.target.value)} placeholder="例如:净颜精华、轻醒咖啡" />
</label>
<div className="quick-field">
<span className="quick-field-label"><span></span><small> · 9</small></span>
<label className={`quick-upload${preview ? " has-image" : ""}`}>
<input type="file" accept="image/jpeg,image/png,image/webp" multiple onChange={(event) => selectImages(event.target.files)} />
<span className="quick-upload-copy"><span className="quick-upload-icon"><Upload /></span><strong></strong><small>使</small></span>
<span className="quick-upload-preview">
<img src={preview} alt="极速成片商品预览" />
<span className="quick-image-count">{images.length}</span>
<button type="button" className="quick-image-clear" onClick={(event) => { event.preventDefault(); setImages([]); }} aria-label="删除已上传图片"><Trash2 /></button>
</span>
</label>
</div>
<div className="quick-auto-note" aria-label="系统自动完成内容"><span></span><span></span><span></span><span></span></div>
<div className="quick-form-footer">
<div className="quick-cost"><span></span><strong> 240 </strong></div>
<button type="button" className="quick-generate-button" disabled><WandSparkles /><span></span></button>
</div>
</section>
<section className="quick-create-panel quick-status-panel" aria-live="polite">
<div className="quick-state quick-state-ready">
<div className="quick-ready-orbit"><span className="quick-ready-icon"><Sparkles /></span></div>
<h2></h2>
<p>AI </p>
<div className="quick-ready-tags"><span></span><span></span><span></span><span></span></div>
</div>
</section>
</div>
</div>
);
}