// package_mine/pages/senceDetail/index.js Page({ /** * 页面的初始数据 */ data: { dataSource: {}, imageList: [], messageList: [ {title: '描述', value: 'content'}, {title: '上传时间', value: 'createTime'}, {title: '审核意见', value: 'status'}, {title: '审核时间', value: 'examineTime'}, {title: '备注', value: 'remark'} ], statusList: { 1: '待审核', 2: '审核通过', 3: '审核驳回' } }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { if(options) { const dataSource = JSON.parse(options.data) let imageList = [] if(dataSource.image.length) { imageList = dataSource.image.split(',') } this.setData({imageList, dataSource}) } }, /* 图片预览 */ showImgPreview(e) { let index = e.currentTarget.dataset.current let urls = this.data.imageList const current = this.data.imageList[index] wx.previewImage({ urls, current }) } })