开启充值和余额支付功能
This commit is contained in:
@@ -4,9 +4,17 @@ import {FormField} from '@/components/ui/form'
|
||||
import Image from 'next/image'
|
||||
import alipay from '../_assets/alipay.svg'
|
||||
import wechat from '../_assets/wechat.svg'
|
||||
import balance from '../_assets/balance.svg'
|
||||
import RechargeModal from '@/components/composites/recharge'
|
||||
import {useProfileStore} from '@/components/stores/profile'
|
||||
import {use} from 'react'
|
||||
import Link from 'next/link'
|
||||
import {buttonVariants} from '@/components/ui/button'
|
||||
|
||||
export function FieldPayment() {
|
||||
return (
|
||||
const profile = use(useProfileStore(store => store.profile))
|
||||
|
||||
return profile ? (
|
||||
<FormField name="pay_type" label="支付方式" className="flex flex-col gap-6">
|
||||
{({id, field}) => (
|
||||
<RadioGroup
|
||||
@@ -15,7 +23,7 @@ export function FieldPayment() {
|
||||
onValueChange={field.onChange}
|
||||
className="flex flex-col gap-3">
|
||||
|
||||
{/* <div className="w-full p-3 flex flex-col gap-4 bg-gray-100 rounded-md">
|
||||
<div className="w-full p-3 flex flex-col gap-4 bg-gray-100 rounded-md">
|
||||
<p className="flex items-center gap-3">
|
||||
<Image src={balance} alt="余额icon"/>
|
||||
<span className="text-sm text-gray-500">账户余额</span>
|
||||
@@ -24,16 +32,15 @@ export function FieldPayment() {
|
||||
<span className="text-xl">{profile.balance}</span>
|
||||
<RechargeModal/>
|
||||
</p>
|
||||
</div> */}
|
||||
|
||||
{/* <FormOption
|
||||
</div>
|
||||
<FormOption
|
||||
id={`${id}-balance`}
|
||||
value="balance"
|
||||
compare={field.value}
|
||||
className="p-3 w-full flex-row gap-2 justify-center">
|
||||
<Image src={balance} alt="余额 icon"/>
|
||||
<span>余额</span>
|
||||
</FormOption> */}
|
||||
</FormOption>
|
||||
<FormOption
|
||||
id={`${id}-wechat`}
|
||||
value="wechat"
|
||||
@@ -53,5 +60,9 @@ export function FieldPayment() {
|
||||
</RadioGroup>
|
||||
)}
|
||||
</FormField>
|
||||
) : (
|
||||
<Link href="/login" className={buttonVariants()}>
|
||||
登录后支付
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user