1.注意使用this.setData({})方法时this的作用域问题,如果this外界有function说明this的作用域已经不是本页面,此时在方法外,使用 var that = this ,将this的值赋给一个变量。
2.轮播图的使用方法
<swiper indicator-dots="true"> //轮播图下面的指示点
autoplay="true" interval="8000" duration="1000"> //是否自动播放;播放间隔;图片停留时间
<block wx:for="{
{imgUrls}}"> //block是一个专为循环准备的一个标签,并不会影响任何的视图
<swiper-item>
<image src="{
{item}}" class="slide-image" width="355" height="150"/>
</swiper-item>
</block>
</swiper>