diff --git a/src/user/order/components/OrderList.tsx b/src/user/order/components/OrderList.tsx
index 1c20792..f5f3273 100644
--- a/src/user/order/components/OrderList.tsx
+++ b/src/user/order/components/OrderList.tsx
@@ -1,8 +1,7 @@
-import {Avatar, Cell, Space, Empty, Tabs, Button, TabPane, Image, Dialog} from '@nutui/nutui-react-taro'
+import {Avatar, Cell, Space, Empty, Tabs, Button, TabPane, Image, Dialog, PullToRefresh, InfiniteLoading} from '@nutui/nutui-react-taro'
import {useEffect, useState, useCallback, useRef, CSSProperties} from "react";
import {View, Text} from '@tarojs/components'
import Taro from '@tarojs/taro';
-import {InfiniteLoading} from '@nutui/nutui-react-taro'
import dayjs from "dayjs";
import {
pageShopOrder,
@@ -685,193 +684,202 @@ function OrderList(props: OrderListProps) {
})
}
-
- {error ? (
-
- {error}
-
-
- ) : (
- {
- }}
- onScrollToUpper={() => {
-
- }}
- loadingText={
- <>
- 加载中
- >
- }
- loadMoreText={
- list.length === 0 ? (
-
- ) : (
-
- 没有更多了
-
- )
- }
- >
-
- {/* 订单列表 */}
- {list.length > 0 && list
- ?.filter((item) => {
- // “待收货”不展示退款中的/已退款订单,这些订单统一放到“退货/售后”
- if (tapIndex === 3 && (item.orderStatus === 4 || item.orderStatus === 6)) {
- return false;
- }
- // “退货/售后”只展示售后相关状态
- if (tapIndex === 5) {
- return item.orderStatus === 4 || item.orderStatus === 5 || item.orderStatus === 6 || item.orderStatus === 7;
- }
- return true;
- })
- ?.map((item, index) => {
- return (
- Taro.navigateTo({url: `/shop/orderDetail/index?orderId=${item.orderId}`})}>
-
-
-
- {
- e.stopPropagation();
- copyText(`${item.orderNo}`)
- }}>{item.orderNo}
+ {/* 订单列表 */}
+ {list.length > 0 && list
+ ?.filter((item) => {
+ // “待收货”不展示退款中的/已退款订单,这些订单统一放到“退货/售后”
+ if (tapIndex === 3 && (item.orderStatus === 4 || item.orderStatus === 6)) {
+ return false;
+ }
+ // “退货/售后”只展示售后相关状态
+ if (tapIndex === 5) {
+ return item.orderStatus === 4 || item.orderStatus === 5 || item.orderStatus === 6 || item.orderStatus === 7;
+ }
+ return true;
+ })
+ ?.map((item, index) => {
+ return (
+ | Taro.navigateTo({url: `/shop/orderDetail/index?orderId=${item.orderId}`})}>
+
+
+
+ {
+ e.stopPropagation();
+ copyText(`${item.orderNo}`)
+ }}>{item.orderNo}
+
+ {/* 右侧显示合并的状态和倒计时 */}
+
+ {!item.payStatus && item.orderStatus !== 2 ? (
+
+ ) : (
+ getOrderStatusText(item)
+ )}
+
- {/* 右侧显示合并的状态和倒计时 */}
-
- {!item.payStatus && item.orderStatus !== 2 ? (
-
+ {dayjs(item.createTime).format('YYYY年MM月DD日 HH:mm:ss')}
+
+ {/* 商品信息 */}
+
+ {item.orderGoods && item.orderGoods.length > 0 ? (
+ item.orderGoods.map((goods, goodsIndex) => (
+
+
+
+
+ {goods.goodsName || (goods as any).goodsTitle || (goods as any).title || item.title || '订单商品'}
+
+ {(goods.spec || (goods as any).specInfo) && (
+ 规格:{goods.spec || (goods as any).specInfo}
+ )}
+ 数量:{(goods as any).quantity ?? goods.totalNum}
+
+ x
+ ¥{goods.price || (goods as any).payPrice}
+
+ ))
) : (
- getOrderStatusText(item)
+
+
+
+ {item.title || '订单商品'}
+ {item.totalNum}件商品
+
+
)}
-
- {dayjs(item.createTime).format('YYYY年MM月DD日 HH:mm:ss')}
- {/* 商品信息 */}
-
- {item.orderGoods && item.orderGoods.length > 0 ? (
- item.orderGoods.map((goods, goodsIndex) => (
-
-
-
-
- {goods.goodsName || (goods as any).goodsTitle || (goods as any).title || item.title || '订单商品'}
-
- {(goods.spec || (goods as any).specInfo) && (
- 规格:{goods.spec || (goods as any).specInfo}
- )}
- 数量:{(goods as any).quantity ?? goods.totalNum}
-
- x
- ¥{goods.price || (goods as any).payPrice}
-
- ))
- ) : (
-
-
-
- {item.title || '订单商品'}
- {item.totalNum}件商品
-
-
- )}
-
+ 实付金额:¥{item.payPrice}
- 实付金额:¥{item.payPrice}
+ {/* 操作按钮 */}
+ {!isReadOnly && (
+
+ {/* 待付款状态:显示取消订单和立即支付 */}
+ {(!item.payStatus) && item.orderStatus !== 2 && (
+
+ {
+ e.stopPropagation();
+ void cancelOrder(item);
+ }}>取消订单
+ {(!item.createTime || !isPaymentExpired(item.createTime, 24)) && (
+ {
+ e.stopPropagation();
+ void payOrder(item);
+ }}>立即支付
+ )}
+
+ )}
- {/* 操作按钮 */}
- {!isReadOnly && (
-
- {/* 待付款状态:显示取消订单和立即支付 */}
- {(!item.payStatus) && item.orderStatus !== 2 && (
-
+ {/* 待发货状态:显示申请退款 */}
+ {item.payStatus && isWithinRefundWindow(item.payTime, 60) && item.deliveryStatus === 10 && item.orderStatus !== 2 && item.orderStatus !== 4 && !isOrderCompleted(item) && (
{
e.stopPropagation();
- void cancelOrder(item);
- }}>取消订单
- {(!item.createTime || !isPaymentExpired(item.createTime, 24)) && (
+ applyRefund(item);
+ }}>申请退款
+ )}
+
+ {/* 待收货状态:显示查看物流和确认收货 */}
+ {item.deliveryStatus === 20 && (!item.riderId || !!item.sendEndTime) && item.orderStatus !== 2 && item.orderStatus !== 6 && !isOrderCompleted(item) && (
+
+ {/* {*/}
+ {/* e.stopPropagation();*/}
+ {/* viewLogistics(item);*/}
+ {/*}}>查看物流*/}
{
e.stopPropagation();
- void payOrder(item);
- }}>立即支付
- )}
-
- )}
+ confirmReceive(item);
+ }}>确认收货
+
+ )}
- {/* 待发货状态:显示申请退款 */}
- {item.payStatus && isWithinRefundWindow(item.payTime, 60) && item.deliveryStatus === 10 && item.orderStatus !== 2 && item.orderStatus !== 4 && !isOrderCompleted(item) && (
- {
- e.stopPropagation();
- applyRefund(item);
- }}>申请退款
- )}
+ {/* 退款/售后状态:显示查看进度和撤销申请 */}
+ {(item.orderStatus === 4 || item.orderStatus === 7) && (
+
+ {/* {*/}
+ {/* e.stopPropagation();*/}
+ {/* viewProgress(item);*/}
+ {/*}}>查看进度*/}
+
+ )}
- {/* 待收货状态:显示查看物流和确认收货 */}
- {item.deliveryStatus === 20 && (!item.riderId || !!item.sendEndTime) && item.orderStatus !== 2 && item.orderStatus !== 6 && !isOrderCompleted(item) && (
-
- {/* {*/}
- {/* e.stopPropagation();*/}
- {/* viewLogistics(item);*/}
- {/*}}>查看物流*/}
- {
- e.stopPropagation();
- confirmReceive(item);
- }}>确认收货
-
+
)}
-
- {/* 退款/售后状态:显示查看进度和撤销申请 */}
- {(item.orderStatus === 4 || item.orderStatus === 7) && (
-
- {/* {*/}
- {/* e.stopPropagation();*/}
- {/* viewProgress(item);*/}
- {/*}}>查看进度*/}
-
- )}
-
- )}
-
- |
- )
- })}
- |
- )}
-
+
+ )
+ })}
+
+ )}
+
+
{/* 取消订单确认对话框 */}