feat: 本次提交更新内容如下

增加tips字段
This commit is contained in:
笔记本里的永平
2025-07-21 15:32:21 +08:00
parent a9b5868016
commit 1cc04366fc
2 changed files with 26 additions and 1 deletions

View File

@@ -98,6 +98,7 @@ export default function NewPlan() {
sceneId: Number(detail.scenario) || 1,
remarkFormat: detail.remarkFormat ?? "",
addFriendInterval: detail.addFriendInterval ?? 1,
tips: detail.tips ?? "",
}));
}
} else {
@@ -178,6 +179,7 @@ export default function NewPlan() {
case 1:
return (
<BasicSettings
isEdit={isEdit}
formData={formData}
onChange={onChange}
onNext={handleNext}

View File

@@ -12,6 +12,7 @@ import EyeIcon from "@/components/icons/EyeIcon";
import { uploadFile } from "@/api/utils";
interface BasicSettingsProps {
isEdit: boolean;
formData: any;
onChange: (data: any) => void;
onNext?: () => void;
@@ -89,6 +90,7 @@ const generatePosterMaterials = (): Material[] => {
};
export function BasicSettings({
isEdit,
formData,
onChange,
onNext,
@@ -123,6 +125,7 @@ export function BasicSettings({
// 自定义标签相关状态
const [customTagInput, setCustomTagInput] = useState("");
const [customTags, setCustomTags] = useState(formData.customTags || []);
const [tips, setTips] = useState(formData.tips || "");
const [selectedScenarioTags, setSelectedScenarioTags] = useState(
formData.scenarioTags || []
);
@@ -188,7 +191,11 @@ export function BasicSettings({
const today = new Date().toLocaleDateString("zh-CN").replace(/\//g, "");
const sceneItem = sceneList.find((v) => formData.scenario === v.id);
onChange({ ...formData, name: `${sceneItem?.name || "海报"}${today}` });
}, [sceneList]);
}, [isEdit]);
useEffect(() => {
setTips(formData.tips || "");
}, [formData.tips]);
// 选中场景
const handleScenarioSelect = (sceneId: number) => {
@@ -494,6 +501,22 @@ export function BasicSettings({
</div>
</div>
{/* 输入获客成功提示 */}
<div className="flex pt-4">
<div className="border p-2 flex-1">
<input
type="text"
value={tips}
onChange={(e) => {
setTips(e.target.value);
onChange({ ...formData, tips: e.target.value });
}}
placeholder="请输入获客成功提示"
className="w-full"
/>
</div>
</div>
{/* 选素材 */}
<div className="my-4" style={openPoster}>
<div className="mb-4"></div>