deviceCheckList.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. // pages/deviceCheck.js
  2. var app = getApp();
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. checkList:[],
  9. openid: '',
  10. },
  11. /**
  12. * 生命周期函数--监听页面加载
  13. */
  14. onLoad(options) {
  15. this.data.openid = wx.getStorageSync('openid');
  16. if(this.data.openid){
  17. this.getCheckList(this.data.openid);
  18. }
  19. },
  20. checkProcessHandle: function (e) {
  21. var checkid = e.currentTarget.dataset.checkid;
  22. wx.navigateTo({
  23. url: '/pages/deviceCheck/report/deviceCheckReport?checkId='+checkid
  24. });
  25. },
  26. locationToHandle: function (e) {
  27. var rtuCode = e.currentTarget.dataset.rtucode;
  28. if(null != rtuCode){
  29. wx.navigateTo({
  30. url: '/pages/rtu/rtuNavigate/detail/rtuNavigateInfoView?rtuCode=' + rtuCode
  31. });
  32. }
  33. },
  34. getCheckList: function (opneId) {
  35. wx.showNavigationBarLoading()
  36. var that = this;
  37. var url = app.globalData.cloudBase + "/Dev/Wx/check/list/" + opneId;
  38. wx.request({
  39. url: url,
  40. method: 'GET',
  41. header: {
  42. "Content-Type": "json"
  43. },
  44. success: function (res) {
  45. wx.hideNavigationBarLoading();
  46. if (res.data.code === "0") {
  47. that.setData({
  48. checkList: res.data.data
  49. });
  50. }
  51. },
  52. fail: function (error) {
  53. console.log(error)
  54. wx.hideNavigationBarLoading();
  55. }
  56. })
  57. },
  58. /**
  59. * 生命周期函数--监听页面初次渲染完成
  60. */
  61. onReady() {
  62. },
  63. /**
  64. * 生命周期函数--监听页面显示
  65. */
  66. onShow() {
  67. },
  68. /**
  69. * 生命周期函数--监听页面隐藏
  70. */
  71. onHide() {
  72. },
  73. /**
  74. * 生命周期函数--监听页面卸载
  75. */
  76. onUnload() {
  77. },
  78. /**
  79. * 页面相关事件处理函数--监听用户下拉动作
  80. */
  81. onPullDownRefresh() {
  82. },
  83. /**
  84. * 页面上拉触底事件的处理函数
  85. */
  86. onReachBottom() {
  87. },
  88. /**
  89. * 用户点击右上角分享
  90. */
  91. onShareAppMessage() {
  92. },
  93. })