-
Notifications
You must be signed in to change notification settings - Fork 599
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
314 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<template> | ||
<div class="like-albums"> | ||
<Transition name="fade" mode="out-in"> | ||
<div v-if="userLikeData.albums?.length" class="list"> | ||
<!-- 列表 --> | ||
<MainCover :data="likeAlbumsData" type="album" /> | ||
</div> | ||
<n-empty | ||
v-else | ||
description="当前暂无收藏专辑" | ||
class="tip" | ||
style="margin-top: 60px" | ||
size="large" | ||
/> | ||
</Transition> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import { storeToRefs } from "pinia"; | ||
import { siteData } from "@/stores"; | ||
import formatData from "@/utils/formatData"; | ||
const data = siteData(); | ||
const { userLikeData } = storeToRefs(data); | ||
// 处理专辑数据 | ||
const likeAlbumsData = computed(() => { | ||
return formatData(userLikeData.value.albums, "album"); | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<template> | ||
<div class="like-artists"> | ||
<Transition name="fade" mode="out-in"> | ||
<div v-if="userLikeData.artists?.length" class="list"> | ||
<!-- 列表 --> | ||
<MainCover :data="likeArtistsData" type="artist" columns="3 s:4 m:5 l:6" /> | ||
</div> | ||
<n-empty | ||
v-else | ||
description="当前暂无收藏歌手" | ||
class="tip" | ||
style="margin-top: 60px" | ||
size="large" | ||
/> | ||
</Transition> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import { storeToRefs } from "pinia"; | ||
import { siteData } from "@/stores"; | ||
import formatData from "@/utils/formatData"; | ||
const data = siteData(); | ||
const { userLikeData } = storeToRefs(data); | ||
// 处理歌手数据 | ||
const likeArtistsData = computed(() => { | ||
return formatData(userLikeData.value.artists, "artist"); | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<template> | ||
<div class="like"> | ||
<n-h1 class="title">我的收藏</n-h1> | ||
<!-- 标签页 --> | ||
<n-tabs v-model:value="tabValue" class="tabs" type="segment" @update:value="tabChange"> | ||
<n-tab name="like-albums"> 专辑 </n-tab> | ||
<n-tab name="like-artists"> 歌手 </n-tab> | ||
<n-tab name="like-videos"> 视频 </n-tab> | ||
</n-tabs> | ||
<!-- 路由页面 --> | ||
<router-view v-slot="{ Component }"> | ||
<keep-alive> | ||
<Transition name="router" mode="out-in"> | ||
<component :is="Component" /> | ||
</Transition> | ||
</keep-alive> | ||
</router-view> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import { useRouter } from "vue-router"; | ||
const router = useRouter(); | ||
// 默认选中 | ||
const tabValue = ref(router.currentRoute.value?.name ?? "like-albums"); | ||
// 标签页切换 | ||
const tabChange = (val) => { | ||
const routerPath = val.replace(/^like-/, ""); | ||
router.push({ | ||
path: `/like/${routerPath}`, | ||
}); | ||
}; | ||
</script> | ||
<style lang="scss" scoped> | ||
.like { | ||
.title { | ||
margin: 20px 0; | ||
font-size: 36px; | ||
font-weight: bold; | ||
} | ||
.tabs { | ||
margin-bottom: 20px; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<template> | ||
<div class="like-videos"> | ||
<Transition name="fade" mode="out-in"> | ||
<div v-if="userLikeData.mvs?.length" class="list"> | ||
<!-- 列表 --> | ||
<MainCover :data="likeVideosData" columns="1 s:2 m:3 l:4 xl:5" type="mv" /> | ||
</div> | ||
<n-empty | ||
v-else | ||
description="当前暂无收藏视频" | ||
class="tip" | ||
style="margin-top: 60px" | ||
size="large" | ||
/> | ||
</Transition> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import { storeToRefs } from "pinia"; | ||
import { siteData } from "@/stores"; | ||
import formatData from "@/utils/formatData"; | ||
const data = siteData(); | ||
const { userLikeData } = storeToRefs(data); | ||
// 处理视频数据 | ||
const likeVideosData = computed(() => { | ||
return formatData(userLikeData.value.mvs, "mv"); | ||
}); | ||
</script> |
Oops, something went wrong.