//wxml <block wx:for="{{Listsimg}}" wx:key=‘unique‘> <block wx:if="{{index == clickId}}"> <view class="img" style="border:{{border}};box-shadow:{{borders}}" id="{{index}}" bindtap="imgList" data-data="{{item}}"> <image src="{{item.imgList}}" /> </view> </block> <block wx:else> <view class="img" id="{{index}}" bindtap="imgList" data-data="{{item}}"> <image src="{{item.imgList}}" /> </view> </block> </block> //js data: { Listsumg: [ { imgList: ‘../../images/1.jpg‘ }, { imgList: ‘../../images/2.jpg‘ }, { imgList: ‘../../images/3.jpg‘ } ], border:‘‘, clickId:‘‘, borders:‘‘ }, imgList:function(e){ console.log(this.data.imgLists[e.currentTarget.id]) this.setData({ border:"1rpx solid #eee", borders:‘10rpx 10rpx 10rpx rgba(141, 161, 167, 0.9);‘, clickId:e.currentTarget.id }) },