1 Star 0 Fork 0

dodofung/DemoCloudMusicPlayer

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
MusicLastestView.qml 2.74 KB
一键复制 编辑 原始数据 按行查看 历史
fengchao 提交于 2024-12-13 14:00 . improvement play music
import QtQuick 2.0
import QtQuick.Controls 2.12
import QtQml 2.12
Item {
property alias playList: imgRepeater.model
Grid{
id:gridHot
anchors.fill: parent
columns: 5
spacing: 0
Repeater{
id:imgRepeater
Frame{
background: Rectangle{
id:imgBackground
color:"#00000000"
}
padding: 3
clip: true
width: parent.width*0.333
height: parent.width*0.1
MusicRoundImage{
id:playImg
width: parent.height
height: parent.height
imgSrc: modelData.album.picUrl
}
Text{
id:songNameText
anchors{
left: playImg.right
right: parent.right
bottom: parent.verticalCenter
bottomMargin: 2
leftMargin: 5
}
text: modelData.name
font.pixelSize: 14
elide: Text.ElideMiddle
}
Text{
anchors{
left: playImg.right
right: parent.right
top: parent.verticalCenter
topMargin: 2
leftMargin: 5
}
text: modelData.artists[0].name
font.pixelSize: 10
elide: Text.ElideMiddle
}
MouseArea{
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onEntered: {
imgBackground.color = "#50000000"
}
onExited: {
imgBackground.color="#00000000"
}
onClicked: {
pageBottomView.musicPlayList = genMusicList()
pageBottomView.playMusic(index)
}
}
}
}
}
function genMusicList()
{
return playList.map(item=>{
return {
id: item.id,
name: item.name,
artist: item.artists[0].name,
album: item.album.name,
lyrics:"",
mp3Url:item.mp3Url,
coverUrl:item.album.picUrl
}
})
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/dodofung/demo-cloud-music-player.git
git@gitee.com:dodofung/demo-cloud-music-player.git
dodofung
demo-cloud-music-player
DemoCloudMusicPlayer
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385