进度条加载

This commit is contained in:
fengerli
2025-08-09 09:47:50 +08:00
parent 3ab58ac29e
commit c6babaa262
3 changed files with 51 additions and 19 deletions

View File

@ -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();
}
},
}