feat: 新增歌单导入功能

添加歌单导入功能,支持通过链接、文本和元数据三种方式导入歌单
- 实现链接导入、文本导入和元数据导入三种方式
- 添加导入状态检查和显示功能
This commit is contained in:
alger
2025-06-04 22:53:49 +08:00
parent 8988cdb082
commit edd393c8ac
9 changed files with 803 additions and 4 deletions
+15 -3
View File
@@ -28,7 +28,10 @@
<div class="uesr-signature">{{ userDetail.profile.signature }}</div>
<div class="play-list" :class="setAnimationClass('animate__fadeInLeft')">
<div class="title">{{ t('user.playlist.created') }}</div>
<div class="title">
<div>{{ t('user.playlist.created') }}</div>
<div class="import-btn" @click="goToImportPlaylist" v-if="isElectron">{{ t('comp.playlist.import.button') }}</div>
</div>
<n-scrollbar>
<div
v-for="(item, index) in playList"
@@ -105,7 +108,7 @@ import { usePlayerStore } from '@/store/modules/player';
import { useUserStore } from '@/store/modules/user';
import type { Playlist } from '@/type/listDetail';
import type { IUserDetail } from '@/type/user';
import { getImgUrl, isMobile, setAnimationClass, setAnimationDelay } from '@/utils';
import { getImgUrl, isElectron, isMobile, setAnimationClass, setAnimationDelay } from '@/utils';
defineOptions({
name: 'User'
@@ -126,6 +129,10 @@ const message = useMessage();
const user = computed(() => userStore.user);
const goToImportPlaylist = () => {
router.push('/playlist/import');
};
onBeforeUnmount(() => {
mounted.value = false;
});
@@ -278,8 +285,13 @@ const showFollowList = () => {
@apply bg-black bg-opacity-40;
}
.title {
@apply text-lg font-bold;
@apply text-lg font-bold flex items-center justify-between;
@apply text-gray-900 dark:text-white;
.import-btn {
@apply bg-light-100 font-normal rounded-lg px-2 py-1 text-opacity-70 text-sm hover:bg-light-200 hover:text-green-500 dark:bg-dark-200 dark:hover:bg-dark-300 dark:hover:text-green-400;
@apply cursor-pointer;
@apply transition-all duration-200;
}
}
.user-name {