yangan
2024-06-24 3d55e7cd3d709e80efc0c03a756f4a984b8bd027
store/index.js
@@ -43,12 +43,13 @@
         text: '我的'
      }
   ],
   three: [{
         pagePath: 'pages/tabbar-page/index-tabbar/index-tabbar',
         iconPath: '../../static/tabBar-icon/home.png',
         selectedIconPath: '../../static/tabBar-icon/homeblue.png',
         text: '首页'
      },
   three: [
      // {
      //    pagePath: 'pages/tabbar-page/index-tabbar/index-tabbar',
      //    iconPath: '../../static/tabBar-icon/home.png',
      //    selectedIconPath: '../../static/tabBar-icon/homeblue.png',
      //    text: '首页'
      // },
      {
         pagePath: 'pages/driver-page/driver-index/bill-of-lading-details/selectOrderPlan/selectOrderPlan',
         iconPath: '../../static/tabBar-icon/checking.png',
@@ -107,7 +108,64 @@
      connectNum: 1, //重连次数,
      reconnectTimeOut: null,
      // 称重稳定态  0/稳定 1/非稳定  非稳定态不能点称重
      globalWarning: false
      globalWarning: false,
      globalShowWeigh: [],
      isFirstLogin: true,
      driverTourImgList: ['https://mx.jzeg.cn:9095/appimg/image/tour/driver/sj1.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/driver/sj2.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/driver/sj3.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/driver/sj4.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/driver/sj5.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/driver/sj6.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/driver/sj7.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/driver/sj8.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/driver/sj9.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/driver/sj10.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/driver/sj11.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/driver/sj12.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/driver/sj13.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/driver/sj14.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/driver/sj15.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/driver/sj16.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/driver/sj17.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/driver/sj18.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/driver/sj19.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/driver/sj20.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/driver/sj21.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/driver/sj22.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/driver/sj23.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/driver/sj24.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/driver/sj25.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/driver/sj26.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/driver/sj27.jpg',
      ],
      customerTourImgList: ['https://mx.jzeg.cn:9095/appimg/image/tour/quality/quality1.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/quality/quality2.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/quality/quality3.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/quality/quality4.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/quality/quality5.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/quality/quality6.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/quality/quality7.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/quality/quality8.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/quality/quality9.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/quality/quality10.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/quality/quality11.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/quality/quality12.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/quality/quality13.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/quality/quality14.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/quality/quality15.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/quality/quality16.jpg',
         'https://mx.jzeg.cn:9095/appimg/image/tour/quality/quality17.jpg',
      ],
      qualityTourImgList:['https://mx.jzeg.cn:9095/appimg/image/tour/quality/quality1.jpg',
      'https://mx.jzeg.cn:9095/appimg/image/tour/quality/quality2.jpg',
      'https://mx.jzeg.cn:9095/appimg/image/tour/quality/quality3.jpg',
      'https://mx.jzeg.cn:9095/appimg/image/tour/quality/quality4.jpg',
      'https://mx.jzeg.cn:9095/appimg/image/tour/quality/quality5.jpg',
      'https://mx.jzeg.cn:9095/appimg/image/tour/quality/quality6.jpg',
      'https://mx.jzeg.cn:9095/appimg/image/tour/quality/quality7.jpg',
      'https://mx.jzeg.cn:9095/appimg/image/tour/quality/quality8.jpg',
      'https://mx.jzeg.cn:9095/appimg/image/tour/quality/quality9.jpg']
   },
   mutations: {
      lengthchange(state, payload) {
@@ -162,6 +220,9 @@
         state.globalisLogin = payload
         console.log(state.globalisLogin, '全局登录状态改变了')
      },
      changesocketTask(state, payload) {
         state.socketTask = payload
      },
      setWebsocketData(state, data) {
         state.websocketData = data
      },
@@ -180,12 +241,19 @@
      // 改变稳定态
      changeWarning(state, payload) {
         state.globalWarning = payload
      },
      changeglobalShowWeigh(state, payload) {
         state.globalShowWeigh = payload
      },
      changeisFirstLogin(state, payload) {
         state.isFirstLogin = payload
         console.log(state.isFirstLogin, '第一次登录');
      }
   },
   actions: {
      websocketInit({ state, dispatch, commit }) {
         let wsUrl = `${webSocketUrl}?access_token=${uni.getStorageSync('token')}`
         state.socketTast = uni.connectSocket({
         state.socketTask = uni.connectSocket({
            url: wsUrl,
            header: { CLIENT_TOC: 'Y' },
            success: res => {
@@ -203,17 +271,17 @@
            }
         })
         state.socketTast.onOpen(() => dispatch('websocketOnOpen'))
         state.socketTast.onMessage(result => dispatch('websocketOnMessage', result.data))
         state.socketTast.onClose(e => dispatch('websocketOnClose', e))
         state.socketTast.onError(e => dispatch('websocketOnError', e))
         state.socketTask.onOpen(() => dispatch('websocketOnOpen'))
         state.socketTask.onMessage(result => dispatch('websocketOnMessage', result.data))
         state.socketTask.onClose(e => dispatch('websocketOnClose', e))
         state.socketTask.onError(e => dispatch('websocketOnError', e))
      },
      websocketOnOpen({ state, commit }) {
         console.log('ws打开')
         clearInterval(state.reconnectTimeOut)
         clearInterval(state.globalIntervalId)
         state.globalIntervalId = setInterval(() => {
            state.socketTast.send({
            state.socketTask.send({
               data: JSON.stringify({ type: 'ping' }),
               success(e) {
                  console.log(e, '发送心跳成功')
@@ -222,14 +290,14 @@
         }, 30000)
      },
      websocketOnClose({ state, commit, dispatch }, e) {
         if (!state.socketTast) return
         if (!state.socketTask) return
         console.log('ws关闭', e)
         state.socketTast.close(e => {
         state.socketTask.close(e => {
            commit('changeisconnect', false)
         })
         clearInterval(state.globalIntervalId)
         clearInterval(state.reconnectTimeOut)
         state.socketTast = null
         state.socketTask = null
         commit('changereconnectState', false)
         if (state.connectNum <= 6 && state.globalisLogin) {
            uni.showToast({
@@ -253,7 +321,7 @@
         console.log('ws报错', e)
         clearInterval(state.globalIntervalId)
         clearInterval(state.reconnectTimeOut)
         state.socketTast = null
         state.socketTask = null
         commit('changereconnectState', false)
         if (state.connectNum < 6 && state.globalisLogin) {
            uni.showToast({
@@ -262,7 +330,7 @@
            })
            commit('changereconnectNum', 1)
            dispatch('reconnect')
         } else if (state.connectNum > 6 && state.globalisLogin) {
         } else if (state.connectNum >= 6 && state.globalisLogin) {
            commit('changereconnectNum', 1)
            uni.showToast({
               title: '网络异常,请稍后重试',