@appthen/cli 1.2.10 → 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/.gitignore +1 -0
- package/bin/main.js +92 -0
- package/dist/index.js +7014 -14988
- package/package.json +8 -1
- package/tests/test-app/.appthen/shadow-space-100001-test-app-e99876b1.json +1862 -0
- package/tests/test-app/.appthen/space-config.json +8 -0
- package/tests/test-app/docs/AI-Workflow.flow +112 -0
- package/tests/test-app/docs/Logic-1.flow +16 -0
- package/tests/test-app/docs/Logic.flow +16 -0
- package/tests/test-app/docs/Project-Blueprint-1.flow +119 -0
- package/tests/test-app/docs/Project-Blueprint.flow +119 -0
- package/tests/test-app/docs/README.md +3 -0
- package/tests/test-app/docs/claude.md +194 -0
- package/tests/test-app/docs/page_requirement_analysis.md +149 -0
- package/tests/test-app/docs//345/267/245/345/215/225/347/256/241/347/220/206/347/263/273/347/273/237/350/257/246/347/273/206/350/256/276/350/256/241.md +377 -0
- package/tests/test-app/src/apis/AddTodoPost.api.ts +42 -0
- package/tests/test-app/src/apis/DeleteTodoPost.api.ts +32 -0
- package/tests/test-app/src/apis/GetListPost.api.ts +38 -0
- package/tests/test-app/src/apis/TicketAttachmentUploadPost.api.ts +42 -0
- package/tests/test-app/src/apis/UpdateTodoPost.api.ts +46 -0
- package/tests/test-app/src/app.css +15 -0
- package/tests/test-app/src/cloud_functions/ticket|attachment|upload.node.ts +86 -0
- package/tests/test-app/src/cloud_functions/ticket|comment|add.node.ts +65 -0
- package/tests/test-app/src/cloud_functions/types|entity|Ticket.node.ts +88 -0
- package/tests/test-app/src/cloud_functions/types|entity|TicketAttachment.node.ts +70 -0
- package/tests/test-app/src/cloud_functions/types|entity|TicketCategory.node.ts +56 -0
- package/tests/test-app/src/cloud_functions/types|entity|TicketComment.node.ts +62 -0
- package/tests/test-app/src/cloud_functions/types|entity|TicketHistory.node.ts +74 -0
- package/tests/test-app/src/cloud_functions/types|entity|TicketPriority.node.ts +68 -0
- package/tests/test-app/src/cloud_functions/types|entity|TicketStatus.node.ts +63 -0
- package/tests/test-app/src/cloud_functions/types|models|CreateTicketParams.node.ts +20 -0
- package/tests/test-app/src/cloud_functions/types|models|TicketListParams.node.ts +30 -0
- package/tests/test-app/src/cloud_functions/types|models|UpdateTicketParams.node.ts +22 -0
- package/tests/test-app/src/components/Button.js +11 -0
- package/tests/test-app/src/components/MessageCenter.tsx +506 -0
- package/tests/test-app/src/components/MouduleDemoNzp.tsx +40 -0
- package/tests/test-app/src/components/Timeline.tsx +145 -0
- package/tests/test-app/src/index.ts +2 -0
- package/tests/test-app/src/modules/work_order_module/apis/TicketCommentAddPost.api.ts +48 -0
- package/tests/test-app/src/modules/work_order_module/apis/TicketCreatePost.api.ts +52 -0
- package/tests/test-app/src/modules/work_order_module/apis/TicketDeleteDelete.api.ts +39 -0
- package/tests/test-app/src/modules/work_order_module/apis/TicketDetailGet.api.ts +39 -0
- package/tests/test-app/src/modules/work_order_module/apis/TicketListGet.api.ts +61 -0
- package/tests/test-app/src/modules/work_order_module/apis/TicketUpdatePut.api.ts +57 -0
- package/tests/test-app/src/modules/work_order_module/apis/TrainDoorFaultListGet.ts +76 -0
- package/tests/test-app/src/modules/work_order_module/apis/TrainDoorListGet.ts +76 -0
- package/tests/test-app/src/modules/work_order_module/apis/TrainDoorOperationRecordsGet.ts +284 -0
- package/tests/test-app/src/modules/work_order_module/apis/TrainDoorStatisticsGet.ts +96 -0
- package/tests/test-app/src/modules/work_order_module/cloud_function/category|list.node.ts +40 -0
- package/tests/test-app/src/modules/work_order_module/cloud_function/priority|list.node.ts +26 -0
- package/tests/test-app/src/modules/work_order_module/cloud_function/status|list.node.ts +26 -0
- package/tests/test-app/src/modules/work_order_module/cloud_function/ticket|create.node.ts +54 -0
- package/tests/test-app/src/modules/work_order_module/cloud_function/ticket|delete.node.ts +55 -0
- package/tests/test-app/src/modules/work_order_module/cloud_function/ticket|detail.node.ts +65 -0
- package/tests/test-app/src/modules/work_order_module/cloud_function/ticket|list.node.ts +85 -0
- package/tests/test-app/src/modules/work_order_module/cloud_function/ticket|update.node.ts +73 -0
- package/tests/test-app/src/modules/work_order_module/data_model/Ticket.m.ts +85 -0
- package/tests/test-app/src/modules/work_order_module/data_model/TicketCategory.m.ts +53 -0
- package/tests/test-app/src/modules/work_order_module/data_model/TicketStatus.m.ts +60 -0
- package/tests/test-app/src/modules/work_order_module//345/267/245/345/215/225/347/263/273/347/273/237/344/272/247/345/223/201/350/256/276/350/256/241/346/226/207/346/241/243.md +301 -0
- package/tests/test-app/src/modules/work_order_module//345/267/245/345/215/225/347/263/273/347/273/237/345/274/200/345/217/221/344/273/273/345/212/241/345/210/206/345/267/245/346/226/207/346/241/243.md +345 -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/SLAManagement.tsx +668 -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/TicketCreate.tsx +27 -0
- package/tests/test-app/src/pages/TicketDetail.tsx +27 -0
- package/tests/test-app/src/pages/TicketList.tsx +27 -0
- package/tests/test-app/src/pages/TicketManagement.tsx +402 -0
- package/tests/test-app/src/pages/TicketManagementPage.tsx +1238 -0
- package/tests/test-app/src/pages/UserProfile.tsx +404 -0
- package/tests/test-app/src/pages/VisualAIIDEUpgrade.tsx +245 -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/appthen_guide/ComponentTreeUnderstanding.tsx +26 -0
- package/tests/test-app/src/pages/appthen_guide/DataBindingLearning.tsx +26 -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/back-end/adminRootLayout.tsx +155 -0
- package/tests/test-app/src/pages/back-end/adminRootLayout10.tsx +157 -0
- package/tests/test-app/src/pages/back-end/adminRootLayout2.tsx +156 -0
- package/tests/test-app/src/pages/back-end/adminRootLayout3.tsx +156 -0
- package/tests/test-app/src/pages/back-end/adminRootLayout4.tsx +157 -0
- package/tests/test-app/src/pages/back-end/adminRootLayout5.tsx +157 -0
- package/tests/test-app/src/pages/back-end/adminRootLayout6.tsx +157 -0
- package/tests/test-app/src/pages/back-end/adminRootLayout7.tsx +157 -0
- package/tests/test-app/src/pages/back-end/adminRootLayout8.tsx +157 -0
- package/tests/test-app/src/pages/back-end/adminRootLayout9.tsx +157 -0
- package/tests/test-app/src/pages/back-end/backgroundManagementSystem.css +5 -0
- package/tests/test-app/src/pages/back-end/backgroundManagementSystem.tsx +1745 -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/component/WorkOrderCard.tsx +140 -0
- package/tests/test-app/src/pages/cover.tsx +42 -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/data_dashboard/blueBrightGreenTechnologyWind.css +181 -0
- package/tests/test-app/src/pages/data_dashboard/blueBrightGreenTechnologyWind.tsx +225 -0
- package/tests/test-app/src/pages/data_dashboard/blueLargeScreen.css +181 -0
- package/tests/test-app/src/pages/data_dashboard/blueLargeScreen.tsx +138 -0
- package/tests/test-app/src/pages/data_dashboard/component_library/BlueBrightGreenBorder.tsx +47 -0
- package/tests/test-app/src/pages/data_dashboard/component_library/FullScreenContainer.tsx +133 -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/description_of_mock_interface.md +32 -0
- package/tests/test-app/src/pages/digitalLargeScreen.css +181 -0
- package/tests/test-app/src/pages/digitalLargeScreen.tsx +1417 -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/PersonalCenter.css +3 -0
- package/tests/test-app/src/pages/mobile_terminal/PersonalCenter.tsx +362 -0
- package/tests/test-app/src/pages/mobile_terminal/WorkOrderHomepage.tsx +337 -0
- package/tests/test-app/src/pages/mobile_terminal/newWorkOrder.tsx +224 -0
- package/tests/test-app/src/pages/mobile_terminal/tabbar.tsx +67 -0
- package/tests/test-app/src/pages/mobile_terminal/uiHandsOnPractice.tsx +638 -0
- package/tests/test-app/src/pages/mobile_terminal/workOrderDetails.tsx +346 -0
- package/tests/test-app/src/pages/mobile_terminal/workOrderPage.tsx +345 -0
- 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/testPage.css +3 -0
- package/tests/test-app/src/pages/testPage.tsx +158 -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/web_version/website.css +205 -0
- package/tests/test-app/src/pages/web_version/website.tsx +1066 -0
- package/tests/test-app/src/pages/wrong-page.tsx +50 -0
- package/tests/test-app/src/pages//345/276/205/345/212/236.apidoc.json +336 -0
- package/tests/test-app/src/project.json +1120 -0
- package/tests/test-app/src/store/global.store.ts +10 -0
- package/tests/test-app/src/types/CreateTicketParams.m.ts +20 -0
- package/tests/test-app/src/types/SLAPolicy.ts +50 -0
- package/tests/test-app/src/types/Ticket.ts +68 -0
- package/tests/test-app/src/types/TicketAttachment.m.ts +67 -0
- package/tests/test-app/src/types/TicketComment.m.ts +59 -0
- package/tests/test-app/src/types/TicketEvaluation.ts +44 -0
- package/tests/test-app/src/types/TicketHistory.m.ts +71 -0
- package/tests/test-app/src/types/TicketListParams.m.ts +30 -0
- package/tests/test-app/src/types/TicketPriority.m.ts +65 -0
- package/tests/test-app/src/types/TicketRecord.ts +47 -0
- package/tests/test-app/src/types/TrainDoor.ts +284 -0
- package/tests/test-app/src/types/UpdateTicketParams.m.ts +22 -0
- package/tests/test-app/src/utils/__afterRequest.util.ts +3 -0
- package/tests/test-app/src/utils/__beforeRequest.util.ts +10 -0
- package/tests/test-app/src/utils/testGlobalAction.util.ts +7 -0
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 订单详情页 - 展示订单的完整信息
|
|
3
|
+
* @type Page
|
|
4
|
+
* @route /order/detail
|
|
5
|
+
* @screen 1200x800 #f5f5f5
|
|
6
|
+
* @frames web, app
|
|
7
|
+
* @clients web, h5, weapp
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class IProps {
|
|
14
|
+
orderId?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/*
|
|
18
|
+
* 数据与接口请求定义
|
|
19
|
+
*/
|
|
20
|
+
class IState {
|
|
21
|
+
loading?: boolean;
|
|
22
|
+
order?: any;
|
|
23
|
+
showStatusModal?: boolean;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
class Document extends React.Component<IProps, IState> {
|
|
27
|
+
state = { loading: true, order: null, showStatusModal: false };
|
|
28
|
+
|
|
29
|
+
componentDidMount() {
|
|
30
|
+
this.loadOrderDetail();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async loadOrderDetail() {
|
|
34
|
+
try {
|
|
35
|
+
const orderId = this.props.orderId || '123456';
|
|
36
|
+
const mockData = {
|
|
37
|
+
id: 'ORD202412010001',
|
|
38
|
+
orderNo: 'ORD202412010001',
|
|
39
|
+
status: 'completed',
|
|
40
|
+
statusText: '已完成',
|
|
41
|
+
createTime: '2024-12-01 14:30:25',
|
|
42
|
+
payTime: '2024-12-01 14:35:10',
|
|
43
|
+
deliveryTime: '2024-12-02 10:20:00',
|
|
44
|
+
receiverName: '张三',
|
|
45
|
+
receiverPhone: '138****5678',
|
|
46
|
+
receiverAddress: '北京市朝阳区建国路88号SOHO现代城A座12层1201室',
|
|
47
|
+
totalAmount: 2999.0,
|
|
48
|
+
discountAmount: 200.0,
|
|
49
|
+
freightAmount: 10.0,
|
|
50
|
+
realAmount: 2809.0,
|
|
51
|
+
paymentMethod: '微信支付',
|
|
52
|
+
remark: '请在工作日配送',
|
|
53
|
+
items: [
|
|
54
|
+
{
|
|
55
|
+
id: 1,
|
|
56
|
+
productName: '无线蓝牙耳机 Pro',
|
|
57
|
+
productImage: 'https://via.placeholder.com/80x80',
|
|
58
|
+
skuName: '白色 / 降噪版',
|
|
59
|
+
price: 1299.0,
|
|
60
|
+
quantity: 2,
|
|
61
|
+
subtotal: 2598.0,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: 2,
|
|
65
|
+
productName: '手机保护壳',
|
|
66
|
+
productImage: 'https://via.placeholder.com/80x80',
|
|
67
|
+
skuName: '透明 / 适用于iPhone 15',
|
|
68
|
+
price: 39.0,
|
|
69
|
+
quantity: 2,
|
|
70
|
+
subtotal: 78.0,
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: 3,
|
|
74
|
+
productName: '数据线 Type-C',
|
|
75
|
+
productImage: 'https://via.placeholder.com/80x80',
|
|
76
|
+
skuName: '1米 / 白色',
|
|
77
|
+
price: 29.0,
|
|
78
|
+
quantity: 1,
|
|
79
|
+
subtotal: 29.0,
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
timeline: [
|
|
83
|
+
{
|
|
84
|
+
time: '2024-12-02 10:20:00',
|
|
85
|
+
title: '已签收',
|
|
86
|
+
description: '您的订单已签收,感谢您的购买',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
time: '2024-12-01 18:30:00',
|
|
90
|
+
title: '派送中',
|
|
91
|
+
description: '快递员正在为您派送',
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
time: '2024-12-01 15:00:00',
|
|
95
|
+
title: '已发货',
|
|
96
|
+
description: '订单已出库,顺丰快递:SF1234567890',
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
time: '2024-12-01 14:35:10',
|
|
100
|
+
title: '已付款',
|
|
101
|
+
description: '您已成功支付订单',
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
time: '2024-12-01 14:30:25',
|
|
105
|
+
title: '订单创建',
|
|
106
|
+
description: '订单创建成功,等待付款',
|
|
107
|
+
},
|
|
108
|
+
],
|
|
109
|
+
};
|
|
110
|
+
this.setState({
|
|
111
|
+
order: mockData,
|
|
112
|
+
loading: false,
|
|
113
|
+
});
|
|
114
|
+
} catch (error) {
|
|
115
|
+
this.setState({
|
|
116
|
+
loading: false,
|
|
117
|
+
});
|
|
118
|
+
this.utils.showToast('加载订单详情失败');
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
getStatusColor(status) {
|
|
123
|
+
const colorMap = {
|
|
124
|
+
pending: 'default',
|
|
125
|
+
paid: 'processing',
|
|
126
|
+
shipped: 'warning',
|
|
127
|
+
completed: 'success',
|
|
128
|
+
cancelled: 'error',
|
|
129
|
+
};
|
|
130
|
+
return colorMap[status] || 'default';
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
handleCancelOrder() {
|
|
134
|
+
this.utils.showComponentModal('CancelOrderModal', {
|
|
135
|
+
orderId: this.state.order?.id,
|
|
136
|
+
onSuccess: () => {
|
|
137
|
+
this.utils.showToast('订单已取消');
|
|
138
|
+
this.loadOrderDetail();
|
|
139
|
+
},
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
handlePay() {
|
|
144
|
+
this.utils.showToast('跳转到支付页面');
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
handleConfirmReceipt() {
|
|
148
|
+
this.utils.showComponentModal('ConfirmReceiptModal', {
|
|
149
|
+
orderId: this.state.order?.id,
|
|
150
|
+
onSuccess: () => {
|
|
151
|
+
this.utils.showToast('已确认收货');
|
|
152
|
+
this.loadOrderDetail();
|
|
153
|
+
},
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
handleContactService() {
|
|
158
|
+
this.utils.showComponentModal('CustomerServiceModal');
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
handleBuyAgain() {
|
|
162
|
+
this.utils.showToast('已加入购物车');
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
render() {
|
|
166
|
+
return (
|
|
167
|
+
<Page className="bg-[#f3f4f6] min-h-screen">
|
|
168
|
+
<View className="p-[16px] ml-[auto] mr-[auto]">
|
|
169
|
+
<Card className="mb-[16px] shadow-[0 1px 2px 0 rgb(0 0 0 / 0.05)]">
|
|
170
|
+
<View className="flex items-center justify-between">
|
|
171
|
+
<View className="flex items-center">
|
|
172
|
+
<Tag
|
|
173
|
+
color={this.getStatusColor(this.state.order?.status)}
|
|
174
|
+
className="text-base pl-[16px] pr-[16px] pt-[4px] pb-[4px]"
|
|
175
|
+
>
|
|
176
|
+
<Text>{this.state.order?.statusText}</Text>
|
|
177
|
+
</Tag>
|
|
178
|
+
<Text className="ml-[16px] text-[#4b5563]">
|
|
179
|
+
订单编号:{this.state.order?.orderNo}
|
|
180
|
+
</Text>
|
|
181
|
+
</View>
|
|
182
|
+
<View className="gap-2 flex">
|
|
183
|
+
<Button type="link" onClick={() => this.handleContactService()}>
|
|
184
|
+
联系客服
|
|
185
|
+
</Button>
|
|
186
|
+
</View>
|
|
187
|
+
</View>
|
|
188
|
+
</Card>
|
|
189
|
+
<Card
|
|
190
|
+
title="订单进度"
|
|
191
|
+
className="mb-[16px] shadow-[0 1px 2px 0 rgb(0 0 0 / 0.05)]"
|
|
192
|
+
>
|
|
193
|
+
<Steps
|
|
194
|
+
direction="vertical"
|
|
195
|
+
current={0}
|
|
196
|
+
items={(this.state.order?.timeline).map((item, index) => (
|
|
197
|
+
<View>
|
|
198
|
+
<Text>{item.description}</Text>
|
|
199
|
+
<Text className="block text-[#9ca3af] text-sm mt-[4px]">
|
|
200
|
+
{item.time}
|
|
201
|
+
</Text>
|
|
202
|
+
</View>
|
|
203
|
+
))}
|
|
204
|
+
/>
|
|
205
|
+
</Card>
|
|
206
|
+
<Card
|
|
207
|
+
title="买家信息"
|
|
208
|
+
className="mb-[16px] shadow-[0 1px 2px 0 rgb(0 0 0 / 0.05)]"
|
|
209
|
+
>
|
|
210
|
+
<Descriptions column={2}>
|
|
211
|
+
<Descriptions.Item label="收货人">
|
|
212
|
+
<Text>{this.state.order?.receiverName}</Text>
|
|
213
|
+
</Descriptions.Item>
|
|
214
|
+
<Descriptions.Item label="联系电话">
|
|
215
|
+
<Text>{this.state.order?.receiverPhone}</Text>
|
|
216
|
+
</Descriptions.Item>
|
|
217
|
+
<Descriptions.Item label="收货地址" span={2}>
|
|
218
|
+
<Text>{this.state.order?.receiverAddress}</Text>
|
|
219
|
+
</Descriptions.Item>
|
|
220
|
+
</Descriptions>
|
|
221
|
+
</Card>
|
|
222
|
+
<Card
|
|
223
|
+
title="订单货品信息"
|
|
224
|
+
className="mb-[16px] shadow-[0 1px 2px 0 rgb(0 0 0 / 0.05)]"
|
|
225
|
+
>
|
|
226
|
+
{(this.state.order?.items).map((item, index) => (
|
|
227
|
+
<View
|
|
228
|
+
key={item.id || index}
|
|
229
|
+
className="border-b border-gray-100 last:border-0 flex pt-[16px] pb-[16px]"
|
|
230
|
+
>
|
|
231
|
+
<Image
|
|
232
|
+
src={item.productImage}
|
|
233
|
+
className="w-[80px] h-[80px] [objectFit:cover] rounded"
|
|
234
|
+
/>
|
|
235
|
+
<View className="flex-1 ml-[16px]">
|
|
236
|
+
<Text className="font-medium text-base">
|
|
237
|
+
{item.productName}
|
|
238
|
+
</Text>
|
|
239
|
+
<Text className="block text-[#6b7280] text-sm mt-[4px]">
|
|
240
|
+
{item.skuName}
|
|
241
|
+
</Text>
|
|
242
|
+
<View className="flex justify-between mt-[8px]">
|
|
243
|
+
<Text className="text-[#ef4444] font-medium">
|
|
244
|
+
¥{item.price?.toFixed(2)}
|
|
245
|
+
</Text>
|
|
246
|
+
<Text className="text-[#4b5563]">x{item.quantity}</Text>
|
|
247
|
+
</View>
|
|
248
|
+
</View>
|
|
249
|
+
<View className="text-[var(--right)]">
|
|
250
|
+
<Text className="font-medium text-base">
|
|
251
|
+
¥{item.subtotal?.toFixed(2)}
|
|
252
|
+
</Text>
|
|
253
|
+
</View>
|
|
254
|
+
</View>
|
|
255
|
+
))}
|
|
256
|
+
<Divider className="mt-[16px] mb-[16px]" />
|
|
257
|
+
<View className="space-y-2">
|
|
258
|
+
<View className="flex justify-between">
|
|
259
|
+
<Text className="text-[#4b5563]">商品总额</Text>
|
|
260
|
+
<Text>¥{this.state.order?.totalAmount?.toFixed(2)}</Text>
|
|
261
|
+
</View>
|
|
262
|
+
<View className="flex justify-between">
|
|
263
|
+
<Text className="text-[#4b5563]">优惠金额</Text>
|
|
264
|
+
<Text className="text-[#ef4444]">
|
|
265
|
+
-¥{this.state.order?.discountAmount?.toFixed(2)}
|
|
266
|
+
</Text>
|
|
267
|
+
</View>
|
|
268
|
+
<View className="flex justify-between">
|
|
269
|
+
<Text className="text-[#4b5563]">运费</Text>
|
|
270
|
+
<Text>¥{this.state.order?.freightAmount?.toFixed(2)}</Text>
|
|
271
|
+
</View>
|
|
272
|
+
<View className="flex justify-between items-center pt-[8px]">
|
|
273
|
+
<Text className="text-base font-medium">实付金额</Text>
|
|
274
|
+
<Text className="text-[#ef4444] text-xl font-bold">
|
|
275
|
+
¥{this.state.order?.realAmount?.toFixed(2)}
|
|
276
|
+
</Text>
|
|
277
|
+
</View>
|
|
278
|
+
</View>
|
|
279
|
+
</Card>
|
|
280
|
+
<Card
|
|
281
|
+
title="支付信息"
|
|
282
|
+
className="mb-[16px] shadow-[0 1px 2px 0 rgb(0 0 0 / 0.05)]"
|
|
283
|
+
>
|
|
284
|
+
<Descriptions column={2}>
|
|
285
|
+
<Descriptions.Item label="支付方式">
|
|
286
|
+
<Text>{this.state.order?.paymentMethod}</Text>
|
|
287
|
+
</Descriptions.Item>
|
|
288
|
+
<Descriptions.Item label="支付时间">
|
|
289
|
+
<Text>{this.state.order?.payTime}</Text>
|
|
290
|
+
</Descriptions.Item>
|
|
291
|
+
<Descriptions.Item label="下单时间" span={2}>
|
|
292
|
+
<Text>{this.state.order?.createTime}</Text>
|
|
293
|
+
</Descriptions.Item>
|
|
294
|
+
<Descriptions.Item label="订单备注" span={2}>
|
|
295
|
+
无
|
|
296
|
+
</Descriptions.Item>
|
|
297
|
+
</Descriptions>
|
|
298
|
+
</Card>
|
|
299
|
+
<Card className="shadow-[0 1px 2px 0 rgb(0 0 0 / 0.05)]">
|
|
300
|
+
<View className="gap-3 flex justify-end">
|
|
301
|
+
<Button onClick={() => this.handleBuyAgain()}>再次购买</Button>
|
|
302
|
+
{!!(this.state.order?.status === 'shipped') && (
|
|
303
|
+
<Button
|
|
304
|
+
type="primary"
|
|
305
|
+
onClick={() => this.handleConfirmReceipt()}
|
|
306
|
+
>
|
|
307
|
+
确认收货
|
|
308
|
+
</Button>
|
|
309
|
+
)}
|
|
310
|
+
{!!(this.state.order?.status === 'completed') && (
|
|
311
|
+
<Button type="default">申请售后</Button>
|
|
312
|
+
)}
|
|
313
|
+
{!!(this.state.order?.status === 'pending') && (
|
|
314
|
+
<Button
|
|
315
|
+
type="primary"
|
|
316
|
+
danger={true}
|
|
317
|
+
onClick={() => this.handleCancelOrder()}
|
|
318
|
+
>
|
|
319
|
+
取消订单
|
|
320
|
+
</Button>
|
|
321
|
+
)}
|
|
322
|
+
</View>
|
|
323
|
+
</Card>
|
|
324
|
+
</View>
|
|
325
|
+
</Page>
|
|
326
|
+
);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
export default Document;
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 订单列表
|
|
3
|
+
* 查看和管理所有订单信息
|
|
4
|
+
*
|
|
5
|
+
* @type Page
|
|
6
|
+
* @route /orders-list
|
|
7
|
+
* @screen 1920w
|
|
8
|
+
* @frames web
|
|
9
|
+
*/
|
|
10
|
+
import React from 'react';
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class IProps {}
|
|
15
|
+
|
|
16
|
+
/*
|
|
17
|
+
* 数据与接口请求定义
|
|
18
|
+
*/
|
|
19
|
+
class IState {
|
|
20
|
+
orders?: {
|
|
21
|
+
/* @example 1 */id?: number,
|
|
22
|
+
/* @example ORD-2024-001 */orderNo?: string,
|
|
23
|
+
/* @example 张三 */customer?: string,
|
|
24
|
+
/* @example 12999 */amount?: number,
|
|
25
|
+
/* @example completed */status?: string,
|
|
26
|
+
/* @example 2024-01-15 */createTime?: string,
|
|
27
|
+
}[];
|
|
28
|
+
loading?: boolean;
|
|
29
|
+
searchKeyword?: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
class Document extends React.Component<IProps, IState> {
|
|
33
|
+
state = {
|
|
34
|
+
orders: [
|
|
35
|
+
{
|
|
36
|
+
id: 1,
|
|
37
|
+
orderNo: 'ORD-2024-001',
|
|
38
|
+
customer: '张三',
|
|
39
|
+
amount: 12999,
|
|
40
|
+
status: 'completed',
|
|
41
|
+
createTime: '2024-01-15',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: 2,
|
|
45
|
+
orderNo: 'ORD-2024-002',
|
|
46
|
+
customer: '李四',
|
|
47
|
+
amount: 5999,
|
|
48
|
+
status: 'pending',
|
|
49
|
+
createTime: '2024-02-20',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
id: 3,
|
|
53
|
+
orderNo: 'ORD-2024-003',
|
|
54
|
+
customer: '王五',
|
|
55
|
+
amount: 8999,
|
|
56
|
+
status: 'shipped',
|
|
57
|
+
createTime: '2024-03-10',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
id: 4,
|
|
61
|
+
orderNo: 'ORD-2024-004',
|
|
62
|
+
customer: '赵六',
|
|
63
|
+
amount: 25999,
|
|
64
|
+
status: 'processing',
|
|
65
|
+
createTime: '2024-04-05',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
id: 5,
|
|
69
|
+
orderNo: 'ORD-2024-005',
|
|
70
|
+
customer: '钱七',
|
|
71
|
+
amount: 799,
|
|
72
|
+
status: 'cancelled',
|
|
73
|
+
createTime: '2024-05-12',
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
loading: false,
|
|
77
|
+
searchKeyword: '',
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
handleSearch(value) {
|
|
81
|
+
this.setState({
|
|
82
|
+
searchKeyword: value,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
handleAdd() {
|
|
87
|
+
console.log('添加订单');
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
handleEdit(record) {
|
|
91
|
+
console.log('编辑订单', record);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
handleDelete(record) {
|
|
95
|
+
console.log('删除订单', record);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
getStatusTag(status) {
|
|
99
|
+
if (status === 'completed') {
|
|
100
|
+
return <Tag color="green">已完成</Tag>;
|
|
101
|
+
}
|
|
102
|
+
if (status === 'pending') {
|
|
103
|
+
return <Tag color="orange">待付款</Tag>;
|
|
104
|
+
}
|
|
105
|
+
if (status === 'processing') {
|
|
106
|
+
return <Tag color="blue">处理中</Tag>;
|
|
107
|
+
}
|
|
108
|
+
if (status === 'shipped') {
|
|
109
|
+
return <Tag color="cyan">已发货</Tag>;
|
|
110
|
+
}
|
|
111
|
+
return <Tag color="gray">已取消</Tag>;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
render() {
|
|
115
|
+
return (
|
|
116
|
+
<Page className="p-[24px] bg-[var(--gray-50)] min-h-screen">
|
|
117
|
+
<View className="mb-[24px]">
|
|
118
|
+
<h1 className="text-2xl font-bold text-[#1f2937]">订单列表</h1>
|
|
119
|
+
<p className="text-[#6b7280] text-sm mt-[4px]">
|
|
120
|
+
管理系统中的所有订单信息
|
|
121
|
+
</p>
|
|
122
|
+
</View>
|
|
123
|
+
<Card className="mb-[24px]">
|
|
124
|
+
<View className="flex items-center justify-between">
|
|
125
|
+
<Input
|
|
126
|
+
placeholder="搜索订单号/客户姓名"
|
|
127
|
+
value={this.state.searchKeyword}
|
|
128
|
+
onChange={e => this.handleSearch(e.target.value)}
|
|
129
|
+
prefix="🔍"
|
|
130
|
+
className=""
|
|
131
|
+
/>
|
|
132
|
+
<Button type="primary" onClick={() => this.handleAdd()}>
|
|
133
|
+
+ 新增订单
|
|
134
|
+
</Button>
|
|
135
|
+
</View>
|
|
136
|
+
</Card>
|
|
137
|
+
<Card>
|
|
138
|
+
<Table
|
|
139
|
+
loading={this.state.loading}
|
|
140
|
+
columns={[
|
|
141
|
+
{ title: 'ID', dataIndex: 'id', key: 'id', width: 80 },
|
|
142
|
+
{ title: '订单号', dataIndex: 'orderNo', key: 'orderNo' },
|
|
143
|
+
{ title: '客户', dataIndex: 'customer', key: 'customer' },
|
|
144
|
+
{
|
|
145
|
+
title: '金额',
|
|
146
|
+
dataIndex: 'amount',
|
|
147
|
+
key: 'amount',
|
|
148
|
+
render: function (text) {
|
|
149
|
+
return `¥${text}`;
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
title: '状态',
|
|
154
|
+
dataIndex: 'status',
|
|
155
|
+
key: 'status',
|
|
156
|
+
render: function (text) {
|
|
157
|
+
return this.getStatusTag(text);
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
{ title: '创建时间', dataIndex: 'createTime', key: 'createTime' },
|
|
161
|
+
{
|
|
162
|
+
title: '操作',
|
|
163
|
+
key: 'action',
|
|
164
|
+
render: (text, record) => (
|
|
165
|
+
<Space>
|
|
166
|
+
<Button type="link" onClick={() => this.handleEdit(record)}>
|
|
167
|
+
编辑
|
|
168
|
+
</Button>
|
|
169
|
+
<Button
|
|
170
|
+
type="link"
|
|
171
|
+
danger={true}
|
|
172
|
+
onClick={() => this.handleDelete(record)}
|
|
173
|
+
>
|
|
174
|
+
删除
|
|
175
|
+
</Button>
|
|
176
|
+
</Space>
|
|
177
|
+
),
|
|
178
|
+
},
|
|
179
|
+
]}
|
|
180
|
+
dataSource={this.state.orders}
|
|
181
|
+
rowKey="id"
|
|
182
|
+
pagination={{
|
|
183
|
+
pageSize: 10,
|
|
184
|
+
showTotal: function (total) {
|
|
185
|
+
return `共 ${total} 条`;
|
|
186
|
+
},
|
|
187
|
+
}}
|
|
188
|
+
/>
|
|
189
|
+
</Card>
|
|
190
|
+
</Page>
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export default Document;
|