const app = getApp(); Page({ /** * 页面的初始数据 */ data: { }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { const {chainId,deviceCode} = options; this.getWarningInfoList(chainId,deviceCode); }, getWarningInfoList(chainId,deviceCode){ var that = this; app.requestP({ url:'/chainBound/warningDeviceInfo', method:'post', contentType:'application/json', data:{ chainId, deviceCode } }).then(res=>{ console.log(res.data.data); that.setData({ warningInfoList:res.data.data }) }).catch(err=>{ app.showToptip(that,'error',err.data.msg) }) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, })