// pages/balance/detail/index.js import { getFinanceLog } from "../../api/saas" const util = require('../../../utils/util') Page({ /** * 页面的初始数据 */ data: { dataDetails: null }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { wx.showLoading({ title: '加载中', mask: true }) getFinanceLog(options.id).then(result => { this.setData({ dataDetails: result.data, type: Number(options.type) }) wx.hideLoading() }).catch(err => { wx.hideLoading() util.showToast(err) }) } })