feat(订单): 添加订单详情弹窗并优化订单状态管理
- 在 `OrdersPage.vue` 中添加 `VanDialog` 组件以显示订单详情 - 更新订单状态映射,支持更多状态如“待支付”、“已支付”、“已取消”等 - 优化订单列表的加载逻辑,使用 API 获取订单数据 - 移除不必要的注释代码,简化页面结构
Showing
4 changed files
with
5 additions
and
4 deletions
| 1 | /* | 1 | /* |
| 2 | * @Date: 2025-04-16 16:21:37 | 2 | * @Date: 2025-04-16 16:21:37 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-04-16 16:41:16 | 4 | + * @LastEditTime: 2025-04-16 17:44:45 |
| 5 | * @FilePath: /mlaj/src/api/order.js | 5 | * @FilePath: /mlaj/src/api/order.js |
| 6 | * @Description: 订单相关接口 | 6 | * @Description: 订单相关接口 |
| 7 | */ | 7 | */ |
| ... | @@ -26,7 +26,7 @@ export const getOrderListAPI = (params) => fn(fetch.get(Api.ORDER_LIST, params)) | ... | @@ -26,7 +26,7 @@ export const getOrderListAPI = (params) => fn(fetch.get(Api.ORDER_LIST, params)) |
| 26 | /** | 26 | /** |
| 27 | * @description: 获取订单详情 | 27 | * @description: 获取订单详情 |
| 28 | * @param: i 订单ID | 28 | * @param: i 订单ID |
| 29 | - * @return: data: { } | 29 | + * @return: data: { id: 订单id, status: 订单状态, note: 备注, total_price: 订单总金额, pay_type: 支付方式, pay_time: 支付时间, receive_name: 姓名, receive_phone: 手机, receive_email: 邮箱, receive_address: 地址 } |
| 30 | */ | 30 | */ |
| 31 | export const getOrderInfoAPI = (params) => fn(fetch.get(Api.ORDER_INFO, params)) | 31 | export const getOrderInfoAPI = (params) => fn(fetch.get(Api.ORDER_INFO, params)) |
| 32 | 32 | ... | ... |
| ... | @@ -31,6 +31,7 @@ declare module 'vue' { | ... | @@ -31,6 +31,7 @@ declare module 'vue' { |
| 31 | VanCellGroup: typeof import('vant/es')['CellGroup'] | 31 | VanCellGroup: typeof import('vant/es')['CellGroup'] |
| 32 | VanCheckbox: typeof import('vant/es')['Checkbox'] | 32 | VanCheckbox: typeof import('vant/es')['Checkbox'] |
| 33 | VanDatePicker: typeof import('vant/es')['DatePicker'] | 33 | VanDatePicker: typeof import('vant/es')['DatePicker'] |
| 34 | + VanDialog: typeof import('vant/es')['Dialog'] | ||
| 34 | VanEmpty: typeof import('vant/es')['Empty'] | 35 | VanEmpty: typeof import('vant/es')['Empty'] |
| 35 | VanField: typeof import('vant/es')['Field'] | 36 | VanField: typeof import('vant/es')['Field'] |
| 36 | VanForm: typeof import('vant/es')['Form'] | 37 | VanForm: typeof import('vant/es')['Form'] | ... | ... |
| ... | @@ -79,14 +79,14 @@ | ... | @@ -79,14 +79,14 @@ |
| 79 | </div> | 79 | </div> |
| 80 | 80 | ||
| 81 | <div class="mt-4 pt-3 border-t border-gray-200"> | 81 | <div class="mt-4 pt-3 border-t border-gray-200"> |
| 82 | - <div class="flex justify-between items-center text-sm"> | 82 | + <!-- <div class="flex justify-between items-center text-sm"> |
| 83 | <span class="text-gray-600">小计</span> | 83 | <span class="text-gray-600">小计</span> |
| 84 | <span class="font-medium">{{ formatPrice(getTotalPrice()) }}</span> | 84 | <span class="font-medium">{{ formatPrice(getTotalPrice()) }}</span> |
| 85 | </div> | 85 | </div> |
| 86 | <div class="flex justify-between items-center text-sm mt-1"> | 86 | <div class="flex justify-between items-center text-sm mt-1"> |
| 87 | <span class="text-gray-600">优惠</span> | 87 | <span class="text-gray-600">优惠</span> |
| 88 | <span class="text-red-500">- ¥0.00</span> | 88 | <span class="text-red-500">- ¥0.00</span> |
| 89 | - </div> | 89 | + </div> --> |
| 90 | <div class="flex justify-between items-center mt-2 font-medium"> | 90 | <div class="flex justify-between items-center mt-2 font-medium"> |
| 91 | <span>总计</span> | 91 | <span>总计</span> |
| 92 | <span class="text-lg text-green-600">{{ formatPrice(getTotalPrice()) }}</span> | 92 | <span class="text-lg text-green-600">{{ formatPrice(getTotalPrice()) }}</span> | ... | ... |
This diff is collapsed. Click to expand it.
-
Please register or login to post a comment