feat(search): 实现歌单搜索功能

- 在前端 Playlist.vue 中添加搜索结果展示逻辑
- 在后端 PlaylistServiceImpl 中实现关键词搜索的查询条件
- 优化搜索性能,使用 distinct 查询避免重复结果
- 搜索范围包括歌单名、描述、创建者用户名以及歌单内的音乐名
This commit is contained in:
ikmkj
2025-07-29 19:48:43 +08:00
parent e8c66e0dd2
commit 8aa076ded1
3 changed files with 16 additions and 9 deletions

View File

@@ -243,7 +243,7 @@ onMounted(() => {
</div>
<!-- 热门歌单 -->
<div class="hot-playlists" v-if="activeType === null && currentPage === 1">
<div class="hot-playlists" v-if="!keyword && activeType === null && currentPage === 1">
<h2>热门歌单</h2>
<div class="playlist-list" v-loading="loadingHot">
<div
@@ -291,7 +291,8 @@ onMounted(() => {
<!-- 歌单列表 -->
<div class="all-playlists">
<h2 v-if="activeType === null && currentPage === 1">全部歌单</h2>
<h2 v-if="keyword">搜索结果</h2>
<h2 v-else-if="activeType === null && currentPage === 1">全部歌单</h2>
<div class="playlist-list" v-loading="loading">
<div
v-for="playlist in playlists"