diff --git a/src/views/Community/components/DynamicNewsCard.js b/src/views/Community/components/DynamicNewsCard.js index 0f30e277..c59e0078 100644 --- a/src/views/Community/components/DynamicNewsCard.js +++ b/src/views/Community/components/DynamicNewsCard.js @@ -113,7 +113,8 @@ const DynamicNewsCard = forwardRef(({ total, cachedCount, dispatch, - toast + toast, + filters // 传递筛选条件 }); // 四排模式的事件点击处理(打开弹窗) diff --git a/src/views/Community/components/DynamicNewsCard/hooks/usePagination.js b/src/views/Community/components/DynamicNewsCard/hooks/usePagination.js index 11426d98..7c734a6d 100644 --- a/src/views/Community/components/DynamicNewsCard/hooks/usePagination.js +++ b/src/views/Community/components/DynamicNewsCard/hooks/usePagination.js @@ -19,9 +19,10 @@ import { * @param {number} options.cachedCount - 已缓存数量 * @param {Function} options.dispatch - Redux dispatch 函数 * @param {Function} options.toast - Toast 通知函数 + * @param {Object} options.filters - 筛选条件 * @returns {Object} 分页状态和方法 */ -export const usePagination = ({ allCachedEvents, total, cachedCount, dispatch, toast }) => { +export const usePagination = ({ allCachedEvents, total, cachedCount, dispatch, toast, filters = {} }) => { // 本地状态 const [currentPage, setCurrentPage] = useState(PAGINATION_CONFIG.INITIAL_PAGE); const [loadingPage, setLoadingPage] = useState(null); @@ -314,11 +315,12 @@ export const usePagination = ({ allCachedEvents, total, cachedCount, dispatch, t page: 1, per_page: newPageSize, pageSize: newPageSize, // 传递 pageSize 确保索引计算一致 - clearCache: true + clearCache: true, + ...filters // 应用筛选条件 })); } // 如果第1页数据完整,不发起请求,直接切换 - }, [mode, allCachedEvents, total, dispatch]); + }, [mode, allCachedEvents, total, dispatch, filters]); return { // 状态