Page({ /** * 页面的初始数据 */ data: { state : null, refund_total: '0.00', refund_no : null, source : null, title : null, created_at : '', items : [] }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { this.onInfo(options.no) }, /** * 获取服务单详情 */ onInfo(no){ wx.showLoading({ title: '加载中...', mask : true }) wx.$api.refund.info(no).then(res => { let { state, refund_total, refund_no, source, title, created_at, items } = res.data; this.setData({ state, refund_total, refund_no, source, title, created_at, items }) wx.hideLoading() }).catch(err => {}) } })