✨ feat(user): Add 'gift_amount' field and update related references in user services and components
This commit is contained in:
@@ -29,14 +29,14 @@ import StripePayment from './stripe';
|
||||
export default function Page() {
|
||||
const t = useTranslations('order');
|
||||
const { getUserInfo } = useGlobalStore();
|
||||
const [order_no, setOrderNo] = useState<string>();
|
||||
const [orderNo, setOrderNo] = useState<string>();
|
||||
const [enabled, setEnabled] = useState<boolean>(false);
|
||||
|
||||
const { data } = useQuery({
|
||||
enabled: enabled,
|
||||
queryKey: ['queryOrderDetail', order_no],
|
||||
queryKey: ['queryOrderDetail', orderNo],
|
||||
queryFn: async () => {
|
||||
const { data } = await queryOrderDetail({ order_no: order_no! });
|
||||
const { data } = await queryOrderDetail({ order_no: orderNo! });
|
||||
if (data?.data?.status !== 1) {
|
||||
getUserInfo();
|
||||
setEnabled(false);
|
||||
@@ -47,10 +47,10 @@ export default function Page() {
|
||||
});
|
||||
|
||||
const { data: payment } = useQuery({
|
||||
enabled: !!order_no && data?.status === 1,
|
||||
queryKey: ['checkoutOrder', order_no],
|
||||
enabled: !!orderNo && data?.status === 1,
|
||||
queryKey: ['checkoutOrder', orderNo],
|
||||
queryFn: async () => {
|
||||
const { data } = await checkoutOrder({ orderNo: order_no! });
|
||||
const { data } = await checkoutOrder({ orderNo: orderNo! });
|
||||
return data?.data;
|
||||
},
|
||||
});
|
||||
|
||||
@@ -39,7 +39,7 @@ export function SidebarRight({ ...props }: React.ComponentProps<typeof Sidebar>)
|
||||
<CardTitle className='text-sm font-medium'>{t('giftAmount')}</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent className='p-3 text-2xl font-bold'>
|
||||
<Display type='currency' value={user?.deduction} />
|
||||
<Display type='currency' value={user?.gift_amount} />
|
||||
</CardContent>
|
||||
</Card>
|
||||
<Card>
|
||||
|
||||
@@ -16,7 +16,7 @@ export default function Page() {
|
||||
const t = useTranslations('wallet');
|
||||
const { user } = useGlobalStore();
|
||||
const ref = useRef<ProListActions>(null);
|
||||
const totalAssets = (user?.balance || 0) + (user?.commission || 0) + (user?.deduction || 0);
|
||||
const totalAssets = (user?.balance || 0) + (user?.commission || 0) + (user?.gift_amount || 0);
|
||||
return (
|
||||
<>
|
||||
<Card className='mb-4'>
|
||||
@@ -47,7 +47,7 @@ export default function Page() {
|
||||
{t('giftAmount')}
|
||||
</p>
|
||||
<p className='text-secondary-foreground text-2xl font-bold'>
|
||||
<Display type='currency' value={user?.deduction} />
|
||||
<Display type='currency' value={user?.gift_amount} />
|
||||
</p>
|
||||
</div>
|
||||
<div className='bg-secondary rounded-lg p-4 shadow-sm transition-all duration-300 hover:shadow-md'>
|
||||
|
||||
Reference in New Issue
Block a user