hookehuyr

feat(订单): 添加订单详情弹窗并优化订单状态管理

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