更新環境變數,將 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=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=存客宝
|
||||||
|
|||||||
@@ -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=存客宝
|
||||||
|
|||||||
18
Cunkebao/dist/.vite/manifest.json
vendored
18
Cunkebao/dist/.vite/manifest.json
vendored
@@ -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"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
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>
|
</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>
|
||||||
|
|||||||
@@ -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) {
|
||||||
// 编辑:拼接后端需要的完整参数
|
// 编辑:拼接后端需要的完整参数
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user