feat: 首页更新
This commit is contained in:
@@ -21,7 +21,6 @@ import { useColorScheme } from '@/hooks';
|
||||
import { styles } from './styles';
|
||||
import useMsgStore from '@/stores/msgStore';
|
||||
|
||||
|
||||
interface BannerSwiperProps {}
|
||||
|
||||
const { width } = Dimensions.get('window');
|
||||
@@ -38,7 +37,6 @@ export default function BannerSwiper({}: BannerSwiperProps) {
|
||||
const autoPlayTimerRef = useRef<any>(null);
|
||||
const { homeBanner } = useMsgStore();
|
||||
|
||||
|
||||
// 加载轮播图数据
|
||||
useEffect(() => {
|
||||
// 如果有传入的 banners 数据,直接使用
|
||||
@@ -127,11 +125,7 @@ export default function BannerSwiper({}: BannerSwiperProps) {
|
||||
onPress={() => onBannerPress(banner)}
|
||||
activeOpacity={0.9}
|
||||
>
|
||||
<Image
|
||||
source={{ uri: banner.subject }}
|
||||
style={s.image}
|
||||
resizeMode="cover"
|
||||
/>
|
||||
<Image source={{ uri: banner.subject }} style={s.image} resizeMode="cover" />
|
||||
</TouchableOpacity>
|
||||
))}
|
||||
</ScrollView>
|
||||
@@ -139,16 +133,9 @@ export default function BannerSwiper({}: BannerSwiperProps) {
|
||||
{/* 指示器 */}
|
||||
<View style={s.indicatorContainer}>
|
||||
{homeBanner.map((_, index) => (
|
||||
<View
|
||||
key={index}
|
||||
style={[
|
||||
s.indicator,
|
||||
index === currentIndex && s.indicatorActive,
|
||||
]}
|
||||
/>
|
||||
<View key={index} style={[s.indicator, index === currentIndex && s.indicatorActive]} />
|
||||
))}
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user