xuncha.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. import http from '../../base/httputil'
  2. const app = getApp()
  3. Page({
  4. /**
  5. * 组件的初始数据
  6. */
  7. data: {
  8. host: app.globalData.host,
  9. todayXunchaCount: 0,
  10. todayRiskCount: 0,
  11. todayEnterpriseCount: 0,
  12. xunchaList: null,
  13. menulist: [{
  14. "id": "1",
  15. "url": "icon-anquanxuncha",
  16. "title": "巡查",
  17. },
  18. {
  19. "id": "2",
  20. "url": "icon-xunjian",
  21. "title": "巡检",
  22. },
  23. ],
  24. mainmodel: {
  25. }
  26. },
  27. onLoad() {
  28. this.getXunchaCount()
  29. this.getXunchaList()
  30. },
  31. getXunchaCount() {
  32. http.post("/system/AppXunchaController/getXunchaCount", null, this.getXunchaCountSuccess)
  33. },
  34. getXunchaCountSuccess(res) {
  35. this.setData({
  36. todayXunchaCount: res.xunchaCount.todayXunchaCount,
  37. todayRiskCount: res.xunchaCount.todayRiskCount,
  38. todayEnterpriseCount: res.xunchaCount.todayEnterpriseCount
  39. })
  40. },
  41. getXunchaList() {
  42. http.post("/system/AppXunchaController/getXunchaList", null, this.getXunchaListSuccess)
  43. },
  44. getXunchaListSuccess(res) {
  45. this.setData({
  46. xunchaList: res.rows
  47. })
  48. },
  49. // 搜索结果跳页
  50. bindViewSearchEnd() {
  51. wx.navigateTo({
  52. url: '../xunchawu/xunchawu'
  53. })
  54. },
  55. toBindXunjinaMore(e){
  56. let isrisk = e.currentTarget.dataset.isrisk
  57. let buslogid = e.currentTarget.dataset.buslogid
  58. if(isrisk == 0){
  59. wx.showToast({
  60. title: '没有发现安全隐患,请放心!!',
  61. icon: "none"
  62. })
  63. }
  64. console.log(isrisk,"####",buslogid)
  65. },
  66. menuItemClick: function (res) {
  67. //获取点击事件的信息
  68. let clickInfo = res.detail.iteminfo
  69. if(clickInfo.id ==2){
  70. //巡检
  71. wx.navigateTo({
  72. url: '../search/search',
  73. })
  74. }
  75. // 根据不同类型进行判别处理
  76. //事件的处理 代码
  77. }
  78. })