warningInfo.js 812 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. const app = getApp();
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. },
  8. /**
  9. * 生命周期函数--监听页面加载
  10. */
  11. onLoad: function (options) {
  12. const {chainId,deviceCode} = options;
  13. this.getWarningInfoList(chainId,deviceCode);
  14. },
  15. getWarningInfoList(chainId,deviceCode){
  16. var that = this;
  17. app.requestP({
  18. url:'/chainBound/warningDeviceInfo',
  19. method:'post',
  20. contentType:'application/json',
  21. data:{
  22. chainId,
  23. deviceCode
  24. }
  25. }).then(res=>{
  26. console.log(res.data.data);
  27. that.setData({
  28. warningInfoList:res.data.data
  29. })
  30. }).catch(err=>{
  31. app.showToptip(that,'error',err.data.msg)
  32. })
  33. },
  34. /**
  35. * 生命周期函数--监听页面初次渲染完成
  36. */
  37. onReady: function () {
  38. },
  39. })