更新界面布局
This commit is contained in:
@@ -3,9 +3,11 @@ import 'package:easydevice/easydevice.dart';
|
||||
import 'package:ef/ef.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
||||
import 'package:vbvs_app/common/color/ServiceConstant.dart';
|
||||
import 'package:vbvs_app/common/color/app_uri_status.dart';
|
||||
import 'package:vbvs_app/common/util/DailyLogUtils.dart';
|
||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/common/util/requestWithLog.dart';
|
||||
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||
import 'package:vbvs_app/controller/device/blueteeth_bind_controller.dart';
|
||||
@@ -89,12 +91,12 @@ class _SingleBlueteethDeviceCompoentWidgetState
|
||||
await blueteethBindController.bindDeviceAndMAC(device);
|
||||
TopSlideNotification.show(context, text: response.msg!);
|
||||
if (response.code == HttpStatusCodes.ok) {
|
||||
|
||||
//更新设备绑定流程
|
||||
updateDeviceBindStatus(device);
|
||||
Get.toNamed("/wifiPage");
|
||||
THapp bledevice = THapp(device: widget.bleDevice.device);
|
||||
blueteethBindController.currentDevice = bledevice;
|
||||
// blueteethBindController.currentDeviceMac.value = "";
|
||||
|
||||
} else {
|
||||
blueteethBindController.currentDeviceMac.value = "";
|
||||
blueteethBindController.updateAll();
|
||||
@@ -252,4 +254,30 @@ class _SingleBlueteethDeviceCompoentWidgetState
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
//更新设备绑定状态
|
||||
void updateDeviceBindStatus(BleDeviceData device) {
|
||||
String serviceAddress = ServiceConstant.service_address;
|
||||
String serviceName = ServiceConstant.server_service;
|
||||
String serviceApi = ServiceConstant.user_setting;
|
||||
String mac = device.mac!;
|
||||
String type = "device_bind_status_${mac}";
|
||||
String queryUrl = "${serviceAddress}${serviceName}${serviceApi}";
|
||||
Map<String, dynamic> data = {
|
||||
"type": type,
|
||||
"mac": mac,
|
||||
"wifi": false,
|
||||
"celibration": false,
|
||||
"person_info": false,
|
||||
"time": DateTime.now().millisecondsSinceEpoch,
|
||||
};
|
||||
requestWithLog(
|
||||
logTitle: "更新用户绑定流程",
|
||||
method: MyHttpMethod.put,
|
||||
queryUrl: queryUrl,
|
||||
data: data,
|
||||
onSuccess: (res) {},
|
||||
onFailure: (res) {},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user