yangan
2024-12-31 f163737585dbc9d8c2313cb29cf8d4503cf39f50
store/index.js
@@ -55,12 +55,27 @@
         selectedIconPath: '../../static/tabBar-icon/Bmine57.png',
         text: '我的'
      }
   ],
   six:[{
      pagePath: 'pages/tabbar-page/index-tabbar/index-tabbar',
      iconPath: '../../static/tabBar-icon/home.png',
      selectedIconPath: '../../static/tabBar-icon/homeblue.png',
      text: '首页'
   },
   {
      pagePath: 'pages/tabbar-page/myPage-tabbar/myPage-tabbar',
      iconPath: '../../static/tabBar-icon/Gmine10.png',
      selectedIconPath: '../../static/tabBar-icon/Bmine57.png',
      text: '我的'
   }
   ]
}
const store = new Vuex.Store({
   state: {
      // 用戶界面判斷
      userInfo: {},
      ispecial:['1821820980778090498'], //用来判断是不是山西大远矿
      roleType: null, // 1客户,2货代,3司机 5装卸员
      userTabbar: [], // 用户所在角色底部菜单,
      // 称重时的重量
@@ -93,55 +108,55 @@
      globalIntervalId: null,
      is_open_socket: false, //避免重复连接
      connectNum: 1, //重连次数,
      reconnectTimeOut: null,
      // 打印出入门证  一次就可以有打印入门证,  两次可以有入门证 出门证  0次一张都没有
      reconnectTimeOut: null,  //重新链接的定时器
      // 打印出入门证  一次就可以有打印入门证,  两次可以有入门证 出门证  0次一张都没有
      ablePrintInduction: false, //入门证
      ablePrintOut: false, //出门证
      driverTourImgList: ['https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj1.png',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj2.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj3.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj4.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj5.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj6.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj7.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj8.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj9.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj10.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj11.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj12.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj13.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj14.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj15.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj16.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj17.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj18.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj19.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj20.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj21.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj22.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj23.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj24.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj25.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj26.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj27.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj28.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj29.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj30.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj31.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj32.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj33.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj33-1.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj34.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj35.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj36.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj37.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj38.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj39.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj40.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj41.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj42.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj43.jpg',
         'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj44.jpg',
      driverTourImgList: ['https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj1.png',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj2.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj3.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj4.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj5.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj6.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj7.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj8.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj9.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj10.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj11.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj12.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj13.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj14.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj15.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj16.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj17.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj18.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj19.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj20.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj21.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj22.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj23.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj24.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj25.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj26.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj27.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj28.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj29.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj30.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj31.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj32.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj33.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj33-1.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj34.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj35.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj36.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj37.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj38.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj39.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj40.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj41.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj42.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj43.jpg',
         'https://mr1.res.jzeg.cn:9096/appimg/image/tour/driver/sj44.jpg',
      ],
      wsgVisiable: false, //磅房忙碌弹窗控制
      wsgContent: '',
@@ -152,9 +167,6 @@
      globalWarning: false,
   },
   mutations: {
      lengthchange(state, payload) {
         state.fleetDriverDataLength = payload
      },
      setUserInfo(state, identity) {
         state.userInfo = userObj[identity]
      },
@@ -169,6 +181,9 @@
            uni.setStorageSync('userTabbar', state.userTabbar)
         } else if (roleType == 5) {
            state.userTabbar = userRoleTabbar.three
            uni.setStorageSync('userTabbar', state.userTabbar)
         }else if(roleType == 6){
            state.userTabbar = userRoleTabbar.six
            uni.setStorageSync('userTabbar', state.userTabbar)
         }
      },
@@ -196,7 +211,7 @@
      changesocketTask(state, payload) {
         state.socketTask = payload
      },
      // 改版全局websocket状态
      // 改版全局websocket状态(判断是否正常链接)
      changeisconnect(state, payload) {
         state.globalisconnect = payload
      },
@@ -254,7 +269,12 @@
   },
   actions: {
      websocketInit({ state, dispatch, commit }) {
         // #ifdef H5
         let wsUrl = `${webSocketUrl}?UUID=${uni.getStorageSync('token')}`
         // #endif
         // #ifndef H5
         let wsUrl = `${webSocketUrl}?access_token=${uni.getStorageSync('token')}`
         // #endif
         state.socketTask = uni.connectSocket({
            url: wsUrl,
            header: { CLIENT_TOC: 'Y' },
@@ -280,8 +300,8 @@
      },
      websocketOnOpen({ state, commit }) {
         console.log('ws打开')
         clearInterval(state.reconnectTimeOut)
         clearInterval(state.globalIntervalId)
         clearInterval(state.reconnectTimeOut) //清除上一次的定时器
         clearInterval(state.globalIntervalId)  //清除心跳
         state.globalIntervalId = setInterval(() => {
            state.socketTask.send({
               data: JSON.stringify({ type: 'ping' }),
@@ -356,7 +376,11 @@
            }, 5000)
         }
      }
   },
   getters: {
      websocketData:(state) => state.websocketData
   }
})
export default store
export default store