index.js 2.39 KB
// pages/zong/index.js
import {
    getPatrolRecordList
} from "../../api/tour.js";
const App = getApp();

Page({

    /**
     * 页面的初始数据
     */
    data: {
        navHeight: App.globalData.navHeight,
        windowHeight: App.globalData.windowHeight,
        windowWidth: App.globalData.windowWidth,

        menuItems: [{
                name: '基础客流',
                icon: '1',
                path: '/pages/zong/basic/index'
            },
            {
                name: '进出客流',
                icon: '2',
                path: '/pages/zong/contrast/index'
            },
            {
                name: '排行榜',
                icon: '3',
                path: '/pages/zong/ranking/index'
            },
            {
                name: '同环比',
                icon: '4',
                path: '/pages/zong/sequential/index'
            },
            {
              name: '时段客流',
              icon: '5',
              path: '/pages/zong/timeTravel/index'
            },
            {
                name: '节假日客流',
                icon: '6',
                path: '/pages/zong/holiday-comparison/index'
            },
            
        ],
        tourItems:[{
            name: '实时监控',
            icon: '8',
            path: '/pages/tour/gate/index?type=view'
        },{
            name: '远程巡店',
            icon: '9',
            path: '/pages/tour/gate/index?type=tour'
        },{
            name: '点检巡店',
            icon: '10',
            path: '/pages/tour/point/index'
        },{
            name: '我发起的',
            icon: '11',
            path: '/pages/tour/list/index?type=create'
        },{
            name: '待我处理',
            icon: '12',
            path: '/pages/tour/list/index?type=handle'
        }]
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function(options) {
        const deploymentType = wx.getStorageSync('deploymentType');
        const { menuItems } = this.data
        if (deploymentType === 'store') {
            menuItems.push({
                name: '进店率',
                icon: '7',
                path: '/pages/zong/entry-rate/index'
            })
            this.setData({ menuItems })
        }
    },

    goOtherPage: function(e) {
        const { path } = e.currentTarget.dataset.value
        wx.navigateTo({ url: path })
    }
})