更新远程控制
This commit is contained in:
parent
ea2fa75c4d
commit
4428b1af3a
|
@ -50,12 +50,12 @@ const user_channel = connection.subscribe('user-breed-datav');
|
|||
|
||||
// 当user-2频道有message事件的消息时
|
||||
user_channel.on('message', function (data) {
|
||||
console.log("收到消息--",data);
|
||||
if(route.query.type=='main'&&data.content.event=='changMap') return;
|
||||
if(data.content.event=='refresh') refresh();
|
||||
if(data.content.event=='back') back();
|
||||
else mitt.emit(data.content.event, data.content.data);
|
||||
|
||||
console.log("收到消息--",data);
|
||||
|
||||
});
|
||||
// 断线事件
|
||||
|
|
|
@ -160,6 +160,38 @@ const changeTime = (e) => {
|
|||
console.log(e);
|
||||
}
|
||||
|
||||
mitt.on("choserArea", (data) => {
|
||||
appStore.setAddress({
|
||||
areaCode: data.code,
|
||||
streetCode: "",
|
||||
});
|
||||
initList();
|
||||
router.push({
|
||||
path: '/',
|
||||
query: {
|
||||
areaCode: data.code,
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
mitt.on("choseTown", (data) => {
|
||||
let c = list.value.find(item=>item.name==data.name);
|
||||
if(!c)return;
|
||||
appStore.setAddress({
|
||||
areaCode: appStore.address.areaCode,
|
||||
streetCode: c.code,
|
||||
});
|
||||
initList();
|
||||
router.push({
|
||||
path: '/indexc',
|
||||
query: {
|
||||
areaCode: appStore.address.areaCode,
|
||||
streetCode: c.code,
|
||||
name: data.name
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
if (route.query.areaCode) {
|
||||
appStore.setAddress({
|
||||
|
@ -188,7 +220,6 @@ onMounted(() => {
|
|||
setInterval(updateClock, 1000);
|
||||
|
||||
initWeather();
|
||||
|
||||
|
||||
mitt.on('changMap', (e)=>{
|
||||
if(e.areaName==info.areaName){
|
||||
|
|
|
@ -13,15 +13,15 @@ const key = ref(Date.now());
|
|||
<template>
|
||||
<div class="center">
|
||||
<div class="item">
|
||||
<leftItme :key="route.query.name+key+'f'" style="height: 98%"></leftItme>
|
||||
<leftItme :key="route.query.areaCode+key+'f'" style="height: 98%"></leftItme>
|
||||
</div>
|
||||
<div class="item item_c">
|
||||
<div style="height: 61%; display: flex; justify-content: space-between">
|
||||
<centerItme :key="route.query.name+key+'c'" style="width: 64%"></centerItme>
|
||||
<rightItme :key="route.query.name+key+'r'" style="width: 35%"></rightItme>
|
||||
<centerItme :key="route.query.areaCode+key+'c'" style="width: 64%"></centerItme>
|
||||
<rightItme :key="route.query.areaCode+key+'r'" style="width: 35%"></rightItme>
|
||||
</div>
|
||||
<div style="height: 36%">
|
||||
<bottomItme :key="route.query.name+key+'b'" style="width: 100%"></bottomItme>
|
||||
<bottomItme :key="route.query.areaCode+key+'b'" style="width: 100%"></bottomItme>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue