<view class="container"> <view class="playlist"> <view class="playlist-header">播放列表</view> <scroll-view class="playlist-content" scroll-y="true"> <view wx:for="{{playList}}" wx:key="index" class="playlist-item" bindtap="playMusic" data-index="{{index}}"> {{item.name}} </view> </scroll-view> </view> <audio id="audio" binderror="audioError" bindtimeupdate="updateTime" bindended="playNext"></audio> <view class="player"> <view class="player-info"> <view class="player-name">{{currentMusic.name}}</view> <view class="player-time">{{formatTime(currentTime)}} / {{formatTime(duration)}}</view> </view> <view class="player-control"> <button class="player-btn" bindtap="togglePlay"> <image src="{{isPlaying ? 'pause.png' : 'play.png'}}"></image> </button> <button class="player-btn" bindtap="playPrev"> <image src="prev.png"></image> </button> <button class="player-btn" bindtap="playNext"> <image src="next.png"></image> </button> </view> </view></view>的样式部分
时间: 2023-06-10 09:06:57 浏览: 149
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
background-color: #f5f5f5;
}
.playlist {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background-color: #fff;
padding: 20px;
border-radius: 5px;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
margin-bottom: 20px;
}
.playlist-header {
font-size: 20px;
font-weight: bold;
margin-bottom: 10px;
}
.playlist-content {
height: 150px;
width: 100%;
margin-bottom: 10px;
}
.playlist-item {
display: flex;
align-items: center;
justify-content: center;
height: 30px;
font-size: 16px;
cursor: pointer;
}
.player {
display: flex;
align-items: center;
justify-content: center;
background-color: #fff;
padding: 20px;
border-radius: 5px;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
}
.player-info {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
margin-right: 20px;
}
.player-name {
font-size: 24px;
font-weight: bold;
margin-bottom: 10px;
}
.player-time {
font-size: 14px;
color: #666;
}
.player-control {
display: flex;
align-items: center;
justify-content: center;
}
.player-btn {
background-color: transparent;
border: none;
margin-right: 10px;
cursor: pointer;
}
.player-btn:last-child {
margin-right: 0;
}
.player-btn:focus {
outline: none;
}
.player-btn:active {
transform: scale(0.9);
}
.image {
height: 20px;
width: 20px;
}
阅读全文