超级老白兔
2025-08-12 11:33:55 +08:00
parent 1750dc13eb
commit faf8a6e234
9 changed files with 50 additions and 529 deletions

View File

@@ -1,4 +1,4 @@
# 基础环境变量示例 # 基础环境变量示例
# VITE_API_BASE_URL=http://www.yishi.com VITE_API_BASE_URL=http://www.yishi.com
VITE_API_BASE_URL=https://ckbapi.quwanzhi.com # VITE_API_BASE_URL=https://ckbapi.quwanzhi.com
VITE_APP_TITLE=存客宝 VITE_APP_TITLE=存客宝

View File

@@ -1,3 +1,4 @@
# 基础环境变量示例 # 基础环境变量示例
VITE_API_BASE_URL=https://ckbapi.quwanzhi.com # VITE_API_BASE_URL=https://ckbapi.quwanzhi.com
VITE_API_BASE_URL=http://www.yishi.com
VITE_APP_TITLE=存客宝 VITE_APP_TITLE=存客宝

View File

@@ -6,8 +6,12 @@
"_vendor-2vc8h_ct.js" "_vendor-2vc8h_ct.js"
] ]
}, },
"_ui-BzcYqnYX.js": { "_ui-D0C0OGrH.css": {
"file": "assets/ui-BzcYqnYX.js", "file": "assets/ui-D0C0OGrH.css",
"src": "_ui-D0C0OGrH.css"
},
"_ui-DE3rfvO3.js": {
"file": "assets/ui-DE3rfvO3.js",
"name": "ui", "name": "ui",
"imports": [ "imports": [
"_vendor-2vc8h_ct.js" "_vendor-2vc8h_ct.js"
@@ -16,10 +20,6 @@
"assets/ui-D0C0OGrH.css" "assets/ui-D0C0OGrH.css"
] ]
}, },
"_ui-D0C0OGrH.css": {
"file": "assets/ui-D0C0OGrH.css",
"src": "_ui-D0C0OGrH.css"
},
"_utils-BEiZ4iZ8.js": { "_utils-BEiZ4iZ8.js": {
"file": "assets/utils-BEiZ4iZ8.js", "file": "assets/utils-BEiZ4iZ8.js",
"name": "utils", "name": "utils",
@@ -32,18 +32,18 @@
"name": "vendor" "name": "vendor"
}, },
"index.html": { "index.html": {
"file": "assets/index-CsnC1RX4.js", "file": "assets/index-D1UOlQE0.js",
"name": "index", "name": "index",
"src": "index.html", "src": "index.html",
"isEntry": true, "isEntry": true,
"imports": [ "imports": [
"_vendor-2vc8h_ct.js", "_vendor-2vc8h_ct.js",
"_ui-BzcYqnYX.js", "_ui-DE3rfvO3.js",
"_utils-BEiZ4iZ8.js", "_utils-BEiZ4iZ8.js",
"_charts-fIK39zKn.js" "_charts-fIK39zKn.js"
], ],
"css": [ "css": [
"assets/index-CrTfgZBT.css" "assets/index-H_tfbIxK.css"
] ]
} }
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -11,13 +11,13 @@
</style> </style>
<!-- 引入 uni-app web-view SDK必须 --> <!-- 引入 uni-app web-view SDK必须 -->
<script type="text/javascript" src="./websdk.js"></script> <script type="text/javascript" src="./websdk.js"></script>
<script type="module" crossorigin src="/assets/index-CsnC1RX4.js"></script> <script type="module" crossorigin src="/assets/index-D1UOlQE0.js"></script>
<link rel="modulepreload" crossorigin href="/assets/vendor-2vc8h_ct.js"> <link rel="modulepreload" crossorigin href="/assets/vendor-2vc8h_ct.js">
<link rel="modulepreload" crossorigin href="/assets/ui-BzcYqnYX.js"> <link rel="modulepreload" crossorigin href="/assets/ui-DE3rfvO3.js">
<link rel="modulepreload" crossorigin href="/assets/utils-BEiZ4iZ8.js"> <link rel="modulepreload" crossorigin href="/assets/utils-BEiZ4iZ8.js">
<link rel="modulepreload" crossorigin href="/assets/charts-fIK39zKn.js"> <link rel="modulepreload" crossorigin href="/assets/charts-fIK39zKn.js">
<link rel="stylesheet" crossorigin href="/assets/ui-D0C0OGrH.css"> <link rel="stylesheet" crossorigin href="/assets/ui-D0C0OGrH.css">
<link rel="stylesheet" crossorigin href="/assets/index-CrTfgZBT.css"> <link rel="stylesheet" crossorigin href="/assets/index-H_tfbIxK.css">
</head> </head>
<body> <body>
<div id="root"></div> <div id="root"></div>

View File

