// pages/myRegisterDetail/index.js const $$ = require('../../utils/util'); // 详情接口 function getByIdApi(param) { return $$.request({ url: 'caseInfo/getCaseInfo', type: 'get', submitData: param || {}, service: 'mediate' }) } // 附件查询接口 function getfilesApi(param) { return $$.request({ url: 'fileInfo/listByMainId', type: 'get', submitData: param || {}, service: 'sys' }) } Page({ /** * 页面的初始数据 */ data: { imgUrl: $$.url.img, submitData: {}, oneList: [], fileList: [] }, // 获取附件信息 async getFilesId(id) { $$.showLoading(); const res = await getfilesApi({ mainId: id }); $$.hideLoading(); if (res.type) { let data = res.data || {}; this.setData({ fileList: data }); } }, detailPerson(e) { let item = e.currentTarget.dataset.item; console.log('item', item); wx.navigateTo({ url: '../../pages/DetailPerson/index?id=' + item.id + '&perType=' + item.perType, }); }, // 获取纠纷案件详情 async getById(data) { $$.showLoading(); const res = await getByIdApi({ id: data.id }); $$.hideLoading(); if (res.type) { let data = res.data || {}; this.setData({ submitData: data, oneList: [...data.personList, ...data.agentList] }); this.getFilesId(data.id) } }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { this.getById(options); }, })