From 7811f7482bd2448506f7e9f194f4ad1af0532c2c Mon Sep 17 00:00:00 2001 From: archer <545436317@qq.com> Date: Fri, 7 Apr 2023 01:20:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B4=A6=E5=8D=95=E7=AC=AC=E4=B8=80?= =?UTF-8?q?=E9=A1=B5=E4=B8=8D=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/usePaging.ts | 7 ++++--- src/pages/number/components/PayModal.tsx | 11 +---------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/hooks/usePaging.ts b/src/hooks/usePaging.ts index 1bf8cdfe3..bf482fac8 100644 --- a/src/hooks/usePaging.ts +++ b/src/hooks/usePaging.ts @@ -1,6 +1,5 @@ -import { useState, useCallback } from 'react'; +import { useState, useCallback, useEffect } from 'react'; import type { PagingData } from '../types/index'; -import { useQuery } from '@tanstack/react-query'; import { useToast } from './useToast'; export const usePaging = ({ @@ -64,7 +63,9 @@ export const usePaging = ({ getData(pageNum + 1); }, [getData, isLoadAll, pageNum, requesting]); - useQuery(['init'], () => getData(1, true)); + useEffect(() => { + getData(1, true); + }, []); return { pageNum, diff --git a/src/pages/number/components/PayModal.tsx b/src/pages/number/components/PayModal.tsx index 66662f0e3..af1ce457b 100644 --- a/src/pages/number/components/PayModal.tsx +++ b/src/pages/number/components/PayModal.tsx @@ -10,21 +10,12 @@ import { Button, Input, Box, - Grid, - Table, - Thead, - Tbody, - Tr, - Th, - Td, - TableContainer + Grid } from '@chakra-ui/react'; import { getPayCode, checkPayResult } from '@/api/user'; import { useToast } from '@/hooks/useToast'; import { useQuery } from '@tanstack/react-query'; import { useRouter } from 'next/router'; -import { modelList } from '@/constants/model'; -import { formatPrice } from '../../../utils/user'; const PayModal = ({ onClose }: { onClose: () => void }) => { const router = useRouter();