v1.2.75 - 搜索功能完善+分页修复

This commit is contained in:
甲辰生产 2026-04-08 23:12:30 +08:00
parent 49b68e802e
commit 6401fc57ea
3 changed files with 4 additions and 4 deletions

View File

@ -1 +1 @@
VERSION=1.2.72 VERSION=1.2.75

View File

@ -1 +1 @@
VERSION=1.2.72 VERSION=1.2.75

View File

@ -140,7 +140,7 @@ export default function YichensBoard() {
type="text" type="text"
placeholder="搜索标题、内容、分类..." placeholder="搜索标题、内容、分类..."
value={searchKeyword} value={searchKeyword}
onChange={(e) => { setSearchKeyword(e.target.value); setPage(1); fetchPosts(1, '') }} onChange={(e) => { const kw = e.target.value; setSearchKeyword(kw); setPage(1); fetchPosts(1, '', kw) }}
style={{ flex: 1, padding: '10px 14px', borderRadius: 8, border: '1px solid #374151', background: '#1f2937', color: '#fff', fontSize: 13, outline: 'none' }} style={{ flex: 1, padding: '10px 14px', borderRadius: 8, border: '1px solid #374151', background: '#1f2937', color: '#fff', fontSize: 13, outline: 'none' }}
/> />
<button <button
@ -149,7 +149,7 @@ export default function YichensBoard() {
清空 清空
</button> </button>
</div> </div>
{searchKeyword && <div style={{ color: '#9ca3af', fontSize: 12, marginTop: 6 }}>搜索: "{searchKeyword}"找到 {posts.length} 条结果</div>} {searchKeyword && <div style={{ color: '#9ca3af', fontSize: 12, marginTop: 6 }}>搜索: "{searchKeyword}"共找到 {totalPosts} 条结果</div>}
</div> </div>
<div style={{ display: 'flex', gap: 8, marginBottom: 12 }}> <div style={{ display: 'flex', gap: 8, marginBottom: 12 }}>