From 76f5ad404069bbecca98d441b4f7cbc2aba51c75 Mon Sep 17 00:00:00 2001 From: yangan <yangan0921@163.com> Date: 星期五, 05 七月 2024 17:55:07 +0800 Subject: [PATCH] feat:呼叫客服增加语音电话 --- pages/tabbar-page/index-tabbar/index-tabbar.vue | 98 +++++++++++++++++++++++++++++-------------------- 1 files changed, 58 insertions(+), 40 deletions(-) diff --git a/pages/tabbar-page/index-tabbar/index-tabbar.vue b/pages/tabbar-page/index-tabbar/index-tabbar.vue index 44b4ce4..7ec3877 100644 --- a/pages/tabbar-page/index-tabbar/index-tabbar.vue +++ b/pages/tabbar-page/index-tabbar/index-tabbar.vue @@ -7,13 +7,14 @@ <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> </view> - <customer-index v-if="roleType == 1||roleType == 4" + <customer-index v-if="roleType == 1" ref="customerIndexRef" :orderPlanDataStore="orderPlanDataStore"></customer-index> <freight-forwarder-index v-if="roleType == 2" @@ -23,6 +24,7 @@ <driver-index v-if="roleType == 3" ref="driverIndexRef" :indexdriverBillOfLoadingData="indexdriverBillOfLoadingData"></driver-index> + <inspectionIndex ref="inspectionIndex" v-if='roleType == 4'/> <tab-bar :current="0"></tab-bar> <!-- 鎺ㄩ�佹秷鎭脊绐� --> <u-modal :show="messagePushShow" @@ -37,21 +39,25 @@ <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/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 { components: { customerIndex, driverIndex, - freightForwarderIndex + freightForwarderIndex, + inspectionIndex }, computed: { ...mapState(['globalweighHouseCode', 'globalweigh', 'globalisconnect', 'globalSocket', 'websocketData', 'globalIntervalId' - ]) + ]), + ...mapGetters(['websocketData']) }, //棣栭〉涓嬫媺鍒锋柊 onPullDownRefresh() { @@ -142,35 +148,45 @@ }; }, 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-----') + console.log('鎴戣繘鏉ヤ簡--------------1111111') + if (this.globalweighHouseCode && nowWeighObj.eqCode == this.globalweighHouseCode) { + console.log('鎴戣繘鏉ヤ簡--------------22') + 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() { @@ -221,9 +237,9 @@ }); break; case 4: - console.log('customerIndexRef'); + console.log('inspectionIndex'); this.$nextTick(() => { - this.$refs.customerIndexRef.init(); + this.$refs.inspectionIndex.init(); }); break; default: @@ -290,6 +306,8 @@ scoped> .max-block { font-family: siYuanLight !important; + width: 100%; + height: 100%; } .white-block { @@ -304,7 +322,7 @@ position: absolute; top: vww(96); right: vww(32); - z-index: 1; + z-index: 999999; .icon-body { position: relative; @@ -329,4 +347,4 @@ } } } -</style> \ No newline at end of file +</style> -- Gitblit v1.9.1