11<template >
2- <div :class =" ['player-data', settingStore.playerType, { center }]" >
2+ <div :class =" ['player-data', settingStore.playerType, { center, light }]" >
33 <!-- 名称 -->
44 <div class =" name" >
55 <span class =" name-text text-hidden" >{{ musicStore.playSong.name || "未知曲目" }}</span >
66 <!-- 额外信息 -->
7- <div v-if =" statusStore.playUblock || musicStore.playSong.pc" class =" extra-info" >
7+ <n-flex
8+ v-if =" statusStore.playUblock || musicStore.playSong.pc"
9+ class =" extra-info"
10+ align =" center"
11+ >
812 <n-popover :show-arrow =" false" placement =" right" raw >
913 <template #trigger >
1014 <SvgIcon
2125 }}
2226 </div >
2327 </n-popover >
24- </div >
28+ </n-flex >
2529 </div >
2630 <!-- 别名 -->
2731 <span v-if =" musicStore.playSong.alia" class =" alia text-hidden" >
2832 {{ musicStore.playSong.alia }}
2933 </span >
30- <!-- 歌手 -->
31- <div v-if =" musicStore.playSong.type !== 'radio'" class =" artists" >
32- <SvgIcon :depth =" 3" name =" Artist" size =" 20" />
33- <div v-if =" Array.isArray(musicStore.playSong.artists)" class =" ar-list" >
34- <span
35- v-for =" ar in musicStore.playSong.artists"
36- :key =" ar.id"
37- class =" ar"
38- @click =" jumpPage({ name: 'artist', query: { id: ar.id } })"
39- >
40- {{ ar.name }}
34+ <n-flex :align =" center ? 'center' : undefined" size =" small" vertical >
35+ <!-- 播放状态 -->
36+ <n-flex
37+ v-if =" settingStore.showPlayMeta && !light"
38+ class =" play-meta"
39+ size =" small"
40+ align =" center"
41+ >
42+ <!-- 歌词模式 -->
43+ <span class =" meta-item" >{{ lyricMode }}</span >
44+ <!-- 是否在线 -->
45+ <span class =" meta-item" >
46+ {{ musicStore.playSong.path ? "LOCAL" : "ONLINE" }}
4147 </span >
48+ </n-flex >
49+ <!-- 歌手 -->
50+ <div v-if =" musicStore.playSong.type !== 'radio'" class =" artists" >
51+ <SvgIcon :depth =" 3" name =" Artist" size =" 20" />
52+ <div v-if =" Array.isArray(musicStore.playSong.artists)" class =" ar-list" >
53+ <span
54+ v-for =" ar in musicStore.playSong.artists"
55+ :key =" ar.id"
56+ class =" ar"
57+ @click =" jumpPage({ name: 'artist', query: { id: ar.id } })"
58+ >
59+ {{ ar.name }}
60+ </span >
61+ </div >
62+ <div v-else class =" ar-list" >
63+ <span class =" ar" >{{ musicStore.playSong.artists || "未知艺术家" }}</span >
64+ </div >
4265 </div >
43- <div v-else class =" ar-list" >
44- <span class =" ar" >{{ musicStore.playSong.artists || "未知艺术家" }}</span >
66+ <div v-else class =" artists" >
67+ <SvgIcon :depth =" 3" name =" Artist" size =" 20" />
68+ <div class =" ar-list" >
69+ <span class =" ar" >{{ musicStore.playSong.dj?.creator || "未知艺术家" }}</span >
70+ </div >
4571 </div >
46- </div >
47- <div v-else class =" artists" >
48- <SvgIcon :depth =" 3" name =" Artist" size =" 20" />
49- <div class =" ar-list" >
50- <span class =" ar" >{{ musicStore.playSong.dj?.creator || "未知艺术家" }}</span >
72+ <!-- 专辑 -->
73+ <div v-if =" musicStore.playSong.type !== 'radio'" class =" album" >
74+ <SvgIcon :depth =" 3" name =" Album" size =" 20" />
75+ <span
76+ v-if =" isObject(musicStore.playSong.album)"
77+ class =" name-text text-hidden"
78+ @click =" jumpPage({ name: 'album', query: { id: musicStore.playSong.album.id } })"
79+ >
80+ {{ musicStore.playSong.album?.name || "未知专辑" }}
81+ </span >
82+ <span v-else class =" name-text text-hidden" >
83+ {{ musicStore.playSong.album || "未知专辑" }}
84+ </span >
5185 </div >
52- </div >
53- <!-- 专辑 -->
54- <div v-if =" musicStore.playSong.type !== 'radio'" class =" album" >
55- <SvgIcon :depth =" 3" name =" Album" size =" 20" />
56- <span
57- v-if =" isObject(musicStore.playSong.album)"
58- class =" name-text text-hidden"
59- @click =" jumpPage({ name: 'album', query: { id: musicStore.playSong.album.id } })"
86+ <!-- 电台 -->
87+ <div
88+ v-if =" musicStore.playSong.type === 'radio'"
89+ class =" dj"
90+ @click =" jumpPage({ name: 'dj', query: { id: musicStore.playSong.dj?.id } })"
6091 >
61- {{ musicStore.playSong.album?.name || "未知专辑" }}
62- </span >
63- <span v-else class =" name-text text-hidden" >
64- {{ musicStore.playSong.album || "未知专辑" }}
65- </span >
66- </div >
67- <!-- 电台 -->
68- <div
69- v-if =" musicStore.playSong.type === 'radio'"
70- class =" dj"
71- @click =" jumpPage({ name: 'dj', query: { id: musicStore.playSong.dj?.id } })"
72- >
73- <SvgIcon :depth =" 3" name =" Podcast" size =" 20" />
74- <span class =" name-text text-hidden" >{{ musicStore.playSong.dj?.name || "播客电台" }}</span >
75- </div >
92+ <SvgIcon :depth =" 3" name =" Podcast" size =" 20" />
93+ <span class =" name-text text-hidden" >{{ musicStore.playSong.dj?.name || "播客电台" }}</span >
94+ </div >
95+ </n-flex >
7696 </div >
7797</template >
7898
@@ -84,13 +104,24 @@ import { debounce, isObject } from "lodash-es";
84104defineProps <{
85105 center? : boolean ;
86106 theme? : string ;
107+ // 少量数据模式
108+ light? : boolean ;
87109}>();
88110
89111const router = useRouter ();
90112const musicStore = useMusicStore ();
91113const statusStore = useStatusStore ();
92114const settingStore = useSettingStore ();
93115
116+ // 当前歌词模式
117+ const lyricMode = computed (() => {
118+ if (settingStore .showYrc ) {
119+ if (statusStore .usingTTMLLyric ) return " TTML" ;
120+ if (musicStore .isHasYrc ) return " YRC" ;
121+ }
122+ return musicStore .isHasLrc ? " LRC" : " NO-LRC" ;
123+ });
124+
94125const jumpPage = debounce (
95126 (go : RouteLocationRaw ) => {
96127 if (! go ) return ;
@@ -134,14 +165,13 @@ const jumpPage = debounce(
134165 }
135166 }
136167 .alia {
137- margin : 6px 0 6px 2 px ;
168+ margin : 6px 0 6px 4 px ;
138169 opacity : 0.6 ;
139170 font-size : 18px ;
140171 line-clamp : 1 ;
141172 -webkit-line-clamp : 1 ;
142173 }
143174 .artists {
144- margin-top : 2px ;
145175 display : flex ;
146176 align-items : center ;
147177 .n-icon {
@@ -178,7 +208,6 @@ const jumpPage = debounce(
178208 }
179209 .album ,
180210 .dj {
181- margin-top : 2px ;
182211 font-size : 16px ;
183212 display : flex ;
184213 align-items : center ;
@@ -196,6 +225,16 @@ const jumpPage = debounce(
196225 }
197226 }
198227 }
228+ .play-meta {
229+ padding : 4px 4px ;
230+ opacity : 0.6 ;
231+ .meta-item {
232+ font-size : 12px ;
233+ border-radius : 8px ;
234+ padding : 2px 6px ;
235+ border : 1px solid rgba (var (--main-color ), 0.6 );
236+ }
237+ }
199238 & .record {
200239 width : 100% ;
201240 padding : 0 80px 0 24px ;
@@ -219,6 +258,20 @@ const jumpPage = debounce(
219258 text-align : center ;
220259 }
221260 }
261+ & .light {
262+ .name {
263+ .name-text {
264+ line-clamp : 1 ;
265+ -webkit-line-clamp : 1 ;
266+ }
267+ .extra-info {
268+ display : none ;
269+ }
270+ }
271+ .alia {
272+ display : none ;
273+ }
274+ }
222275}
223276.player-tip {
224277 max-width : 240px ;
0 commit comments