小程序预览图片

preview.js

previewImg: function (e) {
	wx.previewImage({
		current: this.data.detail.filepath, // 当前显示图片的http链接   
		urls: [this.data.detail.filepath] // 需要预览的图片http链接列表   
	})
},

preview.wxml

<view class="code"> 
	<image class="code-img" bindtap='previewImg'  src=""/>
	<view class="code-text">点击查看图片</view>
</view>