更新特殊处理测试账号
This commit is contained in:
@@ -718,11 +718,11 @@ Future<void> initLogin() async {
|
|||||||
if (userMap != null) {
|
if (userMap != null) {
|
||||||
UserModel user = UserModel.fromJson(userMap);
|
UserModel user = UserModel.fromJson(userMap);
|
||||||
userInfoController.model.user = user;
|
userInfoController.model.user = user;
|
||||||
if (user.test != null && (user.test)!) {
|
// if (user.test != null && (user.test)!) {
|
||||||
AppConstants.is_test_account = true;
|
// AppConstants.is_test_account = true;
|
||||||
} else {
|
// } else {
|
||||||
AppConstants.is_test_account = false;
|
// AppConstants.is_test_account = false;
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print(e);
|
print(e);
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import 'package:ef/ef.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_svg/svg.dart';
|
import 'package:flutter_svg/svg.dart';
|
||||||
import 'package:flutterflow_ui/flutterflow_ui.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/color/appConstants.dart';
|
||||||
import 'package:vbvs_app/common/color/app_uri_status.dart';
|
import 'package:vbvs_app/common/color/app_uri_status.dart';
|
||||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||||
@@ -275,7 +274,7 @@ class _DeviceDataComponentWidgetState extends State<DeviceDataComponentWidget> {
|
|||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
if (widget.device['bind_type'] == BindType.active.code) {
|
if (widget.device['bind_type'] == BindType.active.code && !AppConstants.is_test_account) {
|
||||||
items.addAll([
|
items.addAll([
|
||||||
_buildMenuItem(
|
_buildMenuItem(
|
||||||
text: "WIFI配置".tr,
|
text: "WIFI配置".tr,
|
||||||
@@ -1266,91 +1265,92 @@ class _DeviceDataComponentWidgetState extends State<DeviceDataComponentWidget> {
|
|||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
// Expanded(
|
||||||
child: CustomCard(
|
// child: CustomCard(
|
||||||
borderRadius: AppConstants().button_container_radius,
|
// borderRadius: AppConstants().button_container_radius,
|
||||||
onTap: () async {
|
// onTap: () async {
|
||||||
if (widget.device['person'] != null) {
|
// if (widget.device['person'] != null) {
|
||||||
personController.currentPersonId.value =
|
// personController.currentPersonId.value =
|
||||||
widget.device['_id'];
|
// widget.device['_id'];
|
||||||
personController.name.value =
|
// personController.name.value =
|
||||||
widget.device['person']['name'];
|
// widget.device['person']['name'];
|
||||||
personController.update_person_mac.value =
|
// personController.update_person_mac.value =
|
||||||
widget.device['mac'];
|
// widget.device['mac'];
|
||||||
personController.gender.value =
|
// personController.gender.value =
|
||||||
widget.device['person']['gender'] ?? 1;
|
// widget.device['person']['gender'] ?? 1;
|
||||||
personController.weight?.value =
|
// personController.weight?.value =
|
||||||
widget.device['person']['weight'] == null
|
// widget.device['person']['weight'] == null
|
||||||
? ''
|
// ? ''
|
||||||
: widget.device['person']['weight']
|
// : widget.device['person']['weight']
|
||||||
.toString();
|
// .toString();
|
||||||
|
|
||||||
personController.height.value =
|
// personController.height.value =
|
||||||
widget.device['person']['height'] == null
|
// widget.device['person']['height'] == null
|
||||||
? ''
|
// ? ''
|
||||||
: widget.device['person']['height']
|
// : widget.device['person']['height']
|
||||||
.toString();
|
// .toString();
|
||||||
|
|
||||||
personController.selectedDiseaseIds.value =
|
// personController.selectedDiseaseIds.value =
|
||||||
widget.device['person']['disease'] ?? [];
|
// widget.device['person']['disease'] ?? [];
|
||||||
personController.birthday.value =
|
// personController.birthday.value =
|
||||||
widget.device['person']['birthday'] ?? '';
|
// widget.device['person']['birthday'] ?? '';
|
||||||
personController.dateTime =
|
// personController.dateTime =
|
||||||
MyUtils.formatBirthdayTime(
|
// MyUtils.formatBirthdayTime(
|
||||||
widget.device['person']['birthday']);
|
// widget.device['person']['birthday']);
|
||||||
} else {
|
// } else {
|
||||||
personController.update_person_mac.value =
|
// personController.update_person_mac.value =
|
||||||
widget.device['mac'];
|
// widget.device['mac'];
|
||||||
personController.currentPersonId.value =
|
// personController.currentPersonId.value =
|
||||||
widget.device['_id'];
|
// widget.device['_id'];
|
||||||
personController.name.value = "";
|
// personController.name.value = "";
|
||||||
personController.gender.value = 1;
|
// personController.gender.value = 1;
|
||||||
personController.dateTime = null;
|
// personController.dateTime = null;
|
||||||
personController.height.value = "";
|
// personController.height.value = "";
|
||||||
personController.weight.value = "";
|
// personController.weight.value = "";
|
||||||
personController.diseaseList.value = [];
|
// personController.diseaseList.value = [];
|
||||||
}
|
// }
|
||||||
await Get.toNamed("/updatePersonPage",
|
// await Get.toNamed("/updatePersonPage",
|
||||||
arguments: widget.device['bind_type']);
|
// arguments: widget.device['bind_type']);
|
||||||
bodyDeviceController.getDeviceList();
|
// bodyDeviceController.getDeviceList();
|
||||||
},
|
// },
|
||||||
colors: [
|
// colors: [
|
||||||
themeController.currentColor.sc1,
|
// themeController.currentColor.sc1,
|
||||||
themeController.currentColor.sc2,
|
// themeController.currentColor.sc2,
|
||||||
],
|
// ],
|
||||||
child: Padding(
|
// child: Padding(
|
||||||
padding: EdgeInsetsDirectional.fromSTEB(
|
// padding: EdgeInsetsDirectional.fromSTEB(
|
||||||
0.rpx, 0.rpx, 0.rpx, 0.rpx),
|
// 0.rpx, 0.rpx, 0.rpx, 0.rpx),
|
||||||
child: Container(
|
// child: Container(
|
||||||
alignment: Alignment.center,
|
// alignment: Alignment.center,
|
||||||
height: MediaQuery.sizeOf(context).height * 0.0037,
|
// height: MediaQuery.sizeOf(context).height * 0.0037,
|
||||||
constraints: BoxConstraints(
|
// constraints: BoxConstraints(
|
||||||
minWidth: 143.rpx,
|
// minWidth: 143.rpx,
|
||||||
minHeight: 61.rpx,
|
// minHeight: 61.rpx,
|
||||||
),
|
// ),
|
||||||
child: Row(
|
// child: Row(
|
||||||
mainAxisSize: MainAxisSize.max,
|
// mainAxisSize: MainAxisSize.max,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
// mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
// children: [
|
||||||
Text(
|
// Text(
|
||||||
"体征检测设备.人员资料".tr,
|
// "体征检测设备.人员资料".tr,
|
||||||
style: TextStyle(
|
// style: TextStyle(
|
||||||
color: themeController.currentColor.sc3,
|
// color: themeController.currentColor.sc3,
|
||||||
fontFamily: 'Inter',
|
// fontFamily: 'Inter',
|
||||||
fontSize:
|
// fontSize:
|
||||||
AppConstants().normal_text_fontSize,
|
// AppConstants().normal_text_fontSize,
|
||||||
letterSpacing: 0.0,
|
// letterSpacing: 0.0,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
].divide(SizedBox(width: 17.rpx)),
|
// ].divide(SizedBox(width: 17.rpx)),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
SizedBox(
|
|
||||||
width: 20.rpx,
|
// SizedBox(
|
||||||
),
|
// width: 20.rpx,
|
||||||
|
// ),
|
||||||
Expanded(
|
Expanded(
|
||||||
// 使用 Expanded 来占据屏幕宽度的一半
|
// 使用 Expanded 来占据屏幕宽度的一半
|
||||||
child: CustomCard(
|
child: CustomCard(
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import 'package:ef/ef.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
||||||
import 'package:vbvs_app/common/color/ServiceConstant.dart';
|
import 'package:vbvs_app/common/color/ServiceConstant.dart';
|
||||||
|
import 'package:vbvs_app/common/color/appConstants.dart';
|
||||||
import 'package:vbvs_app/common/color/app_uri_status.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/DailyLogUtils.dart';
|
||||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||||
@@ -11,6 +12,8 @@ import 'package:vbvs_app/common/util/requestWithLog.dart';
|
|||||||
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||||
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||||
import 'package:vbvs_app/controller/device/blueteeth_bind_controller.dart';
|
import 'package:vbvs_app/controller/device/blueteeth_bind_controller.dart';
|
||||||
|
import 'package:vbvs_app/controller/device/body_device_controller.dart';
|
||||||
|
import 'package:vbvs_app/controller/home/home_controller.dart';
|
||||||
import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
|
import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
|
||||||
import 'package:vbvs_app/model/BleDeviceData.dart';
|
import 'package:vbvs_app/model/BleDeviceData.dart';
|
||||||
import 'package:vbvs_app/model/api_response.dart';
|
import 'package:vbvs_app/model/api_response.dart';
|
||||||
@@ -95,9 +98,43 @@ class _SingleBlueteethDeviceCompoentWidgetState
|
|||||||
if (response.code == HttpStatusCodes.ok) {
|
if (response.code == HttpStatusCodes.ok) {
|
||||||
//更新设备绑定流程
|
//更新设备绑定流程
|
||||||
updateDeviceBindStatus(device);
|
updateDeviceBindStatus(device);
|
||||||
|
if (AppConstants.is_test_account) {
|
||||||
|
BlueteethBindController blueteethBindController =
|
||||||
|
Get.find();
|
||||||
|
if (blueteethBindController.returnPage == 0) {
|
||||||
|
HomeController homeController = Get.find();
|
||||||
|
BodyDeviceController deviceController = Get.find();
|
||||||
|
if (true) {
|
||||||
|
homeController.getSleepReport();
|
||||||
|
deviceController
|
||||||
|
.getDeviceNum()
|
||||||
|
.then((apiResponse) {
|
||||||
|
if (apiResponse.code != HttpStatusCodes.ok) {}
|
||||||
|
});
|
||||||
|
deviceController
|
||||||
|
.getDeviceList()
|
||||||
|
.then((apiResponse) {
|
||||||
|
if (apiResponse.code != HttpStatusCodes.ok) {
|
||||||
|
} else {
|
||||||
|
//请求睡眠报告
|
||||||
|
deviceController.getSleepReport();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
Get.until((route) =>
|
||||||
|
Get.currentRoute == "/mianPageBottomChange");
|
||||||
|
} else {
|
||||||
|
// Get.offNamed("/bodyDevice");
|
||||||
|
// Get.offNamedUntil(page, predicate);
|
||||||
|
Get.until(
|
||||||
|
(route) => Get.currentRoute == "/bodyDevice");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
Get.toNamed("/wifiPage");
|
Get.toNamed("/wifiPage");
|
||||||
THapp bledevice = THapp(device: widget.bleDevice.device);
|
THapp bledevice = THapp(device: widget.bleDevice.device);
|
||||||
blueteethBindController.currentDevice = bledevice;
|
blueteethBindController.currentDevice = bledevice;
|
||||||
|
}
|
||||||
|
|
||||||
// blueteethBindController.currentDeviceMac.value = "";
|
// blueteethBindController.currentDeviceMac.value = "";
|
||||||
} else {
|
} else {
|
||||||
blueteethBindController.currentDeviceMac.value = "";
|
blueteethBindController.currentDeviceMac.value = "";
|
||||||
|
|||||||
Reference in New Issue
Block a user