wxml:
<image class="imageclass" wx:elif="{{msg.msgType=='file' && msg.contentType == 'image/jpg'}}" src="{{msg.httpFileUrl}}" bindtap='phonefull' data-src='{{msg.httpFileUrl}}'></image>
msg.js:
phonefull:function (e) {
var src = e.target.dataset.src;//获取data-src
var imgList = [e.target.dataset.src];//获取data-list
//图片预览
wx.previewImage({
current: src, // 当前显示图片的http链接
urls: imgList // 需要预览的图片http链接列表如果没有预览图片指向原图片地址即可
})
}