// pages/myRegisterFlow/index.js const $$ = require('../../utils/util'); const app = getApp(); // 详情接口 function getByIdApi(param) { return $$.request({ url: 'caseTask/listCaseFlow', type: 'get', submitData: param || {}, service: 'mediate' }) } // 催办 function saveCaseUrgingApi(submitData) { return $$.request({ url: 'caseUrging/saveCaseUrging', type: 'post', submitData, service: 'mediate' }) } // 催办回复量 function countByCaseIdApi(submitData) { return $$.request({ url: 'caseUrging/countByCaseId', type: 'get', submitData, service: 'mediate' }) } Page({ /** * 页面的初始数据 */ data: { imgUrl: $$.url.img, flows: [{ title: '提交申请', status: '1', name1: '线上', name2: '2024-7-12 12:00', name3: '金融纠纷' }, { title: '事项办理', status: '2', name4: '2024-7-12 12:00', name5: '白云区新市街司法所' }, { title: '事项办结', status: '3', name6: '2024-7-12 12:00', name7: '1', name7_1: '化解成功' } // , { // title: '事项评价', // status: '4', // name8: '2024-7-12 12:00', // name9: '张孟宇', // name10: '4', // name11: '工作人员认真负责结案结果符合预期' // } ] }, // 获取纠纷案件详情 async getById(data) { $$.showLoading(); const res = await getByIdApi({ caseId: data.caseId }); $$.hideLoading(); if (res.type) { let data = res.data || []; let urgingShow = res.data.findIndex(i => i.processStep === 3) > -1 ? false : true this.setData({ flows: data, urgingShow }); } }, // 催办任务 async urgingClick() { $$.showLoading(); const res = await saveCaseUrgingApi({ caseId: this.data.caseId }); $$.hideLoading(); if (res.type) { let data = res.data; if (!data) { $$.showToast({ icon: 'success', title: '催办成功', duration: 1000 }); } else { $$.showToast({ title: '您的操作过于频繁,请稍后再试', duration: 1000 }); } } }, // 催办任务 async countByCaseId(caseId) { $$.showLoading(); const res = await countByCaseIdApi({ caseId }); $$.hideLoading(); if (res.type) { let data = res.data || 0; this.setData({ flowNumber: data }) } }, // 查看催办回复 GoPage(e) { let url = e.currentTarget.dataset.url; wx.navigateTo({ url: url, }); }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { this.getById(options); this.countByCaseId(options.caseId) this.setData({ caseId: options.caseId }) }, })