From 2f851f3172b31d989351270c142af4b71ef1dc49 Mon Sep 17 00:00:00 2001 From: alger Date: Wed, 5 Jun 2024 15:35:31 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=88=20perf:=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=AD=8C=E6=9B=B2=E5=88=97=E8=A1=A8=E4=BB=A5=E5=8F=8A=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/MusicList.vue | 35 ++++++++++++++++++++++++++--------- src/utils/index.ts | 7 +++++-- src/views/list/index.vue | 7 +++---- src/views/user/index.vue | 14 ++++++++------ 4 files changed, 42 insertions(+), 21 deletions(-) diff --git a/src/components/MusicList.vue b/src/components/MusicList.vue index 74a648e..825b3f4 100644 --- a/src/components/MusicList.vue +++ b/src/components/MusicList.vue @@ -9,16 +9,20 @@
{{ name }}
-
+
-
- -
+ +
+
+ +
+
+
@@ -34,6 +38,8 @@ import { isMobile, setAnimationClass, setAnimationDelay } from '@/utils'; import PlayBottom from './common/PlayBottom.vue'; +const loading = ref(true); + const store = useStore(); const props = defineProps<{ @@ -43,6 +49,14 @@ const props = defineProps<{ }>(); const emit = defineEmits(['update:show']); +watch( + () => props.songList, + (val) => { + loading.value = !(val && val.length); + }, + { immediate: true }, +); + const formatDetail = computed(() => (detail: any) => { const song = { artists: detail.ar, @@ -81,6 +95,9 @@ const close = () => { &-list { height: calc(100% - 60px); + &-content { + min-height: 400px; + } } } diff --git a/src/utils/index.ts b/src/utils/index.ts index 229f51a..9108968 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -60,8 +60,11 @@ export const getMusicProxyUrl = (url: string) => { export const getImgUrl = computed(() => (url: string | undefined, size: string = '') => { const bdUrl = 'https://image.baidu.com/search/down?url='; - const imgUrl = encodeURIComponent(`${url}?param=${size}`); - return `${bdUrl}${imgUrl}`; + const imgUrl = `${url}?param=${size}`; + if (!getIsMc()) { + return imgUrl; + } + return `${bdUrl}${encodeURIComponent(imgUrl)}`; }); export const isMobile = computed(() => { diff --git a/src/views/list/index.vue b/src/views/list/index.vue index 19a2f61..cefeaed 100644 --- a/src/views/list/index.vue +++ b/src/views/list/index.vue @@ -20,8 +20,8 @@ const selectRecommendItem = async (item: IRecommendItem) => { recommendItem.value = null; listDetail.value = null; showMusic.value = true; - const { data } = await getListDetail(item.id); recommendItem.value = item; + const { data } = await getListDetail(item.id); listDetail.value = data; }; @@ -90,10 +90,9 @@ watch(
diff --git a/src/views/user/index.vue b/src/views/user/index.vue index 843fcf4..d87fcee 100644 --- a/src/views/user/index.vue +++ b/src/views/user/index.vue @@ -1,6 +1,6 @@