qingyiay
2023-04-14 0becab45282781f281ad5aa04202b83039ab275e
store/index.js
@@ -5,29 +5,29 @@
// 动态底部tabbar
const userRoleTabbar = {
   first: [{
         pagePath: "pages/tabbar-page/index-tabbar/index-tabbar",
         iconPath: "../../static/tabBar-icon/Gfayun.png",
         selectedIconPath: "../../static/tabBar-icon/Bfayun1.png",
         text: "首页"
         pagePath: 'pages/tabbar-page/index-tabbar/index-tabbar',
         iconPath: '../../static/tabBar-icon/Gfayun.png',
         selectedIconPath: '../../static/tabBar-icon/Bfayun1.png',
         text: '首页'
      },
      {
         pagePath: "pages/tabbar-page/myPage-tabbar/myPage-tabbar",
         iconPath: "../../static/tabBar-icon/Gmine10.png",
         selectedIconPath: "../../static/tabBar-icon/Bmine57.png",
         text: "我的"
         pagePath: 'pages/tabbar-page/myPage-tabbar/myPage-tabbar',
         iconPath: '../../static/tabBar-icon/Gmine10.png',
         selectedIconPath: '../../static/tabBar-icon/Bmine57.png',
         text: '我的'
      }
   ],
   second: [{
         pagePath: "pages/tabbar-page/index-tabbar/index-tabbar",
         iconPath: "../../static/tabBar-icon/Ghome.png",
         selectedIconPath: "../../static/tabBar-icon/Bhome.png",
         text: "首页"
         pagePath: 'pages/tabbar-page/index-tabbar/index-tabbar',
         iconPath: '../../static/tabBar-icon/Ghome.png',
         selectedIconPath: '../../static/tabBar-icon/Bhome.png',
         text: '首页'
      },
      {
         pagePath: "pages/tabbar-page/myPage-tabbar/myPage-tabbar",
         iconPath: "../../static/tabBar-icon/Gmine10.png",
         selectedIconPath: "../../static/tabBar-icon/Bmine57.png",
         text: "我的"
         pagePath: 'pages/tabbar-page/myPage-tabbar/myPage-tabbar',
         iconPath: '../../static/tabBar-icon/Gmine10.png',
         selectedIconPath: '../../static/tabBar-icon/Bmine57.png',
         text: '我的'
      }
   ]
}
@@ -37,7 +37,14 @@
      userInfo: {},
      roleType: null, // 1客户,2货代,3司机
      userTabbar: [], // 用户所在角色底部菜单,
      fleetDriverDataLength: 0
      // 称重时的重量
      globalweigh: 0,
      // 消息推送
      globalmessage: '',
      // 全局weihousecode
      globalweighHouseCode: '',
      // 全局红外状态
      globalinfraredStatus: false
   },
   mutations: {
      lengthchange(state, payload) {
@@ -56,8 +63,24 @@
            state.userTabbar = userRoleTabbar.second
            uni.setStorageSync('userTabbar', state.userTabbar)
         }
      },
      // 改变重量
      changeWeigh(state, payload) {
         state.globalweigh = payload
         console.log(state.globalweigh, '重量改变了')
      },
      // 消息推送
      pushMessage(state, payload) {
         state.globalmessage = payload
      },
      // 改变weighHouseCode
      changeweighHouseCode(state, payload) {
         state.globalweighHouseCode = payload
         console.log(state.globalweighHouseCode, 'globalweighHouseCode改变了')
      },
      // 改变红外状态
      changeinfraredStatus(state, payload) {
         state.globalinfraredStatus = payload
      }
   }
})