Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
bd643f93
authored
Jul 19, 2024
by
xiaohong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 音乐卡片新增播放和暂停按钮
parent
b7f06ec6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
src/views/ai/music/components/list/index.vue
+2
-2
src/views/ai/music/components/list/songCard/index.vue
+14
-1
No files found.
src/views/ai/music/components/list/index.vue
View file @
bd643f93
...
...
@@ -6,7 +6,7 @@
<el-tab-pane
v-loading=
"loading"
label=
"我的创作"
name=
"mine"
>
<el-row
v-if=
"mySongList.length"
:gutter=
"12"
>
<el-col
v-for=
"song in mySongList"
:key=
"song.id"
:span=
"24"
>
<songCard
:songInfo=
"song"
@
click
=
"setCurrentSong(song)"
/>
<songCard
:songInfo=
"song"
@
play
=
"setCurrentSong(song)"
/>
</el-col>
</el-row>
<el-empty
v-else
description=
"暂无音乐"
/>
...
...
@@ -16,7 +16,7 @@
<el-tab-pane
v-loading=
"loading"
label=
"试听广场"
name=
"square"
>
<el-row
v-if=
"squareSongList.length"
v-loading=
"loading"
:gutter=
"12"
>
<el-col
v-for=
"song in squareSongList"
:key=
"song.id"
:span=
"24"
>
<songCard
:songInfo=
"song"
@
click
=
"setCurrentSong(song)"
/>
<songCard
:songInfo=
"song"
@
play
=
"setCurrentSong(song)"
/>
</el-col>
</el-row>
<el-empty
v-else
description=
"暂无音乐"
/>
...
...
src/views/ai/music/components/list/songCard/index.vue
View file @
bd643f93
<
template
>
<div
class=
"flex bg-[var(--el-bg-color-overlay)] p-12px mb-12px rounded-1"
>
<el-image
:src=
"songInfo.imageUrl"
class=
"flex-none w-80px"
/>
<div
class=
"relative"
@
click=
"playSong"
>
<el-image
:src=
"songInfo.imageUrl"
class=
"flex-none w-80px"
/>
<div
class=
"bg-black bg-op-40 absolute top-0 left-0 w-full h-full flex items-center justify-center cursor-pointer"
>
<Icon
:icon=
"currentSong.id === songInfo.id ? 'solar:pause-circle-bold':'mdi:arrow-right-drop-circle'"
:size=
"30"
/>
</div>
</div>
<div
class=
"ml-8px"
>
<div>
{{
songInfo
.
title
}}
</div>
<div
class=
"mt-8px text-12px text-[var(--el-text-color-secondary)] line-clamp-2"
>
...
...
@@ -20,4 +25,12 @@ defineProps({
default
:
()
=>
({})
}
})
const
emits
=
defineEmits
([
'play'
])
const
currentSong
=
inject
(
'currentSong'
,
{})
function
playSong
()
{
emits
(
'play'
)
}
</
script
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment