import http from '../../base/httputil'
Page({

  onLoad(){
    this.getXunchaList()
  },
  /**
   * 页面的初始数据
   */
  data: {

    xunchaList: null,

    menulist: [{
        "id": "1",
        "url": "icon-anquanxuncha",
        "title": "巡更",
        "bindtap": ""
      },
      {
        "id": "2",
        "url": "icon-xunjian",
        "title": "巡检",
        "bindtap": "bindViewQiYeChaXun"
      },
    ],
    mainmodel: {

    }
  },

  toBindXunjinaMore(e){
    let isrisk = e.currentTarget.dataset.isrisk
    let buslogid = e.currentTarget.dataset.buslogid
    if(isrisk == 0){
      wx.showToast({
        title: '没有发现安全隐患,请放心!!',
        icon: "none" 
      })
    }
    console.log(isrisk,"####",buslogid)
  },

  getXunchaList() {
    http.post("/system/AppXunchaController/getXunchaList", null, this.getXunchaListSuccess)
  },
  getXunchaListSuccess(res) {
    this.setData({
      xunchaList: res.rows
    })
  },
  getXunchaListByEnterpriseName(e) {
    let obj = new Object()
    obj.busEnterpriseName = e.detail.value
    http.post("/system/AppXunchaController/getXunchaList", obj, this.getXunchaListSuccess)
  },




  // 搜索结果跳页
  bindViewSearchEnd() {
    wx.navigateTo({
      url: '../search/search'
    })
  },
  // 企业详细页
  bindViewDetails() {
    wx.navigateTo({
      url: '../details/details'
    })
  },
  // 企业查询页
  bindViewQiYeChaXun() {
    wx.navigateTo({
      url: '../qiyechaxun/qiyechaxun'
    })
  },

  menuItemClick: function (res) {
    //获取点击事件的信息
    let clickInfo = res.detail.iteminfo
    // 根据不同类型进行判别处理
    //事件的处理 代码
  }

})