修复关闭订单后未返回到充值页面的问题
This commit is contained in:
@@ -17,11 +17,13 @@ export function PaymentModal(props: PaymentModalProps) {
|
|||||||
// 手动关闭时的处理
|
// 手动关闭时的处理
|
||||||
const handleClose = async () => {
|
const handleClose = async () => {
|
||||||
try {
|
try {
|
||||||
const req = {
|
const res = await payClose({
|
||||||
trade_no: props.inner_no,
|
trade_no: props.inner_no,
|
||||||
method: props.method,
|
method: props.method,
|
||||||
|
})
|
||||||
|
if (!res.success) {
|
||||||
|
throw new Error(res.message)
|
||||||
}
|
}
|
||||||
const res = await payClose(req)
|
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
console.error('关闭订单失败:', error)
|
console.error('关闭订单失败:', error)
|
||||||
|
|||||||
@@ -118,8 +118,6 @@ export default function RechargeModal(props: RechargeModelProps) {
|
|||||||
|
|
||||||
const handleClose = () => {
|
const handleClose = () => {
|
||||||
setTrade(undefined)
|
setTrade(undefined)
|
||||||
setOpen(false)
|
|
||||||
form.reset()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -215,8 +213,8 @@ export default function RechargeModal(props: RechargeModelProps) {
|
|||||||
)}
|
)}
|
||||||
</FormField>
|
</FormField>
|
||||||
|
|
||||||
<DialogFooter className="!flex !flex-row !justify-center">
|
<DialogFooter>
|
||||||
<Button className="px-8 h-12 text-lg">立即支付</Button>
|
<Button>立即支付</Button>
|
||||||
</DialogFooter>
|
</DialogFooter>
|
||||||
</Form>
|
</Form>
|
||||||
</>
|
</>
|
||||||
|
|||||||
Reference in New Issue
Block a user