From 2e5603801a429395a196fb45a24d37fce2a989ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=B1=B3=E7=B1=B3=E7=B1=B3=E5=8F=AE?= Date: Sat, 14 Mar 2026 03:42:56 +0800 Subject: [PATCH] =?UTF-8?q?DEV-009:=20M20=E7=8E=AF=E8=8A=825+6-=E6=8E=92?= =?UTF-8?q?=E5=BA=8F+=E5=88=86=E9=A1=B5+=E6=A8=A1=E7=B3=8A=E6=90=9C?= =?UTF-8?q?=E7=B4=A2+=E6=8B=BC=E9=9F=B3=E6=94=AF=E6=8C=81+=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E8=A1=A5=E5=85=A8+=E9=98=B2=E6=8A=96+=E7=BC=93?= =?UTF-8?q?=E5=AD=98+=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- search-filter/css/style.css | 252 ++++++++++++ search-filter/index.html | 79 +++- search-filter/js/app.js | 754 ++++++++++++++++++++++++++++------ search-filter/js/fuzzy.js | 134 ++++++ search-filter/js/pinyin.js | 233 +++++++++++ search-filter/js/temp_data.js | 2 + 6 files changed, 1328 insertions(+), 126 deletions(-) create mode 100644 search-filter/js/fuzzy.js create mode 100644 search-filter/js/pinyin.js create mode 100644 search-filter/js/temp_data.js diff --git a/search-filter/css/style.css b/search-filter/css/style.css index a4b9d03e..1ef77b04 100644 --- a/search-filter/css/style.css +++ b/search-filter/css/style.css @@ -404,3 +404,255 @@ h1 { background: #1a2639; color: white; } + +/* ========== 新增样式:排序、分页、自动补全、统计、无结果 ========== */ + +/* 排序区域 */ +.sort-section { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 25px; + padding: 15px 0; + border-bottom: 1px solid #eef2f6; +} + +.sort-buttons { + display: flex; + gap: 12px; + align-items: center; +} + +.sort-label { + color: #6c757d; + font-size: 0.95rem; +} + +.sort-btn { + padding: 8px 18px; + background: white; + border: 1.5px solid #e0e4e9; + border-radius: 40px; + color: #495057; + font-size: 0.95rem; + cursor: pointer; + transition: all 0.2s; +} + +.sort-btn:hover { + border-color: #ffb347; + background: #fff9f0; +} + +.sort-btn.active { + background: #1a2639; + border-color: #1a2639; + color: white; +} + +.sort-order { + display: flex; + align-items: center; + gap: 6px; + color: #495057; +} + +/* 自动补全 */ +.autocomplete-panel { + position: absolute; + top: 70px; + left: 0; + right: 0; + background: white; + border-radius: 24px; + box-shadow: 0 12px 30px rgba(0,0,0,0.15); + padding: 10px 0; + z-index: 200; + border: 1px solid #eef2f6; + max-height: 300px; + overflow-y: auto; +} + +.autocomplete-panel.hidden { + display: none; +} + +.autocomplete-list { + list-style: none; +} + +.autocomplete-item { + padding: 12px 20px; + cursor: pointer; + transition: background 0.2s; + color: #1a2639; +} + +.autocomplete-item:hover { + background: #f8fafd; +} + +/* 统计区域 */ +.stats-section { + display: flex; + justify-content: space-between; + margin-bottom: 15px; + padding: 10px 0; + color: #6c757d; + font-size: 0.95rem; + border-bottom: 1px dashed #e0e4e9; +} + +/* 无结果提示 */ +.no-results-panel { + text-align: center; + padding: 40px 20px; + background: #f8fafd; + border-radius: 32px; + margin: 20px 0; +} + +.no-results-panel.hidden { + display: none; +} + +.no-results-panel p { + color: #6c757d; + margin-bottom: 20px; + font-size: 1.1rem; +} + +.suggestions-panel { + margin-top: 20px; +} + +.suggestions-panel p { + font-size: 0.95rem; + margin-bottom: 15px; +} + +.suggestion-tags { + display: flex; + flex-wrap: wrap; + gap: 12px; + justify-content: center; +} + +.suggestion-tag { + padding: 8px 18px; + background: white; + border: 1.5px solid #ffd166; + border-radius: 40px; + color: #b85e00; + font-size: 0.95rem; + cursor: pointer; + transition: all 0.2s; +} + +.suggestion-tag:hover { + background: #ffd166; + color: #1a2639; +} + +/* 模糊匹配标记 */ +.fuzzy-badge { + background: #e3f2fd; + color: #1976d2; + font-size: 0.75rem; + padding: 2px 8px; + border-radius: 40px; + margin-left: 8px; +} + +/* 分页区域 */ +.pagination-section { + margin-top: 40px; + padding-top: 25px; + border-top: 2px solid #eef2f6; + display: flex; + flex-wrap: wrap; + gap: 20px; + align-items: center; + justify-content: space-between; +} + +.pagination-controls { + display: flex; + gap: 8px; + align-items: center; +} + +.pagination-controls button { + padding: 8px 16px; + background: white; + border: 1.5px solid #e0e4e9; + border-radius: 40px; + color: #495057; + font-size: 1rem; + cursor: pointer; + transition: all 0.2s; + min-width: 45px; +} + +.pagination-controls button:hover:not(:disabled) { + border-color: #ffb347; + background: #fff9f0; +} + +.pagination-controls button:disabled { + opacity: 0.4; + cursor: not-allowed; +} + +#pageInfo { + margin: 0 12px; + color: #1a2639; + font-weight: 500; +} + +.pagination-size select { + padding: 8px 16px; + border: 1.5px solid #e0e4e9; + border-radius: 40px; + background: white; + color: #1a2639; + outline: none; + cursor: pointer; +} + +.pagination-jump { + display: flex; + gap: 8px; + align-items: center; +} + +.pagination-jump input { + width: 70px; + padding: 8px 12px; + border: 1.5px solid #e0e4e9; + border-radius: 40px; + text-align: center; + outline: none; +} + +.pagination-jump button { + padding: 8px 18px; + background: #1a2639; + border: none; + border-radius: 40px; + color: white; + cursor: pointer; + transition: all 0.2s; +} + +.pagination-jump button:hover { + background: #2c3e50; +} + +/* 响应式调整 */ +@media (max-width: 768px) { + .pagination-section { + flex-direction: column; + align-items: flex-start; + } +} diff --git a/search-filter/index.html b/search-filter/index.html index 64b93893..094bf4a1 100644 --- a/search-filter/index.html +++ b/search-filter/index.html @@ -3,22 +3,27 @@ - 搜索与筛选 · 糖星云陪妈妈 + 搜索与筛选系统 · 糖星云陪妈妈 · 环节5+6

🔍 搜索与筛选系统

-

糖星云陪妈妈一起做 · 环节4:搜索历史+筛选预设+实时高亮

+

糖星云陪妈妈一起做 · 环节5+6:排序+分页+模糊+拼音+自动补全

- +
- +
- + + + + - + +
+
+ 排序: + + + +
+
+ +
+
+ +

🎛️ 筛选条件

@@ -54,10 +74,53 @@
+ +
+ 共 0 条结果 + +
+

📦 搜索结果

+ + + +
+ + +
+
+ + + 第 1 页 / 共 1 页 + + +
+
+ +
+
+ +
@@ -65,7 +128,7 @@