From b0eb2441462ee9587837e954308d222362ba7af0 Mon Sep 17 00:00:00 2001 From: jinyaqiu Date: Thu, 7 Aug 2025 16:40:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=BD=AE=E6=92=AD=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/(tabs)/owner.tsx | 5 +++-- components/owner/carousel.tsx | 10 ++++------ components/owner/category.tsx | 8 ++++---- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/app/(tabs)/owner.tsx b/app/(tabs)/owner.tsx index 0281b91..7258872 100644 --- a/app/(tabs)/owner.tsx +++ b/app/(tabs)/owner.tsx @@ -13,13 +13,14 @@ import { CountData, UserInfoDetails } from '@/types/user'; import { useFocusEffect, useRouter } from 'expo-router'; import { useCallback, useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; -import { FlatList, StyleSheet, View } from 'react-native'; +import { Dimensions, FlatList, StyleSheet, View } from 'react-native'; import { useSafeAreaInsets } from "react-native-safe-area-context"; export default function OwnerPage() { const insets = useSafeAreaInsets(); const { t } = useTranslation(); const router = useRouter(); + const width = Dimensions.get("window").width; // 添加页面挂载状态 const [isMounted, setIsMounted] = useState(false); @@ -122,7 +123,7 @@ export default function OwnerPage() { {/* 分类 */} - + diff --git a/components/owner/carousel.tsx b/components/owner/carousel.tsx index 6d21d82..6b5aca4 100644 --- a/components/owner/carousel.tsx +++ b/components/owner/carousel.tsx @@ -75,7 +75,7 @@ function CarouselComponent(props: Props) { }}> setCurrentIndex(index)} @@ -89,16 +89,14 @@ function CarouselComponent(props: Props) { } modeConfig={{ parallaxScrollingScale: 1, - parallaxScrollingOffset: 140, + parallaxScrollingOffset: 130, parallaxAdjacentItemScale: 0.7 }} renderItem={({ item, index }) => { - const isActive = index === currentIndex; const style: ViewStyle = { width: width, - height: width * 0.8, - alignItems: "center", - // paddingTop: isActive && item?.key === 'total_count' ? 0 : 40 + height: width * 0.7, + alignItems: "center" }; return ( diff --git a/components/owner/category.tsx b/components/owner/category.tsx index fdefbb6..e1e7fb5 100644 --- a/components/owner/category.tsx +++ b/components/owner/category.tsx @@ -44,7 +44,7 @@ const CategoryComponent = ({ title, data, bgSvg, style, width }: CategoryProps) }; return ( - + {item.title} - + {item?.title === "Length" ? ( typeof item.number === 'object' ? ( renderTimeDisplay(item.number) @@ -110,6 +110,7 @@ const styles = StyleSheet.create({ }, content: { padding: 32, + paddingRight: 16, justifyContent: "space-between", flex: 1 }, @@ -136,7 +137,7 @@ const styles = StyleSheet.create({ flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', - paddingVertical: 8, + paddingVertical: 16, width: '100%', }, itemTitle: { @@ -152,7 +153,6 @@ const styles = StyleSheet.create({ lineHeight: 30, fontWeight: '700', textAlign: 'left', - marginLeft: 8, flex: 1, } });