样式布局代码
wxml:
wxss:
.page_music{
position: absolute;
width: 100%;
height: 80%;
}
.icon{
position: relative;
width: 500rpx;
height: 500rpx;
top:5%;
left: 125rpx;
background-image: url(""); /*放入光碟图片*/
background-size: 100% 100%;
background-repeat:no-repeat;
background-position: center;
}
.tools{
position: relative;
width: 80%;
height: 10%;
top: 10%;
left: 10%;
}
.last{
width: 100rpx;
height: 100rpx;
position: absolute;
left: 0;
top:0;
background-image: url(""); /*放入上一首图标*/
background-size: 100% 100%;
background-repeat:no-repeat;
background-position: center;
}
.play{
width: 100rpx;
height: 100rpx;
position: absolute;
left: 42%;
top:0;
background-image: url(""); /*放入播放图标*/
background-size: 100% 100%;
background-repeat:no-repeat;
background-position: center;
}
.pause{
width: 100rpx;
height: 100rpx;
position: absolute;
left: 42%;
top:0;
background-image: url(""); /*放入暂停图标*/
background-size: 100% 100%;
background-repeat:no-repeat;
background-position: center;
}
.next{
width: 100rpx;
height: 100rpx;
position: absolute;
right: 0;
top:0;
background-image: url(""); /*放入下一首图标*/
background-size: 100% 100%;
background-repeat:no-repeat;
background-position: center;
}
.volume{
position: relative;
width: 80%;
height: 10%;
top: 20%;
left: 10%;
}
.volumeIcon{
position: absolute;
left: 0;
width: 80rpx;
height: 80rpx;
top:0;
background-image: url(""); /*放入音量图标*/
background-size: 100% 100%;
background-repeat:no-repeat;
background-position: center;
}
.sl{
position: absolute;
right: 0;
width: 80%;
height: 100%;
top: 0;
background-image: url(""); /*放入滑动条背景图片*/
background-size: 100% 100%;
background-repeat:no-repeat;
background-position: center;
}
.rotateAu{
animation: rotate 3s linear infinite;
}
@keyframes rotate{
from{transform: rotate(0deg)}
to{transform: rotate(360deg)}
}js:
Page({
data:{
isPlay:false,
},
play:function(e){
if(this.data.isPlay==true)
{
this.setData({
isPlay:false
})
}
else
{
this.setData({
isPlay:true
})
}
}
})