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
00209dcc
Commit
00209dcc
authored
3 months ago
by
CosineSky
Browse files
Options
Downloads
Patches
Plain Diff
- 添加了删除歌单、从歌单中删除歌曲的功能。
parent
bd553e32
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/api/playlist.js
+17
-2
17 additions, 2 deletions
src/api/playlist.js
src/components/MusicAlbumView.vue
+14
-5
14 additions, 5 deletions
src/components/MusicAlbumView.vue
with
31 additions
and
7 deletions
src/api/playlist.js
+
17
−
2
View file @
00209dcc
...
...
@@ -52,8 +52,23 @@ export const addSongToPlaylist = (songInfo) => {
- playlist_id: number
*/
export
const
removePlaylist
=
(
removePlaylistInfo
)
=>
{
return
axios
.
post
(
`
${
PLAYLIST_MODULE
}
/remove`
,
removePlaylistInfo
,
{
headers
:
{
'
Content-Type
'
:
'
application/json
'
}
})
console
.
log
(
removePlaylistInfo
)
return
axios
.
post
(
`
${
PLAYLIST_MODULE
}
/delete`
,
null
,
{
params
:
removePlaylistInfo
})
.
then
(
res
=>
{
return
res
;
});
}
/*
// TODO - newly added
- playlist_id: number
- song_id: number
*/
export
const
removeSongFromPlaylist
=
(
removeSongFromPlaylistInfo
)
=>
{
console
.
log
(
removeSongFromPlaylistInfo
)
return
axios
.
post
(
`
${
PLAYLIST_MODULE
}
/removeSong`
,
null
,
{
params
:
removeSongFromPlaylistInfo
})
.
then
(
res
=>
{
return
res
;
});
...
...
This diff is collapsed.
Click to expand it.
src/components/MusicAlbumView.vue
+
14
−
5
View file @
00209dcc
...
...
@@ -6,6 +6,7 @@ import checkMark from "../icon/checkMark.vue";
import
{
ElPopover
}
from
"
element-plus
"
;
import
{
backgroundColor
,
updateBackground
}
from
"
../utils/getBackgroundColor
"
;
import
pauseButton
from
"
../icon/pauseButton.vue
"
;
import
{
removePlaylist
,
removeSongFromPlaylist
}
from
"
../api/playlist
"
;
const
emit
=
defineEmits
();
const
props
=
defineProps
({
...
...
@@ -142,7 +143,12 @@ const enterPersonalSpace = () => {
}
const
editAlbumDescription
=
()
=>
{
}
const
removeAlbum
=
()
=>
{
const
removeAlbum
=
(
albumId
)
=>
{
removePlaylist
({
playlist_id
:
albumId
,
}).
then
(
res
=>
{
console
.
log
(
"
Hi
"
)
})
}
const
playFromId
=
(
musicId
)
=>
{
...
...
@@ -157,8 +163,11 @@ const playFromId = (musicId) => {
}
const
addToFavorite
=
(
musicId
)
=>
{
}
const
removeMusicFromAlbum
=
(
musicId
)
=>
{
const
removeMusicFromAlbum
=
(
albumId
,
songId
)
=>
{
removeSongFromPlaylist
({
playlist_id
:
albumId
,
song_id
:
songId
,
})
}
const
enterMusicDescription
=
(
musicId
)
=>
{
}
...
...
@@ -207,7 +216,7 @@ const pauseMusic = (musicId) => {
</
template
>
<ul>
<li
@
click=
"editAlbumDescription"
>
编辑歌单详情
</li>
<li
@
click=
"removeAlbum"
>
删除歌单
</li>
<li
@
click=
"removeAlbum
(albumInfo.id)
"
>
删除歌单
</li>
</ul>
</el-popover>
</div>
...
...
@@ -316,7 +325,7 @@ const pauseMusic = (musicId) => {
<dots
class=
"music-more-info"
/>
</
template
>
<ul>
<li
@
click=
"removeMusicFromAlbum(music.id)"
>
删除歌曲
</li>
<li
@
click=
"removeMusicFromAlbum(
albumInfo.id,
music.id)"
>
删除歌曲
</li>
</ul>
</el-popover>
...
...
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