当前位置:网站首页>微信小程序-最近动态滚动实现
微信小程序-最近动态滚动实现
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;
}
边栏推荐
猜你喜欢
方舟生存进化淘宝面板服务器是怎么一回事?
How to improve the originality of self-media creation and create popular works?
Diodes and their applications
供应磷脂-聚乙二醇-羧基,DSPE-PEG-COOH,DSPE-PEG-Acid,MW:5000
苹果,与Web3 “八字不合”
自媒体创作怎样提高原创度,打造爆款作品?
【C语言】剖析函数递归(3)
C language improvement (3)
stack && queue
How to create short images and short videos from the media?How to make the click volume reach 10W?
随机推荐
网络安全第五次作业
Awesome!Alibaba interview reference guide (Songshan version) open source sharing, programmer interview must brush
如何通过DBeaver 连接 TDengine?
The uniapp/applet onload method executes the interpretation every time the page is opened
Image retrieval method based on deep learning!
requestparam注解接的收的是什么格式(玄机赋注解)
SQL函数 USER
读《IDEO,设计改变一切》有感
Interviewer: Can you talk about optimistic locking and pessimistic locking?
暑假集训-week2图论
How to create short images and short videos from the media?How to make the click volume reach 10W?
矩阵中的路径
[C language] Explicit array solution (1)
我的创作纪念日
RHCE第一天作业
Enterprise Network Planning Based on Huawei eNSP
C# 编译错误:Compiler Error CS1044
Mysql索引详解(图文并茂)
【C语言】剖析函数递归(1)
腾讯安全发布Tencent Cloud EdgeOne,为企业出海打造安全加速一体化服务