取消关闭支付弹窗调用关闭订单接口 & 添加未实名去支付时的拦截

This commit is contained in:
Eamon-meng
2026-04-20 16:22:49 +08:00
parent 74d53c619d
commit 27e694ee0d
3 changed files with 41 additions and 25 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "lanhu-web",
"version": "1.7.0",
"version": "1.8.0",
"private": true,
"scripts": {
"dev": "next dev -H 0.0.0.0 --turbopack",

View File

@@ -17,21 +17,21 @@ export type PaymentModalProps = {
export function PaymentModal(props: PaymentModalProps) {
// 手动关闭时的处理
const handleClose = async () => {
try {
const res = await payClose({
trade_no: props.inner_no,
method: props.method,
})
if (!res.success) {
throw new Error(res.message)
}
}
catch (error) {
console.error('关闭订单失败:', error)
}
finally {
// try {
// const res = await payClose({
// trade_no: props.inner_no,
// method: props.method,
// })
// if (!res.success) {
// throw new Error(res.message)
// }
// }
// catch (error) {
// console.error('关闭订单失败:', error)
// }
// finally {
props.onClose?.()
}
// }
}
// SSE处理方式检查支付状态

View File

@@ -14,6 +14,7 @@ import {ExtraResp} from '@/lib/api'
import {formatPurchaseLiveLabel} from './sku'
import {User} from '@/lib/models'
import {PurchaseFormValues} from './form-values'
import {IdCard} from 'lucide-react'
const emptyPrice: ExtraResp<typeof getPrice> = {
price: '0.00',
@@ -107,6 +108,7 @@ export function PurchaseSidePanel(props: PurchaseSidePanelProps) {
<span className="text-xl text-orange-500">{discountedPrice}</span>
</p>
{profile ? (
profile.id_type !== 0 ? (
<>
<FieldPayment balance={profile.balance}/>
<Pay
@@ -116,6 +118,20 @@ export function PurchaseSidePanel(props: PurchaseSidePanelProps) {
resource={resource}
/>
</>
) : (
<div className="flex flex-col gap-3">
<p className="text-sm text-gray-500">
</p>
<Link
href="/admin/identify"
className={buttonVariants()}
>
<IdCard size={16} className="mr-1"/>
</Link>
</div>
)
) : (
<Link href="/login" className={buttonVariants()}>