代码如下,现在微信小程序有API,建议从头仔细看,虽然我没看哈哈哈
1、wxml
-----------------------------------------------------------------------------
<view class="page-body">
<swiper class="swiper" indicator-dots="true" autoplay="true" interval="3000" duration="1500">
<swiper-item wx:for="{ {imgUrls}}" >
<image src='{ {item}}' width="100%" height="10%" mode='widthFix' class='img' />
</swiper-item>
</swiper>
</view>
-------------------------------------------------------------------------------------------
2、wxss
---------------------------------------------------------------------------------------------
.swiper {
height: 400rpx;
width: 100%;
}