feat:完善功能
This commit is contained in:
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user