🔧 chore: 移除统计,更新支持的音乐源列表

This commit is contained in:
algerkong
2025-06-27 18:49:37 +08:00
parent 95c255d2ba
commit 4d831777f1
15 changed files with 20 additions and 264 deletions
+1 -17
View File
@@ -142,7 +142,7 @@ import { IDayRecommend } from '@/type/day_recommend';
import { Playlist } from '@/type/list';
import type { IListDetail } from '@/type/listDetail';
import { SongResult } from '@/type/music';
import type { Artist, IHotSinger } from '@/type/singer';
import type { IHotSinger } from '@/type/singer';
import {
getImgUrl,
isMobile,
@@ -150,7 +150,6 @@ import {
setAnimationDelay,
setBackgroundImg
} from '@/utils';
import { getArtistDetail } from '@/api/artist';
import { navigateToMusicList } from '@/components/common/MusicListNavigator';
const userStore = useUserStore();
@@ -233,20 +232,6 @@ onMounted(async () => {
loadNonUserData();
});
const JayChouId = 6452;
const loadArtistData = async () => {
try {
const { data: artistData }: { data: { data: { artist: Artist } } } = await getArtistDetail(JayChouId);
console.log('artistData', artistData);
if (hotSingerData.value) {
// 将周杰伦数据放在第一位
hotSingerData.value.artists = [artistData.data.artist, ...hotSingerData.value.artists];
}
} catch (error) {
console.error('获取周杰伦数据失败:', error);
}
}
// 提取每日推荐加载逻辑到单独的函数
const loadDayRecommendData = async () => {
@@ -276,7 +261,6 @@ const loadNonUserData = async () => {
const { data: singerData } = await getHotSinger({ offset: 0, limit: 5 });
hotSingerData.value = singerData;
await loadArtistData();
} catch (error) {
console.error('加载热门歌手数据失败:', error);
}
@@ -87,7 +87,6 @@ const musicSourceOptions = ref([
{ label: 'MiGu', value: 'migu' as Platform },
{ label: 'KuGou', value: 'kugou' as Platform },
{ label: 'pyncmd', value: 'pyncmd' as Platform },
{ label: 'KuWo', value: 'kuwo' as Platform },
{ label: 'Bilibili', value: 'bilibili' as Platform },
{ label: 'GdMuisc', value: 'gdmusic' as Platform }
]);
@@ -102,7 +101,6 @@ const getSourceIcon = (source: Platform) => {
const iconMap: Record<Platform, string> = {
'migu': 'ri-music-2-fill',
'kugou': 'ri-music-fill',
'kuwo': 'ri-album-fill',
'qq': 'ri-qq-fill',
'joox': 'ri-disc-fill',
'pyncmd': 'ri-netease-cloud-music-fill',
@@ -56,7 +56,7 @@ const props = defineProps({
},
sources: {
type: Array as () => Platform[],
default: () => ['migu', 'kugou', 'pyncmd', 'bilibili', 'kuwo']
default: () => ['migu', 'kugou', 'pyncmd', 'bilibili']
}
});
@@ -70,7 +70,6 @@ const musicSourceOptions = ref([
{ label: 'MiGu音乐', value: 'migu' },
{ label: '酷狗音乐', value: 'kugou' },
{ label: 'pyncmd', value: 'pyncmd' },
{ label: '酷我音乐', value: 'kuwo' },
{ label: 'Bilibili音乐', value: 'bilibili' },
{ label: 'GD音乐台', value: 'gdmusic' }
]);
@@ -102,7 +101,7 @@ watch(
const handleConfirm = () => {
// 确保至少选择一个音源
const defaultPlatforms = ['migu', 'kugou', 'pyncmd', 'bilibili', 'kuwo'];
const defaultPlatforms = ['migu', 'kugou', 'pyncmd', 'bilibili'];
const valuesToEmit = selectedSources.value.length > 0
? [...new Set(selectedSources.value)]
: defaultPlatforms;