微信小程序 点击预览图片
//图片点击事件
imgYu:
function
(event){
var
src = event.currentTarget.dataset.src;
//获取data-src
var
imgList = event.currentTarget.dataset.list;
//获取data-list
//图片预览
wx.previewImage({
current: src,
// 当前显示图片的http链接
urls: imgList
// 需要预览的图片http链接列表
})
}
<!--图片描述-->
<
view
wx:if
=
"{{item.pictures}}"
class
=
"list-dImg"
>
<
image
bindtap
=
"imgYu"
data-list
=
"{{item.pictures}}"
data-src
=
"{{dImg}}"
wx:for
=
"{{item.pictures}}"
wx:for-item
=
"dImg"
src
=
"{{dImg}}"
></
image
>
</
view
>