更新環境變數,將 API 基礎 URL 更改為 http://www.yishi.com,並調整前端資源引用的版本號。同時在新計劃頁面中新增自定義標籤功能,並優化相關邏輯。
This commit is contained in:
@@ -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=存客宝
|
||||
|
||||
@@ -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=存客宝
|
||||
|
||||
18
Cunkebao/dist/.vite/manifest.json
vendored
18
Cunkebao/dist/.vite/manifest.json
vendored
@@ -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"
|
||||
]
|
||||
}
|
||||
}
|
||||
1
Cunkebao/dist/assets/index-CrTfgZBT.css
vendored
1
Cunkebao/dist/assets/index-CrTfgZBT.css
vendored
File diff suppressed because one or more lines are too long
79
Cunkebao/dist/assets/index-CsnC1RX4.js
vendored
79
Cunkebao/dist/assets/index-CsnC1RX4.js
vendored
File diff suppressed because one or more lines are too long
401
Cunkebao/dist/assets/ui-BzcYqnYX.js
vendored
401
Cunkebao/dist/assets/ui-BzcYqnYX.js
vendored
File diff suppressed because one or more lines are too long
6
Cunkebao/dist/index.html
vendored
6
Cunkebao/dist/index.html
vendored
@@ -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>
|
||||
|
||||
@@ -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) {
|
||||
// 编辑:拼接后端需要的完整参数
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user