feat: 首页更新

This commit is contained in:
2025-11-12 00:13:26 +08:00
parent b48cce06f4
commit 9ef9233797
46 changed files with 660 additions and 369 deletions

View File

@@ -2,7 +2,6 @@
* 轮播图组件
*
* 展示首页轮播图,支持自动播放和手动滑动
* 使用真实数据
*/
import React, { useState, useEffect, useRef, useCallback } from 'react';
@@ -17,23 +16,22 @@ import {
Dimensions,
Alert,
} from 'react-native';
import Colors from '@/constants/Colors';
import { useColorScheme } from '@/hooks';
// import type { Banner } from '@/types/home';
import { styles } from './styles';
import useMsgStore from '@/stores/msgStore';
interface BannerSwiperProps {
theme: 'light' | 'dark';
}
interface BannerSwiperProps {}
const { width } = Dimensions.get('window');
/**
* 轮播图组件
*/
export default function BannerSwiper({ theme }: BannerSwiperProps) {
const s = styles[theme];
export default function BannerSwiper({}: BannerSwiperProps) {
const colorScheme = useColorScheme();
const s = styles[colorScheme];
const [currentIndex, setCurrentIndex] = useState(0);
const [loading, setLoading] = useState(true);
const scrollViewRef = useRef<ScrollView>(null);
@@ -102,7 +100,7 @@ export default function BannerSwiper({ theme }: BannerSwiperProps) {
style={[
s.image,
{
backgroundColor: theme === 'dark' ? '#333' : '#e0e0e0',
backgroundColor: colorScheme === 'dark' ? '#333' : '#e0e0e0',
},
]}
/>