完善支付功能,添加支付宝的准备与创建逻辑

This commit is contained in:
2025-04-16 18:51:17 +08:00
parent d435d98887
commit 9a438491be
9 changed files with 258 additions and 86 deletions

View File

@@ -11,6 +11,7 @@ import balance from '@/components/composites/purchase/_assets/balance.svg'
import {Button} from '@/components/ui/button'
import {AuthContext} from '@/components/providers/AuthProvider'
import RechargeModal from '@/components/composites/purchase/_client/recharge'
import Pay from '@/components/composites/purchase/_client/pay'
export type RightProps = {}
@@ -30,6 +31,7 @@ export default function Right(props: RightProps) {
const watchQuota = form.watch('quota')
const watchExpire = form.watch('expire')
const watchDailyLimit = form.watch('daily_limit')
const payType = form.watch('pay_type')
return (
<div className={`flex-none basis-80 p-6 flex flex-col gap-6`}>
@@ -119,9 +121,13 @@ export default function Right(props: RightProps) {
</RadioGroup>
)}
</FormField>
<Button className={`mt-4 h-12`} type="submit">
</Button>
<Pay method={payType} amount={100} resource={{
type: Number(watchType),
live: Number(watchLive) * 60,
quota: watchQuota,
expire: Number(watchExpire) * 24 * 3600,
daily_limit: watchDailyLimit,
}}/>
</div>
)
}