|
@@ -83,16 +83,16 @@ const HomePage: React.FC = () => {
|
|
|
const { pagination } = lastPage
|
|
const { pagination } = lastPage
|
|
|
const totalPages = Math.ceil(pagination.total / pagination.pageSize)
|
|
const totalPages = Math.ceil(pagination.total / pagination.pageSize)
|
|
|
|
|
|
|
|
- // 调试信息
|
|
|
|
|
- console.debug('分页信息:', {
|
|
|
|
|
- current: pagination.current,
|
|
|
|
|
- pageSize: pagination.pageSize,
|
|
|
|
|
- total: pagination.total,
|
|
|
|
|
- totalPages,
|
|
|
|
|
- hasNext: pagination.current < totalPages,
|
|
|
|
|
- allPagesCount: allPages.length,
|
|
|
|
|
- allGoodsCount: allPages.flatMap(page => page.data).length
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ // // 调试信息
|
|
|
|
|
+ // console.debug('分页信息:', {
|
|
|
|
|
+ // current: pagination.current,
|
|
|
|
|
+ // pageSize: pagination.pageSize,
|
|
|
|
|
+ // total: pagination.total,
|
|
|
|
|
+ // totalPages,
|
|
|
|
|
+ // hasNext: pagination.current < totalPages,
|
|
|
|
|
+ // allPagesCount: allPages.length,
|
|
|
|
|
+ // allGoodsCount: allPages.flatMap(page => page.data).length
|
|
|
|
|
+ // })
|
|
|
|
|
|
|
|
return pagination.current < totalPages ? pagination.current + 1 : undefined
|
|
return pagination.current < totalPages ? pagination.current + 1 : undefined
|
|
|
},
|
|
},
|
|
@@ -135,13 +135,13 @@ const HomePage: React.FC = () => {
|
|
|
|
|
|
|
|
// 触底加载更多
|
|
// 触底加载更多
|
|
|
const handleScrollToLower = () => {
|
|
const handleScrollToLower = () => {
|
|
|
- console.debug('触底加载更多:', {
|
|
|
|
|
- hasNextPage,
|
|
|
|
|
- isFetchingNextPage,
|
|
|
|
|
- allGoodsCount: allGoods.length,
|
|
|
|
|
- pagesCount: data?.pages?.length || 0,
|
|
|
|
|
- currentPage: data?.pages?.[data.pages.length - 1]?.pagination?.current || 0
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ // console.debug('触底加载更多:', {
|
|
|
|
|
+ // hasNextPage,
|
|
|
|
|
+ // isFetchingNextPage,
|
|
|
|
|
+ // allGoodsCount: allGoods.length,
|
|
|
|
|
+ // pagesCount: data?.pages?.length || 0,
|
|
|
|
|
+ // currentPage: data?.pages?.[data.pages.length - 1]?.pagination?.current || 0
|
|
|
|
|
+ // })
|
|
|
fetchNextPage();
|
|
fetchNextPage();
|
|
|
// if (hasNextPage && isFetchingNextPage) {
|
|
// if (hasNextPage && isFetchingNextPage) {
|
|
|
// console.debug('开始加载下一页...')
|
|
// console.debug('开始加载下一页...')
|
|
@@ -240,6 +240,7 @@ const HomePage: React.FC = () => {
|
|
|
<Text className="error-text">广告加载失败</Text>
|
|
<Text className="error-text">广告加载失败</Text>
|
|
|
</View>
|
|
</View>
|
|
|
) : finalImgSrcs && finalImgSrcs.length > 0 ? (
|
|
) : finalImgSrcs && finalImgSrcs.length > 0 ? (
|
|
|
|
|
+
|
|
|
<Carousel
|
|
<Carousel
|
|
|
items={finalImgSrcs.filter(item => item.imageFile?.fullUrl).map(item => ({
|
|
items={finalImgSrcs.filter(item => item.imageFile?.fullUrl).map(item => ({
|
|
|
src: item.imageFile!.fullUrl,
|
|
src: item.imageFile!.fullUrl,
|
|
@@ -250,9 +251,11 @@ const HomePage: React.FC = () => {
|
|
|
autoplay={true}
|
|
autoplay={true}
|
|
|
interval={4000}
|
|
interval={4000}
|
|
|
circular={true}
|
|
circular={true}
|
|
|
- imageMode="heightFix"
|
|
|
|
|
|
|
+ imageMode="aspectFit"
|
|
|
/>
|
|
/>
|
|
|
- ) : (
|
|
|
|
|
|
|
+
|
|
|
|
|
+ )
|
|
|
|
|
+ : (
|
|
|
<View className="empty-container">
|
|
<View className="empty-container">
|
|
|
<Text className="empty-text">暂无广告</Text>
|
|
<Text className="empty-text">暂无广告</Text>
|
|
|
</View>
|
|
</View>
|