perf(前端): 移动端支付链接
parent
07653ef024
commit
b5259edd1c
@ -0,0 +1,14 @@
|
||||
import { createContext, useEffect, useState } from 'react'
|
||||
import { Drawer } from 'antd'
|
||||
import { useOrderStore } from '@/stores/OrderStore'
|
||||
import GeneratePayment from '@/views/accounts/GeneratePayment'
|
||||
|
||||
const GeneratePaymentDrawer = ({ ...props }) => {
|
||||
const [openPaymentDrawer, closePaymentDrawer, paymentDrawerOpen] = useOrderStore((state) => [state.openDrawer, state.closeDrawer, state.drawerOpen])
|
||||
return (
|
||||
<Drawer title='支付链接' placement={'top'} size={'large'} onClose={() => closePaymentDrawer()} open={paymentDrawerOpen}>
|
||||
<GeneratePayment></GeneratePayment>
|
||||
</Drawer>
|
||||
)
|
||||
}
|
||||
export default GeneratePaymentDrawer
|
@ -1,15 +1,28 @@
|
||||
import { createContext, useEffect, useState } from 'react'
|
||||
import { useOrderStore } from '@/stores/OrderStore'
|
||||
import { Tooltip, Button } from 'antd'
|
||||
import GeneratePaymentDrawer from '../Components/GeneratePaymentDrawer'
|
||||
|
||||
const PaymentlinkBtn = ({ ...props }) => {
|
||||
const PaymentlinkBtn = ({ type, ...props }) => {
|
||||
const [openPaymentDrawer] = useOrderStore((state) => [state.openDrawer])
|
||||
|
||||
return (
|
||||
<Tooltip title='支付链接' >
|
||||
{/* <Button type='text' onClick={() => openPaymentDrawer()} icon={<DollarOutlined className='text-orange-500' />} size={'middle'} /> */}
|
||||
<Button type='text' onClick={() => openPaymentDrawer()} size={'middle'} className='px-1' >💲</Button>
|
||||
</Tooltip>
|
||||
<>
|
||||
<GeneratePaymentDrawer />
|
||||
<Tooltip title='支付链接'>
|
||||
{/* <Button type='text' onClick={() => openPaymentDrawer()} icon={<DollarOutlined className='text-orange-500' />} size={'middle'} /> */}
|
||||
|
||||
{type === 'link' ? (
|
||||
<Button type={'link'} onClick={() => openPaymentDrawer()}>
|
||||
支付链接
|
||||
</Button>
|
||||
) : (
|
||||
<Button type='text' onClick={() => openPaymentDrawer()} size={'middle'} className='px-1'>
|
||||
💲
|
||||
</Button>
|
||||
)}
|
||||
</Tooltip>
|
||||
</>
|
||||
)
|
||||
}
|
||||
export default PaymentlinkBtn
|
||||
|
Loading…
Reference in New Issue