Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
2
2024-HCI-Mirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
米 天为
2024-HCI-Mirror
Commits
ec011079
Commit
ec011079
authored
3 months ago
by
CosineSky
Browse files
Options
Downloads
Patches
Plain Diff
- Fixing
parent
b3cc49b2
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/components/MainView.vue
+77
-74
77 additions, 74 deletions
src/components/MainView.vue
src/components/MusicAlbumView.vue
+657
-614
657 additions, 614 deletions
src/components/MusicAlbumView.vue
src/views/HomePage.vue
+243
-245
243 additions, 245 deletions
src/views/HomePage.vue
with
977 additions
and
933 deletions
src/components/MainView.vue
+
77
−
74
View file @
ec011079
...
...
@@ -7,120 +7,123 @@ const songs = ref([]);
const
currentTab
=
ref
(
'
all
'
)
const
handleTabClick
=
(
tab
)
=>
{
currentTab
.
value
=
tab
currentTab
.
value
=
tab
}
getSongsByPlaylist
({
playlist_id
:
3
,
playlist_id
:
3
,
}).
then
((
res
)
=>
{
songs
.
value
=
res
.
data
.
result
.
slice
(
0
,
4
);
songs
.
value
=
res
.
data
.
result
.
slice
(
0
,
4
);
});
</
script
>
<
template
>
<div
class=
"main-view"
>
<div
class=
"tabs"
>
<button
class=
"tab-button"
:class=
"
{ 'active': currentTab === 'all' }"
@click="handleTabClick('all')"
>全部
</button>
<button
class=
"tab-button"
:class=
"
{ 'active': currentTab === 'songs' }"
@click="handleTabClick('songs')"
>音乐
</button>
</div>
<div
class=
"recommendations"
>
<h1>
根据您的喜好推荐的音乐
</h1>
<div
class=
"recommend-songs"
>
<div
v-for=
"song in songs"
:key=
"song.id"
class=
"song"
>
<img
:src=
"song.picPath"
alt=
""
>
<h2>
{{
song
.
title
}}
</h2>
<p>
{{
song
.
artist
}}
</p>
</div>
</div>
</div>
</div>
<div
class=
"main-view"
>
<div
class=
"tabs"
>
<button
class=
"tab-button"
:class=
"
{ 'active': currentTab === 'all' }"
@click="handleTabClick('all')"
>全部
</button>
<button
class=
"tab-button"
:class=
"
{ 'active': currentTab === 'songs' }"
@click="handleTabClick('songs')"
>音乐
</button>
</div>
<div
class=
"recommendations"
>
<h1>
根据您的喜好推荐的音乐
</h1>
<div
class=
"recommend-songs"
>
<div
v-for=
"song in songs"
:key=
"song.id"
class=
"song"
>
<img
:src=
"song.picPath"
alt=
""
>
<h2>
{{
song
.
title
}}
</h2>
<p>
{{
song
.
artist
}}
</p>
</div>
</div>
</div>
</div>
</
template
>
<
style
scoped
>
.main-view
{
padding
:
20px
;
padding
:
20px
;
}
.tabs
{
margin-bottom
:
20px
;
display
:
flex
;
flex-direction
:
row
;
margin-bottom
:
20px
;
display
:
flex
;
flex-direction
:
row
;
}
.tab-button
{
background-color
:
transparent
;
color
:
#eaeaea
;
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
justify-content
:
center
;
cursor
:
pointer
;
z-index
:
999
;
transition
:
background-color
0.3s
ease
;
border
:
1px
solid
#fff
;
margin
:
0
10px
;
border-radius
:
12px
;
font-size
:
18px
;
padding
:
5px
10px
;
background-color
:
transparent
;
color
:
#eaeaea
;
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
justify-content
:
center
;
cursor
:
pointer
;
z-index
:
999
;
transition
:
background-color
0.3s
ease
;
border
:
1px
solid
#fff
;
margin
:
0
10px
;
border-radius
:
12px
;
font-size
:
18px
;
padding
:
5px
10px
;
}
.tab-button
:hover
{
background
:
rgba
(
255
,
255
,
255
,
0.2
);
background
:
rgba
(
255
,
255
,
255
,
0.2
);
}
.recommendations
h1
{
font-size
:
24px
;
margin-bottom
:
15px
;
margin-left
:
10px
;
color
:
#fff
;
text-align
:
left
;
font-size
:
24px
;
margin-bottom
:
15px
;
margin-left
:
10px
;
color
:
#fff
;
text-align
:
left
;
}
.recommend-songs
{
display
:
flex
;
flex-direction
:
row
;
display
:
flex
;
flex-direction
:
row
;
}
.recommend-songs
img
{
width
:
200px
;
height
:
200px
;
margin-top
:
10px
width
:
200px
;
height
:
200px
;
margin-top
:
10px
}
.recommend-songs
h2
{
font-size
:
20px
;
margin-bottom
:
5px
;
color
:
#fff
;
text-align
:
left
;
margin-left
:
15px
;
font-size
:
20px
;
margin-bottom
:
5px
;
color
:
#fff
;
text-align
:
left
;
margin-left
:
15px
;
}
.recommend-songs
p
{
font-size
:
14px
;
color
:
#f0f0f0
;
text-align
:
left
;
margin-left
:
15px
;
font-size
:
14px
;
color
:
#f0f0f0
;
text-align
:
left
;
margin-left
:
15px
;
}
.song
{
border
:
1px
solid
#fff
;
width
:
240px
;
border-radius
:
20px
;
margin-right
:
20px
;
border
:
1px
solid
#fff
;
width
:
240px
;
border-radius
:
20px
;
margin-right
:
20px
;
}
.active
{
background-color
:
#fff
;
color
:
#000
;
background-color
:
#fff
;
color
:
#000
;
}
</
style
>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/components/MusicAlbumView.vue
+
657
−
614
View file @
ec011079
This diff is collapsed.
Click to expand it.
src/views/HomePage.vue
+
243
−
245
View file @
ec011079
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment