完善功能;更换icon

This commit is contained in:
yezian 2024-12-24 15:29:29 +08:00
parent f5487d23b5
commit e95ace080d
1 changed files with 13 additions and 6 deletions

View File

@ -75,12 +75,14 @@ export function ImageViewer({
}; };
// //
const [isLoading, setIsLoading] = useState(false);
const handleCheckOriginalImage = async (index) => { const handleCheckOriginalImage = async (index) => {
const isVip = await checkRole(); const isVip = await checkRole();
if (!isVip) { if (!isVip) {
setIsVipModalVisible(true); setIsVipModalVisible(true);
return; return;
} }
setIsLoading(true);
const apiUrl = process.env.EXPO_PUBLIC_API_URL; const apiUrl = process.env.EXPO_PUBLIC_API_URL;
try { try {
const base = await baseRequest(); const base = await baseRequest();
@ -123,6 +125,8 @@ export function ImageViewer({
}); });
} catch (error) { } catch (error) {
console.error(error); console.error(error);
} finally {
setIsLoading(false);
} }
}; };
@ -211,12 +215,15 @@ export function ImageViewer({
), ),
}} }}
> >
<Icon {isLoading && <ActivityIndicator size="small" />}
type="ionicon" {!isLoading && (
name="image-outline" <Icon
size={20} type="ionicon"
color="white" name="image-outline"
/> size={20}
color="white"
/>
)}
<Text <Text
style={tailwind("text-xs text-[#FFFFFF80] font-medium mt-1")} style={tailwind("text-xs text-[#FFFFFF80] font-medium mt-1")}
> >