From 5e08d4f61c24db589bd6d30875fcb1191f719b16 Mon Sep 17 00:00:00 2001 From: yangan <yangan0921@163.com> Date: 星期五, 11 四月 2025 20:41:44 +0800 Subject: [PATCH] feat:申请复磅 --- store/index.js | 66 +++++++++++++++++++------------- 1 files changed, 39 insertions(+), 27 deletions(-) diff --git a/store/index.js b/store/index.js index b0f55d7..85bcdbf 100644 --- a/store/index.js +++ b/store/index.js @@ -55,19 +55,22 @@ iconPath: '../../static/tabBar-icon/checking.png', selectedIconPath: '../../static/tabBar-icon/checkingblue.png', text: '楠岃川' - }, - { + },{ + pagePath: 'pages/customer-page/zhijian-bangfang/zhijian-bangfang', + iconPath: '../../static/tabBar-icon/bang.png', + selectedIconPath: '../../static/tabBar-icon/bangblue.png', + text: '纾呮埧' + },{ pagePath: 'pages/customer-page/customer-my/faYunstatistics/faYunstatistics', iconPath: '../../static/tabBar-icon/statistics.png', selectedIconPath: '../../static/tabBar-icon/statisticsactive.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({ @@ -177,6 +180,7 @@ // 璁剧疆搴曢儴鏍� setUserTabbar(state, roleType) { state.roleType = roleType + console.log(roleType,'roledType===') if (roleType === 1) { state.userTabbar = userRoleTabbar.first uni.setStorageSync('userTabbar', state.userTabbar) @@ -232,10 +236,14 @@ }, // 鏀瑰彉閲嶈繛娆℃暟 changereconnectNum(state, payload) { - if (state.connectNum <= 6) { - state.connectNum += payload + if (payload.isWeigh) { + state.connectNum = payload.connectNum } else { - state.connectNum = payload + if (state.connectNum < 6) { + state.connectNum += payload.connectNum + } else { + state.connectNum = payload.connectNum + } } }, // 鏀瑰彉绋冲畾鎬� @@ -292,7 +300,7 @@ }, websocketOnClose({ state, commit, dispatch }, e) { if (!state.socketTask) return - console.log('ws鍏抽棴',state.connectNum , JSON.parse( state.globalisLogin), e) + console.log('ws鍏抽棴', e) state.socketTask.close(e => { commit('changeisconnect', false) }) @@ -300,16 +308,15 @@ clearInterval(state.reconnectTimeOut) state.socketTask = null commit('changereconnectState', false) - if (state.connectNum <= 6 && state.globalisLogin) { - console.log('瑙﹀彂閲嶈繛锛�========') - uni.showToast({ - title: `杩炴帴澶辫触锛屾鍦ㄥ皾璇曠${state.connectNum}娆¤繛鎺, - icon: 'none' - }) - commit('changereconnectNum', 1) + if ((state.connectNum < 6 || state.connectNum.connectNum < 6) && state.globalisLogin) { + // uni.showToast({ + // title: '杩炴帴澶辫触锛屾鍦ㄥ皾璇曢噸鏂拌繛鎺�', + // icon: 'none' + // }) + commit('changereconnectNum', { connectNum: 1, isWeigh: false }) dispatch('reconnect') - } else if (state.connectNum > 6 && state.globalisLogin) { - commit('changereconnectNum', 1) + } else if (state.connectNum >= 6 && state.globalisLogin) { + commit('changereconnectNum', { connectNum: 1, isWeigh: false }) uni.showToast({ title: '缃戠粶寮傚父,璇风◢鍚庨噸璇�', icon: 'none' @@ -325,15 +332,15 @@ clearInterval(state.reconnectTimeOut) state.socketTask = null commit('changereconnectState', false) - if (state.connectNum < 6 && state.globalisLogin) { - uni.showToast({ - title: `杩炴帴澶辫触锛屾鍦ㄥ皾璇曠${state.connectNum}娆¤繛鎺, - icon: 'none' - }) - commit('changereconnectNum', 1) + if (state.connectNum < 6 || state.connectNum.connectNum < 6 && state.globalisLogin) { + // uni.showToast({ + // title: '杩炴帴澶辫触锛屾鍦ㄥ皾璇曢噸鏂拌繛鎺�', + // icon: 'none' + // }) + commit('changereconnectNum', { connectNum: 1, isWeigh: false }) dispatch('reconnect') - } else if (state.connectNum >= 6 && state.globalisLogin) { - commit('changereconnectNum', 1) + } else if (state.connectNum > 6 && state.globalisLogin) { + commit('changereconnectNum', { connectNum: 1, isWeigh: false }) uni.showToast({ title: '缃戠粶寮傚父,璇风◢鍚庨噸璇�', icon: 'none' @@ -356,7 +363,12 @@ }, 5000) } } + }, + getters: { + websocketData:(state) => state.websocketData, + globalweigh:(state) => state.globalweigh, + userTabbar: (state) => state.userTabbar, } }) -export default store \ No newline at end of file +export default store -- Gitblit v1.9.1