Skip to content
Snippets Groups Projects
Commit ec011079 authored by CosineSky's avatar CosineSky
Browse files

- Fixing

parent b3cc49b2
Branches hang2
No related tags found
No related merge requests found
...@@ -7,120 +7,123 @@ const songs = ref([]); ...@@ -7,120 +7,123 @@ const songs = ref([]);
const currentTab = ref('all') const currentTab = ref('all')
const handleTabClick = (tab) => { const handleTabClick = (tab) => {
currentTab.value = tab currentTab.value = tab
} }
getSongsByPlaylist({ getSongsByPlaylist({
playlist_id: 3, playlist_id: 3,
}).then((res) => { }).then((res) => {
songs.value = res.data.result.slice(0, 4); songs.value = res.data.result.slice(0, 4);
}); });
</script> </script>
<template> <template>
<div class="main-view"> <div class="main-view">
<div class="tabs"> <div class="tabs">
<button <button
class="tab-button" class="tab-button"
:class="{ 'active': currentTab === 'all' }" :class="{ 'active': currentTab === 'all' }"
@click="handleTabClick('all')" @click="handleTabClick('all')"
>全部</button> >全部
<button </button>
class="tab-button" <button
:class="{ 'active': currentTab === 'songs' }" class="tab-button"
@click="handleTabClick('songs')" :class="{ 'active': currentTab === 'songs' }"
>音乐</button> @click="handleTabClick('songs')"
</div> >音乐
</button>
<div class="recommendations"> </div>
<h1>根据您的喜好推荐的音乐</h1>
<div class="recommend-songs"> <div class="recommendations">
<div v-for="song in songs" <h1>根据您的喜好推荐的音乐</h1>
:key="song.id" <div class="recommend-songs">
class="song"> <div v-for="song in songs"
<img :src="song.picPath" alt=""> :key="song.id"
<h2>{{ song.title }}</h2> class="song">
<p>{{ song.artist }}</p> <img :src="song.picPath" alt="">
</div> <h2>{{ song.title }}</h2>
</div> <p>{{ song.artist }}</p>
</div> </div>
</div> </div>
</div>
</div>
</template> </template>
<style scoped> <style scoped>
.main-view { .main-view {
padding: 20px; padding: 20px;
} }
.tabs { .tabs {
margin-bottom: 20px; margin-bottom: 20px;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
} }
.tab-button { .tab-button {
background-color: transparent; background-color: transparent;
color: #eaeaea; color: #eaeaea;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
cursor: pointer; cursor: pointer;
z-index: 999; z-index: 999;
transition: background-color 0.3s ease; transition: background-color 0.3s ease;
border: 1px solid #fff; border: 1px solid #fff;
margin: 0 10px; margin: 0 10px;
border-radius: 12px; border-radius: 12px;
font-size: 18px; font-size: 18px;
padding: 5px 10px; padding: 5px 10px;
} }
.tab-button:hover { .tab-button:hover {
background: rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.2);
} }
.recommendations h1 { .recommendations h1 {
font-size: 24px; font-size: 24px;
margin-bottom: 15px; margin-bottom: 15px;
margin-left: 10px; margin-left: 10px;
color: #fff; color: #fff;
text-align: left; text-align: left;
} }
.recommend-songs { .recommend-songs {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
} }
.recommend-songs img { .recommend-songs img {
width: 200px; width: 200px;
height: 200px; height: 200px;
margin-top: 10px margin-top: 10px
} }
.recommend-songs h2 { .recommend-songs h2 {
font-size: 20px; font-size: 20px;
margin-bottom: 5px; margin-bottom: 5px;
color: #fff; color: #fff;
text-align: left; text-align: left;
margin-left: 15px; margin-left: 15px;
} }
.recommend-songs p { .recommend-songs p {
font-size: 14px; font-size: 14px;
color: #f0f0f0; color: #f0f0f0;
text-align: left; text-align: left;
margin-left: 15px; margin-left: 15px;
} }
.song { .song {
border: 1px solid #fff; border: 1px solid #fff;
width: 240px; width: 240px;
border-radius: 20px; border-radius: 20px;
margin-right: 20px; margin-right: 20px;
} }
.active { .active {
background-color: #fff; background-color: #fff;
color: #000; color: #000;
} }
</style> </style>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment