This commit is contained in:
duanliang
2025-04-17 20:18:38 +08:00
parent d7eeea3efe
commit 09dcabadda
23 changed files with 1302 additions and 269 deletions

View File

@@ -23,7 +23,7 @@
let scenicChange = null
let timer = null
let timer2 = null
let keyword = ref('')
watch(
() => [isConnected.value, scenicSpotId.value],
(val) => {
@@ -36,6 +36,14 @@
scenicSpotId: scenicSpotId.value
})
)
sendMessage(
JSON.stringify({
action: 'start',
type: 'gpsData',
keyword:keyword.value,
scenicSpotId: scenicSpotId.value
})
)
}
},
{ immediate: true }
@@ -45,8 +53,11 @@
() => dataRes.value,
(val) => {
if (val) {
// console.log(val.type, '=====')
// console.log(val, '=====')
switch (val.type) {
case 'gpsData':
scenicStore.setVehicleData(val.data)
break
case 'wordkOrderlist':
scenicStore.setWordkOrderList(val.data)
break
@@ -75,6 +86,7 @@
scenicStore.setUserPortraitData(val)
break
case 'carShipData':
console.log(val,'carShipData')
scenicStore.setCarShipData(val.data)
break
}
@@ -115,8 +127,15 @@
type: 'carShipData',
scenicSpotId: scenicSpotId.value
})
) //车窗数据
) //车窗数据2
sendMessage(
JSON.stringify({
action: 'start',
type: 'gpsData',
keyword:keyword.value,
scenicSpotId: scenicSpotId.value
})
) //车窗数据
}
}, 5000)
}
@@ -124,6 +143,10 @@
scenicChange = PubSub.subscribe('scenicChange', (msg, data) => {
scenicSpotId.value = data.scenicSpotId
})
PubSub.subscribe('keywordChange', (msg, data) => {
keyword.value = data
sendMessage(JSON.stringify({ action: 'start', type: '',"keyword":keyword.value, scenicSpotId: scenicSpotId.value }))
})
})
onUnmounted(() => {
if (scenicChange) PubSub.unsubscribe(scenicChange)