更新界面布局

This commit is contained in:
wyf
2025-06-04 11:54:01 +08:00
parent 40732066fe
commit 857317caf1
34 changed files with 4961 additions and 459 deletions

View File

@@ -6,9 +6,11 @@ import 'package:flutter/material.dart';
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
import 'package:flutter_svg/svg.dart';
import 'package:flutterflow_ui/flutterflow_ui.dart';
import 'package:vbvs_app/common/color/ServiceConstant.dart';
import 'package:vbvs_app/common/color/appConstants.dart';
import 'package:vbvs_app/common/util/FitTool.dart';
import 'package:vbvs_app/common/util/MyUtils.dart';
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';
@@ -75,6 +77,8 @@ class _WifiPageState extends State<WifiPage> {
blueteethBindController.netType.value = 2;
blueteethBindController.connectStatus.value = 1;
blueteethBindController.updateAll();
updateDeviceBindStatus(
blueteethBindController.currentDeviceMac!.value);
Future.delayed(const Duration(seconds: 1), () {
Get.toNamed("/calibrationPage", arguments: 1);
});
@@ -224,11 +228,11 @@ class _WifiPageState extends State<WifiPage> {
themeController.currentColor.sc2,
],
child: Container(
width: 130.rpx,
width: 140.rpx,
height: 60.rpx,
alignment: Alignment.center,
padding: EdgeInsetsDirectional.fromSTEB(
0.rpx, 0, 0.rpx, 0),
16.rpx, 0, 16.rpx, 0),
child: Text(
'下一步'.tr,
style: FlutterFlowTheme.of(context)
@@ -618,6 +622,10 @@ class _WifiPageState extends State<WifiPage> {
? 1
: 0;
if (wifiStatus) {
updateDeviceBindStatus(
blueteethBindController
.currentDeviceMac!
.value);
// Navigator.pop(context);
TopSlideNotification
.show(
@@ -749,6 +757,9 @@ class _WifiPageState extends State<WifiPage> {
blueteethBindController
.connectStatus.value = 1;
blueteethBindController.updateAll();
updateDeviceBindStatus(
blueteethBindController
.currentDeviceMac!.value);
Future.delayed(
const Duration(seconds: 1), () {
Get.toNamed("/calibrationPage",
@@ -843,6 +854,7 @@ class _WifiPageState extends State<WifiPage> {
await getDeviceWifiStatus(blueteethBindController.currentDevice!, 1);
if (aa != null && aa is Map) {
wifiStatus = true;
updateDeviceBindStatus(blueteethBindController.currentDeviceMac!.value);
blueteethBindController.connect_wifi.value = aa;
} else {
wifiStatus = false;
@@ -1090,6 +1102,7 @@ class _WifiPageState extends State<WifiPage> {
// text: "4g设备配置wifi提示".tr,
// textColor: themeController.currentColor.sc9,
// );
updateDeviceBindStatus(blueteethBindController.currentDeviceMac!.value);
WidgetsBinding.instance.addPostFrameCallback((_) {
TopSlideNotification.show(
context,
@@ -1148,4 +1161,38 @@ class _WifiPageState extends State<WifiPage> {
await FlutterBluePlus.stopScan();
}
}
void updateDeviceBindStatus(String mac) {
String serviceAddress = ServiceConstant.service_address;
String serviceName = ServiceConstant.server_service;
String serviceApi = ServiceConstant.user_setting;
String type = "device_bind_status_$mac";
String queryUrl =
"${serviceAddress}${serviceName}${serviceApi}?type=${type}";
requestWithLog(
logTitle: "查询绑定流程",
method: MyHttpMethod.get,
queryUrl: queryUrl,
onSuccess: (res) {
print(res);
Map<String, dynamic> data = {
"type": type,
"mac": mac,
"wifi": true,
"celibration":res.data['celibration'],
"person_info":res.data['person_info'],
"time": DateTime.now().millisecondsSinceEpoch,
};
requestWithLog(
logTitle: "更新绑定流程",
method: MyHttpMethod.put,
queryUrl: queryUrl,
data: data,
onSuccess: (res) {},
onFailure: (res) {},
);
},
onFailure: (res) {},
);
}
}