设备控制

master
lld 2025-12-25 17:34:54 +08:00
parent 528caef3a5
commit a18f888531
1 changed files with 15 additions and 11 deletions

View File

@ -455,6 +455,7 @@ export default {
cancelText: '取消',
confirmText: '确定',
success: (res) =>{
if (res.confirm) {
console.info("操作功能:【"+type+"】,变更状态为:"+ status)
if (!this.connected) {
// mqtt
@ -468,6 +469,7 @@ export default {
//
this.ackMessage(type);
}
}
})
console.info(this.status)
},
@ -515,6 +517,7 @@ export default {
},
publishMessage() {
console.info("开始发布消息")
if (!this.connected || !this.publishTopic || !this.message) {
uni.showToast({
title: '控制设备失败',
@ -536,6 +539,7 @@ export default {
},
ackMessage(type) {
console.info("处理回执消息")
this.client.on("message", (topic, payload) => {
// 1. dtu/xxx/up
if (topic !== this.status.subscribeTopic) return;