@@ -29,6 +29,7 @@ interface FormData {
scenario: number; scenario: number;
posters: any[]; // 后续可替换为具体Poster类型 posters: any[]; // 后续可替换为具体Poster类型
device: string[]; device: string[];
customTags: string[];
remarkType: string; remarkType: string;
greeting: string; greeting: string;
addInterval: number; addInterval: number;
@@ -50,6 +51,7 @@ export default function NewPlan() {
scenario: 1, scenario: 1,
posters: [], posters: [],
device: [], device: [],
customTags: [],
remarkType: "phone", remarkType: "phone",
greeting: "你好,请通过", greeting: "你好,请通过",
addInterval: 1, addInterval: 1,
@@ -126,6 +128,23 @@ export default function NewPlan() {
// 处理保存 // 处理保存
const handleSave = async () => { const handleSave = async () => {
if (isEdit && planId) {
// 编辑:拼接后端需要的完整参数
const editData = {
...formData,
...{ sceneId: Number(formData.scenario) },
id: Number(planId),
planId: Number(planId),
};
console.log("editData", editData);
} else {
// 新建
formData.sceneId = Number(formData.scenario);
console.log("formData", formData);
}
};
// 处理保存
const handleSave2 = async () => {
try { try {
if (isEdit && planId) { if (isEdit && planId) {
// 编辑:拼接后端需要的完整参数 // 编辑:拼接后端需要的完整参数

View File

@@ -51,7 +51,9 @@ const BasicSettings: React.FC<BasicSettingsProps> = ({
// 自定义标签相关状态 // 自定义标签相关状态
const [customTagInput, setCustomTagInput] = useState(""); const [customTagInput, setCustomTagInput] = useState("");
const [customTags, setCustomTags] = useState(formData.customTags || []); const [customTags, setCustomTags] = useState<string[]>(
formData.customTags || [],
);
const [tips, setTips] = useState(formData.tips || ""); const [tips, setTips] = useState(formData.tips || "");
const [selectedScenarioTags, setSelectedScenarioTags] = useState( const [selectedScenarioTags, setSelectedScenarioTags] = useState(
formData.scenarioTags || [], formData.scenarioTags || [],
@@ -107,10 +109,7 @@ const BasicSettings: React.FC<BasicSettingsProps> = ({
// 添加自定义标签 // 添加自定义标签
const handleAddCustomTag = () => { const handleAddCustomTag = () => {
if (!customTagInput.trim()) return; if (!customTagInput.trim()) return;
const newTag = { const newTag = customTagInput.trim();
id: `custom-${Date.now()}`,
name: customTagInput.trim(),
};
const updatedCustomTags = [...customTags, newTag]; const updatedCustomTags = [...customTags, newTag];
setCustomTags(updatedCustomTags); setCustomTags(updatedCustomTags);
setCustomTagInput(""); setCustomTagInput("");
@@ -118,13 +117,15 @@ const BasicSettings: React.FC<BasicSettingsProps> = ({
}; };
// 删除自定义标签 // 删除自定义标签
const handleRemoveCustomTag = (tagId: string) => { const handleRemoveCustomTag = (tagName: string) => {
const updatedCustomTags = customTags.filter((tag: any) => tag.id !== tagId); const updatedCustomTags = customTags.filter(
(tag: string) => tag !== tagName,
);
setCustomTags(updatedCustomTags); setCustomTags(updatedCustomTags);
onChange({ ...formData, customTags: updatedCustomTags }); onChange({ ...formData, customTags: updatedCustomTags });
// 同时从选中标签中移除 // 同时从选中标签中移除
const updatedSelectedTags = selectedScenarioTags.filter( const updatedSelectedTags = selectedScenarioTags.filter(
(t: string) => t !== tagId, (t: string) => t !== tagName,
); );
setSelectedScenarioTags(updatedSelectedTags); setSelectedScenarioTags(updatedSelectedTags);
onChange({ onChange({
@@ -134,19 +135,6 @@ const BasicSettings: React.FC<BasicSettingsProps> = ({
}); });
}; };
// 新增:自定义上传图片
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) => { const handleRemoveCustomPoster = (id: string) => {
setCustomPosters(prev => prev.filter(p => p.id !== id)); setCustomPosters(prev => prev.filter(p => p.id !== id));
@@ -169,12 +157,6 @@ const BasicSettings: React.FC<BasicSettingsProps> = ({
} }
}; };
// 移除已选素材
const handleRemoveMaterial = (id: string) => {
setSelectedMaterials([]);
onChange({ ...formData, materials: [] });
};
// 新增:全屏预览 // 新增:全屏预览
const handlePreviewImage = (url: string) => { const handlePreviewImage = (url: string) => {
setPreviewUrl(url); setPreviewUrl(url);
@@ -266,16 +248,16 @@ const BasicSettings: React.FC<BasicSettingsProps> = ({
</Tag> </Tag>
))} ))}
{/* 自定义标签 */} {/* 自定义标签 */}
{customTags.map((tag: any) => ( {customTags.map((tag: string) => (
<Tag <Tag
key={tag.id} key={tag}
color={selectedScenarioTags.includes(tag.id) ? "blue" : "default"} color={selectedScenarioTags.includes(tag) ? "blue" : "default"}
onClick={() => handleScenarioTagToggle(tag.id)} onClick={() => handleScenarioTagToggle(tag)}
closable closable
onClose={() => handleRemoveCustomTag(tag.id)} onClose={() => handleRemoveCustomTag(tag)}
className={styles["basic-tag-item"]} className={styles["basic-tag-item"]}
> >
{tag.name} {tag}
</Tag> </Tag>
))} ))}
</div> </div>