进度条加载
This commit is contained in:
@ -912,7 +912,18 @@
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
handleMqttLost() {
|
||||
this.Progress = {
|
||||
...this.Progress,
|
||||
show: false, // 隐藏进度条
|
||||
};
|
||||
uni.showToast({
|
||||
title: '网络异常',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
onLoad(options) {
|
||||
const eventChannel = this.getOpenerEventChannel();
|
||||
@ -973,9 +984,10 @@
|
||||
this.selectedImage = ''; // 清空已选图片
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
})
|
||||
// 设置连接丢失回调
|
||||
uni.$on('mqttConnectionLost', this.handleMqttLost);
|
||||
if (this.apiType === 'listA') {
|
||||
this.fetchDeviceDetail(data.data.id)
|
||||
} else {
|
||||
@ -995,6 +1007,10 @@
|
||||
if (this.mqttClient) {
|
||||
this.mqttClient.disconnect();
|
||||
}
|
||||
uni.$off('mqttConnectionLost', this.handleMqttLost);
|
||||
if (this.mqttClient) {
|
||||
this.mqttClient.disconnect();
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user