diff --git a/src/api/user.ts b/src/api/user.ts index 45ea1cc..10b1e0e 100644 --- a/src/api/user.ts +++ b/src/api/user.ts @@ -9,3 +9,9 @@ export function getUserDetail(uid: number) { export function getUserPlaylist(uid: number) { return request.get("/user/playlist", { params: { uid } }); } + +// 播放历史 +// /user/record?uid=32953014&type=1 +export function getUserRecord(uid: number, type: number = 0) { + return request.get("/user/record", { params: { uid, type } }); +} diff --git a/src/layout/AppLayout.vue b/src/layout/AppLayout.vue index cc72057..4b0a110 100644 --- a/src/layout/AppLayout.vue +++ b/src/layout/AppLayout.vue @@ -11,10 +11,13 @@ - + + + + diff --git a/src/views/home/index.vue b/src/views/home/index.vue index 75e2b0a..f232bb0 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -23,6 +23,26 @@ const RecommendSinger = defineAsyncComponent(() => import("@/components/Recommen const PlaylistType = defineAsyncComponent(() => import("@/components/PlaylistType.vue")); const RecommendSonglist = defineAsyncComponent(() => import("@/components/RecommendSonglist.vue")); const RecommendAlbum = defineAsyncComponent(() => import("@/components/RecommendAlbum.vue")); +/* + 异步组件的定义方式 + const asyncComponents = defineAsyncComponent({ + // 异步组件的路径 + loader: () => import("@/components/RecommendSinger.vue"), + // 异步组件的占位 + loadingComponent:aaa, + // 异步组件的错误 + errorComponent:bbb, + // 在显示loading组件之前,等待多长时间 + delay:1000, + // 监听错误 + // error 错误信息 retry 再次请求 attempts 当前重试次数 + onError:(err,retry,attempts)=>{ + console.log("错误") + } + }) +*/ + + diff --git a/src/views/list/index.vue b/src/views/list/index.vue index f3c8b58..6c13799 100644 --- a/src/views/list/index.vue +++ b/src/views/list/index.vue @@ -131,7 +131,7 @@ const formatDetail = computed(() => (detail: any) => { v-for="(item, index) in listDetail?.playlist.tracks" :key="item.id" :class="setAnimationClass('animate__bounceInUp')" - :style="setAnimationDelay(index, 100)" + :style="setAnimationDelay(index, 50)" > diff --git a/src/views/user/index.vue b/src/views/user/index.vue index 245448e..985c2b2 100644 --- a/src/views/user/index.vue +++ b/src/views/user/index.vue @@ -1,11 +1,14 @@ - - + + {{ user.nickname }} @@ -58,7 +103,12 @@ loadPage() 创建的歌单 - + {{ item.name }} @@ -68,46 +118,92 @@ loadPage() + + + 听歌排行 + + + {{ item.playCount }}次 + + + - + + + {{ list?.name }} + + + + + + + \ No newline at end of file