// pages/urgingList/index.js const $$ = require('../../utils/util'); function listByCaseIdApi(param) { return $$.request({ url: 'caseUrging/listByCaseId', type: 'get', submitData: param || {}, service: 'mediate', }); } Page({ /** * 页面的初始数据 */ data: { data: [], }, // 获取回复列表 async listByCaseId(caseId) { $$.showLoading(); const res = await listByCaseIdApi({ caseId }); $$.hideLoading(); if (res.type) { this.setData({ data: res.data || [], }); } }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { this.listByCaseId(options.caseId); }, })