更新眠花糖兼容wifi配置

This commit is contained in:
wyf
2025-10-28 14:51:28 +08:00
parent 7cfd3bf8f5
commit 3c5db3bdf2
14 changed files with 1259 additions and 882 deletions

View File

@@ -12,14 +12,16 @@ import 'package:vbvs_app/common/util/requestWithLog.dart';
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
import 'package:vbvs_app/component/tool/CustomCard.dart';
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
import 'package:vbvs_app/controller/device/blueteeth_bind_controller.dart';
import 'package:vbvs_app/pages/device_bind/componnet/CalibrationProgressWidget.dart';
import 'package:vbvs_app/pages/mh_page/component/mht_bind_dialog.dart';
import 'package:vbvs_app/pages/mh_page/device/component/mht_device_calibration_controller.dart';
import 'package:vbvs_app/pages/mh_page/device/controller/mht_bluetooth_controller.dart';
import 'package:vbvs_app/pages/mh_page/device/model/BlueToothDataModel.dart';
class MHTCalibrationPage extends StatefulWidget {
const MHTCalibrationPage({super.key});
BlueToothDataModel deviceInfo;
MHTCalibrationPage({super.key, required this.deviceInfo});
@override
State<MHTCalibrationPage> createState() => _MHTCalibrationPageState();
}
@@ -114,6 +116,10 @@ class _MHTCalibrationPageState extends State<MHTCalibrationPage> {
onConfirm: () async {
exit = true;
_resetCalibrationState();
// Get.back();
initWifiData();
// Get.toNamed('/mHTwifiPage',
// arguments: widget.deviceInfo);
Get.back();
}, onCancel: () {
exit = false;
@@ -125,6 +131,9 @@ class _MHTCalibrationPageState extends State<MHTCalibrationPage> {
exit = true;
}
if (exit) {
initWifiData();
// Get.toNamed('/mHTwifiPage',
// arguments: widget.deviceInfo);
Get.back();
}
}, enableBack: exit),
@@ -741,7 +750,7 @@ class _MHTCalibrationPageState extends State<MHTCalibrationPage> {
}
void _requestProgress(
String serviceAddress, String progressApi, bool isSecondStep) {
String serviceAddress, String progressApi, bool isSecondStep) {
String cid = blueteethBindController.cid!.value;
String progressUrl = "$serviceAddress$progressApi?id=$cid";
@@ -1006,4 +1015,19 @@ class _MHTCalibrationPageState extends State<MHTCalibrationPage> {
onFailure: (res) {},
);
}
void initWifiData() {
BlueteethBindController blueteethBindController = Get.find();
blueteethBindController.shareDevice = widget.deviceInfo;
blueteethBindController.netType.value = 0;
blueteethBindController.connectStatus.value = 0;
blueteethBindController.wifiList = [].obs;
blueteethBindController.wifiStatus = 0.obs;
blueteethBindController.connect_wifi.value = {};
blueteethBindController.selectWifi.value = {};
blueteethBindController.wifiStatus.value = 0;
blueteethBindController.blueConnectFlag.value = 0;
blueteethBindController.wifiConnectStatus.value = 1;
blueteethBindController.updateAll();
}
}