Skip to content

Commit

Permalink
fix: 修复底部播放器样式错误
Browse files Browse the repository at this point in the history
  • Loading branch information
imsyy committed Dec 11, 2023
1 parent 750d570 commit c5747b6
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 14 deletions.
1 change: 0 additions & 1 deletion components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export {}
declare module 'vue' {
export interface GlobalComponents {
AddPlaylist: typeof import('./src/components/Modal/AddPlaylist.vue')['default']
CloudMatch: typeof import('./src/components/Modal/CloudMatch.vue')['default']
CloudSongMatch: typeof import('./src/components/Modal/CloudSongMatch.vue')['default']
CommentList: typeof import('./src/components/List/CommentList.vue')['default']
CountDown: typeof import('./src/components/Player/CountDown.vue')['default']
Expand Down
2 changes: 1 addition & 1 deletion electron/main/startNcmServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const netEaseApi = require("NeteaseCloudMusicApi");
*
* @async
* @param {Object} options - 服务器配置
* @param {number} [options.port=12141] - 服务器端口
* @param {number} [options.port=11451] - 服务器端口
* @param {string} [options.host="127.0.0.1"] - 服务器主机地址
* @returns {Promise<void>} 返回一个 Promise,在 API 服务器成功启动后 resolve
*/
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@electron-toolkit/preload": "^2.0.0",
"@electron-toolkit/utils": "^2.0.0",
"@material/material-color-utilities": "^0.2.7",
"NeteaseCloudMusicApi": "^4.13.5",
"NeteaseCloudMusicApi": "^4.13.6",
"axios": "^1.4.0",
"colorthief": "^2.4.0",
"electron-dl": "^3.5.1",
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions src/components/Player/MainControl.vue
Original file line number Diff line number Diff line change
Expand Up @@ -780,11 +780,15 @@ watch(
bottom: 0;
}
&.no-sider {
max-width: 1400px;
margin: 0 auto;
padding: 0 10vw;
@media (max-width: 1200px) {
padding: 0 5vw;
padding: 0;
.player {
width: auto;
max-width: 1400px;
margin: 0 auto;
padding: 0 10vw;
@media (max-width: 1200px) {
padding: 0 5vw;
}
}
}
}
Expand Down
10 changes: 9 additions & 1 deletion src/views/Artist/hot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<script setup>
import { useRouter } from "vue-router";
import { getArtistSongs } from "@/api/artist";
import { getSongDetail } from "@/api/song";
import formatData from "@/utils/formatData";
const router = useRouter();
Expand All @@ -41,7 +42,14 @@ const getArtistHotData = async (id) => {
artistHotSongs.value = null;
// 获取热门歌曲
const result = await getArtistSongs(id);
artistHotSongs.value = formatData(result.hotSongs, "song");
// 处理数据
if (result.hotSongs?.[0]?.al?.picUrl) {
artistHotSongs.value = formatData(result.hotSongs, "song");
return true;
}
const ids = result.hotSongs.map((song) => song.id).join(",");
const songsDetail = await getSongDetail(ids);
artistHotSongs.value = formatData(songsDetail.songs, "song");
} catch (error) {
console.error("获取歌手热门数据失败:", error);
}
Expand Down
7 changes: 6 additions & 1 deletion src/views/List/album.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@
</n-text>
<n-text v-if="albumDetail.alia" class="alia" depth="3">{{ albumDetail.alia }}</n-text>
<div v-if="albumDetail.artists" class="creator">
<n-text v-for="(item, index) in albumDetail.artists" :key="index" class="ar">
<n-text
v-for="(item, index) in albumDetail.artists"
:key="index"
class="ar"
@click="router.push(`/artist?id=${item.id}`)"
>
{{ item.name }}
</n-text>
</div>
Expand Down

0 comments on commit c5747b6

Please sign in to comment.