From 1bb34b493284a0655ef18134ca478c3d1d162457 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AC=94=E8=AE=B0=E6=9C=AC=E9=87=8C=E7=9A=84=E6=B0=B8?= =?UTF-8?q?=E5=B9=B3?= Date: Wed, 16 Jul 2025 10:22:12 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9C=AC=E6=AC=A1=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=86=85=E5=AE=B9=E5=A6=82=E4=B8=8B=20?= =?UTF-8?q?=E5=AD=98=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nkebao/src/components/icons/EyeIcon.tsx | 22 + .../scenarios/new/steps/BasicSettings.tsx | 762 ++++++++++++------ .../workspace/moments-sync/MomentsSync.tsx | 2 +- 3 files changed, 539 insertions(+), 247 deletions(-) create mode 100644 nkebao/src/components/icons/EyeIcon.tsx diff --git a/nkebao/src/components/icons/EyeIcon.tsx b/nkebao/src/components/icons/EyeIcon.tsx new file mode 100644 index 000000000..fb414f983 --- /dev/null +++ b/nkebao/src/components/icons/EyeIcon.tsx @@ -0,0 +1,22 @@ +import React from "react"; + +export function EyeIcon(props: React.SVGProps) { + return ( + + + + + ); +} + +export default EyeIcon; diff --git a/nkebao/src/pages/scenarios/new/steps/BasicSettings.tsx b/nkebao/src/pages/scenarios/new/steps/BasicSettings.tsx index b38081d93..704af4722 100644 --- a/nkebao/src/pages/scenarios/new/steps/BasicSettings.tsx +++ b/nkebao/src/pages/scenarios/new/steps/BasicSettings.tsx @@ -1,20 +1,17 @@ -import type React from "react" -import { useState, useEffect } from "react" -import { Button, Input, Tag, Grid, Dialog, ImageViewer, Table, Switch } from 'tdesign-mobile-react'; - - -// 调整场景顺序,确保API获客在最后,并且前三个是最常用的场景 -const scenarios = [ - { id: "haibao", name: "海报获客", type: "material" }, - { id: "order", name: "订单获客", type: "api" }, - { id: "douyin", name: "抖音获客", type: "social" }, - { id: "xiaohongshu", name: "小红书获客", type: "social" }, - { id: "phone", name: "电话获客", type: "social" }, - { id: "gongzhonghao", name: "公众号获客", type: "social" }, - { id: "weixinqun", name: "微信群获客", type: "social" }, - { id: "payment", name: "付款码获客", type: "material" }, - { id: "api", name: "API获客", type: "api" }, // API获客放在最后 -] +import type React from "react"; +import { useState, useEffect, useRef } from "react"; +import { + Button, + Input, + Tag, + Grid, + Dialog, + ImageViewer, + Table, + Switch, +} from "tdesign-mobile-react"; +import EyeIcon from "@/components/icons/EyeIcon"; +import UploadImage from "@/components/UploadImage"; const phoneCallTags = [ { id: "tag-1", name: "咨询", color: "bg-blue-100 text-blue-800" }, @@ -24,91 +21,171 @@ const phoneCallTags = [ { id: "tag-5", name: "售后", color: "bg-purple-100 text-purple-800" }, { id: "tag-6", name: "订单", color: "bg-yellow-100 text-yellow-800" }, { id: "tag-7", name: "物流", color: "bg-teal-100 text-teal-800" }, -] +]; // 不同场景的预设标签 const scenarioTags = { haibao: [ - { id: "poster-tag-1", name: "活动推广", color: "bg-blue-100 text-blue-800" }, - { id: "poster-tag-2", name: "产品宣传", color: "bg-green-100 text-green-800" }, - { id: "poster-tag-3", name: "品牌展示", color: "bg-purple-100 text-purple-800" }, + { + id: "poster-tag-1", + name: "活动推广", + color: "bg-blue-100 text-blue-800", + }, + { + id: "poster-tag-2", + name: "产品宣传", + color: "bg-green-100 text-green-800", + }, + { + id: "poster-tag-3", + name: "品牌展示", + color: "bg-purple-100 text-purple-800", + }, { id: "poster-tag-4", name: "优惠促销", color: "bg-red-100 text-red-800" }, - { id: "poster-tag-5", name: "新品发布", color: "bg-orange-100 text-orange-800" }, + { + id: "poster-tag-5", + name: "新品发布", + color: "bg-orange-100 text-orange-800", + }, ], order: [ { id: "order-tag-1", name: "新订单", color: "bg-green-100 text-green-800" }, { id: "order-tag-2", name: "复购客户", color: "bg-blue-100 text-blue-800" }, - { id: "order-tag-3", name: "高价值订单", color: "bg-purple-100 text-purple-800" }, - { id: "order-tag-4", name: "待付款", color: "bg-yellow-100 text-yellow-800" }, + { + id: "order-tag-3", + name: "高价值订单", + color: "bg-purple-100 text-purple-800", + }, + { + id: "order-tag-4", + name: "待付款", + color: "bg-yellow-100 text-yellow-800", + }, { id: "order-tag-5", name: "已完成", color: "bg-gray-100 text-gray-800" }, ], douyin: [ { id: "douyin-tag-1", name: "短视频", color: "bg-pink-100 text-pink-800" }, { id: "douyin-tag-2", name: "直播", color: "bg-red-100 text-red-800" }, - { id: "douyin-tag-3", name: "带货", color: "bg-orange-100 text-orange-800" }, - { id: "douyin-tag-4", name: "粉丝互动", color: "bg-blue-100 text-blue-800" }, - { id: "douyin-tag-5", name: "热门话题", color: "bg-purple-100 text-purple-800" }, + { + id: "douyin-tag-3", + name: "带货", + color: "bg-orange-100 text-orange-800", + }, + { + id: "douyin-tag-4", + name: "粉丝互动", + color: "bg-blue-100 text-blue-800", + }, + { + id: "douyin-tag-5", + name: "热门话题", + color: "bg-purple-100 text-purple-800", + }, ], xiaohongshu: [ { id: "xhs-tag-1", name: "种草笔记", color: "bg-red-100 text-red-800" }, { id: "xhs-tag-2", name: "美妆", color: "bg-pink-100 text-pink-800" }, { id: "xhs-tag-3", name: "穿搭", color: "bg-purple-100 text-purple-800" }, { id: "xhs-tag-4", name: "生活方式", color: "bg-green-100 text-green-800" }, - { id: "xhs-tag-5", name: "好物推荐", color: "bg-orange-100 text-orange-800" }, + { + id: "xhs-tag-5", + name: "好物推荐", + color: "bg-orange-100 text-orange-800", + }, ], phone: phoneCallTags, gongzhonghao: [ { id: "gzh-tag-1", name: "文章推送", color: "bg-blue-100 text-blue-800" }, { id: "gzh-tag-2", name: "活动通知", color: "bg-green-100 text-green-800" }, - { id: "gzh-tag-3", name: "产品介绍", color: "bg-purple-100 text-purple-800" }, - { id: "gzh-tag-4", name: "用户服务", color: "bg-orange-100 text-orange-800" }, + { + id: "gzh-tag-3", + name: "产品介绍", + color: "bg-purple-100 text-purple-800", + }, + { + id: "gzh-tag-4", + name: "用户服务", + color: "bg-orange-100 text-orange-800", + }, { id: "gzh-tag-5", name: "品牌故事", color: "bg-gray-100 text-gray-800" }, ], weixinqun: [ { id: "wxq-tag-1", name: "群活动", color: "bg-green-100 text-green-800" }, { id: "wxq-tag-2", name: "产品分享", color: "bg-blue-100 text-blue-800" }, - { id: "wxq-tag-3", name: "用户交流", color: "bg-purple-100 text-purple-800" }, + { + id: "wxq-tag-3", + name: "用户交流", + color: "bg-purple-100 text-purple-800", + }, { id: "wxq-tag-4", name: "优惠信息", color: "bg-pink-100 text-pink-800" }, - { id: "wxq-tag-5", name: "答疑解惑", color: "bg-orange-100 text-orange-800" }, - { id: "wxq-tag-6", name: "新人欢迎", color: "bg-yellow-100 text-yellow-800" }, + { + id: "wxq-tag-5", + name: "答疑解惑", + color: "bg-orange-100 text-orange-800", + }, + { + id: "wxq-tag-6", + name: "新人欢迎", + color: "bg-yellow-100 text-yellow-800", + }, { id: "wxq-tag-7", name: "群规通知", color: "bg-gray-100 text-gray-800" }, - { id: "wxq-tag-8", name: "活跃互动", color: "bg-indigo-100 text-indigo-800" }, + { + id: "wxq-tag-8", + name: "活跃互动", + color: "bg-indigo-100 text-indigo-800", + }, ], payment: [ { id: "pay-tag-1", name: "扫码支付", color: "bg-green-100 text-green-800" }, { id: "pay-tag-2", name: "线下门店", color: "bg-blue-100 text-blue-800" }, - { id: "pay-tag-3", name: "活动收款", color: "bg-purple-100 text-purple-800" }, - { id: "pay-tag-4", name: "服务费用", color: "bg-orange-100 text-orange-800" }, - { id: "pay-tag-5", name: "会员充值", color: "bg-yellow-100 text-yellow-800" }, + { + id: "pay-tag-3", + name: "活动收款", + color: "bg-purple-100 text-purple-800", + }, + { + id: "pay-tag-4", + name: "服务费用", + color: "bg-orange-100 text-orange-800", + }, + { + id: "pay-tag-5", + name: "会员充值", + color: "bg-yellow-100 text-yellow-800", + }, ], api: [ { id: "api-tag-1", name: "系统对接", color: "bg-blue-100 text-blue-800" }, { id: "api-tag-2", name: "数据同步", color: "bg-green-100 text-green-800" }, { id: "api-tag-3", name: "自动化", color: "bg-purple-100 text-purple-800" }, - { id: "api-tag-4", name: "第三方平台", color: "bg-orange-100 text-orange-800" }, + { + id: "api-tag-4", + name: "第三方平台", + color: "bg-orange-100 text-orange-800", + }, { id: "api-tag-5", name: "实时推送", color: "bg-gray-100 text-gray-800" }, ], -} +}; interface BasicSettingsProps { - formData: any - onChange: (data: any) => void - onNext?: () => void - sceneList: any[] - sceneLoading: boolean + formData: any; + onChange: (data: any) => void; + onNext?: () => void; + sceneList: any[]; + sceneLoading: boolean; } interface Account { - id: string - nickname: string - avatar: string + id: string; + nickname: string; + avatar: string; } interface Material { - id: string - name: string - type: string - preview: string + id: string; + name: string; + type: string; + preview: string; } const posterTemplates = [ @@ -148,15 +225,15 @@ const posterTemplates = [ preview: "https://hebbkx1anhila5yf.public.blob.vercel-storage.com/%E7%82%B9%E5%87%BB%E6%8A%A5%E5%90%8D-Mj0nnva0BiASeDAIhNNaRRAbjPgjEj.gif", }, -] +]; const generateRandomAccounts = (count: number): Account[] => { return Array.from({ length: count }, (_, index) => ({ id: `account-${index + 1}`, nickname: `账号-${Math.random().toString(36).substring(2, 7)}`, avatar: `/placeholder.svg?height=40&width=40&text=${index + 1}`, - })) -} + })); +}; const generatePosterMaterials = (): Material[] => { return posterTemplates.map((template) => ({ @@ -164,39 +241,47 @@ const generatePosterMaterials = (): Material[] => { name: template.name, type: "poster", preview: template.preview, - })) -} + })); +}; -export function BasicSettings({ formData, onChange, onNext, sceneList, sceneLoading }: BasicSettingsProps) { - const [isAccountDialogOpen, setIsAccountDialogOpen] = useState(false) - const [isMaterialDialogOpen, setIsMaterialDialogOpen] = useState(false) - const [isPreviewOpen, setIsPreviewOpen] = useState(false) - const [isPhoneSettingsOpen, setIsPhoneSettingsOpen] = useState(false) - const [accounts] = useState(generateRandomAccounts(50)) - const [materials] = useState(generatePosterMaterials()) +export function BasicSettings({ + formData, + onChange, + onNext, + sceneList, + sceneLoading, +}: BasicSettingsProps) { + const [isAccountDialogOpen, setIsAccountDialogOpen] = useState(false); + const [isMaterialDialogOpen, setIsMaterialDialogOpen] = useState(false); + const [isPreviewOpen, setIsPreviewOpen] = useState(false); + const [isPhoneSettingsOpen, setIsPhoneSettingsOpen] = useState(false); + const [accounts] = useState(generateRandomAccounts(50)); + const [materials] = useState(generatePosterMaterials()); const [selectedAccounts, setSelectedAccounts] = useState( - formData.accounts?.length > 0 ? formData.accounts : [], - ) + formData.accounts?.length > 0 ? formData.accounts : [] + ); const [selectedMaterials, setSelectedMaterials] = useState( - formData.materials?.length > 0 ? formData.materials : [], - ) + formData.materials?.length > 0 ? formData.materials : [] + ); // showAllScenarios 默认为 true const [showAllScenarios, setShowAllScenarios] = useState(true); - const [isImportDialogOpen, setIsImportDialogOpen] = useState(false) + const [isImportDialogOpen, setIsImportDialogOpen] = useState(false); const [importedTags, setImportedTags] = useState< Array<{ - phone: string - wechat: string - source?: string - orderAmount?: number - orderDate?: string + phone: string; + wechat: string; + source?: string; + orderAmount?: number; + orderDate?: string; }> - >(formData.importedTags || []) + >(formData.importedTags || []); // 自定义标签相关状态 const [customTagInput, setCustomTagInput] = useState(""); const [customTags, setCustomTags] = useState(formData.customTags || []); - const [selectedScenarioTags, setSelectedScenarioTags] = useState(formData.scenarioTags || []); + const [selectedScenarioTags, setSelectedScenarioTags] = useState( + formData.scenarioTags || [] + ); // 电话获客相关状态 const [phoneSettings, setPhoneSettings] = useState({ @@ -206,8 +291,19 @@ export function BasicSettings({ formData, onChange, onNext, sceneList, sceneLoad }); // 群设置相关状态 - const [weixinqunName, setWeixinqunName] = useState(formData.weixinqunName || ""); - const [weixinqunNotice, setWeixinqunNotice] = useState(formData.weixinqunNotice || ""); + const [weixinqunName, setWeixinqunName] = useState( + formData.weixinqunName || "" + ); + const [weixinqunNotice, setWeixinqunNotice] = useState( + formData.weixinqunNotice || "" + ); + + // 新增:自定义海报相关状态 + const [customPosters, setCustomPosters] = useState([]); + const [previewUrl, setPreviewUrl] = useState(null); + + // 新增:用于文件选择的ref + const uploadInputRef = useRef(null); // 更新电话获客设置 const handlePhoneSettingsUpdate = () => { @@ -219,43 +315,43 @@ export function BasicSettings({ formData, onChange, onNext, sceneList, sceneLoad const handleTagToggle = (tagId: string) => { const newTags = selectedScenarioTags.includes(tagId) ? selectedScenarioTags.filter((id: string) => id !== tagId) - : [...selectedScenarioTags, tagId] + : [...selectedScenarioTags, tagId]; - setSelectedScenarioTags(newTags) - onChange({ ...formData, scenarioTags: newTags }) - } + setSelectedScenarioTags(newTags); + onChange({ ...formData, scenarioTags: newTags }); + }; // 处理通话类型选择 const handleCallTypeChange = (type: string) => { // setPhoneCallType(type) // This line was removed as per the edit hint. - onChange({ ...formData, phoneCallType: type }) - } + onChange({ ...formData, phoneCallType: type }); + }; // 初始化时,如果没有选择场景,默认选择海报获客 useEffect(() => { if (!formData.scenario) { - onChange({ ...formData, scenario: "haibao" }) + onChange({ ...formData, scenario: "haibao" }); } if (!formData.planName) { - const today = new Date().toLocaleDateString("zh-CN").replace(/\//g, "") - onChange({ ...formData, planName: `海报${today}` }) + const today = new Date().toLocaleDateString("zh-CN").replace(/\//g, ""); + onChange({ ...formData, planName: `海报${today}` }); } - }, [formData, onChange]) + }, [formData, onChange]); // 选中场景 const handleScenarioSelect = (sceneId: number) => { - onChange({ ...formData, scenario: sceneId }) - } + onChange({ ...formData, scenario: sceneId }); + }; // 选中/取消标签 const handleScenarioTagToggle = (tag: string) => { const newTags = selectedScenarioTags.includes(tag) ? selectedScenarioTags.filter((t: string) => t !== tag) - : [...selectedScenarioTags, tag] - setSelectedScenarioTags(newTags) - onChange({ ...formData, scenarioTags: newTags }) - } + : [...selectedScenarioTags, tag]; + setSelectedScenarioTags(newTags); + onChange({ ...formData, scenarioTags: newTags }); + }; // 添加自定义标签 const handleAddCustomTag = () => { @@ -276,16 +372,50 @@ export function BasicSettings({ formData, onChange, onNext, sceneList, sceneLoad setCustomTags(updatedCustomTags); onChange({ ...formData, customTags: updatedCustomTags }); // 同时从选中标签中移除 - const updatedSelectedTags = selectedScenarioTags.filter((t: string) => t !== tagId); + const updatedSelectedTags = selectedScenarioTags.filter( + (t: string) => t !== tagId + ); setSelectedScenarioTags(updatedSelectedTags); - onChange({ ...formData, scenarioTags: updatedSelectedTags, customTags: updatedCustomTags }); + onChange({ + ...formData, + scenarioTags: updatedSelectedTags, + customTags: updatedCustomTags, + }); }; - // 选择素材(单选) + // 新增:自定义上传图片 + const handleCustomPosterUpload = (urls: string[]) => { + if (urls && urls.length > 0) { + const newPoster: Material = { + id: `custom-${Date.now()}`, + name: "自定义海报", + type: "poster", + preview: urls[0], + }; + setCustomPosters((prev) => [...prev, newPoster]); + } + }; + + // 新增:删除自定义海报 + const handleRemoveCustomPoster = (id: string) => { + setCustomPosters((prev) => prev.filter((p) => p.id !== id)); + // 如果选中则取消选中 + if (selectedMaterials.some((m) => m.id === id)) { + setSelectedMaterials([]); + onChange({ ...formData, materials: [] }); + } + }; + + // 修改:选中/取消选中海报 const handleMaterialSelect = (material: Material) => { - setSelectedMaterials([material]); - onChange({ ...formData, materials: [material] }); - setIsMaterialDialogOpen(false); + const isSelected = selectedMaterials.some((m) => m.id === material.id); + if (isSelected) { + setSelectedMaterials([]); + onChange({ ...formData, materials: [] }); + } else { + setSelectedMaterials([material]); + onChange({ ...formData, materials: [material] }); + } }; // 移除已选素材 @@ -294,17 +424,22 @@ export function BasicSettings({ formData, onChange, onNext, sceneList, sceneLoad onChange({ ...formData, materials: [] }); }; - // 预览图片 + // 新增:全屏预览 const handlePreviewImage = (url: string) => { + setPreviewUrl(url); setIsPreviewOpen(true); }; // 账号多选切换 const handleAccountToggle = (account: Account) => { - const isSelected = selectedAccounts.some((a: Account) => a.id === account.id); + const isSelected = selectedAccounts.some( + (a: Account) => a.id === account.id + ); let newSelected; if (isSelected) { - newSelected = selectedAccounts.filter((a: Account) => a.id !== account.id); + newSelected = selectedAccounts.filter( + (a: Account) => a.id !== account.id + ); } else { newSelected = [...selectedAccounts, account]; } @@ -319,9 +454,6 @@ export function BasicSettings({ formData, onChange, onNext, sceneList, sceneLoad onChange({ ...formData, accounts: newSelected }); }; - // 只显示前三个场景,其他的需要点击展开 - const displayedScenarios = showAllScenarios ? scenarios : scenarios.slice(0, 3) - // 处理文件导入 const handleFileImport = (event: React.ChangeEvent) => { const file = event.target.files?.[0]; @@ -332,7 +464,8 @@ export function BasicSettings({ formData, onChange, onNext, sceneList, sceneLoad const content = e.target?.result as string; const rows = content.split("\n").filter((row) => row.trim()); const tags = rows.slice(1).map((row) => { - const [phone, wechat, source, orderAmount, orderDate] = row.split(","); + const [phone, wechat, source, orderAmount, orderDate] = + row.split(","); return { phone: phone?.trim(), wechat: wechat?.trim(), @@ -348,12 +481,13 @@ export function BasicSettings({ formData, onChange, onNext, sceneList, sceneLoad } }; reader.readAsText(file); - } + } }; // 下载模板 const handleDownloadTemplate = () => { - const template = "电话号码,微信号,来源,订单金额,下单日期\n13800138000,wxid_123,抖音,99.00,2024-03-03"; + const template = + "电话号码,微信号,来源,订单金额,下单日期\n13800138000,wxid_123,抖音,99.00,2024-03-03"; const blob = new Blob([template], { type: "text/csv" }); const url = window.URL.createObjectURL(blob); const a = document.createElement("a"); @@ -390,23 +524,29 @@ export function BasicSettings({ formData, onChange, onNext, sceneList, sceneLoad }; // 当前选中的场景对象 - const currentScene = sceneList.find(s => s.id === formData.scenario); + const currentScene = sceneList.find((s) => s.id === formData.scenario); + //打开订单 + const openOrder = + formData.scenario !== 2 ? { display: "none" } : { display: "block" }; + + const openPoster = + formData.scenario !== 1 ? { display: "none" } : { display: "block" }; return (
{/* 场景选择区块 */} {sceneLoading ? ( -
加载中...
+
加载中...
) : ( {sceneList.map((scene) => ( ))} @@ -419,19 +559,22 @@ export function BasicSettings({ formData, onChange, onNext, sceneList, sceneLoad className="w-full" type="text" value={formData.planName} - onChange={(e) => onChange({ ...formData, planName: String(e.target.value) })} + onChange={(e) => + onChange({ ...formData, planName: String(e.target.value) }) + } placeholder="请输入计划名称" />
+
获客标签(可多选)
{/* 标签选择区块 */} {formData.scenario && ( -
+
{(currentScene?.scenarioTags || []).map((tag: string) => ( handleScenarioTagToggle(tag)} style={{ marginBottom: 4 }} size="large" @@ -445,7 +588,9 @@ export function BasicSettings({ formData, onChange, onNext, sceneList, sceneLoad handleScenarioTagToggle(tag.id)} style={{ marginBottom: 4 }} closable @@ -470,129 +615,226 @@ export function BasicSettings({ formData, onChange, onNext, sceneList, sceneLoad />
-
- {/* 账号选择区块 */} -
- -
- {selectedAccounts.map((account: Account) => ( - handleRemoveAccount(account.id)} - > - {account.nickname} - - ))} -
- +
选择海报
+
-
选择账号
-
- {accounts.map((account) => ( -
handleAccountToggle(account)} - > - a.id === account.id)} - readOnly - style={{ marginRight: 8 }} - /> - {account.nickname} -
- ))} -
- -
-
- {/* 素材选择区块 */} -
- -
- {selectedMaterials.map((material: Material) => ( - handleRemoveMaterial(material.id)} - onClick={() => handlePreviewImage(material.preview)} - > - {material.name} - - ))} -
- -
选择素材
-
- {materials.map((material) => ( + {[...materials, ...customPosters].map((material) => { + const isSelected = selectedMaterials.some( + (m) => m.id === material.id + ); + const isCustom = material.id.startsWith("custom-"); + return (
handleMaterialSelect(material)} > - {material.name} - {material.name} -
- ))} -
-
+ {/* 预览按钮:自定义海报在左上,内置海报在右上 */} + + {/* 删除自定义海报按钮 */} + {isCustom && ( + + )} + {material.name} +
+ {material.name} +
+
+ ); + })} + {/* 添加海报卡片 */} +
uploadInputRef.current?.click()} + > + + + + + 添加海报 + { + const file = e.target.files?.[0]; + if (file) { + // 直接上传 + try { + const url = await ( + await import("@/api/upload") + ).uploadImage(file); + const newPoster = { + id: `custom-${Date.now()}`, + name: "自定义海报", + type: "poster", + preview: url, + }; + setCustomPosters((prev) => [...prev, newPoster]); + } catch (err) { + // 可加toast提示 + } + e.target.value = ""; + } + }} + /> +
+ + {/* 全屏图片预览 */} m.preview)} + images={previewUrl ? [previewUrl] : []} visible={isPreviewOpen} - onClose={handleImagePreviewClose} + onClose={() => { + setIsPreviewOpen(false); + setPreviewUrl(null); + }} index={0} /> - + {/* 订单导入区块 */} -
+
- -
导入订单
+ +
+ 导入订单 +
- + -
- {importedTags.length > 0 && ( +
+ {importedTags.length > 0 && ( )} - + {/* 电话获客设置区块,仅在选择电话获客场景时显示 */} - {formData.scenario === 'phone' && ( -
+ {formData.scenario === "phone" && ( +
@@ -611,39 +853,65 @@ export function BasicSettings({ formData, onChange, onNext, sceneList, sceneLoad visible={isPhoneSettingsOpen} onClose={handlePhoneSettingsDialogClose} > -
电话获客设置
-
-
+
+ 电话获客设置 +
+
+
自动加好友 - setPhoneSettings((s) => ({ ...s, autoAdd: v }))} - /> -
-
+ onChange={(v) => + setPhoneSettings((s) => ({ ...s, autoAdd: v })) + } + /> +
+
语音转文字 - setPhoneSettings((s) => ({ ...s, speechToText: v }))} - /> -
-
+ onChange={(v) => + setPhoneSettings((s) => ({ ...s, speechToText: v })) + } + /> +
+
问题提取 - setPhoneSettings((s) => ({ ...s, questionExtraction: v }))} - /> -
+ onChange={(v) => + setPhoneSettings((s) => ({ ...s, questionExtraction: v })) + } + /> +
-
- +
+ +
)} {/* 微信群设置区块,仅在选择微信群场景时显示 */} - {formData.scenario === 'weixinqun' && ( -
+ {formData.scenario === "weixinqun" && ( +
onChange({ ...formData, weixinqunName })} - /> -
+ /> +
onChange({ ...formData, weixinqunNotice })} - /> -
-
+ /> +
+ )} - + ); } diff --git a/nkebao/src/pages/workspace/moments-sync/MomentsSync.tsx b/nkebao/src/pages/workspace/moments-sync/MomentsSync.tsx index 064e0f91c..aa7ed1554 100644 --- a/nkebao/src/pages/workspace/moments-sync/MomentsSync.tsx +++ b/nkebao/src/pages/workspace/moments-sync/MomentsSync.tsx @@ -300,7 +300,7 @@ export default function MomentsSync() {
-
推送设备:{task.deviceCount} 个
+
推送设备:{task?.config?.devices.length||0} 个
内容库: