mode='widthFix' //作用:使图片不变形
<view >
<view wx:key='id' wx:for='{{wawa}}'>
<image src='{{item.img_url}}' mode='widthFix' data-src='{{item.img_url}}' bindtap='previewImage'></image>
<text class='waName'>{{item.name}}</text>
</view>
</view>
//预览图片
previewImage: function (e) {
var current = e.target.dataset.src;
var imgList = [];
for (let i = 0; i < this.data.wawa.length; i++) {
imgList.push(this.data.wawa[i].img_url);
}
wx.previewImage({
current: current,//当前点击的图片链接
urls: imgList//图片数组
})
},