修复支付取消的调用和规定时间内更新订单支付状态
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user