let index=this.data.index; let img=this.data.img; ++index; if(index>=img.length){ index=0; } this.setData({ index })