diff --git a/assets/langs/en_US.json b/assets/langs/en_US.json index ae617b9..6fed392 100644 --- a/assets/langs/en_US.json +++ b/assets/langs/en_US.json @@ -3,9 +3,9 @@ "菜单": { "首页": "Home", "报告": "Report", - "小e": "Little e", + "小e": "EChat", "消息": "Messages", - "我的": "Me" + "我的": "Mine" }, "首页": { "登录": "Login", @@ -16,8 +16,8 @@ "扫一扫绑定": "Scan to add new device", "蓝牙绑定": "Search nearby devices via Bluetooth", "已关联体征监测设备": "Bound vital sign monitoring devices", - "我的e护": "My eCare", - "云关爱": "Cloud Care", + "我的e护": "Mine", + "云关爱": "Cloud", "报告详情": "Report details" }, "我的": { @@ -183,8 +183,8 @@ "标题": "Vital Sign Monitoring Device", "输入关键词": "Enter keywords", "搜索": "Search", - "我的e护": "My eCare", - "云关爱": "Cloud Care", + "我的e护": "Mine", + "云关爱": "Cloud", "设备ID": "Device ID", "更新时间": "Update time", "设备来源": "Device source", @@ -236,7 +236,7 @@ "更新时间": "Update time", "已分享": "Shared", "设备来源": "Device source", - "云关爱": "Cloud Care", + "云关爱": "Cloud", "是否确认解绑": "Confirm unbinding?", "请求失败": "Request failed!", "操作成功": "Operation successful!", @@ -511,5 +511,10 @@ "否": "No", "男": "Male", "女": "Female", - "可用WLAN": "Available WiFi","请输入人员名称":"Please enter the person's name" + "可用WLAN": "Available WiFi", + "发现": "Found!", + "检测到": "Detected", + "绑定流程未走完是否继续": "Binding process is incomplete, continue?", + "继续": "Continue", + "下次再说": "deal next time" } \ No newline at end of file diff --git a/assets/langs/zh_CN.json b/assets/langs/zh_CN.json index 7b220d7..64fe8e3 100644 --- a/assets/langs/zh_CN.json +++ b/assets/langs/zh_CN.json @@ -427,7 +427,7 @@ "下次再说": "下次再说", "发现": "发现!", "检测到": "检测到", - "绑定流程未走完是否继续": "绑定流程未走完是否继续", + "绑定流程未走完是否继续": "绑定流程未走完是否继续?", "暂无": "暂无", "设备连接超时,请重试": "设备连接超时,请点击刷新重试", "设备连接失败": "设备连接失败,请点击刷新重试", diff --git a/assets/langs/zh_TW.json b/assets/langs/zh_TW.json index 69666e8..2429067 100644 --- a/assets/langs/zh_TW.json +++ b/assets/langs/zh_TW.json @@ -508,6 +508,9 @@ "否": "否", "男": "男", "女": "女", - "请输入人员名称": "請輸入人員名稱", - "可用wifi": "可用Wi-Fi" + "发现": "發現!", + "检测到": "檢測到", + "绑定流程未走完是否继续": "綁定流程未走完是否繼續?", + "继续": "繼續", + "下次再说": "下次再說" } \ No newline at end of file diff --git a/lib/controller/repair/repair_controller.dart b/lib/controller/repair/repair_controller.dart index a3e640a..099bb57 100644 --- a/lib/controller/repair/repair_controller.dart +++ b/lib/controller/repair/repair_controller.dart @@ -47,6 +47,7 @@ class RepairController extends GetControllerEx { RxString phone = "".obs; List? deviceListId = []; + List? deviceListIdLabel = []; List? deviceListName = []; RxList repairHistory = [].obs; diff --git a/lib/pages/device/BodyDeviceWidget.dart b/lib/pages/device/BodyDeviceWidget.dart index 362c2c6..a352c22 100644 --- a/lib/pages/device/BodyDeviceWidget.dart +++ b/lib/pages/device/BodyDeviceWidget.dart @@ -364,7 +364,7 @@ class _BodyDevicePageState extends State { mainAxisSize: MainAxisSize.max, children: [ Container( - width: 160.rpx, + width: 180.rpx, alignment: Alignment.center, child: Text( '体征检测设备.我的e护'.tr, @@ -416,7 +416,7 @@ class _BodyDevicePageState extends State { mainAxisSize: MainAxisSize.max, children: [ Container( - width: 160.rpx, + width: 180.rpx, alignment: Alignment.center, child: Text( '体征检测设备.云关爱'.tr, @@ -437,6 +437,9 @@ class _BodyDevicePageState extends State { .currentColor .sc2, ), + overflow: + TextOverflow.ellipsis, + maxLines: 1, ), ), SizedBox(height: 10.rpx), @@ -447,8 +450,8 @@ class _BodyDevicePageState extends State { ], ), Obx(() { - // 横线宽度固定为160.rpx - double lineWidth = 160.rpx; + // 横线宽度固定为180.rpx + double lineWidth = 180.rpx; return AnimatedPositioned( duration: Duration(milliseconds: 300), curve: Curves.easeInOut, @@ -456,7 +459,7 @@ class _BodyDevicePageState extends State { left: bodyDeviceController.model.type == 1 ? 0 - : 160.rpx, + : 180.rpx, child: Container( width: lineWidth, height: 4.rpx, diff --git a/lib/pages/device_bind/after/after_device_calibration_person.dart b/lib/pages/device_bind/after/after_device_calibration_person.dart index 9422738..c5cd376 100644 --- a/lib/pages/device_bind/after/after_device_calibration_person.dart +++ b/lib/pages/device_bind/after/after_device_calibration_person.dart @@ -35,6 +35,7 @@ class _AfterCalibrationPersonPageState Timer? _pollingTimer; bool exit = false; + bool start = false; @override void initState() { super.initState(); @@ -123,11 +124,68 @@ class _AfterCalibrationPersonPageState borderRadius: 20.rpx, onTap: () async { if (deviceCalibrationController.flag.value != 2) { - showConfirmDialog( - context, Container(), "校准未完成提示".tr, - onConfirm: () async { - // Get.back(); - // print("object"); + if (start) { + showConfirmDialog( + context, Container(), "校准未完成提示".tr, + onConfirm: () async { + // Get.back(); + // print("object"); + deviceCalibrationController.process.value = + 0; + deviceCalibrationController + .bed_calibration.value = 0; + deviceCalibrationController + .position_calibration.value = 0; + blueteethBindController.cid!.value = ""; + PersonController personController = + Get.find(); + var data = personController.after_deveice; + if (data['person'] != null) { + personController.currentPersonId.value = + data['_id']; + personController.name.value = + data['person']['name']; + personController.update_person_mac.value = + data['mac']; + personController.gender.value = + data['person']['gender'] ?? 1; + personController.weight?.value = + data['person']['weight'] == null + ? '' + : data['person']['weight'] + .toString(); + + personController.height.value = + data['person']['height'] == null + ? '' + : data['person']['height'] + .toString(); + + personController + .selectedDiseaseIds.value = + data['person']['disease'] ?? []; + personController.birthday.value = + data['person']['birthday'] ?? ''; + personController.dateTime = + MyUtils.formatBirthdayTime( + data['person']['birthday']); + } else { + personController.update_person_mac.value = + data['mac']; + personController.currentPersonId.value = + data['_id']; + personController.name.value = ""; + personController.gender.value = 1; + personController.dateTime = null; + personController.height.value = ""; + personController.weight.value = ""; + personController.diseaseList.value = []; + } + + await Get.toNamed("/afterUpdatePersonPage"); + return; + }, onCancel: () {}); + } else { deviceCalibrationController.process.value = 0; deviceCalibrationController .bed_calibration.value = 0; @@ -180,7 +238,7 @@ class _AfterCalibrationPersonPageState await Get.toNamed("/afterUpdatePersonPage"); return; - }, onCancel: () {}); + } } else { // Get.back(); deviceCalibrationController.process.value = 0; @@ -686,6 +744,7 @@ class _AfterCalibrationPersonPageState borderRadius: AppConstants() .button_container_radius, // 圆角半径 onTap: () async { + start = true; if (deviceCalibrationController.flag.value == 2) { deviceCalibrationController diff --git a/lib/pages/device_bind/componnet/bind_dialog.dart b/lib/pages/device_bind/componnet/bind_dialog.dart index be0f15c..0ffcdaa 100644 --- a/lib/pages/device_bind/componnet/bind_dialog.dart +++ b/lib/pages/device_bind/componnet/bind_dialog.dart @@ -186,7 +186,7 @@ Future showHaveBindDialog(BuildContext context) async { padding: EdgeInsetsDirectional.fromSTEB( 0.rpx, 93.rpx, 0.rpx, 0.rpx), child: Text( - '无法绑定'.tr, + '蓝牙绑定.无法绑定'.tr, style: TextStyle( fontFamily: 'Inter', fontSize: 30.rpx, @@ -202,21 +202,21 @@ Future showHaveBindDialog(BuildContext context) async { child: RichText( text: TextSpan(children: [ TextSpan( - text: "无法绑定1".tr, + text: "蓝牙绑定.无法绑定1".tr, style: TextStyle( color: themeController.currentColor.sc3, fontSize: AppConstants().normal_text_fontSize, ), ), TextSpan( - text: "无法绑定2".tr, + text: "蓝牙绑定.无法绑定2".tr, style: TextStyle( color: themeController.currentColor.sc8, fontSize: AppConstants().normal_text_fontSize, ), ), TextSpan( - text: "无法绑定3".tr, + text: "蓝牙绑定.无法绑定3".tr, style: TextStyle( color: themeController.currentColor.sc3, fontSize: AppConstants().normal_text_fontSize, diff --git a/lib/pages/device_bind/device_calibration.dart b/lib/pages/device_bind/device_calibration.dart index dc62db4..7f2e8d7 100644 --- a/lib/pages/device_bind/device_calibration.dart +++ b/lib/pages/device_bind/device_calibration.dart @@ -33,6 +33,7 @@ class _CalibrationPageState extends State { Timer? _pollingTimer; bool exit = false; + bool start = false; @override void initState() { super.initState(); @@ -95,9 +96,23 @@ class _CalibrationPageState extends State { child: returnIconButtomAddCallback(() { if (deviceCalibrationController.flag.value != 2) { try { - showConfirmDialog( - context, Container(), "校准未完成提示".tr, - onConfirm: () async { + if (start) { + showConfirmDialog( + context, Container(), "校准未完成提示".tr, + onConfirm: () async { + exit = true; + deviceCalibrationController.process.value = + 0; + deviceCalibrationController + .bed_calibration.value = 0; + deviceCalibrationController + .position_calibration.value = 0; + blueteethBindController.cid!.value = ""; + Get.back(); + }, onCancel: () { + exit = false; + }); + } else { exit = true; deviceCalibrationController.process.value = 0; deviceCalibrationController @@ -106,9 +121,7 @@ class _CalibrationPageState extends State { .position_calibration.value = 0; blueteethBindController.cid!.value = ""; Get.back(); - }, onCancel: () { - exit = false; - }); + } } catch (e) { print(e); } @@ -128,9 +141,21 @@ class _CalibrationPageState extends State { onTap: () async { if (deviceCalibrationController.flag.value != 2) { - showConfirmDialog( - context, Container(), "校准未完成提示".tr, - onConfirm: () async { + if (start) { + showConfirmDialog( + context, Container(), "校准未完成提示".tr, + onConfirm: () async { + await Get.toNamed("/personPage"); + print("object"); + deviceCalibrationController + .process.value = 0; + deviceCalibrationController + .bed_calibration.value = 0; + deviceCalibrationController + .position_calibration.value = 0; + blueteethBindController.cid!.value = ""; + }, onCancel: () {}); + } else { await Get.toNamed("/personPage"); print("object"); deviceCalibrationController.process.value = @@ -140,7 +165,7 @@ class _CalibrationPageState extends State { deviceCalibrationController .position_calibration.value = 0; blueteethBindController.cid!.value = ""; - }, onCancel: () {}); + } } else { await Get.toNamed("/personPage"); deviceCalibrationController.process.value = 0; @@ -595,6 +620,7 @@ class _CalibrationPageState extends State { borderRadius: AppConstants() .button_container_radius, // 圆角半径 onTap: () async { + start = true; if (deviceCalibrationController.flag.value == 2) { deviceCalibrationController diff --git a/lib/pages/device_bind/device_calibration_person.dart b/lib/pages/device_bind/device_calibration_person.dart index 042db57..3bf8c86 100644 --- a/lib/pages/device_bind/device_calibration_person.dart +++ b/lib/pages/device_bind/device_calibration_person.dart @@ -33,6 +33,7 @@ class _CalibrationPersonPageState extends State { Timer? _pollingTimer; bool exit = false; + bool start = false; @override void initState() { super.initState(); @@ -92,12 +93,31 @@ class _CalibrationPersonPageState extends State { ), Positioned( left: 0, - child: returnIconButtomAddCallback(() { + child: returnIconButtomAddCallback(() async { if (deviceCalibrationController.flag.value != 2) { try { - showConfirmDialog( - context, Container(), "校准未完成提示".tr, - onConfirm: () async { + if (start) { + showConfirmDialog( + context, Container(), "校准未完成提示".tr, + onConfirm: () async { + exit = true; + if (widget.type == 2) { + Get.back(); + return; + } + await Get.toNamed("/personPage"); + print("object"); + deviceCalibrationController.process.value = + 0; + deviceCalibrationController + .bed_calibration.value = 0; + deviceCalibrationController + .position_calibration.value = 0; + blueteethBindController.cid!.value = ""; + }, onCancel: () { + exit = false; + }); + } else { exit = true; if (widget.type == 2) { Get.back(); @@ -111,9 +131,7 @@ class _CalibrationPersonPageState extends State { deviceCalibrationController .position_calibration.value = 0; blueteethBindController.cid!.value = ""; - }, onCancel: () { - exit = false; - }); + } } catch (e) { print(e); } @@ -597,6 +615,7 @@ class _CalibrationPersonPageState extends State { borderRadius: AppConstants() .button_container_radius, // 圆角半径 onTap: () async { + start = true; if (deviceCalibrationController.flag.value == 2) { deviceCalibrationController diff --git a/lib/pages/main_bottom/home_page.dart b/lib/pages/main_bottom/home_page.dart index b0cceb5..96a144e 100644 --- a/lib/pages/main_bottom/home_page.dart +++ b/lib/pages/main_bottom/home_page.dart @@ -91,7 +91,7 @@ class _HomePageState extends State { ), child: Column( mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, children: [ SizedBox(height: 11.rpx), ClickableContainer( @@ -1123,7 +1123,7 @@ class _HomePageState extends State { ), ), TextSpan( - text: "绑定流程未走完是否继续?".tr, + text: "绑定流程未走完是否继续".tr, style: TextStyle( fontSize: AppConstants().normal_text_fontSize, color: themeController.currentColor.sc3, diff --git a/lib/pages/repair/apply_repair_page.dart b/lib/pages/repair/apply_repair_page.dart index 40296b7..ba9c79b 100644 --- a/lib/pages/repair/apply_repair_page.dart +++ b/lib/pages/repair/apply_repair_page.dart @@ -84,7 +84,10 @@ class _ApplyRepairPageState extends State { } if (bodyDeviceController.deviceList.isNotEmpty) { repairController.deviceListId = bodyDeviceController.deviceList - .map((e) => e['_id'] as String) + .map((e) => (e['_id']) as String) + .toList(); + repairController.deviceListIdLabel = bodyDeviceController.deviceList + .map((e) => (e['code']??e['mac']) as String) .toList(); } return LayoutBuilder( @@ -157,14 +160,20 @@ class _ApplyRepairPageState extends State { EdgeInsetsDirectional.fromSTEB(30.rpx, 29.rpx, 30.rpx, 0), child: SingleChildScrollView( child: Column( + crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.max, children: [ Obx(() { + var devicetype = deviceTypeController + .deviceTypeList.value + .where((device) => device['type'] == 1) + .toList(); return SingleChildScrollView( scrollDirection: Axis.horizontal, // 横向滚动 child: Row( + mainAxisAlignment: MainAxisAlignment.start, mainAxisSize: MainAxisSize.min, // 设置为 min,避免撑满父组件宽度 - children: deviceTypeController.deviceTypeList.value + children: devicetype .map( (deviceType) => CustomCard( borderRadius: diff --git a/lib/pages/repair/component/RepairModelWidget.dart b/lib/pages/repair/component/RepairModelWidget.dart index 2be024c..75c5e91 100644 --- a/lib/pages/repair/component/RepairModelWidget.dart +++ b/lib/pages/repair/component/RepairModelWidget.dart @@ -117,7 +117,7 @@ class _RepairModelWidgetState extends State { ); if (matchedDevice != null) { // 找到了匹配的项 - widget.model['param'] = matchedDevice['mac']; + // widget.model['param'] = matchedDevice['mac']; widget.model['mac'] = matchedDevice['mac']; widget.model['code'] = matchedDevice['code'] ?? ''; @@ -161,7 +161,7 @@ class _RepairModelWidgetState extends State { isMultiSelect: false, // controller: _deviceController, options: repairController.deviceListId!, - optionLabels: repairController.deviceListId!, + optionLabels: repairController.deviceListIdLabel!, ), ), ), diff --git a/lib/pages/setting/language_setting.dart b/lib/pages/setting/language_setting.dart index ad136b4..b10c8be 100644 --- a/lib/pages/setting/language_setting.dart +++ b/lib/pages/setting/language_setting.dart @@ -129,8 +129,6 @@ class _LanguageSettingState extends State { languageController .updateAll(); // 更新操作 try { - // ef.kv.set("language", - // language.language_code); await ef.kvdb.write( "th/language", language.language_code);