|
|
@ -200,23 +200,26 @@ export default { |
|
|
|
|
|
|
|
|
// 处理搜索 |
|
|
// 处理搜索 |
|
|
const handleSearch = () => { |
|
|
const handleSearch = () => { |
|
|
|
|
|
// 清除类型,进入搜索模式 |
|
|
|
|
|
const query = { |
|
|
|
|
|
page: 1 |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
// 如果有搜索关键词,添加到查询参数中 |
|
|
if (localSearchKeyword.value.trim()) { |
|
|
if (localSearchKeyword.value.trim()) { |
|
|
// 清除类型,进入搜索模式 |
|
|
|
|
|
const query = { |
|
|
|
|
|
q: localSearchKeyword.value.trim(), |
|
|
|
|
|
page: 1 |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
if (selectedCategory.value) { |
|
|
|
|
|
query.category = selectedCategory.value; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 更新URL参数 |
|
|
|
|
|
router.push({ |
|
|
|
|
|
path: '/search', |
|
|
|
|
|
query: query |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
query.q = localSearchKeyword.value.trim(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 如果有选中的分类,添加到查询参数中 |
|
|
|
|
|
if (selectedCategory.value) { |
|
|
|
|
|
query.category = selectedCategory.value; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 更新URL参数 |
|
|
|
|
|
router.push({ |
|
|
|
|
|
path: '/search', |
|
|
|
|
|
query: query |
|
|
|
|
|
}); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
// 处理分页变化 |
|
|
// 处理分页变化 |
|
|
|