diff --git a/components/ImageViewer/index.jsx b/components/ImageViewer/index.jsx index 435d86f..e413b9d 100644 --- a/components/ImageViewer/index.jsx +++ b/components/ImageViewer/index.jsx @@ -75,12 +75,14 @@ export function ImageViewer({ }; //查看原图 + const [isLoading, setIsLoading] = useState(false); const handleCheckOriginalImage = async (index) => { const isVip = await checkRole(); if (!isVip) { setIsVipModalVisible(true); return; } + setIsLoading(true); const apiUrl = process.env.EXPO_PUBLIC_API_URL; try { const base = await baseRequest(); @@ -123,6 +125,8 @@ export function ImageViewer({ }); } catch (error) { console.error(error); + } finally { + setIsLoading(false); } }; @@ -211,12 +215,15 @@ export function ImageViewer({ ), }} > - + {isLoading && } + {!isLoading && ( + + )}