From 0e231a5e91d4a24e6d7b5b3a846c46371f29c583 Mon Sep 17 00:00:00 2001 From: tk Date: Tue, 20 Aug 2024 11:47:14 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=B1=BB=20=20=E5=9E=8B=E3=80=91?= =?UTF-8?q?=EF=BC=9Afix=20=E9=80=80=E5=87=BA=E7=BB=84=E4=BB=B6=E6=97=B6=20?= =?UTF-8?q?=E5=85=B3=E9=97=ADsettimeout=20=E7=9A=84=E5=AE=9E=E4=BE=8B=20?= =?UTF-8?q?=E3=80=90=E5=8E=9F=20=20=E5=9B=A0=E3=80=91=EF=BC=9A=20=E3=80=90?= =?UTF-8?q?=E8=BF=87=20=20=E7=A8=8B=E3=80=91=EF=BC=9A=20=E3=80=90=E5=BD=B1?= =?UTF-8?q?=20=20=E5=93=8D=E3=80=91=EF=BC=9A=E4=B8=8D=E9=94=80=E6=AF=81?= =?UTF-8?q?=E4=BC=9A=E5=8F=A0=E5=8A=A0=E5=A4=9A=E6=AC=A1=20settimeout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动 --- src/components/BatteryStatus.vue | 2 +- src/components/ControllerTabs.vue | 12 ++++++------ src/store/index.js | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/BatteryStatus.vue b/src/components/BatteryStatus.vue index 80a8beb..52455cc 100644 --- a/src/components/BatteryStatus.vue +++ b/src/components/BatteryStatus.vue @@ -181,7 +181,7 @@ export default { // 在组件挂载时检查显示条件 this.checkDisplayConditions() }, - beforeDestroy () { + destroyed () { // 在组件销毁前清除定时器 this.clearInterval() } diff --git a/src/components/ControllerTabs.vue b/src/components/ControllerTabs.vue index 40d8eab..3fbca3c 100644 --- a/src/components/ControllerTabs.vue +++ b/src/components/ControllerTabs.vue @@ -9,7 +9,7 @@ 关闭 确认起飞 + @click="publishFun(`{setPlaneState:{bit:6,state:1,count:1,param:[${takeoffValue}]}}`); speakText('确认起飞')">确认起飞 @@ -96,7 +96,7 @@ + @click="publishFun('{setPlaneState:{bit:5,state:1}}'); speakText('准备起飞,执行送餐任务')"> 执行任务 @@ -142,7 +142,7 @@
起飞
+ @click="publishFun('{setPlaneState:{bit:7,state:1}}'); speakText('悬停')">
悬停
@@ -151,12 +151,12 @@
复航
+ @click="publishFun('{setPlaneState:{bit:9,state:1}}'); speakText('返航')">
返航
+ @click="publishFun('{setPlaneState:{bit:8,state:1}}'); speakText('降落')">
降落
@@ -239,7 +239,7 @@
+ @click="publishFun('{setPlaneState:{bit:11,state:1}}'); speakText('校准磁罗盘')">
磁罗盘
diff --git a/src/store/index.js b/src/store/index.js index 544ce35..7434468 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -270,7 +270,7 @@ const store = new Vuex.Store({ res.data.airList.forEach(plane => { plane.planeState = { // 飞机状态初始化字段 heartBeat: null, // 心跳 - heartRandom: null, // 每次接收到心跳创建一个随机数 用于watch监听 + heartRandom: 0, // 每次接收到心跳创建一个随机数 用于watch监听 voltagBattery: null, // 电压信息 currentBattery: null, // 电流信息 batteryRemaining: null, // 电池电量