@forgetman505/ttwashcar-order 1.0.3 → 1.0.5
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/order.js +6 -1
- package/package.json +1 -1
package/order.js
CHANGED
|
@@ -20,11 +20,13 @@ function createOrder(data = {}) {
|
|
|
20
20
|
car_number: "", // 车牌号
|
|
21
21
|
car_type: CarType.NONE,
|
|
22
22
|
address: "", // 地址
|
|
23
|
+
phone: "", // 手机号
|
|
23
24
|
amount: 0,
|
|
24
25
|
status: OrderStatus.PENDING,
|
|
25
26
|
employee_id: "",
|
|
26
27
|
images: [],
|
|
27
28
|
create_time: new Date(),
|
|
29
|
+
finish_time: null,
|
|
28
30
|
...data // 覆盖传入的字段
|
|
29
31
|
}
|
|
30
32
|
}
|
|
@@ -41,7 +43,10 @@ function formatOrder(order = {}) {
|
|
|
41
43
|
|
|
42
44
|
// 安全处理日期:有值用原值,没有则为 null
|
|
43
45
|
create_time: order.create_time || null,
|
|
44
|
-
|
|
46
|
+
finish_time: order.finish_time || null,
|
|
47
|
+
|
|
48
|
+
// 安全处理手机号:确保为字符串
|
|
49
|
+
phone: order.phone || "",
|
|
45
50
|
|
|
46
51
|
// 安全处理数组:防止后端/数据库没有 images 字段
|
|
47
52
|
images: Array.isArray(order.images) ? order.images : [],
|