From 72f34389562b0a7b93e29cf78a371bd6b61d3191 Mon Sep 17 00:00:00 2001 From: yezian Date: Tue, 23 Jan 2024 21:52:17 +0800 Subject: [PATCH] =?UTF-8?q?webview=E7=9B=B8=E5=85=B3=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E8=BF=9B=E5=85=A5=E6=97=B6=E5=85=88=E7=AD=89=E5=BE=85500?= =?UTF-8?q?=E6=AF=AB=E7=A7=92=E7=AD=89=E5=BE=85cookie=E5=86=99=E5=85=A5?= =?UTF-8?q?=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/bill/[type]/page.jsx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/app/bill/[type]/page.jsx b/app/bill/[type]/page.jsx index 18f8931..1768d00 100644 --- a/app/bill/[type]/page.jsx +++ b/app/bill/[type]/page.jsx @@ -5,9 +5,9 @@ import { Toast } from "antd-mobile"; import { generateSignature } from "@/utils/crypto"; import webviewBaseRequest from "@/utils/webviewBaseRequest"; -//todo:增加空数据展示图 export default function BillDetail({ params }) { const [data, setData] = useState([]); + const [isFetching, setIsFetching] = useState(true); useEffect(() => { const getData = async () => { let type; @@ -58,11 +58,14 @@ export default function BillDetail({ params }) { return; } setData(temData.data.list); + setIsFetching(false); } catch (error) { console.error(error); } }; - getData(); + setTimeout(() => { + getData(); + }, 500); }, []); const RenderItem = ({ item }) => { @@ -82,6 +85,14 @@ export default function BillDetail({ params }) { ); }; + if (isFetching) { + return ( +
+ +
+ ); + } + return (
{data.length === 0 && (