更新界面布局
This commit is contained in:
@@ -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';
|
||||
@@ -563,6 +565,10 @@ class _WifiPagePersonState extends State<WifiPagePerson> {
|
||||
? 1
|
||||
: 0;
|
||||
if (wifiStatus) {
|
||||
updateDeviceBindStatus(
|
||||
blueteethBindController
|
||||
.currentDeviceMac!
|
||||
.value);
|
||||
// Navigator.pop(context);
|
||||
TopSlideNotification
|
||||
.show(
|
||||
@@ -702,6 +708,9 @@ class _WifiPagePersonState extends State<WifiPagePerson> {
|
||||
.currentDevice!,
|
||||
1);
|
||||
if (aa == "4g") {
|
||||
updateDeviceBindStatus(
|
||||
blueteethBindController
|
||||
.currentDeviceMac!.value);
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: "4g设备配置wifi提示".tr,
|
||||
@@ -793,6 +802,7 @@ class _WifiPagePersonState extends State<WifiPagePerson> {
|
||||
var aa =
|
||||
await getDeviceWifiStatus(blueteethBindController.currentDevice!, 0);
|
||||
if (aa != null && aa is Map) {
|
||||
updateDeviceBindStatus(blueteethBindController.currentDeviceMac!.value);
|
||||
wifiStatus = true;
|
||||
blueteethBindController.connect_wifi.value = aa;
|
||||
} else {
|
||||
@@ -994,6 +1004,8 @@ class _WifiPagePersonState extends State<WifiPagePerson> {
|
||||
// );
|
||||
blueteethBindController.netType.value = 2;
|
||||
blueteethBindController.updateAll();
|
||||
updateDeviceBindStatus(
|
||||
blueteethBindController.currentDeviceMac!.value);
|
||||
// WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
// TopSlideNotification.show(
|
||||
// context,
|
||||
@@ -1094,4 +1106,39 @@ class _WifiPagePersonState extends State<WifiPagePerson> {
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
//更新设备绑定状态
|
||||
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) {},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user