设备 预约接口
This commit is contained in:
@@ -8,34 +8,13 @@ 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/controller/main_bottom/global_controller.dart';
|
||||
import 'package:vbvs_app/controller/mh_controller/people_info_controller.dart';
|
||||
|
||||
class DevicePeopleInfo extends GetView {
|
||||
class DevicePeopleInfo extends GetView<PeopleInfoController> {
|
||||
Map data;
|
||||
DevicePeopleInfo({required this.data});
|
||||
|
||||
// get glController => Get.find<GlobalController>();
|
||||
// get bodyData => glController.model.mainDevicePeople;
|
||||
RxList<dynamic> peopleList = <dynamic>[].obs;
|
||||
Future<void> devicePeopleInfo() async {
|
||||
String serviceAddress = ServiceConstant.service_address;
|
||||
String serviceName = ServiceConstant.server_service;
|
||||
String serviceApi = ServiceConstant.person_info;
|
||||
String queryUrl =
|
||||
"$serviceAddress$serviceName$serviceApi?mac=${data["mac"]}";
|
||||
|
||||
requestWithLog(
|
||||
logTitle: "获取设备的人员信息列表",
|
||||
method: MyHttpMethod.get,
|
||||
queryUrl: queryUrl,
|
||||
onSuccess: (res) {
|
||||
if (res.data != null && res.data is List) {
|
||||
peopleList.assignAll(res.data);
|
||||
print("peopleList: $peopleList");
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
PeopleInfoController controller = Get.put(PeopleInfoController());
|
||||
getInfoRow(context, String str) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
@@ -56,11 +35,6 @@ class DevicePeopleInfo extends GetView {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (data["device_type"] == 1 && peopleList.isEmpty) {
|
||||
devicePeopleInfo();
|
||||
}
|
||||
});
|
||||
return LayoutBuilder(
|
||||
builder: (context, boxConstraints) => GestureDetector(
|
||||
onTap: () => FocusScope.of(context).unfocus(),
|
||||
@@ -170,9 +144,10 @@ class DevicePeopleInfo extends GetView {
|
||||
],
|
||||
),
|
||||
)),
|
||||
if (data["device_type"] == 1 && peopleList.isNotEmpty)
|
||||
...List.generate(peopleList.length, (index) {
|
||||
final person = peopleList[index];
|
||||
if (controller.model.peopleList.isNotEmpty)
|
||||
...List.generate(controller.model.peopleList.length,
|
||||
(index) {
|
||||
final person = controller.model.peopleList[index];
|
||||
String location_ = '';
|
||||
if ("${data["bindMacB"]}".length > 6 &&
|
||||
(person["direction"] == 1 ||
|
||||
@@ -206,9 +181,8 @@ class DevicePeopleInfo extends GetView {
|
||||
),
|
||||
),
|
||||
if (location_.isNotEmpty)
|
||||
getInfoRow(context, "校准位置:$location_"),
|
||||
getInfoRow(
|
||||
context, "姓名:${person["name"] ?? "-"}"),
|
||||
getInfoRow(context,
|
||||
"姓名:${person["name"] ?? "-"}"),
|
||||
getInfoRow(context,
|
||||
"性别:${person["gender"] == null ? "-" : (person["gender"] == 1 ? "男" : "女")}"),
|
||||
getInfoRow(context,
|
||||
|
||||
Reference in New Issue
Block a user