Realize the scrolling of the winner list in the WeChat applet

Swiper component using applet

<swiper class="swiperBox" vertical="true" autoplay="true" circular="true" interval="2000" display-multiple-items='1'>
	<block wx:for-index="index" wx:for='{
   
   {list}}'>
		<swiper-item>
			<view class='swiperItem'>
				<view>{
   
   {item.time}}分钟前</view>
				<view>{
   
   {item.nickName}}获得了</view>
				<view>{
   
   {item.reward}}元红包</view>
			</view>
		</swiper-item>
	</block>
</swiper>

css

.swiperBox{
  width: calc(100% - 200rpx);
  height: 50rpx;
  float: left;
  margin-top: 30rpx;
}
.swiperItem{
  display: flex;
  flex-direction: row;
}

 js

ok, finish, see the effect

 

 

Guess you like

Origin blog.csdn.net/qq_41588568/article/details/109161484