//index.js //获取应用实例 const app = getApp() Page({ data: { exchangeList: [ { type: '微信', number: '1200.00', create_time: '2020-12-12', status: '已处理', }, ] }, //提交 onLoad: function () { let data = app.globalData.userInfo; wx.request({ url: `${app.globalData.publicUrl}/api/htyd/cash?mobile=${data.mobile}`, success: res => { console.log(res); if (res.data.errcode == 0) { this.setData({ exchangeList: res.data.data }) } }, error: err => { wx.showToast({ title: err.data.errmsg, icon: 'error' }) } }) }, })