|
|
@@ -3,6 +3,8 @@ import { View, Text, ScrollView } from '@tarojs/components';
|
|
|
import { Button } from '@/components/ui/button';
|
|
|
import Taro from '@tarojs/taro';
|
|
|
import { useQuery } from '@tanstack/react-query';
|
|
|
+import { format } from 'date-fns';
|
|
|
+import { zhCN } from 'date-fns/locale';
|
|
|
import { orderClient } from '@/api';
|
|
|
import { OrderStatus } from '@/types/order.types';
|
|
|
import { getVehicleTypeText, getTravelModeText } from '@/types/route.types';
|
|
|
@@ -107,7 +109,7 @@ const OrderCard = ({ order, onViewDetail }) => {
|
|
|
isCharterOrder ? 'text-white' : 'text-gray-900'
|
|
|
}`}>
|
|
|
{order.routeSnapshot?.departureTime
|
|
|
- ? new Date(order.routeSnapshot.departureTime).toLocaleString('zh-CN')
|
|
|
+ ? format(new Date(order.routeSnapshot.departureTime), 'yyyy-MM-dd HH:mm:ss', { locale: zhCN })
|
|
|
: '未知时间'
|
|
|
}
|
|
|
</Text>
|
|
|
@@ -161,7 +163,7 @@ const OrderCard = ({ order, onViewDetail }) => {
|
|
|
<Text className={`text-[26rpx] flex-1 min-w-0 font-medium leading-[1.4] ${
|
|
|
isCharterOrder ? 'text-gray-300' : 'text-gray-500'
|
|
|
}`}>
|
|
|
- 下单时间:{new Date(order.createdAt).toLocaleString('zh-CN')}
|
|
|
+ 下单时间:{format(new Date(order.createdAt), 'yyyy-MM-dd HH:mm:ss', { locale: zhCN })}
|
|
|
</Text>
|
|
|
<View className="flex items-center flex-shrink-0">
|
|
|
<Text className={`text-[28rpx] mr-2 ${
|