超级老白兔
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=https://ckbapi.quwanzhi.com
VITE_API_BASE_URL=http://www.yishi.com
# VITE_API_BASE_URL=https://ckbapi.quwanzhi.com
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=存客宝

View File

@@ -6,8 +6,12 @@
"_vendor-2vc8h_ct.js"
]
},
"_ui-BzcYqnYX.js": {
"file": "assets/ui-BzcYqnYX.js",
"_ui-D0C0OGrH.css": {
"file": "assets/ui-D0C0OGrH.css",
"src": "_ui-D0C0OGrH.css"
},
"_ui-DE3rfvO3.js": {
"file": "assets/ui-DE3rfvO3.js",
"name": "ui",
"imports": [
"_vendor-2vc8h_ct.js"
@@ -16,10 +20,6 @@
"assets/ui-D0C0OGrH.css"
]
},
"_ui-D0C0OGrH.css": {
"file": "assets/ui-D0C0OGrH.css",
"src": "_ui-D0C0OGrH.css"
},
"_utils-BEiZ4iZ8.js": {
"file": "assets/utils-BEiZ4iZ8.js",
"name": "utils",
@@ -32,18 +32,18 @@
"name": "vendor"
},
"index.html": {
"file": "assets/index-CsnC1RX4.js",
"file": "assets/index-D1UOlQE0.js",
"name": "index",
"src": "index.html",
"isEntry": true,
"imports": [
"_vendor-2vc8h_ct.js",
"_ui-BzcYqnYX.js",
"_ui-DE3rfvO3.js",
"_utils-BEiZ4iZ8.js",
"_charts-fIK39zKn.js"
],
"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>
<!-- 引入 uni-app web-view SDK必须 -->
<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/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/charts-fIK39zKn.js">
<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>
<body>
<div id="root"></div>

View File

@@ -29,6 +29,7 @@ interface FormData {
scenario: number;
posters: any[]; // 后续可替换为具体Poster类型
device: string[];
customTags: string[];
remarkType: string;
greeting: string;
addInterval: number;
@@ -50,6 +51,7 @@ export default function NewPlan() {
scenario: 1,
posters: [],
device: [],
customTags: [],
remarkType: "phone",
greeting: "你好,请通过",
addInterval: 1,
@@ -126,6 +128,23 @@ export default function NewPlan() {
// 处理保存
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 {
if (isEdit && planId) {
// 编辑:拼接后端需要的完整参数

View File

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