yangan
2023-11-16 700c025aa912047fbd71975d4c6f8bb930ba82f8
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',
@@ -105,7 +106,57 @@
      globalIntervalId: null,
      is_open_socket: false, //避免重复连接
      connectNum: 1, //重连次数,
      reconnectTimeOut: null
      reconnectTimeOut: null,
      // 称重稳定态  0/稳定 1/非稳定  非稳定态不能点称重
      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',
      ],
   },
   mutations: {
      lengthchange(state, payload) {
@@ -169,8 +220,23 @@
      },
      // 改变重连次数
      changereconnectNum(state, payload) {
         state.connectNum = payload
         if (state.connectNum <= 6) {
            state.connectNum += payload
         } else {
            state.connectNum = payload
         }
      },
      // 改变稳定态
      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 }) {
@@ -221,12 +287,22 @@
         clearInterval(state.reconnectTimeOut)
         state.socketTast = null
         commit('changereconnectState', false)
         if (state.connectNum < 6) {
            dispatch('reconnect')
         } else {
         if (state.connectNum <= 6 && state.globalisLogin) {
            uni.showToast({
               title: `连接失败,正在尝试第${state.connectNum}次连接`,
               icon: 'none'
            })
            commit('changereconnectNum', 1)
            dispatch('reconnect')
         } else if (state.connectNum > 6 && state.globalisLogin) {
            commit('changereconnectNum', 1)
            uni.showToast({
               title: '网络异常,请稍后重试',
               icon: 'none'
            })
         } else {
            return
         }
      },
      websocketOnError({ state, commit, dispatch }, e) {
         // 如果重连状态为false则不进行重连,为true才会
@@ -235,17 +311,21 @@
         clearInterval(state.reconnectTimeOut)
         state.socketTast = null
         commit('changereconnectState', false)
         if (state.connectNum < 6) {
         if (state.connectNum < 6 && state.globalisLogin) {
            uni.showToast({
               title: `连接失败,正尝试第${state.connectNum}次连接`,
               title: `连接失败,正在尝试第${state.connectNum}次连接`,
               icon: 'none'
            })
            let num = 1;
            num++;
            commit('changereconnectNum', num)
            dispatch('reconnect')
         } else {
            commit('changereconnectNum', 1)
            dispatch('reconnect')
         } else if (state.connectNum >= 6 && state.globalisLogin) {
            commit('changereconnectNum', 1)
            uni.showToast({
               title: '网络异常,请稍后重试',
               icon: 'none'
            })
         } else {
            return
         }
      },
      // 接收数据
@@ -256,7 +336,7 @@
      reconnect({ state, commit, dispatch }) {
         console.log(state.is_open_socket, '重新连接socket状态');
         clearInterval(state.globalIntervalId)
         if (!state.is_open_socket) {
         if (!state.is_open_socket && state.globalisLogin) {
            state.reconnectTimeOut = setInterval(() => {
               dispatch('websocketInit')
            }, 5000)