diff --git a/src/api/types.ts b/src/api/types.ts index bcf29ad..1ee7397 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -743,6 +743,8 @@ export interface InputOrderPaymentInfo { pay_type: number; /** 挂账公司ID(挂账公司传对应的ID,其他传0) */ company_id: number; + /** 订单总金额 */ + orderAmount: number; } /** diff --git a/src/components/exam/ExamAddonPanel.tsx b/src/components/exam/ExamAddonPanel.tsx index 0d67855..edc966d 100644 --- a/src/components/exam/ExamAddonPanel.tsx +++ b/src/components/exam/ExamAddonPanel.tsx @@ -801,7 +801,8 @@ export const ExamAddonPanel = ({ client, onGoToSign }: ExamAddonPanelProps) => { }>, pay_type: number, company_id: number, - combinationItemCodes: string + combinationItemCodes: string, + orderAmount: number ) => { if (pollingTimerRef.current) { clearInterval(pollingTimerRef.current); @@ -815,6 +816,7 @@ export const ExamAddonPanel = ({ client, onGoToSign }: ExamAddonPanelProps) => { listAddItemCombination, pay_type, company_id, + orderAmount, }); if (res.Status === 200) { @@ -928,6 +930,20 @@ export const ExamAddonPanel = ({ client, onGoToSign }: ExamAddonPanelProps) => { const patient_id = customerInfo.patient_id; if (paymentMethod === 'self') { + // 自费模式:如果是 0 元支付,直接查询状态,不生成二维码 + if (totalCurrent === 0) { + startPaymentPolling( + physical_exam_id, + patient_id, + listAddItemCombination, + 12, // 微信支付 + 0, // 自费模式,company_id 传 0 + combinationItemCodes, + 0 + ); + return; + } + // 自费模式:生成二维码 const res = await createNativePaymentQrcode({ physical_exam_id, @@ -952,7 +968,8 @@ export const ExamAddonPanel = ({ client, onGoToSign }: ExamAddonPanelProps) => { listAddItemCombination, 12, // 微信支付 0, // 自费模式,company_id 传 0 - combinationItemCodes + combinationItemCodes, + totalCurrent ); } else { setPaymentMessage(res.Message || '生成支付二维码失败'); @@ -984,6 +1001,7 @@ export const ExamAddonPanel = ({ client, onGoToSign }: ExamAddonPanelProps) => { listAddItemCombination, pay_type: 13, // 挂账公司 company_id: selectedCompany.company_id, + orderAmount: totalCurrent, }); if (res.Status === 200) {