修复支付取消的调用和规定时间内更新订单支付状态

This commit is contained in:
Eamon-meng
2025-08-16 11:41:07 +08:00
parent 1baa7c94dc
commit 99c3b9914e
7 changed files with 105 additions and 98 deletions

View File

@@ -1,5 +1,5 @@
'use client'
import {DialogContent} from '@/components/ui/dialog'
import {DialogClose, DialogContent} from '@/components/ui/dialog'
import {Button} from '@/components/ui/button'
import {toast} from 'sonner'
import {CreditCard, Loader} from 'lucide-react'
@@ -26,7 +26,7 @@ export function MobilePayment(props: PaymentModalProps) {
// 处理支付完成确认
const handlePaymentComplete = async () => {
setLoading(true)
await props.onConfirm?.() // 调用父组件传入的确认方法
await props.onConfirm(true) // 调用父组件传入的确认方法
setLoading(false)
}
@@ -77,13 +77,15 @@ export function MobilePayment(props: PaymentModalProps) {
<div className="flex gap-3">
{!paymentInitiated ? ( // 未发起支付时显示
<>
<Button
theme="outline"
className="flex-1 py-3 text-base"
onClick={props.onClose}
>
</Button>
<DialogClose asChild>
<Button
theme="outline"
className="flex-1 py-3 text-base"
onClick={props.onClose}
>
</Button>
</DialogClose>
<Button
className="flex-1 py-3 text-base"
onClick={handleConfirmPayment}