From 3faac301a0954f74bf5050eab0ec1e4c696bc87f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=B2=E8=BE=B0=E7=94=9F=E4=BA=A7?= Date: Mon, 20 Apr 2026 00:58:39 +0800 Subject: [PATCH] =?UTF-8?q?v0.0.2=20-=20=E4=BF=AE=E5=A4=8D=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E6=8C=89=E9=92=AE=EF=BC=8C=E6=B7=BB=E5=8A=A0numberFil?= =?UTF-8?q?ter=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/YichensBoard.jsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/src/pages/YichensBoard.jsx b/frontend/src/pages/YichensBoard.jsx index 6d59a1b..f9a74bb 100644 --- a/frontend/src/pages/YichensBoard.jsx +++ b/frontend/src/pages/YichensBoard.jsx @@ -42,18 +42,20 @@ export default function YichensBoard() { } } - const fetchPosts = async (p, cat, kw) => { + const fetchPosts = async (p, cat, kw, numFilter) => { setLoading(true) setError(null) const currentPage = p !== undefined ? p : page const currentCat = cat !== undefined ? cat : categoryFilter const searchKw = kw !== undefined ? kw : searchKeyword + const numFilterVal = numFilter !== undefined ? numFilter : numberFilter let url = '/api/yichens/posts?limit=390&offset=' + ((currentPage - 1) * 390) if (postTypeFilter === 'deal') url += '&post_type=deal' else if (postTypeFilter === 'want') url += '&post_type=want' else if (postTypeFilter === 'other') url += '&post_type=normal' if (searchKw && searchKw.trim()) url += '&keyword=' + encodeURIComponent(searchKw.trim()) + if (numFilterVal && numFilterVal !== '') url += '&number_filter=' + encodeURIComponent(numFilterVal) try { console.log('YichensBoard: 请求 posts', url) @@ -273,12 +275,12 @@ export default function YichensBoard() {
{page > 1 ? ( - + ) : ( 上一页 )} - {posts.length >= 390 && totalPosts > page * 390 ? ( - + {posts.length >= 390 ? ( + ) : ( 下一页 )}