feat:完善功能

This commit is contained in:
zjc
2025-01-20 16:22:44 +08:00
parent 65244492b4
commit f27f34bcfb
15 changed files with 160 additions and 334 deletions

View File

@@ -1,5 +1,5 @@
<template>
<box1 />
<box1 :scenicSpotId="scenicSpotId" />
<box2 />
</template>
@@ -18,13 +18,13 @@
`${mode == 'dev' ? socketBaseUrl : proSocketBaseUrl}/ws/scenic-spot`
)
let id = ref('')
let scenicSpotId = ref('')
watch(
() => [isConnected.value, id.value],
() => [isConnected.value, scenicSpotId.value],
(val) => {
if (val[0] && val[1]) {
sendMessage(JSON.stringify({ action: 'start', type: '', scenicSpotId: id.value }))
sendMessage(JSON.stringify({ action: 'start', type: '', scenicSpotId: scenicSpotId.value }))
}
},
{ immediate: true }
@@ -34,7 +34,6 @@
() => dataRes.value,
(val) => {
if (val) {
console.log(val, '景区接受消息')
switch (val.type) {
case 'wordkOrderlist':
scenicStore.setWordkOrderList(val.data)
@@ -73,8 +72,7 @@
let scenicChange = null
onMounted(() => {
scenicChange = PubSub.subscribe('scenicChange', (msg, data) => {
id.value = data.scenicSpotId
console.log(id.value, 'id.value')
scenicSpotId.value = data.scenicSpotId
})
})
onUnmounted(() => {