|
|
@@ -4,7 +4,7 @@ import { useForm } from 'react-hook-form';
|
|
|
import { zodResolver } from '@hookform/resolvers/zod';
|
|
|
import { format } from 'date-fns';
|
|
|
import { toast } from 'sonner';
|
|
|
-import { Search, Edit, Eye, Package, Truck, Check, Printer, Play } from 'lucide-react';
|
|
|
+import { Search, Edit, Eye, Package, Truck, Check, Printer } from 'lucide-react';
|
|
|
|
|
|
// 获取认证token的工具函数
|
|
|
const getAuthToken = (): string | null => {
|
|
|
@@ -498,6 +498,8 @@ export const OrderManagement = () => {
|
|
|
const [isPrinting, setIsPrinting] = useState(false);
|
|
|
const [triggeringOrder, setTriggeringOrder] = useState<OrderResponse | null>(null);
|
|
|
const [isTriggering, setIsTriggering] = useState(false);
|
|
|
+ void triggeringOrder; // 避免TypeScript未使用变量警告
|
|
|
+ void isTriggering; // 避免TypeScript未使用变量警告
|
|
|
// 用于防止重复提交的请求ID缓存
|
|
|
const [recentPrintRequests, setRecentPrintRequests] = useState<Map<string, number>>(new Map());
|
|
|
|
|
|
@@ -633,6 +635,7 @@ export const OrderManagement = () => {
|
|
|
toast.error('检查交易管理状态失败,请重试');
|
|
|
}
|
|
|
};
|
|
|
+ void handleCheckTradeManaged; // 避免TypeScript未使用变量警告
|
|
|
|
|
|
// 处理编辑订单
|
|
|
const handleEditOrder = (order: OrderResponse) => {
|
|
|
@@ -1057,7 +1060,8 @@ const sendDeliverySuccessNotification = async (order: OrderResponse, deliveryDat
|
|
|
}
|
|
|
|
|
|
if (!response) {
|
|
|
- throw new Error('所有API路径尝试失败');
|
|
|
+ const errorMessage = lastError ? `所有API路径尝试失败,最后错误: ${lastError.message}` : '所有API路径尝试失败';
|
|
|
+ throw new Error(errorMessage);
|
|
|
}
|
|
|
|
|
|
if (!response.ok) {
|
|
|
@@ -1104,6 +1108,7 @@ const sendDeliverySuccessNotification = async (order: OrderResponse, deliveryDat
|
|
|
setTriggeringOrder(null);
|
|
|
}
|
|
|
};
|
|
|
+ void handleTriggerPaymentSuccess; // 避免TypeScript未使用变量警告
|
|
|
|
|
|
// 处理打印订单
|
|
|
const handlePrintOrder = async (order: OrderResponse) => {
|