Spaces:
Running
Running
Add 2 files
Browse files- index.html +385 -16
- prompts.txt +3 -1
index.html
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
<script src="https://cdn.tailwindcss.com"></script>
|
8 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
9 |
<style>
|
10 |
-
/*
|
11 |
.custom-scrollbar::-webkit-scrollbar {
|
12 |
width: 6px;
|
13 |
}
|
@@ -23,7 +23,6 @@
|
|
23 |
background: #a0aec0;
|
24 |
}
|
25 |
|
26 |
-
/* 菜单项悬停效果 */
|
27 |
.menu-item {
|
28 |
transition: all 0.2s ease;
|
29 |
}
|
@@ -37,12 +36,10 @@
|
|
37 |
color: #2b6cb0;
|
38 |
}
|
39 |
|
40 |
-
/* 主内容区过渡效果 */
|
41 |
.main-content {
|
42 |
transition: margin-left 0.3s ease;
|
43 |
}
|
44 |
|
45 |
-
/* 响应式调整 */
|
46 |
@media (max-width: 768px) {
|
47 |
.sidebar {
|
48 |
transform: translateX(-100%);
|
@@ -61,7 +58,6 @@
|
|
61 |
}
|
62 |
}
|
63 |
|
64 |
-
/* 图标动画 */
|
65 |
@keyframes iconPulse {
|
66 |
0% { transform: scale(1); }
|
67 |
50% { transform: scale(1.1); }
|
@@ -71,7 +67,6 @@
|
|
71 |
animation: iconPulse 0.5s ease;
|
72 |
}
|
73 |
|
74 |
-
/* 仓库选择下拉菜单 */
|
75 |
.warehouse-dropdown {
|
76 |
position: relative;
|
77 |
display: inline-block;
|
@@ -103,7 +98,6 @@
|
|
103 |
color: #3182ce;
|
104 |
}
|
105 |
|
106 |
-
/* 产品表格样式 */
|
107 |
.product-table th {
|
108 |
background-color: #f8fafc;
|
109 |
font-weight: 600;
|
@@ -125,7 +119,6 @@
|
|
125 |
color: #d69e2e;
|
126 |
}
|
127 |
|
128 |
-
/* 分页样式 */
|
129 |
.pagination-btn {
|
130 |
transition: all 0.2s;
|
131 |
}
|
@@ -137,11 +130,10 @@
|
|
137 |
cursor: not-allowed;
|
138 |
}
|
139 |
|
140 |
-
/* 新增:确保内容区域填满剩余空间并与边框衔接 */
|
141 |
.content-container {
|
142 |
display: flex;
|
143 |
flex-direction: column;
|
144 |
-
height: calc(100vh - 64px);
|
145 |
}
|
146 |
.content-wrapper {
|
147 |
flex: 1;
|
@@ -153,7 +145,6 @@
|
|
153 |
flex: 1;
|
154 |
overflow: auto;
|
155 |
}
|
156 |
-
/* 修改主内容区样式 */
|
157 |
.main-content {
|
158 |
margin-left: 0;
|
159 |
padding: 0;
|
@@ -172,7 +163,6 @@
|
|
172 |
border-radius: 0;
|
173 |
}
|
174 |
|
175 |
-
/* 优化后的表格单元格对齐样式 */
|
176 |
.table-cell {
|
177 |
vertical-align: middle;
|
178 |
padding: 12px 16px;
|
@@ -206,7 +196,6 @@
|
|
206 |
width: 150px;
|
207 |
}
|
208 |
|
209 |
-
/* 产品图片样式 */
|
210 |
.product-image {
|
211 |
width: 40px;
|
212 |
height: 40px;
|
@@ -214,7 +203,6 @@
|
|
214 |
border-radius: 4px;
|
215 |
}
|
216 |
|
217 |
-
/* 状态标签统一大小 */
|
218 |
.status-badge {
|
219 |
display: inline-block;
|
220 |
padding: 4px 8px;
|
@@ -224,6 +212,156 @@
|
|
224 |
min-width: 60px;
|
225 |
text-align: center;
|
226 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
227 |
</style>
|
228 |
</head>
|
229 |
<body class="bg-gray-50 h-screen overflow-hidden">
|
@@ -356,7 +494,7 @@
|
|
356 |
<div class="flex flex-col md:flex-row md:items-center md:justify-between p-6 pb-0">
|
357 |
<h2 class="text-xl font-semibold text-gray-800 mb-4 md:mb-0">产品管理</h2>
|
358 |
<div class="flex space-x-3">
|
359 |
-
<button class="flex items-center px-4 py-2 bg-blue-500 hover:bg-blue-600 text-white rounded-lg transition-colors">
|
360 |
<i class="fas fa-plus mr-2"></i>
|
361 |
添加产品
|
362 |
</button>
|
@@ -506,7 +644,7 @@
|
|
506 |
<td class="table-cell table-cell-id">P10005</td>
|
507 |
<td class="table-cell table-cell-name">
|
508 |
<div class="flex items-center">
|
509 |
-
<img class="product
|
510 |
<div>
|
511 |
<div class="text-sm font-medium text-gray-900">运动水壶</div>
|
512 |
<div class="text-xs text-gray-500">型号: SB-2022</div>
|
@@ -622,6 +760,138 @@
|
|
622 |
</div>
|
623 |
</div>
|
624 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
625 |
<script>
|
626 |
// 移动端菜单切换
|
627 |
document.addEventListener('DOMContentLoaded', function() {
|
@@ -711,6 +981,105 @@
|
|
711 |
}, index * 50);
|
712 |
});
|
713 |
}, 100);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
714 |
});
|
715 |
</script>
|
716 |
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Sephiroth1984/system" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
|
|
7 |
<script src="https://cdn.tailwindcss.com"></script>
|
8 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
9 |
<style>
|
10 |
+
/* 之前的所有样式保持不变 */
|
11 |
.custom-scrollbar::-webkit-scrollbar {
|
12 |
width: 6px;
|
13 |
}
|
|
|
23 |
background: #a0aec0;
|
24 |
}
|
25 |
|
|
|
26 |
.menu-item {
|
27 |
transition: all 0.2s ease;
|
28 |
}
|
|
|
36 |
color: #2b6cb0;
|
37 |
}
|
38 |
|
|
|
39 |
.main-content {
|
40 |
transition: margin-left 0.3s ease;
|
41 |
}
|
42 |
|
|
|
43 |
@media (max-width: 768px) {
|
44 |
.sidebar {
|
45 |
transform: translateX(-100%);
|
|
|
58 |
}
|
59 |
}
|
60 |
|
|
|
61 |
@keyframes iconPulse {
|
62 |
0% { transform: scale(1); }
|
63 |
50% { transform: scale(1.1); }
|
|
|
67 |
animation: iconPulse 0.5s ease;
|
68 |
}
|
69 |
|
|
|
70 |
.warehouse-dropdown {
|
71 |
position: relative;
|
72 |
display: inline-block;
|
|
|
98 |
color: #3182ce;
|
99 |
}
|
100 |
|
|
|
101 |
.product-table th {
|
102 |
background-color: #f8fafc;
|
103 |
font-weight: 600;
|
|
|
119 |
color: #d69e2e;
|
120 |
}
|
121 |
|
|
|
122 |
.pagination-btn {
|
123 |
transition: all 0.2s;
|
124 |
}
|
|
|
130 |
cursor: not-allowed;
|
131 |
}
|
132 |
|
|
|
133 |
.content-container {
|
134 |
display: flex;
|
135 |
flex-direction: column;
|
136 |
+
height: calc(100vh - 64px);
|
137 |
}
|
138 |
.content-wrapper {
|
139 |
flex: 1;
|
|
|
145 |
flex: 1;
|
146 |
overflow: auto;
|
147 |
}
|
|
|
148 |
.main-content {
|
149 |
margin-left: 0;
|
150 |
padding: 0;
|
|
|
163 |
border-radius: 0;
|
164 |
}
|
165 |
|
|
|
166 |
.table-cell {
|
167 |
vertical-align: middle;
|
168 |
padding: 12px 16px;
|
|
|
196 |
width: 150px;
|
197 |
}
|
198 |
|
|
|
199 |
.product-image {
|
200 |
width: 40px;
|
201 |
height: 40px;
|
|
|
203 |
border-radius: 4px;
|
204 |
}
|
205 |
|
|
|
206 |
.status-badge {
|
207 |
display: inline-block;
|
208 |
padding: 4px 8px;
|
|
|
212 |
min-width: 60px;
|
213 |
text-align: center;
|
214 |
}
|
215 |
+
|
216 |
+
/* 新增:右侧抽屉样式 */
|
217 |
+
.drawer-overlay {
|
218 |
+
position: fixed;
|
219 |
+
top: 0;
|
220 |
+
left: 0;
|
221 |
+
right: 0;
|
222 |
+
bottom: 0;
|
223 |
+
background-color: rgba(0, 0, 0, 0.5);
|
224 |
+
z-index: 100;
|
225 |
+
opacity: 0;
|
226 |
+
visibility: hidden;
|
227 |
+
transition: all 0.3s ease;
|
228 |
+
}
|
229 |
+
|
230 |
+
.drawer-overlay.active {
|
231 |
+
opacity: 1;
|
232 |
+
visibility: visible;
|
233 |
+
}
|
234 |
+
|
235 |
+
.drawer {
|
236 |
+
position: fixed;
|
237 |
+
top: 0;
|
238 |
+
right: -75%;
|
239 |
+
width: 75%;
|
240 |
+
height: 100%;
|
241 |
+
background-color: white;
|
242 |
+
z-index: 101;
|
243 |
+
transition: all 0.3s ease;
|
244 |
+
box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
|
245 |
+
display: flex;
|
246 |
+
flex-direction: column;
|
247 |
+
}
|
248 |
+
|
249 |
+
.drawer.active {
|
250 |
+
right: 0;
|
251 |
+
}
|
252 |
+
|
253 |
+
.drawer-header {
|
254 |
+
padding: 1.5rem;
|
255 |
+
border-bottom: 1px solid #e2e8f0;
|
256 |
+
display: flex;
|
257 |
+
justify-content: space-between;
|
258 |
+
align-items: center;
|
259 |
+
}
|
260 |
+
|
261 |
+
.drawer-body {
|
262 |
+
flex: 1;
|
263 |
+
overflow-y: auto;
|
264 |
+
padding: 1.5rem;
|
265 |
+
}
|
266 |
+
|
267 |
+
.drawer-footer {
|
268 |
+
padding: 1.5rem;
|
269 |
+
border-top: 1px solid #e2e8f0;
|
270 |
+
display: flex;
|
271 |
+
justify-content: flex-end;
|
272 |
+
gap: 1rem;
|
273 |
+
}
|
274 |
+
|
275 |
+
/* 表单样式 */
|
276 |
+
.form-group {
|
277 |
+
margin-bottom: 1.5rem;
|
278 |
+
}
|
279 |
+
|
280 |
+
.form-label {
|
281 |
+
display: block;
|
282 |
+
margin-bottom: 0.5rem;
|
283 |
+
font-weight: 500;
|
284 |
+
color: #4a5568;
|
285 |
+
}
|
286 |
+
|
287 |
+
.form-control {
|
288 |
+
width: 100%;
|
289 |
+
padding: 0.5rem 0.75rem;
|
290 |
+
border: 1px solid #e2e8f0;
|
291 |
+
border-radius: 0.375rem;
|
292 |
+
transition: border-color 0.2s;
|
293 |
+
}
|
294 |
+
|
295 |
+
.form-control:focus {
|
296 |
+
outline: none;
|
297 |
+
border-color: #4299e1;
|
298 |
+
box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
|
299 |
+
}
|
300 |
+
|
301 |
+
.form-textarea {
|
302 |
+
min-height: 100px;
|
303 |
+
resize: vertical;
|
304 |
+
}
|
305 |
+
|
306 |
+
.form-grid {
|
307 |
+
display: grid;
|
308 |
+
grid-template-columns: repeat(2, 1fr);
|
309 |
+
gap: 1.5rem;
|
310 |
+
}
|
311 |
+
|
312 |
+
.form-full-width {
|
313 |
+
grid-column: span 2;
|
314 |
+
}
|
315 |
+
|
316 |
+
.image-upload {
|
317 |
+
border: 2px dashed #e2e8f0;
|
318 |
+
border-radius: 0.5rem;
|
319 |
+
padding: 2rem;
|
320 |
+
text-align: center;
|
321 |
+
cursor: pointer;
|
322 |
+
transition: all 0.2s;
|
323 |
+
}
|
324 |
+
|
325 |
+
.image-upload:hover {
|
326 |
+
border-color: #4299e1;
|
327 |
+
background-color: #f8fafc;
|
328 |
+
}
|
329 |
+
|
330 |
+
.image-preview {
|
331 |
+
display: flex;
|
332 |
+
flex-wrap: wrap;
|
333 |
+
gap: 1rem;
|
334 |
+
margin-top: 1rem;
|
335 |
+
}
|
336 |
+
|
337 |
+
.preview-item {
|
338 |
+
position: relative;
|
339 |
+
width: 80px;
|
340 |
+
height: 80px;
|
341 |
+
border-radius: 0.375rem;
|
342 |
+
overflow: hidden;
|
343 |
+
}
|
344 |
+
|
345 |
+
.preview-item img {
|
346 |
+
width: 100%;
|
347 |
+
height: 100%;
|
348 |
+
object-fit: cover;
|
349 |
+
}
|
350 |
+
|
351 |
+
.remove-image {
|
352 |
+
position: absolute;
|
353 |
+
top: 0.25rem;
|
354 |
+
right: 0.25rem;
|
355 |
+
background-color: rgba(0, 0, 0, 0.5);
|
356 |
+
color: white;
|
357 |
+
width: 1.5rem;
|
358 |
+
height: 1.5rem;
|
359 |
+
border-radius: 50%;
|
360 |
+
display: flex;
|
361 |
+
align-items: center;
|
362 |
+
justify-content: center;
|
363 |
+
cursor: pointer;
|
364 |
+
}
|
365 |
</style>
|
366 |
</head>
|
367 |
<body class="bg-gray-50 h-screen overflow-hidden">
|
|
|
494 |
<div class="flex flex-col md:flex-row md:items-center md:justify-between p-6 pb-0">
|
495 |
<h2 class="text-xl font-semibold text-gray-800 mb-4 md:mb-0">产品管理</h2>
|
496 |
<div class="flex space-x-3">
|
497 |
+
<button id="addProductBtn" class="flex items-center px-4 py-2 bg-blue-500 hover:bg-blue-600 text-white rounded-lg transition-colors">
|
498 |
<i class="fas fa-plus mr-2"></i>
|
499 |
添加产品
|
500 |
</button>
|
|
|
644 |
<td class="table-cell table-cell-id">P10005</td>
|
645 |
<td class="table-cell table-cell-name">
|
646 |
<div class="flex items-center">
|
647 |
+
<img class="product图像 mr-3" src="https://via.placeholder.com/40" alt="">
|
648 |
<div>
|
649 |
<div class="text-sm font-medium text-gray-900">运动水壶</div>
|
650 |
<div class="text-xs text-gray-500">型号: SB-2022</div>
|
|
|
760 |
</div>
|
761 |
</div>
|
762 |
|
763 |
+
<!-- 添加产品抽屉 -->
|
764 |
+
<div class="drawer-overlay" id="addProductOverlay"></div>
|
765 |
+
<div class="drawer" id="addProductDrawer">
|
766 |
+
<div class="drawer-header">
|
767 |
+
<h3 class="text-lg font-semibold text-gray-800">添加新产品</h3>
|
768 |
+
<button id="closeDrawerBtn" class="text-gray-400 hover:text-gray-500">
|
769 |
+
<i class="fas fa-times"></i>
|
770 |
+
</button>
|
771 |
+
</div>
|
772 |
+
|
773 |
+
<div class="drawer-body">
|
774 |
+
<form id="addProductForm">
|
775 |
+
<div class="form-grid">
|
776 |
+
<!-- 基本信息 -->
|
777 |
+
<div class="form-group form-full-width">
|
778 |
+
<label class="form-label">产品名称</label>
|
779 |
+
<input type="text" class="form-control" placeholder="输入产品名称" required>
|
780 |
+
</div>
|
781 |
+
|
782 |
+
<div class="form-group">
|
783 |
+
<label class="form-label">产品型号</label>
|
784 |
+
<input type="text" class="form-control" placeholder="输入产品型号" required>
|
785 |
+
</div>
|
786 |
+
|
787 |
+
<div class="form-group">
|
788 |
+
<label class="form-label">产品类别</label>
|
789 |
+
<select class="form-control" required>
|
790 |
+
<option value="">选择类别</option>
|
791 |
+
<option value="electronics">电子产品</option>
|
792 |
+
<option value="home">家居用品</option>
|
793 |
+
<option value="office">办公设备</option>
|
794 |
+
<option value="clothing">服装鞋帽</option>
|
795 |
+
</select>
|
796 |
+
</div>
|
797 |
+
|
798 |
+
<div class="form-group">
|
799 |
+
<label class="form-label">产品品牌</label>
|
800 |
+
<input type="text" class="form-control" placeholder="输入品牌名称">
|
801 |
+
</div>
|
802 |
+
|
803 |
+
<!-- 价格和库存 -->
|
804 |
+
<div class="form-group">
|
805 |
+
<label class="form-label">单价</label>
|
806 |
+
<div class="relative">
|
807 |
+
<span class="absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-500">¥</span>
|
808 |
+
<input type="number" class="form-control pl-8" placeholder="0.00" min="0" step="0.01" required>
|
809 |
+
</div>
|
810 |
+
</div>
|
811 |
+
|
812 |
+
<div class="form-group">
|
813 |
+
<label class="form-label">初始库存</label>
|
814 |
+
<input type="number" class="form-control" placeholder="0" min="0" required>
|
815 |
+
</div>
|
816 |
+
|
817 |
+
<!-- 状态和SKU -->
|
818 |
+
<div class="form-group">
|
819 |
+
<label class="form-label">产品状态</label>
|
820 |
+
<select class="form-control" required>
|
821 |
+
<option value="active">在售</option>
|
822 |
+
<option value="inactive">停售</option>
|
823 |
+
<option value="pending">待审核</option>
|
824 |
+
</select>
|
825 |
+
</div>
|
826 |
+
|
827 |
+
<div class="form-group">
|
828 |
+
<label class="form-label">SKU编码</label>
|
829 |
+
<input type="text" class="form-control" placeholder="自动生成" readonly>
|
830 |
+
</div>
|
831 |
+
|
832 |
+
<!-- 图片上传 -->
|
833 |
+
<div class="form-group form-full-width">
|
834 |
+
<label class="form-label">产品图片</label>
|
835 |
+
<div class="image-upload">
|
836 |
+
<div class="flex flex-col items-center justify-center">
|
837 |
+
<i class="fas fa-cloud-upload-alt text-3xl text-blue-500 mb-2"></i>
|
838 |
+
<p class="text-sm text-gray-600">拖放图片到此处或点击上传</p>
|
839 |
+
<p class="text-xs text-gray-400 mt-1">支持JPG, PNG格式,最大5MB</p>
|
840 |
+
</div>
|
841 |
+
<input type="file" id="productImages" class="hidden" accept="image/*" multiple>
|
842 |
+
</div>
|
843 |
+
<div class="image-preview" id="imagePreview"></div>
|
844 |
+
</div>
|
845 |
+
|
846 |
+
<!-- 产品描述 -->
|
847 |
+
<div class="form-group form-full-width">
|
848 |
+
<label class="form-label">产品描述</label>
|
849 |
+
<textarea class="form-control form-textarea" placeholder="输入产品详细描述..."></textarea>
|
850 |
+
</div>
|
851 |
+
|
852 |
+
<!-- 规格参数 -->
|
853 |
+
<div class="form-group form-full-width">
|
854 |
+
<label class="form-label">规格参数</label>
|
855 |
+
<div class="space-y-2">
|
856 |
+
<div class="flex space-x-2">
|
857 |
+
<input type="text" class="form-control flex-1" placeholder="参数名称">
|
858 |
+
<input type="text" class="form-control flex-1" placeholder="参数值">
|
859 |
+
<button type="button" class="px-3 py-1 bg-gray-100 hover:bg-gray-200 rounded">
|
860 |
+
<i class="fas fa-plus"></i>
|
861 |
+
</button>
|
862 |
+
</div>
|
863 |
+
<div class="border border-gray-200 rounded p-2">
|
864 |
+
<div class="flex justify-between items-center py-1 px-2 bg-gray-50 rounded">
|
865 |
+
<span class="text-sm">重量</span>
|
866 |
+
<span class="text-sm">500g</span>
|
867 |
+
<button type="button" class="text-red-400 hover:text-red-600">
|
868 |
+
<i class="fas fa-times"></i>
|
869 |
+
</button>
|
870 |
+
</div>
|
871 |
+
<div class="flex justify-between items-center py-1 px-2">
|
872 |
+
<span class="text-sm">尺寸</span>
|
873 |
+
<span class="text-sm">20x30x5cm</span>
|
874 |
+
<button type="button" class="text-red-400 hover:text-red-600">
|
875 |
+
<i class="fas fa-times"></i>
|
876 |
+
</button>
|
877 |
+
</div>
|
878 |
+
</div>
|
879 |
+
</div>
|
880 |
+
</div>
|
881 |
+
</div>
|
882 |
+
</form>
|
883 |
+
</div>
|
884 |
+
|
885 |
+
<div class="drawer-footer">
|
886 |
+
<button type="button" id="cancelAddBtn" class="px-4 py-2 border border-gray-300 rounded-lg hover:bg-gray-50">
|
887 |
+
取消
|
888 |
+
</button>
|
889 |
+
<button type="submit" form="addProductForm" class="px-4 py-2 bg-blue-500 hover:bg-blue-600 text-white rounded-lg">
|
890 |
+
保存产品
|
891 |
+
</button>
|
892 |
+
</div>
|
893 |
+
</div>
|
894 |
+
|
895 |
<script>
|
896 |
// 移动端菜单切换
|
897 |
document.addEventListener('DOMContentLoaded', function() {
|
|
|
981 |
}, index * 50);
|
982 |
});
|
983 |
}, 100);
|
984 |
+
|
985 |
+
// 添加产品抽屉功能
|
986 |
+
const addProductBtn = document.getElementById('addProductBtn');
|
987 |
+
const addProductOverlay = document.getElementById('addProductOverlay');
|
988 |
+
const addProductDrawer = document.getElementById('addProductDrawer');
|
989 |
+
const closeDrawerBtn = document.getElementById('closeDrawerBtn');
|
990 |
+
const cancelAddBtn = document.getElementById('cancelAddBtn');
|
991 |
+
|
992 |
+
// 打开抽屉
|
993 |
+
addProductBtn.addEventListener('click', function() {
|
994 |
+
addProductOverlay.classList.add('active');
|
995 |
+
addProductDrawer.classList.add('active');
|
996 |
+
document.body.style.overflow = 'hidden';
|
997 |
+
});
|
998 |
+
|
999 |
+
// 关闭抽屉
|
1000 |
+
function closeDrawer() {
|
1001 |
+
addProductOverlay.classList.remove('active');
|
1002 |
+
addProductDrawer.classList.remove('active');
|
1003 |
+
document.body.style.overflow = '';
|
1004 |
+
}
|
1005 |
+
|
1006 |
+
closeDrawerBtn.addEventListener('click', closeDrawer);
|
1007 |
+
cancelAddBtn.addEventListener('click', closeDrawer);
|
1008 |
+
addProductOverlay.addEventListener('click', closeDrawer);
|
1009 |
+
|
1010 |
+
// 图片上传预览功能
|
1011 |
+
const imageUpload = document.querySelector('.image-upload');
|
1012 |
+
const productImages = document.getElementById('productImages');
|
1013 |
+
const imagePreview = document.getElementById('imagePreview');
|
1014 |
+
|
1015 |
+
imageUpload.addEventListener('click', function() {
|
1016 |
+
productImages.click();
|
1017 |
+
});
|
1018 |
+
|
1019 |
+
productImages.addEventListener('change', function(e) {
|
1020 |
+
const files = e.target.files;
|
1021 |
+
imagePreview.innerHTML = '';
|
1022 |
+
|
1023 |
+
if (files) {
|
1024 |
+
Array.from(files).forEach(file => {
|
1025 |
+
if (file.type.match('image.*')) {
|
1026 |
+
const reader = new FileReader();
|
1027 |
+
|
1028 |
+
reader.onload = function(e) {
|
1029 |
+
const previewItem = document.createElement('div');
|
1030 |
+
previewItem.className = 'preview-item';
|
1031 |
+
|
1032 |
+
const img = document.createElement('img');
|
1033 |
+
img.src = e.target.result;
|
1034 |
+
|
1035 |
+
const removeBtn = document.createElement('div');
|
1036 |
+
removeBtn.className = 'remove-image';
|
1037 |
+
removeBtn.innerHTML = '<i class="fas fa-times text-xs"></i>';
|
1038 |
+
removeBtn.addEventListener('click', function(e) {
|
1039 |
+
e.stopPropagation();
|
1040 |
+
previewItem.remove();
|
1041 |
+
});
|
1042 |
+
|
1043 |
+
previewItem.appendChild(img);
|
1044 |
+
previewItem.appendChild(removeBtn);
|
1045 |
+
imagePreview.appendChild(previewItem);
|
1046 |
+
};
|
1047 |
+
|
1048 |
+
reader.readAsDataURL(file);
|
1049 |
+
}
|
1050 |
+
});
|
1051 |
+
}
|
1052 |
+
});
|
1053 |
+
|
1054 |
+
// 拖放上传功能
|
1055 |
+
imageUpload.addEventListener('dragover', function(e) {
|
1056 |
+
e.preventDefault();
|
1057 |
+
this.classList.add('border-blue-500', 'bg-blue-50');
|
1058 |
+
});
|
1059 |
+
|
1060 |
+
imageUpload.addEventListener('dragleave', function() {
|
1061 |
+
this.classList.remove('border-blue-500', 'bg-blue-50');
|
1062 |
+
});
|
1063 |
+
|
1064 |
+
imageUpload.addEventListener('drop', function(e) {
|
1065 |
+
e.preventDefault();
|
1066 |
+
this.classList.remove('border-blue-500', 'bg-blue-50');
|
1067 |
+
|
1068 |
+
const files = e.dataTransfer.files;
|
1069 |
+
productImages.files = files;
|
1070 |
+
|
1071 |
+
// 触发change事件
|
1072 |
+
const event = new Event('change');
|
1073 |
+
productImages.dispatchEvent(event);
|
1074 |
+
});
|
1075 |
+
|
1076 |
+
// 表单提交
|
1077 |
+
document.getElementById('addProductForm').addEventListener('submit', function(e) {
|
1078 |
+
e.preventDefault();
|
1079 |
+
// 这里可以添加表单提交逻辑
|
1080 |
+
alert('产品添加成功!');
|
1081 |
+
closeDrawer();
|
1082 |
+
});
|
1083 |
});
|
1084 |
</script>
|
1085 |
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Sephiroth1984/system" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
prompts.txt
CHANGED
@@ -5,4 +5,6 @@
|
|
5 |
请将产品管理菜单栏右边的展示区域中的页面内容展示宽度左侧与菜单栏边框衔接,上面与顶部信息栏边框衔接
|
6 |
请将产品管理详情页中的所有字段进行排列对齐,其余设计不变
|
7 |
请将产品管理页中的字段进行对齐调整,其余设计不变
|
8 |
-
请调整并对齐产品管理页面中的字段及展示的内容信息
|
|
|
|
|
|
5 |
请将产品管理菜单栏右边的展示区域中的页面内容展示宽度左侧与菜单栏边框衔接,上面与顶部信息栏边框衔接
|
6 |
请将产品管理详情页中的所有字段进行排列对齐,其余设计不变
|
7 |
请将产品管理页中的字段进行对齐调整,其余设计不变
|
8 |
+
请调整并对齐产品管理页面中的字段及展示的内容信息
|
9 |
+
请生成产品管理界面中的添加产品功能
|
10 |
+
请帮我设计添加产品页面,点击添加产品,弹出弹框,弹框采用右侧抽屉弹出,弹框宽度占产品管理显示内容的四分之三,弹框中展示添加产品详情页。其余设计不变
|