@appthen/cli 1.2.11 → 1.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/main.js +47 -0
- package/dist/index.js +6165 -14980
- package/package.json +8 -1
- package/tests/test-app/.appthen/shadow-space-100001-test-app-e99876b1.json +1197 -741
- package/tests/test-app/.appthen/space-config.json +2 -2
- package/tests/test-app/src/components/MessageCenter.tsx +506 -0
- package/tests/test-app/src/pages/CustomerManagement.tsx +535 -0
- package/tests/test-app/src/pages/CyberpunkDashboard.tsx +348 -0
- package/tests/test-app/src/pages/CyberpunkProductManagement.tsx +637 -0
- package/tests/test-app/src/pages/CyberpunkUserList.tsx +316 -0
- package/tests/test-app/src/pages/DashboardV2.tsx +334 -0
- package/tests/test-app/src/pages/DataReport.tsx +298 -0
- package/tests/test-app/src/pages/DataStatistics.tsx +317 -0
- package/tests/test-app/src/pages/DepartmentManagement.tsx +503 -0
- package/tests/test-app/src/pages/FileExplorer.tsx +441 -0
- package/tests/test-app/src/pages/OrderDetail.tsx +393 -0
- package/tests/test-app/src/pages/ProductManagement.tsx +521 -0
- package/tests/test-app/src/pages/ProjectTimeline.tsx +395 -0
- package/tests/test-app/src/pages/RoleManagement.tsx +523 -0
- package/tests/test-app/src/pages/StaticCyberpunkDashboard.tsx +462 -0
- package/tests/test-app/src/pages/StaticCyberpunkUserList.tsx +567 -0
- package/tests/test-app/src/pages/StudentWeaknessList.tsx +547 -0
- package/tests/test-app/src/pages/SystemSettings.tsx +422 -0
- package/tests/test-app/src/pages/TaskManagement.tsx +467 -0
- package/tests/test-app/src/pages/TicketManagement.tsx +402 -0
- package/tests/test-app/src/pages/UserProfile.tsx +404 -0
- package/tests/test-app/src/pages/WorkflowDesigner.tsx +434 -0
- package/tests/test-app/src/pages/admin/dashboard.tsx +591 -0
- package/tests/test-app/src/pages/article-list.tsx +222 -0
- package/tests/test-app/src/pages/babyProductRecommendationPage.tsx +168 -0
- package/tests/test-app/src/pages/category-list.tsx +179 -0
- package/tests/test-app/src/pages/comment-list.tsx +194 -0
- package/tests/test-app/src/pages/cyberpunk/cyberpunkCRMPage.tsx +1299 -0
- package/tests/test-app/src/pages/data-analytics.tsx +1872 -0
- package/tests/test-app/src/pages/data-overview.tsx +600 -0
- package/tests/test-app/src/pages/demo-error-page.tsx +119 -0
- package/tests/test-app/src/pages/department-list.tsx +183 -0
- package/tests/test-app/src/pages/goods-list.tsx +233 -0
- package/tests/test-app/src/pages/housekeeping/adminDashboardPage.tsx +880 -0
- package/tests/test-app/src/pages/mobile_terminal/uiHandsOnPractice.tsx +1 -1
- package/tests/test-app/src/pages/notice-list.tsx +217 -0
- package/tests/test-app/src/pages/order-detail.tsx +330 -0
- package/tests/test-app/src/pages/order-list.tsx +195 -0
- package/tests/test-app/src/pages/order-management.tsx +563 -0
- package/tests/test-app/src/pages/page/OrderList.tsx +230 -0
- package/tests/test-app/src/pages/role-list.tsx +184 -0
- package/tests/test-app/src/pages/simple/simplePage.tsx +92 -0
- package/tests/test-app/src/pages/simple-page.tsx +43 -0
- package/tests/test-app/src/pages/test-destructure.tsx +44 -0
- package/tests/test-app/src/pages/test-error-page.tsx +75 -0
- package/tests/test-app/src/pages/test-page-with-errors.tsx +51 -0
- package/tests/test-app/src/pages/test-page.tsx +101 -0
- package/tests/test-app/src/pages/test-render.tsx +52 -0
- package/tests/test-app/src/pages/test-return-type.tsx +41 -0
- package/tests/test-app/src/pages/test-type-assertion.tsx +37 -0
- package/tests/test-app/src/pages/ui/styleSelectorPage.tsx +1554 -0
- package/tests/test-app/src/pages/user-list.tsx +212 -0
- package/tests/test-app/src/pages/wrong-page.tsx +50 -0
- package/tests/test-app/.appthen/shadow-space-unknown-user-test-app-e99876b1.json +0 -1060
|
@@ -0,0 +1,637 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 赛博朋克产品管理
|
|
3
|
+
* 充满未来科技感的产品管理页面,采用全息卡片和霓虹效果
|
|
4
|
+
*
|
|
5
|
+
* @type Page
|
|
6
|
+
* @route /cyberpunk-product-management
|
|
7
|
+
* @screen 1920x1080 #0a0a0f
|
|
8
|
+
* @frames web
|
|
9
|
+
*/
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import { Button, Image, Text, View } from '@appthen/react';
|
|
12
|
+
import { Input, Select, Space, Tag } from '@appthen/antd';
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class IProps {
|
|
16
|
+
title?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/*
|
|
20
|
+
* 数据与接口请求定义
|
|
21
|
+
*/
|
|
22
|
+
class IState {
|
|
23
|
+
products?: {
|
|
24
|
+
/* @example 1 */id?: number,
|
|
25
|
+
/* @example 神经植入体 V7 */name?: string,
|
|
26
|
+
/* @example implants */category?: string,
|
|
27
|
+
/* @example 8999 */price?: number,
|
|
28
|
+
/* @example 42 */stock?: number,
|
|
29
|
+
/* @example available */status?: string,
|
|
30
|
+
/* @example 4.8 */rating?: number,
|
|
31
|
+
/* @example https://via.placeholder.com/200x200/00ffff/000000?text=NEURAL */image?: string,
|
|
32
|
+
/* @example 最新一代神经接口,支持直接脑机连接 */description?: string,
|
|
33
|
+
features?: string[],
|
|
34
|
+
}[];
|
|
35
|
+
filteredProducts?: string[];
|
|
36
|
+
selectedCategory?: string;
|
|
37
|
+
searchKeyword?: string;
|
|
38
|
+
selectedProduct?: any;
|
|
39
|
+
modalVisible?: boolean;
|
|
40
|
+
viewMode?: string;
|
|
41
|
+
sortBy?: string;
|
|
42
|
+
hologramMode?: boolean;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
class Document extends React.Component<IProps, IState> {
|
|
46
|
+
state = {
|
|
47
|
+
products: [
|
|
48
|
+
{
|
|
49
|
+
id: 1,
|
|
50
|
+
name: '神经植入体 V7',
|
|
51
|
+
category: 'implants',
|
|
52
|
+
price: 8999,
|
|
53
|
+
stock: 42,
|
|
54
|
+
status: 'available',
|
|
55
|
+
rating: 4.8,
|
|
56
|
+
image: 'https://via.placeholder.com/200x200/00ffff/000000?text=NEURAL',
|
|
57
|
+
description: '最新一代神经接口,支持直接脑机连接',
|
|
58
|
+
features: ['低延迟', '高带宽', '自适应'],
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
id: 2,
|
|
62
|
+
name: '量子处理器核心',
|
|
63
|
+
category: 'hardware',
|
|
64
|
+
price: 15999,
|
|
65
|
+
stock: 18,
|
|
66
|
+
status: 'limited',
|
|
67
|
+
rating: 4.9,
|
|
68
|
+
image: 'https://via.placeholder.com/200x200/ff00ff/000000?text=QUANTUM',
|
|
69
|
+
description: '突破性的量子计算单元,算力提升1000倍',
|
|
70
|
+
features: ['超导', '稳定', '可扩展'],
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: 3,
|
|
74
|
+
name: '全息投影仪',
|
|
75
|
+
category: 'devices',
|
|
76
|
+
price: 4999,
|
|
77
|
+
stock: 67,
|
|
78
|
+
status: 'available',
|
|
79
|
+
rating: 4.5,
|
|
80
|
+
image:
|
|
81
|
+
'https://via.placeholder.com/200x200/00ff88/000000?text=HOLOGRAM',
|
|
82
|
+
description: '8K 分辨率全息投影,支持360度观看',
|
|
83
|
+
features: ['8K', '360°', '触控'],
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
id: 4,
|
|
87
|
+
name: '纳米修复机器人',
|
|
88
|
+
category: 'medical',
|
|
89
|
+
price: 24999,
|
|
90
|
+
stock: 8,
|
|
91
|
+
status: 'limited',
|
|
92
|
+
rating: 4.7,
|
|
93
|
+
image: 'https://via.placeholder.com/200x200/ffaa00/000000?text=NANO',
|
|
94
|
+
description: '智能纳米机器人,快速修复细胞损伤',
|
|
95
|
+
features: ['精准', '快速', '安全'],
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
id: 5,
|
|
99
|
+
name: '反重力推进器',
|
|
100
|
+
category: 'vehicles',
|
|
101
|
+
price: 49999,
|
|
102
|
+
stock: 3,
|
|
103
|
+
status: 'rare',
|
|
104
|
+
rating: 5,
|
|
105
|
+
image: 'https://via.placeholder.com/200x200/ff0055/000000?text=GRAVITY',
|
|
106
|
+
description: '个人飞行装置,最高时速500km/h',
|
|
107
|
+
features: ['静音', '高效', '稳定'],
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
id: 6,
|
|
111
|
+
name: '记忆芯片 1PB',
|
|
112
|
+
category: 'storage',
|
|
113
|
+
price: 2999,
|
|
114
|
+
stock: 156,
|
|
115
|
+
status: 'available',
|
|
116
|
+
rating: 4.3,
|
|
117
|
+
image: 'https://via.placeholder.com/200x200/00ffff/000000?text=MEMORY',
|
|
118
|
+
description: '超高密度存储,可保存整个人类记忆',
|
|
119
|
+
features: ['1PB', '快速', '加密'],
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
id: 7,
|
|
123
|
+
name: '能量护盾发生器',
|
|
124
|
+
category: 'defense',
|
|
125
|
+
price: 12999,
|
|
126
|
+
stock: 24,
|
|
127
|
+
status: 'available',
|
|
128
|
+
rating: 4.6,
|
|
129
|
+
image: 'https://via.placeholder.com/200x200/ff00ff/000000?text=SHIELD',
|
|
130
|
+
description: '便携式能量护盾,可抵御物理和能量攻击',
|
|
131
|
+
features: ['轻便', '强效', '持久'],
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
id: 8,
|
|
135
|
+
name: 'AI 助手核心',
|
|
136
|
+
category: 'software',
|
|
137
|
+
price: 7999,
|
|
138
|
+
stock: 89,
|
|
139
|
+
status: 'available',
|
|
140
|
+
rating: 4.4,
|
|
141
|
+
image: 'https://via.placeholder.com/200x200/00ff88/000000?text=AI',
|
|
142
|
+
description: '个人AI助手,全天候智能服务',
|
|
143
|
+
features: ['学习', '推理', '创造'],
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
id: 9,
|
|
147
|
+
name: '隐形迷彩服',
|
|
148
|
+
category: 'clothing',
|
|
149
|
+
price: 6999,
|
|
150
|
+
stock: 31,
|
|
151
|
+
status: 'limited',
|
|
152
|
+
rating: 4.5,
|
|
153
|
+
image: 'https://via.placeholder.com/200x200/ffaa00/000000?text=CLOAK',
|
|
154
|
+
description: '光学隐形技术,完全融入环境',
|
|
155
|
+
features: ['隐形', '透气', '耐用'],
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
id: 10,
|
|
159
|
+
name: '时间扭曲器',
|
|
160
|
+
category: 'experimental',
|
|
161
|
+
price: 99999,
|
|
162
|
+
stock: 1,
|
|
163
|
+
status: 'rare',
|
|
164
|
+
rating: 5,
|
|
165
|
+
image: 'https://via.placeholder.com/200x200/ff0055/000000?text=TIME',
|
|
166
|
+
description: '实验性时间操控设备,慎用',
|
|
167
|
+
features: ['危险', '强大', '实验'],
|
|
168
|
+
},
|
|
169
|
+
],
|
|
170
|
+
filteredProducts: [],
|
|
171
|
+
selectedCategory: 'all',
|
|
172
|
+
searchKeyword: '',
|
|
173
|
+
selectedProduct: null,
|
|
174
|
+
modalVisible: false,
|
|
175
|
+
viewMode: 'grid',
|
|
176
|
+
sortBy: 'name',
|
|
177
|
+
hologramMode: true,
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
componentDidMount() {
|
|
181
|
+
this.filterProducts();
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
filterProducts() {
|
|
185
|
+
let filtered = this.state.products;
|
|
186
|
+
if (this.state.selectedCategory !== 'all') {
|
|
187
|
+
filtered = filtered.filter(
|
|
188
|
+
p => p.category === this.state.selectedCategory
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
if (this.state.searchKeyword) {
|
|
192
|
+
const keyword = this.state.searchKeyword.toLowerCase();
|
|
193
|
+
filtered = filtered.filter(
|
|
194
|
+
p =>
|
|
195
|
+
p.name.toLowerCase().includes(keyword) ||
|
|
196
|
+
p.description.toLowerCase().includes(keyword)
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
if (this.state.sortBy === 'price') {
|
|
200
|
+
filtered = [...filtered].sort((a, b) => b.price - a.price);
|
|
201
|
+
} else if (this.state.sortBy === 'rating') {
|
|
202
|
+
filtered = [...filtered].sort((a, b) => b.rating - a.rating);
|
|
203
|
+
} else if (this.state.sortBy === 'stock') {
|
|
204
|
+
filtered = [...filtered].sort((a, b) => b.stock - a.stock);
|
|
205
|
+
}
|
|
206
|
+
this.setState({
|
|
207
|
+
filteredProducts: filtered,
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
handleCategoryChange(value) {
|
|
212
|
+
this.setState(
|
|
213
|
+
{
|
|
214
|
+
selectedCategory: value,
|
|
215
|
+
},
|
|
216
|
+
() => this.filterProducts()
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
handleSearch(value) {
|
|
221
|
+
this.setState(
|
|
222
|
+
{
|
|
223
|
+
searchKeyword: value,
|
|
224
|
+
},
|
|
225
|
+
() => this.filterProducts()
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
handleSortChange(value) {
|
|
230
|
+
this.setState(
|
|
231
|
+
{
|
|
232
|
+
sortBy: value,
|
|
233
|
+
},
|
|
234
|
+
() => this.filterProducts()
|
|
235
|
+
);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
handleViewProduct(product) {
|
|
239
|
+
this.setState({
|
|
240
|
+
selectedProduct: product,
|
|
241
|
+
modalVisible: true,
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
handleCloseModal() {
|
|
246
|
+
this.setState({
|
|
247
|
+
modalVisible: false,
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
handleAddProduct() {
|
|
252
|
+
this.utils.showToast('添加新产品');
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
handleEditProduct(product) {
|
|
256
|
+
this.utils.showToast(`编辑产品: ${product.name}`);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
handleDeleteProduct(product) {
|
|
260
|
+
this.utils.showToast(`删除产品: ${product.name}`);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
toggleViewMode() {
|
|
264
|
+
this.setState({
|
|
265
|
+
viewMode: this.state.viewMode === 'grid' ? 'list' : 'grid',
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
toggleHologramMode() {
|
|
270
|
+
this.setState({
|
|
271
|
+
hologramMode: !this.state.hologramMode,
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
getStatusColor(status) {
|
|
276
|
+
switch (status) {
|
|
277
|
+
case 'available':
|
|
278
|
+
return '#00ff88';
|
|
279
|
+
case 'limited':
|
|
280
|
+
return '#ffaa00';
|
|
281
|
+
case 'rare':
|
|
282
|
+
return '#ff00ff';
|
|
283
|
+
default:
|
|
284
|
+
return '#888888';
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
getStatusText(status) {
|
|
289
|
+
switch (status) {
|
|
290
|
+
case 'available':
|
|
291
|
+
return '现货';
|
|
292
|
+
case 'limited':
|
|
293
|
+
return '限量';
|
|
294
|
+
case 'rare':
|
|
295
|
+
return '稀有';
|
|
296
|
+
default:
|
|
297
|
+
return status;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
getCategoryColor(category) {
|
|
302
|
+
const colors = {
|
|
303
|
+
implants: '#00ffff',
|
|
304
|
+
hardware: '#ff00ff',
|
|
305
|
+
devices: '#00ff88',
|
|
306
|
+
medical: '#ffaa00',
|
|
307
|
+
vehicles: '#ff0055',
|
|
308
|
+
storage: '#00ffff',
|
|
309
|
+
defense: '#ff00ff',
|
|
310
|
+
software: '#00ff88',
|
|
311
|
+
clothing: '#ffaa00',
|
|
312
|
+
experimental: '#ff0055',
|
|
313
|
+
};
|
|
314
|
+
return colors[category] || '#888888';
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
render() {
|
|
318
|
+
return (
|
|
319
|
+
<Page style={styles.container}>
|
|
320
|
+
<View style={styles.scanlines} />
|
|
321
|
+
<View style={styles.grid} />
|
|
322
|
+
<View style={styles.particles} />
|
|
323
|
+
<View style={styles.header}>
|
|
324
|
+
<View style={styles.headerLeft}>
|
|
325
|
+
<Text style={styles.title}>产品管理</Text>
|
|
326
|
+
<Text style={styles.subtitle}>PRODUCT MANAGEMENT SYSTEM</Text>
|
|
327
|
+
</View>
|
|
328
|
+
<View style={styles.headerRight}>
|
|
329
|
+
<Button
|
|
330
|
+
style={styles.cyberButton}
|
|
331
|
+
onClick={() => this.toggleHologramMode()}
|
|
332
|
+
>
|
|
333
|
+
<Text style={styles.buttonText}>
|
|
334
|
+
{this.state.hologramMode ? '关闭全息' : '开启全息'}
|
|
335
|
+
</Text>
|
|
336
|
+
</Button>
|
|
337
|
+
<Button
|
|
338
|
+
style={[styles.cyberButton, styles.primaryButton]}
|
|
339
|
+
onClick={() => this.handleAddProduct()}
|
|
340
|
+
>
|
|
341
|
+
<Text style={styles.buttonText}>+ 新增产品</Text>
|
|
342
|
+
</Button>
|
|
343
|
+
</View>
|
|
344
|
+
</View>
|
|
345
|
+
<View style={styles.toolbar}>
|
|
346
|
+
<View style={styles.toolbarLeft}>
|
|
347
|
+
<Input
|
|
348
|
+
placeholder="搜索产品..."
|
|
349
|
+
style={styles.searchInput}
|
|
350
|
+
value={this.state.searchKeyword}
|
|
351
|
+
onChange={e => this.handleSearch(e.target.value)}
|
|
352
|
+
/>
|
|
353
|
+
<Select
|
|
354
|
+
style={styles.categorySelect}
|
|
355
|
+
value={this.state.selectedCategory}
|
|
356
|
+
onChange={value => this.handleCategoryChange(value)}
|
|
357
|
+
>
|
|
358
|
+
{categories.map((cat, index) => (
|
|
359
|
+
<Select.Option key={cat.value} value={cat.value}>
|
|
360
|
+
<Text className="text-[#ffffff]">{cat.label}</Text>
|
|
361
|
+
</Select.Option>
|
|
362
|
+
))}
|
|
363
|
+
</Select>
|
|
364
|
+
<Select
|
|
365
|
+
style={styles.sortSelect}
|
|
366
|
+
value={this.state.sortBy}
|
|
367
|
+
onChange={value => this.handleSortChange(value)}
|
|
368
|
+
>
|
|
369
|
+
<Select.Option value="name">
|
|
370
|
+
<Text className="text-[#ffffff]">按名称</Text>
|
|
371
|
+
</Select.Option>
|
|
372
|
+
<Select.Option value="price">
|
|
373
|
+
<Text className="text-[#ffffff]">按价格</Text>
|
|
374
|
+
</Select.Option>
|
|
375
|
+
<Select.Option value="rating">
|
|
376
|
+
<Text className="text-[#ffffff]">按评分</Text>
|
|
377
|
+
</Select.Option>
|
|
378
|
+
<Select.Option value="stock">
|
|
379
|
+
<Text className="text-[#ffffff]">按库存</Text>
|
|
380
|
+
</Select.Option>
|
|
381
|
+
</Select>
|
|
382
|
+
</View>
|
|
383
|
+
<View style={styles.toolbarRight}>
|
|
384
|
+
<Text style={styles.totalText}>
|
|
385
|
+
共{this.state.filteredProducts?.length}件产品
|
|
386
|
+
</Text>
|
|
387
|
+
<Button
|
|
388
|
+
style={styles.viewModeButton}
|
|
389
|
+
onClick={() => this.toggleViewMode()}
|
|
390
|
+
>
|
|
391
|
+
<Text style={styles.buttonText}>
|
|
392
|
+
{this.state.viewMode === 'grid' ? '列表' : '网格'}
|
|
393
|
+
</Text>
|
|
394
|
+
</Button>
|
|
395
|
+
</View>
|
|
396
|
+
</View>
|
|
397
|
+
<View style={styles.productContainer}>
|
|
398
|
+
{!!(this.state.viewMode === 'grid') && (
|
|
399
|
+
<View style={styles.productGrid}>
|
|
400
|
+
{this.state.filteredProducts.map((product, index) => (
|
|
401
|
+
<View
|
|
402
|
+
key={product.id}
|
|
403
|
+
style={[
|
|
404
|
+
styles.productCard,
|
|
405
|
+
this.state.hologramMode && styles.productCardHologram,
|
|
406
|
+
]}
|
|
407
|
+
onClick={() => this.handleViewProduct(product)}
|
|
408
|
+
>
|
|
409
|
+
<View style={styles.productImageContainer}>
|
|
410
|
+
<Image src={product.image} style={styles.productImage} />
|
|
411
|
+
<View
|
|
412
|
+
style={[
|
|
413
|
+
styles.statusBadge,
|
|
414
|
+
{
|
|
415
|
+
backgroundColor:
|
|
416
|
+
this.getStatusColor(product.status) + '33',
|
|
417
|
+
borderColor: this.getStatusColor(product.status),
|
|
418
|
+
},
|
|
419
|
+
]}
|
|
420
|
+
>
|
|
421
|
+
<Text
|
|
422
|
+
style={[
|
|
423
|
+
styles.statusText,
|
|
424
|
+
{ color: this.getStatusColor(product.status) },
|
|
425
|
+
]}
|
|
426
|
+
>
|
|
427
|
+
{this.getStatusText(product.status)}
|
|
428
|
+
</Text>
|
|
429
|
+
</View>
|
|
430
|
+
</View>
|
|
431
|
+
<View style={styles.productInfo}>
|
|
432
|
+
<Text style={styles.productName}>{product.name}</Text>
|
|
433
|
+
<Tag
|
|
434
|
+
color={this.getCategoryColor(product.category)}
|
|
435
|
+
style={styles.categoryTag}
|
|
436
|
+
>
|
|
437
|
+
<Text>
|
|
438
|
+
{
|
|
439
|
+
this.categories.find(function (c) {
|
|
440
|
+
return c.value === product.category;
|
|
441
|
+
})?.label
|
|
442
|
+
}
|
|
443
|
+
</Text>
|
|
444
|
+
</Tag>
|
|
445
|
+
<View style={styles.productMeta}>
|
|
446
|
+
<Text style={styles.productPrice}>
|
|
447
|
+
¥{product.price.toLocaleString()}
|
|
448
|
+
</Text>
|
|
449
|
+
<Text style={styles.productRating}>
|
|
450
|
+
★{product.rating}
|
|
451
|
+
</Text>
|
|
452
|
+
</View>
|
|
453
|
+
<View style={styles.productStock}>
|
|
454
|
+
<Text style={styles.stockLabel}>库存:</Text>
|
|
455
|
+
<Text style={styles.stockValue}>{product.stock}</Text>
|
|
456
|
+
</View>
|
|
457
|
+
</View>
|
|
458
|
+
</View>
|
|
459
|
+
))}
|
|
460
|
+
</View>
|
|
461
|
+
)}
|
|
462
|
+
{!(this.state.viewMode === 'grid') && (
|
|
463
|
+
<View style={styles.productList}>
|
|
464
|
+
{this.state.filteredProducts.map((product, index) => (
|
|
465
|
+
<View
|
|
466
|
+
key={product.id}
|
|
467
|
+
style={[
|
|
468
|
+
styles.productListItem,
|
|
469
|
+
this.state.hologramMode && styles.productListItemHologram,
|
|
470
|
+
]}
|
|
471
|
+
onClick={() => this.handleViewProduct(product)}
|
|
472
|
+
>
|
|
473
|
+
<Image src={product.image} style={styles.listItemImage} />
|
|
474
|
+
<View style={styles.listItemInfo}>
|
|
475
|
+
<Text style={styles.listItemName}>{product.name}</Text>
|
|
476
|
+
<Text style={styles.listItemDescription}>
|
|
477
|
+
{product.description}
|
|
478
|
+
</Text>
|
|
479
|
+
</View>
|
|
480
|
+
<View style={styles.listItemMeta}>
|
|
481
|
+
<Text style={styles.listItemPrice}>
|
|
482
|
+
¥{product.price.toLocaleString()}
|
|
483
|
+
</Text>
|
|
484
|
+
<Text style={styles.listItemRating}>★{product.rating}</Text>
|
|
485
|
+
<Text style={styles.listItemStock}>
|
|
486
|
+
库存:{product.stock}
|
|
487
|
+
</Text>
|
|
488
|
+
</View>
|
|
489
|
+
<View style={styles.listItemActions}>
|
|
490
|
+
<Button
|
|
491
|
+
size="small"
|
|
492
|
+
style={styles.actionButton}
|
|
493
|
+
onClick={e => {
|
|
494
|
+
e.stopPropagation();
|
|
495
|
+
this.handleEditProduct(product);
|
|
496
|
+
}}
|
|
497
|
+
>
|
|
498
|
+
编辑
|
|
499
|
+
</Button>
|
|
500
|
+
<Button
|
|
501
|
+
size="small"
|
|
502
|
+
style={[styles.actionButton, styles.deleteButton]}
|
|
503
|
+
onClick={e => {
|
|
504
|
+
e.stopPropagation();
|
|
505
|
+
this.handleDeleteProduct(product);
|
|
506
|
+
}}
|
|
507
|
+
>
|
|
508
|
+
删除
|
|
509
|
+
</Button>
|
|
510
|
+
</View>
|
|
511
|
+
</View>
|
|
512
|
+
))}
|
|
513
|
+
</View>
|
|
514
|
+
)}
|
|
515
|
+
</View>
|
|
516
|
+
{!!this.state.modalVisible && (
|
|
517
|
+
<View
|
|
518
|
+
style={styles.modalOverlay}
|
|
519
|
+
onClick={() => this.handleCloseModal()}
|
|
520
|
+
>
|
|
521
|
+
<View style={styles.modal} onClick={e => e.stopPropagation()}>
|
|
522
|
+
<View style={styles.modalHeader}>
|
|
523
|
+
<Text style={styles.modalTitle}>产品详情</Text>
|
|
524
|
+
<Button
|
|
525
|
+
style={styles.closeButton}
|
|
526
|
+
onClick={() => this.handleCloseModal()}
|
|
527
|
+
>
|
|
528
|
+
<Text style={styles.closeButtonText}>✕</Text>
|
|
529
|
+
</Button>
|
|
530
|
+
</View>
|
|
531
|
+
<View style={styles.modalContent}>
|
|
532
|
+
<View style={styles.modalImageSection}>
|
|
533
|
+
<Image
|
|
534
|
+
src={this.state.selectedProduct?.image}
|
|
535
|
+
style={styles.modalImage}
|
|
536
|
+
/>
|
|
537
|
+
</View>
|
|
538
|
+
<View style={styles.modalInfoSection}>
|
|
539
|
+
<Text style={styles.modalProductName}>
|
|
540
|
+
{this.state.selectedProduct?.name}
|
|
541
|
+
</Text>
|
|
542
|
+
<View style={styles.modalTags}>
|
|
543
|
+
<Tag
|
|
544
|
+
color={this.getCategoryColor(
|
|
545
|
+
this.state.selectedProduct?.category
|
|
546
|
+
)}
|
|
547
|
+
style={styles.modalTag}
|
|
548
|
+
>
|
|
549
|
+
<Text>
|
|
550
|
+
{
|
|
551
|
+
this.categories.find(function (c) {
|
|
552
|
+
return (
|
|
553
|
+
c.value === this.state.selectedProduct?.category
|
|
554
|
+
);
|
|
555
|
+
})?.label
|
|
556
|
+
}
|
|
557
|
+
</Text>
|
|
558
|
+
</Tag>
|
|
559
|
+
<Tag
|
|
560
|
+
color={this.getStatusColor(
|
|
561
|
+
this.state.selectedProduct?.status
|
|
562
|
+
)}
|
|
563
|
+
style={styles.modalTag}
|
|
564
|
+
>
|
|
565
|
+
<Text>
|
|
566
|
+
{this.getStatusText(this.state.selectedProduct?.status)}
|
|
567
|
+
</Text>
|
|
568
|
+
</Tag>
|
|
569
|
+
</View>
|
|
570
|
+
<Text style={styles.modalDescription}>
|
|
571
|
+
{this.state.selectedProduct?.description}
|
|
572
|
+
</Text>
|
|
573
|
+
<View style={styles.modalFeatures}>
|
|
574
|
+
<Text style={styles.featuresTitle}>特性:</Text>
|
|
575
|
+
{(this.state.selectedProduct?.features).map(
|
|
576
|
+
(feature, index) => (
|
|
577
|
+
<Tag
|
|
578
|
+
key={index}
|
|
579
|
+
color="#00ffff"
|
|
580
|
+
style={styles.featureTag}
|
|
581
|
+
>
|
|
582
|
+
<Text>{feature}</Text>
|
|
583
|
+
</Tag>
|
|
584
|
+
)
|
|
585
|
+
)}
|
|
586
|
+
</View>
|
|
587
|
+
<View style={styles.modalMeta}>
|
|
588
|
+
<View style={styles.metaItem}>
|
|
589
|
+
<Text style={styles.metaLabel}>价格</Text>
|
|
590
|
+
<Text style={styles.metaValue}>
|
|
591
|
+
¥{this.state.selectedProduct?.price?.toLocaleString()}
|
|
592
|
+
</Text>
|
|
593
|
+
</View>
|
|
594
|
+
<View style={styles.metaItem}>
|
|
595
|
+
<Text style={styles.metaLabel}>评分</Text>
|
|
596
|
+
<Text style={styles.metaValue}>
|
|
597
|
+
★{this.state.selectedProduct?.rating}
|
|
598
|
+
</Text>
|
|
599
|
+
</View>
|
|
600
|
+
<View style={styles.metaItem}>
|
|
601
|
+
<Text style={styles.metaLabel}>库存</Text>
|
|
602
|
+
<Text style={styles.metaValue}>
|
|
603
|
+
{this.state.selectedProduct?.stock}
|
|
604
|
+
</Text>
|
|
605
|
+
</View>
|
|
606
|
+
</View>
|
|
607
|
+
</View>
|
|
608
|
+
</View>
|
|
609
|
+
<View style={styles.modalFooter}>
|
|
610
|
+
<Button
|
|
611
|
+
style={[styles.cyberButton, styles.modalButton]}
|
|
612
|
+
onClick={() => this.handleCloseModal()}
|
|
613
|
+
>
|
|
614
|
+
<Text style={styles.buttonText}>关闭</Text>
|
|
615
|
+
</Button>
|
|
616
|
+
<Button
|
|
617
|
+
style={[
|
|
618
|
+
styles.cyberButton,
|
|
619
|
+
styles.primaryButton,
|
|
620
|
+
styles.modalButton,
|
|
621
|
+
]}
|
|
622
|
+
onClick={() =>
|
|
623
|
+
this.handleEditProduct(this.state.selectedProduct)
|
|
624
|
+
}
|
|
625
|
+
>
|
|
626
|
+
<Text style={styles.buttonText}>编辑产品</Text>
|
|
627
|
+
</Button>
|
|
628
|
+
</View>
|
|
629
|
+
</View>
|
|
630
|
+
</View>
|
|
631
|
+
)}
|
|
632
|
+
</Page>
|
|
633
|
+
);
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
export default Document;
|