本文实例为大家分享了微信小程序实现音乐播放页面的布局,供大家参考,具体内容如下
1.效果图如下,点击播放按钮后,光碟转动,播放按钮变为暂停按钮;播放中点击暂停,光碟复位,暂停按钮恢复为播放按钮。
本文仅提供样式布局,其他具体响应不作介绍
2.样式布局代码
wxml:
<view class="page_music"> <view class='icon {{isPlay"rotateAu":""}}' mode="widthFix"> </view> <view class="tools"> <view class="last" bindtap="last"> </view> <view class='{{isPlay"pause":"play"}}' bindtap="play"> </view> <view class="next" bindtap="next"> </view> </view> <view class="volume"> <view class="volumeIcon"> </view> <view class="sl"> <slider min='0' max='10' step="1" value="0" bindchange="slide"/> </view> </view> </view>
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 }) } } })
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。
风云阁资源网 Design By www.bgabc.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
风云阁资源网 Design By www.bgabc.com
暂无评论...
更新日志
2024年09月20日
2024年09月20日
- 【小提琴】陈立新《思乡曲》2004[FLAC+CUE]
- 《战地》新作明年初大规模测试!EA已内部测试一年
- 《GTAOL》PC版时隔多年更新反作弊!小助手宣布跑路
- EA称AI是其业务核心!能提高开发效率、节约成本
- 卫华.1990-太阳升【BMG】【WAV+CUE】
- 呼吸乐队.1992-THEBREATHING【深飞】【WAV+CUE】
- 李玟.2008-1994-2008豪华典藏精选2CD【SONY】【WAV+CUE】
- 《张学友 再现歌神的光辉岁月 梦想成真 2CD》[WAV/分轨][1.2GB]
- 《海来阿木 高音测试王》[WAV+CUE][500MB]
- 《许巍 歌声给你生命的力量 珍藏许巍 3CD》[WAV/分轨][2GB]
- 《直到黎明重制版》配置要求推荐
- 《赛博朋克2077》2.13版本更新内容一览
- 《神话时代:重述版》评测:粉丝们的朝花夕拾
- 战锤40K星际战士2先锋职业介绍|先锋职业技能效果一览
- 战锤40K星际战士2重装职业介绍|重装职业技能效果一览