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