From 78252f8407345ffceed8157a1c1685c09cdec029 Mon Sep 17 00:00:00 2001 From: yangan <yangan0921@163.com> Date: 星期五, 02 八月 2024 09:16:52 +0800 Subject: [PATCH] docs:再生体验版发布 --- pages/tabbar-page/index-tabbar/index-tabbar.vue | 81 +++++++++++++++++++++++----------------- 1 files changed, 46 insertions(+), 35 deletions(-) diff --git a/pages/tabbar-page/index-tabbar/index-tabbar.vue b/pages/tabbar-page/index-tabbar/index-tabbar.vue index 248cfdb..ade255d 100644 --- a/pages/tabbar-page/index-tabbar/index-tabbar.vue +++ b/pages/tabbar-page/index-tabbar/index-tabbar.vue @@ -7,8 +7,9 @@ <u-badge :isDot="true" type="error" v-if="dotShow"></u-badge> - <u-icon name="chat" - color="#fff" + <u-icon + name="chat" + :color="[roleType == 4 ? '#3b56eb' : '#fff']" size="50"></u-icon> </view> </view> @@ -39,9 +40,10 @@ <script> import customerIndex from '@/pages/customer-page/customer-index/customer-index.vue'; import driverIndex from '@/pages/driver-page/driver-index/driver-index.vue'; + // import driverIndex from '@/pages/driver-page/driver-index/test-index.vue' import inspectionIndex from '@/pages/driver-page/driver-index/bill-of-lading-details/selectOrderPlan/selectOrderPlan.vue' import freightForwarderIndex from '@/pages/freight-forwarder-page/freightForwarder-index/freightForwarder-index.vue'; - import { mapState, mapMutations } from 'vuex'; + import { mapState, mapMutations, mapGetters } from 'vuex'; import { webSocketUrl } from '@/api/request.js'; let socket = null; export default { @@ -54,7 +56,8 @@ computed: { ...mapState(['globalweighHouseCode', 'globalweigh', 'globalisconnect', 'globalSocket', 'websocketData', 'globalIntervalId' - ]) + ]), + ...mapGetters(['websocketData']) }, //棣栭〉涓嬫媺鍒锋柊 onPullDownRefresh() { @@ -145,35 +148,43 @@ }; }, watch: { - '$store.state.websocketData'(v) { - console.log(v, '鎺ュ彈鐨剋s鏁版嵁'); - if (v.startsWith('weigh')) { - let nowWeighObj = JSON.parse(v.slice(7)); - if (this.globalweighHouseCode && nowWeighObj.eqCode == this.globalweighHouseCode) { - if (nowWeighObj.eqInfraredStatus) { - this.changeinfraredStatus(true); - this.changeWeigh(nowWeighObj.weigh); - let warningState = nowWeighObj.warning == 1 - this.changeWarning(warningState) - } else { - this.changeinfraredStatus(false); - this.changeWeigh(nowWeighObj.weigh); - let warningState = nowWeighObj.warning == 1 - this.changeWarning(warningState) - } - } - } else if (v.startsWith('msg')) { - function removeTags(str) { - return str.replace(/<\/?[^>]+>/gi, ''); - } - this.messageList = JSON.parse(v.slice(5)); - this.messageList = { - ...this.messageList, - title: this.messageList.title.slice(0, 8) + '...', - content: removeTags(this.messageList.content).trim().slice(0, 8) + '...' - } - this.messagePushShow = true; - } else {} + 'websocketData': { + handler(v) { + console.log(v, '鎺ュ彈鐨剋s鏁版嵁'); + if(v) { + if (v.startsWith('weigh')) { + let nowWeighObj = JSON.parse(v.slice(7)); + console.log(nowWeighObj,'nowWeighObj-----') + console.log(this.globalweighHouseCode,'this.globalweighHouseCode-----') + if (this.globalweighHouseCode && nowWeighObj.eqCode == this.globalweighHouseCode) { + if (nowWeighObj.eqInfraredStatus) { + this.changeinfraredStatus(true); + this.changeWeigh(nowWeighObj.weigh); + let warningState = nowWeighObj.warning == 1 + this.changeWarning(warningState) + } else { + this.changeinfraredStatus(false); + this.changeWeigh(nowWeighObj.weigh); + let warningState = nowWeighObj.warning == 1 + this.changeWarning(warningState) + } + } + } else if (v.startsWith('msg')) { + function removeTags(str) { + return str.replace(/<\/?[^>]+>/gi, ''); + } + this.messageList = JSON.parse(v.slice(5)); + this.messageList = { + ...this.messageList, + title: this.messageList.title.slice(0, 8) + '...', + content: removeTags(this.messageList.content).trim().slice(0, 8) + '...' + } + this.messagePushShow = true; + } else {} + } + }, + deep: true, + immediate: true } }, onShow() { @@ -309,7 +320,7 @@ position: absolute; top: vww(96); right: vww(32); - z-index: 1; + z-index: 999999; .icon-body { position: relative; @@ -334,4 +345,4 @@ } } } -</style> \ No newline at end of file +</style> -- Gitblit v1.9.1