1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- import http from '../../base/httputil'
- const app = getApp()
- Page({
- /**
- * 组件的初始数据
- */
- data: {
- host: app.globalData.host,
- todayXunchaCount: 0,
- todayRiskCount: 0,
- todayEnterpriseCount: 0,
- xunchaList: null,
- menulist: [{
- "id": "1",
- "url": "icon-anquanxuncha",
- "title": "巡更",
- },
- {
- "id": "2",
- "url": "icon-xunjian",
- "title": "巡检",
- },
- ],
- mainmodel: {
- }
- },
- onLoad() {
- this.getXunchaCount()
- this.getXunchaList()
- },
- getXunchaCount() {
- http.post("/system/AppXunchaController/getXunchaCount", null, this.getXunchaCountSuccess)
- },
- getXunchaCountSuccess(res) {
- this.setData({
- todayXunchaCount: res.xunchaCount.todayXunchaCount,
- todayRiskCount: res.xunchaCount.todayRiskCount,
- todayEnterpriseCount: res.xunchaCount.todayEnterpriseCount
- })
- },
- getXunchaList() {
- http.post("/system/AppXunchaController/getXunchaList", null, this.getXunchaListSuccess)
- },
- getXunchaListSuccess(res) {
- this.setData({
- xunchaList: res.rows
- })
- },
- // 搜索结果跳页
- bindViewSearchEnd() {
- wx.navigateTo({
- url: '../xunchawu/xunchawu'
- })
- },
- toBindXunjinaMore(e){
- let isrisk = e.currentTarget.dataset.isrisk
- let buslogid = e.currentTarget.dataset.buslogid
- if(isrisk == 0){
- wx.showToast({
- title: '没有发现安全隐患,请放心!!',
- icon: "none"
- })
- }else{
- console.log(isrisk,"####",buslogid)
- wx.navigateTo({
- url: '../xunjianmore/xunjianmore?buslogid='+buslogid
- })
- }
-
- },
- menuItemClick: function (res) {
- //获取点击事件的信息
- let clickInfo = res.detail.iteminfo
- if(clickInfo.id ==2){
- //巡检
- wx.navigateTo({
- url: '../search/search',
- })
- }
- // 根据不同类型进行判别处理
- //事件的处理 代码
- }
- })
|