// pages/workstand/index.js
Page({

  /**
   * 页面的初始数据
    //"bizAdmin"管理员, "driver"司机, "customer"用友客户, "ship"船主, "sale"销售, "dispatcher"调度员, "send"发货员, "load"起卸员  "serviceCustomer"服务客户
   */
  data: {
    loginStatus: wx.getStorageSync('loginStatus') ? wx.getStorageSync('loginStatus') : false,
    roleCodeList: wx.getStorageSync('roleCodeList') ? wx.getStorageSync('roleCodeList') : '',
    menuData:[
      {url:'/pages/index/index',flowName:'扫码预约',flowIcon:'',iconfont:'yuyue',color:"#00a8ff",role:["driver","customer"]},

      {url:'/pages/reservationMan/index',flowName:'预约管理',flowIcon:'',iconfont:'yuyueguanli2',color:"#FF6160",role:["bizAdmin"]},

      {url:'/pages/weighingRecord/index',flowName:'过磅记录',flowIcon:'',iconfont:'xuexijilu-',color:"#26CA83",role:["bizAdmin","driver"]},

      {url:'/pages/queueCar/index',flowName:'排队车辆',flowIcon:'',iconfont:'item5',color:"#6c5ce7",role:["bizAdmin"]},

      {url:'/pages/salesOrderMan/index',flowName:'物流订单',flowIcon:'',iconfont:'xiaoshouguanli3',color:"#20A0E3",role:["bizAdmin","sale","customer","dispatcher"]},

      {url:'/otherPages/loadAppoint/index',flowName:'起卸订单',flowIcon:'',iconfont:'loadAppoint',color:"#6c5ce7",role:["load","bizAdmin", "dispatcher", "serviceCustomer"]},

      {url:'/otherPages/loadArrive/index',flowName:'报港预约',flowIcon:'',iconfont:'loadArrive',color:"#20A0E3",role:["ship", "bizAdmin"]},
      
      {url:'/pages/appointReplace/index',flowName:'预约调度审批',flowIcon:'',iconfont:'wodebaozhang',color:"#e17055",role:["dispatcher"]},

      {url:'/pages/deliveryConfirm/index',flowName:'发货确认',flowIcon:'',iconfont:'daifahuo1',color:"#FF9237",role:["send"]},

      {url:'/pages/signReview/index',flowName:'签收审核',flowIcon:'',iconfont:'qianshou',color:"#e17055",role:["sale"]},
      

      // {url:'/pages/reservationPipe/index',flowName:'管桩预约',flowIcon:'',iconfont:'reservationPipe',color:"#20A0E3",role:["driver", "bizAdmin"]},
      
      // {url:'/pages/reservationChargestation/index',flowName:'充电桩预约',flowIcon:'',iconfont:'chargestation',color:"#20A0E3",role:["driver", "bizAdmin"]},
      
      // 新增功能模块，包含列表、详情、新增，后续其他页面可复制，修改页面参数显示、接口地址即可
      // url：表示页面地址  role：有权限的角色名
    //   {url:'/pages/operationExecution/index',flowName:'运营执行',flowIcon:'',iconfont:'moxingzhihang',color:"#20A0E3",role:["dispatcher"]},
    //   {url:'/otherPages/repairDispatch/index',flowName:'维修调度',flowIcon:'',iconfont:'weixiu1',color:"#20A0E3",role:["dispatcher"]},

    //   {url:'/otherPages/upDownSubmit/index',flowName:'起卸填报',flowIcon:'',iconfont:'yuyueshenbao',color:"#20A0E3",role:["起卸员"]},
    //   {url:'/otherPages/workTask/index',flowName:'工作任务',flowIcon:'',iconfont:'gongzuorenwu',color:"#20A0E3",role:["起卸员","巡检员","工序操作员","保洁员"]},

    //   {url:'/otherPages/reportFault/index',flowName:'报障',flowIcon:'',iconfont:'guzhang',color:"#20A0E3",role:["巡检员"]},

    //   {url:'',flowName:'工序任务',flowIcon:'',iconfont:'gongxu',color:"#20A0E3",role:["工序操作员"]},

    //   {url:'',flowName:'保洁任务',flowIcon:'',iconfont:'baojie-chulizhong',color:"#20A0E3",role:["保洁员"]},


    ]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {

  },

  //页面跳转
  toLink: function (e) {
    let { url } = e.currentTarget.dataset
    wx.navigateTo({
      url: url
    })
  },

  //去登录页面
  toLogin(e) {
    wx.navigateTo({
      url: '../login/index',
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
    const roleCodeList = wx.getStorageSync('roleCodeList')
    let loginStatus = wx.getStorageSync('loginStatus')
    this.setData({
      roleCodeList: roleCodeList ? roleCodeList : '',
      loginStatus: loginStatus ? loginStatus : false
    })
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})