盒子实例--滑动--轮播
<view class="root"> <!-- 标签栏的页签 固定高度 --> <view class="tabs"> <view class="item active"> <text>个性推荐</text> </view> <view class="item"> <text>歌单</text> </view> <view class="item"> <text>主播电台</text> </view> <view class="item"> <text>排行榜</text> </view> </view> <!-- 内容区域 自适应高度 --> <scroll-view class="content" scroll-y> <swiper class="slide" autoplay indicator-dots> <swiper-item> <image src="../../images/slide.png"></image> </swiper-item> <swiper-item> <image src="../../images/slide.png"></image> </swiper-item> <swiper-item> <image src="../../images/slide.png"></image> </swiper-item> </swiper> <view class="portals"> <view class="item"> <image src="../../images/04.png"></image> <text>私人FM</text> </view> <view class="item"> <image src="../../images/05.png"></image> <text>每日歌曲推荐</text> </view> <view class="item"> <image src="../../images/06.png"></image> <text>云音乐新歌榜</text> </view> </view> <view class="list"> <view class="title"> <text>推荐歌单</text> </view> <view class="inner"> <view class="item"> <image src="../../images/poster.jpg"></image> <text>一生中最爱的是谁谁?</text> </view> <view class="item"> <image src="../../images/poster.jpg"></image> <text>一生中最爱的是谁谁?</text> </view> <view class="item"> <image src="../../images/poster.jpg"></image> <text>一生中最爱的是谁谁?</text> </view> <view class="item"> <image src="../../images/poster.jpg"></image> <text>一生中最爱的是谁谁?</text> </view> <view class="item"> <image src="../../images/poster.jpg"></image> <text>一生中最爱的是谁谁?</text> </view> <view class="item"> <image src="../../images/poster.jpg"></image> <text>一生中最爱的是谁谁?</text> </view> </view> </view> </scroll-view> <!-- 播放控制条条 固定高度 --> <view class="player"> <view class="poster"> <image src="../../images/poster.jpg"></image> </view> <view class="info"> <text class="title">一生中最爱</text> <text class="artist">谭咏麟</text> </view> <view class="controls"> <image src="../../images/01.png"></image> <image src="../../images/02.png"></image> <image src="../../images/03.png"></image> </view> </view> </view>
index.wxcss
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | /* page根节点-页面里边没有,也得设置 */ page { height : 100% ; } .root { display : flex; /* 改变主轴方向,从上到下 */ flex- direction : column; height : 100% ; background-color : #f0f0f0 ; } .tabs { display : flex; background-color : pink; } /* 父子选择器,避免出错 */ .tabs .item { flex: 1 ; text-align : center ; font-size : 12px ; background-color : #222 ; color : #ccc ; padding : 8px 0 ; } /* 下划线选中样式 */ .tabs .item.active { color : #fff ; border-bottom : 2px solid #e9232c ; } .content { flex: 1 ; background-color : #111214 ; color : #ccc ; overflow : hidden ; } .slide image { width : 100% ; height : 130px ; } .portals { display : flex; margin-bottom : 15px ; } .portals .item { flex: 1 ; } .portals .item image { width : 60px ; height : 60px ; /* 块级元素 */ display : block ; margin : 10px auto ; } .portals .item text { display : block ; font-size : 12px ; text-align : center ; } .list .title { margin : 5px 10px ; font-size : 14px ; } .list .inner { display : flex; flex-wrap: wrap; } .list .inner .item { width : 33.33333333% ; } .list .inner .item image { display : block ; width : 120px ; height : 120px ; margin : 0 auto ; } .list .inner .item text { font-size : 14px ; } .player { display : flex; height : 50px ; background-color : #17181A ; } .poster image { width : 40px ; height : 40px ; margin : 5px ; } .info { flex: 1 ; color : #888 ; font-size : 14px ; margin : 5px ; } .info .title{ display : block ; font-size : 16px ; color : #ccc ; } .controls image { width : 40px ; height : 40px ; margin : 5px 2px ; } |
分类:
微信小程序
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?