当前位置:网站首页>微信小程序-最近动态滚动实现
微信小程序-最近动态滚动实现
2022-08-02 13:51:00 【kenick】
1.界面

2.代码实现
page/test/test.wxml
<view class="latest-box" wx:if="{
{latestData.length>0}}">
<view class="cate-name">最近动态</view>
<view class="slide-box">
<swiper class="swiper" autoplay="true" interval="2000" duration="500" circular="true" vertical="true">
<block wx:for="{
{latestData}}" wx:for-index="idx1" wx:key="idx1">
<swiper-item class="swiper-item">
<view class="title">{
{item.province}} {
{item.addressee}} 刚刚下了一笔订单</view>
</swiper-item>
</block>
</swiper>
</view>
</view>
page/test/test.js
Page({
/**
* 页面的初始数据
*/
data: {
latestData: [
{ "province": "湖南省", "addressee": "张**" },
{ "province": "广西省", "addressee": "李**" }
], //今日动态
}
})page/test/test.wxss
.latest-box {
width: calc(100% - 56rpx);
height: 68rpx;
line-height: 88rpx;
margin: 0 auto;
position: relative;
}
.latest-box .cate-name {
width: 200rpx;
height: 68rpx;
overflow: hidden;
position: absolute;
top: 0;
left: 0;
z-index: 1;
font-size: 30rpx;
font-weight: 650;
}
.latest-box .slide-box {
width: 100%;
height: 68rpx;
overflow: hidden;
}
.latest-box .swiper {
height: 68rpx;
}
.latest-box .title {
width: 100%;
height: 68rpx;
font-size: 24rpx;
text-align: right;
}边栏推荐
- 供应磷脂-聚乙二醇-羧基,DSPE-PEG-COOH,DSPE-PEG-Acid,MW:5000
- How to do short video food from the media?5 steps to teach you to get started quickly
- 线程安全问题及关键字synchronized,volatile
- stack && queue
- 为什么四个字节的float表示的范围比八个字节的long要广
- 【C语言】手撕循环结构 —— for语句
- 【C语言】夏日一题 —— 求最大公约数和最小公倍数
- 【C语言】手撕循环结构 ——do...while语句及循环练习题(1)
- 存储过程详解
- HALCON: 对象(object)从声明(declaration)到结束(finalization)
猜你喜欢
随机推荐
FFmpeg 的AVCodecContext结构体详解
[C language] Analysis of function recursion (3)
Flutter 实现光影变换的立体旋转效果
Large and comprehensive pom file example
基于 WeihanLi.Npoi 实现excel导入时纯汉字的日期转换
拯救流浪猫 | 「喵先锋」系列数字版权盲盒明日开抢
网络安全第六次作业
微信小程序如何实现支付功能?看官方文档头疼(使用云函数的方式操作)「建议收藏」
requestparam注解接的收的是什么格式(玄机赋注解)
js数组递归使用
OpenMMLab简介
图文短视频自媒体怎么创作?如何让点击量达到10W?
方舟生存进化淘宝面板服务器是怎么一回事?
【C语言】细品分支结构——switch语句
删除链表的节点
Detailed explanation of ORACLE expdp/impdp
SQL函数 USER
【C语言】函数哪些事儿,你真的get到了吗?(2)
【C语言】夏日一题 —— 如何判断素数?
SQL函数 TRUNCATE
![[C language] Analysis of function recursion (3)](/img/95/8bd4483cf03db2dc326eb44675bf5a.png)


![[C language] Analysis of function recursion (2)](/img/b1/9baa60a69d41a1823ed92001d1b0a0.png)





