diff --git a/src/api/list.ts b/src/api/list.ts index d873be5..096cbbe 100644 --- a/src/api/list.ts +++ b/src/api/list.ts @@ -1,5 +1,5 @@ import request from "@/utils/request"; -import { IList, IRecommendList } from "@/type/list"; +import { IList } from "@/type/list"; import type { IListDetail } from "@/type/listDetail"; interface IListByTagParams { @@ -8,14 +8,27 @@ interface IListByTagParams { limit: number; } +interface IListByCatParams { + cat: string; + offset: number; + limit: number; +} + // 根据tag 获取歌单列表 export function getListByTag(params: IListByTagParams) { return request.get("/top/playlist/highquality", { params: params }); } +// 根据cat 获取歌单列表 +export function getListByCat(params: IListByCatParams) { + return request.get("/top/playlist", { + params: params, + }); +} + // 获取推荐歌单 export function getRecommendList(limit: number = 30) { - return request.get("/personalized", { params: { limit } }); + return request.get("/personalized", { params: { limit } }); } // 获取歌单详情 diff --git a/src/components/PlaylistType.vue b/src/components/PlaylistType.vue index 4fb52fc..745a8c6 100644 --- a/src/components/PlaylistType.vue +++ b/src/components/PlaylistType.vue @@ -9,6 +9,7 @@ :class="setAnimationClass('animate__bounceIn')" :style="setAnimationDelay(index <= 13 ? index : index - 13)" v-if="isShowAllPlaylistCategory || index <= 13" + @click="handleClickPlaylistType(item.name)" >{{ item.name }}
(); // 是否显示全部歌单分类 @@ -43,6 +45,15 @@ const loadPlaylistCategory = async () => { playlistCategory.value = data; }; +const router = useRouter(); +const handleClickPlaylistType = (type: any) => { + router.push({ + path: "/list", + query: { + type: type, + } + }); +}; // 页面初始化 onMounted(() => { loadPlaylistCategory(); diff --git a/src/components/common/MPop.vue b/src/components/common/MPop.vue new file mode 100644 index 0000000..a17a278 --- /dev/null +++ b/src/components/common/MPop.vue @@ -0,0 +1,41 @@ + + + + + \ No newline at end of file diff --git a/src/layout/components/PlayBar.vue b/src/layout/components/PlayBar.vue index 6a62214..90b5192 100644 --- a/src/layout/components/PlayBar.vue +++ b/src/layout/components/PlayBar.vue @@ -187,7 +187,8 @@ const onAudio = (audio: any) => { allTime.value = audio.duration if (audio.currentTime >= audio.duration) { - store.commit("setPlayMusic", false); + // store.commit("setPlayMusic", false); + audio.play() } // 获取音量 audioVolume.value = audio.volume diff --git a/src/views/list/index.vue b/src/views/list/index.vue index 8038192..f3c8b58 100644 --- a/src/views/list/index.vue +++ b/src/views/list/index.vue @@ -1,19 +1,16 @@