// pages/test2/test2.js Page({ /** * 页面的初始数据 */ data: { imgFiles: [ '/res/icons/ass_1.png', '/res/icons/ass_2.png', '/res/icons/ass_3.png', '/res/icons/ass_3.png', '/res/icons/ass_3.png', '/res/icons/ass_3.png', '/res/icons/ass_3.png', '/res/icons/ass_3.png', '/res/icons/ass_3.png', '/res/icons/ass_3.png', '/res/icons/ass_3.png', '/res/icons/ass_3.png', ], ledgerRemark: '台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注台账备注', previewImageUrls:[], previewCurrent: 0, showPreview: false, }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady() { }, previewImage(e) { const { index } = e.currentTarget.dataset; const previewImageUrls = this.data.imgFiles; this.setData({ previewImageUrls, previewCurrent: index, showPreview: true }); }, })