.
This commit is contained in:
parent
56f17f651d
commit
12f2d45ee4
@ -3,5 +3,5 @@ VITE_BASE_API = 'http://39.105.121.219'
|
||||
#VITE_BASE_API = 'http://127.0.0.1'
|
||||
#VITE_BASE_API = 'http://api.jsyzhineng.com'
|
||||
|
||||
VITE_BASE_MQTT = 'mqtt://39.105.121.219:8083/mqtt'
|
||||
#VITE_BASE_MQTT = 'mqtt://8.130.77.146:8083/mqtt'
|
||||
VITE_BASE_MQTT = '39.105.121.219:8083/mqtt'
|
||||
#VITE_BASE_MQTT = '8.130.77.146:8083/mqtt'
|
@ -1,5 +1,5 @@
|
||||
ENV = 'production'
|
||||
VITE_BASE_API = 'http://api.jsyzhineng.com'
|
||||
|
||||
VITE_BASE_MQTT = 'ws://39.105.121.219:8083/mqtt'
|
||||
#VITE_BASE_MQTT = 'ws://8.130.77.146:8083/mqtt'
|
||||
#VITE_BASE_MQTT = '39.105.121.219:8083/mqtt'
|
||||
VITE_BASE_MQTT = '8.130.77.146:8083/mqtt'
|
32
App.vue
32
App.vue
@ -36,36 +36,35 @@
|
||||
methods: {
|
||||
//监听indexData的回调
|
||||
indexDataHandler(e, data) {
|
||||
// console.error("indexDataHandler_1:", {
|
||||
// e: e,
|
||||
// data: data
|
||||
// });
|
||||
if (e == this.indexData.eventType.land) {
|
||||
// console.error("地块更新通知:", this.indexData.selectItem)
|
||||
|
||||
this.dc.setLandItem(this.indexData.selectItem, null);
|
||||
}
|
||||
if (e == this.indexData.eventType.device) {
|
||||
// console.error("设备更新通知:", this.indexData.device)
|
||||
|
||||
this.dc.setStations(this.indexData.device.stations);
|
||||
this.dc.setFlapValves(this.indexData.device.flapValves);
|
||||
this.dc.setValves(this.indexData.selectItem.id, this.indexData.device.waterOutlets);
|
||||
}
|
||||
uni.hideLoading();
|
||||
console.error("indexDataHandler_2:", {
|
||||
indexData: this.indexData,
|
||||
dc: this.dc,
|
||||
})
|
||||
// console.error("indexDataHandler_2:", {
|
||||
// e: e,
|
||||
// data: data,
|
||||
// indexData: this.indexData,
|
||||
// dc: this.dc,
|
||||
// })
|
||||
},
|
||||
//Mqtt连接
|
||||
mqttLink(userId) {
|
||||
console.error("mqttLink");
|
||||
this.mqtt.link(userId);
|
||||
},
|
||||
//Mqtt断开连接
|
||||
mqttEnd() {
|
||||
this.mqtt.over();
|
||||
//Mqtt连接
|
||||
mqttSubscribes(topics) {
|
||||
this.mqtt.subscribes(topics);
|
||||
},
|
||||
//Mqtt连接
|
||||
mqttUnsubscribes(topics) {
|
||||
this.mqtt.unsubscribes(topics);
|
||||
},
|
||||
//Mqtt消息回调
|
||||
mqttMsgHandler(topic, data) {
|
||||
@ -74,6 +73,11 @@
|
||||
data: data,
|
||||
});
|
||||
},
|
||||
//Mqtt断开连接
|
||||
mqttEnd() {
|
||||
this.mqtt.over();
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -25,9 +25,6 @@ class MqttUtil {
|
||||
static client;
|
||||
static connected = false;
|
||||
static reconnectCount = 0;
|
||||
onCallback = (data) => {
|
||||
console.error("onCallback:", data)
|
||||
};
|
||||
|
||||
//接收创建来的数据
|
||||
constructor(eventHandler) {
|
||||
|
Loading…
Reference in New Issue
Block a user