Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -205,7 +205,7 @@ class _MHTBlueteethDevicePageState extends State<MHTBlueteethDevicePage> {
|
||||
}
|
||||
|
||||
void _startPeriodicScan() {
|
||||
_timer = Timer.periodic(Duration(seconds: 10), (timer) {
|
||||
_timer = Timer.periodic(Duration(seconds: 3), (timer) {
|
||||
if (mhtBlueToothController.shouldScan.value && !isScanning) {
|
||||
_removeOldDevices(); // 先清理老旧设备
|
||||
_startScanning();
|
||||
|
||||
@@ -734,7 +734,7 @@ class _MHTCalibrationPageState extends State<MHTCalibrationPage> {
|
||||
|
||||
void _startPollingProgress(
|
||||
String serviceAddress, String progressApi, bool isSecondStep) {
|
||||
_requestProgress(serviceAddress, progressApi, isSecondStep);
|
||||
// _requestProgress(serviceAddress, progressApi, isSecondStep);
|
||||
_pollingTimer = Timer.periodic(Duration(seconds: 1), (_) {
|
||||
_requestProgress(serviceAddress, progressApi, isSecondStep);
|
||||
});
|
||||
@@ -866,6 +866,14 @@ class _MHTCalibrationPageState extends State<MHTCalibrationPage> {
|
||||
|
||||
void _handleCalibrationFailure(String message) {
|
||||
_pollingTimer?.cancel();
|
||||
if (deviceCalibrationController.cd.value != 10000) {
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: message,
|
||||
textColor: themeController.currentColor.sc9,
|
||||
);
|
||||
}
|
||||
|
||||
deviceCalibrationController.statusContext.value = "";
|
||||
deviceCalibrationController.bed_calibration.value == 0;
|
||||
blueteethBindController.cid?.value = "";
|
||||
@@ -875,11 +883,6 @@ class _MHTCalibrationPageState extends State<MHTCalibrationPage> {
|
||||
deviceCalibrationController.cd.value = 10000;
|
||||
deviceCalibrationController.updateAll();
|
||||
failureNotifier.value = true;
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: message,
|
||||
textColor: themeController.currentColor.sc9,
|
||||
);
|
||||
}
|
||||
|
||||
void _startCalibration(bool isSecondStep) {
|
||||
@@ -904,7 +907,7 @@ class _MHTCalibrationPageState extends State<MHTCalibrationPage> {
|
||||
data["side"] = currentCalibrationStep.value == 1 ? "A" : "B";
|
||||
}
|
||||
}
|
||||
|
||||
data['cancel'] = true;
|
||||
requestWithLog(
|
||||
logTitle: "设备校准",
|
||||
method: MyHttpMethod.post,
|
||||
|
||||
@@ -11,6 +11,7 @@ import 'package:vbvs_app/component/tool/CustomCard.dart';
|
||||
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||
import 'package:vbvs_app/pages/common/selectDialog.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/device/controller/mht_bluetooth_controller.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/homepage/controller/mht_home_controller.dart';
|
||||
|
||||
class MHTPeopleInfoPage extends StatefulWidget {
|
||||
const MHTPeopleInfoPage({Key? key}) : super(key: key);
|
||||
@@ -192,6 +193,8 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
||||
await _savePersonData(person, context);
|
||||
}
|
||||
TopSlideNotification.show(context, text: "保存成功");
|
||||
MHTHomeController mhtHomeController = Get.find();
|
||||
mhtHomeController.getPersonList();
|
||||
Get.offNamed("/bindDeviceSuccess");
|
||||
},
|
||||
colors: const [
|
||||
|
||||
@@ -107,12 +107,14 @@ class _MHTWifiPageState extends State<MHTWifiPage> {
|
||||
|
||||
// 导航到下一页
|
||||
if (blueteethBindController.wifiStatus.value != 1) {
|
||||
showConfirmDialog(context, Container(), "未配置网络提示".tr, onConfirm: () {
|
||||
showConfirmDialog(context, Container(), "未配置网络提示".tr, onConfirm: () async {
|
||||
_cleanupResources();
|
||||
await _disconnectDevice();
|
||||
Get.toNamed("/calibrationPage");
|
||||
}, onCancel: () {});
|
||||
} else {
|
||||
_cleanupResources();
|
||||
await _disconnectDevice();
|
||||
Get.toNamed("/calibrationPage");
|
||||
}
|
||||
}
|
||||
@@ -1101,7 +1103,7 @@ class _MHTWifiPageState extends State<MHTWifiPage> {
|
||||
);
|
||||
}
|
||||
|
||||
void _disconnectDevice() async {
|
||||
Future<void> _disconnectDevice() async {
|
||||
try {
|
||||
THapp bledevice = THapp(device: widget.deviceInfo.scanResult.device);
|
||||
await bledevice.disconnect();
|
||||
|
||||
Reference in New Issue
Block a user