// components/event/itemProcessList/itemProcessList.js Component({ /** * 组件的属性列表 */ properties: { processList: { type: Object, value: {} } }, /** * 组件的初始数据 */ data: { imgList:[], isShow: false, //控制收起展开 }, /** * 组件的方法列表 */ methods: { //预览图片,放大预览 preview(event) { let currentUrl = event.currentTarget.dataset.src let id = event.currentTarget.dataset.id for (var i = 0; i < this.data.processList.length; i++) { if (id == this.data.processList[i].id){ this.setData({ imgList: this.data.processList[i].images }) } } wx.previewImage({ current: currentUrl, // 当前显示图片的http链接= urls: this.data.imgList // 需要预览的图片http链接列表 }) }, toChange: function () { let that = this; that.setData({ isShow: !that.data.isShow }) } } })