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, // 电池电量