diff --git a/components.d.ts b/components.d.ts index c777cfd..326b305 100644 --- a/components.d.ts +++ b/components.d.ts @@ -17,6 +17,7 @@ declare module 'vue' { NDropdown: typeof import('naive-ui')['NDropdown'] NEllipsis: typeof import('naive-ui')['NEllipsis'] NImage: typeof import('naive-ui')['NImage'] + NInfiniteScroll: typeof import('naive-ui')['NInfiniteScroll'] NInput: typeof import('naive-ui')['NInput'] NLayout: typeof import('naive-ui')['NLayout'] NMessageProvider: typeof import('naive-ui')['NMessageProvider'] @@ -25,6 +26,7 @@ declare module 'vue' { NSlider: typeof import('naive-ui')['NSlider'] NSwitch: typeof import('naive-ui')['NSwitch'] NTooltip: typeof import('naive-ui')['NTooltip'] + NVirtualList: typeof import('naive-ui')['NVirtualList'] PlayBottom: typeof import('./src/components/common/PlayBottom.vue')['default'] PlayListsItem: typeof import('./src/components/common/PlayListsItem.vue')['default'] PlaylistType: typeof import('./src/components/PlaylistType.vue')['default'] diff --git a/src/components/MusicList.vue b/src/components/MusicList.vue index 33645e0..35d9cc3 100644 --- a/src/components/MusicList.vue +++ b/src/components/MusicList.vue @@ -6,23 +6,41 @@ :drawer-style="{ backgroundColor: 'transparent' }" >
- +
+ + +
{{ name }}
- -
+ +
+
加载更多...
+ +
@@ -31,6 +49,7 @@ diff --git a/src/utils/index.ts b/src/utils/index.ts index 9108968..8307df8 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -28,16 +28,21 @@ export const secondToMinute = (s: number) => { }; // 格式化数字 千,万, 百万, 千万,亿 +const units = [ + { value: 1e8, symbol: '亿' }, + { value: 1e4, symbol: '万' }, +]; + export const formatNumber = (num: string | number) => { num = Number(num); - if (num < 10000) { - return num; + for (let i = 0; i < units.length; i++) { + if (num >= units[i].value) { + return `${(num / units[i].value).toFixed(1)}${units[i].symbol}`; + } } - if (num < 100000000) { - return `${(num / 10000).toFixed(1)}万`; - } - return `${(num / 100000000).toFixed(1)}亿`; + return num.toString(); }; + const windowData = window as any; export const getIsMc = () => { if (!windowData.electron) { diff --git a/src/views/list/index.vue b/src/views/list/index.vue index 2d00481..b31b52f 100644 --- a/src/views/list/index.vue +++ b/src/views/list/index.vue @@ -101,6 +101,7 @@ watch( v-model:loading="listLoading" :name="recommendItem?.name || ''" :song-list="listDetail?.playlist.tracks || []" + :list-info="listDetail?.playlist" />
diff --git a/src/views/user/index.vue b/src/views/user/index.vue index f52520f..fda4dc5 100644 --- a/src/views/user/index.vue +++ b/src/views/user/index.vue @@ -145,7 +145,7 @@ const handlePlay = () => { - +