更新
This commit is contained in:
@@ -85,7 +85,7 @@ Future<ApiResponse> requestWithLog({
|
||||
|
||||
return apiResponse;
|
||||
} else {
|
||||
apiResponse = ApiResponse(code: -1, msg: "服务器.失败".tr);
|
||||
apiResponse = ApiResponse(code: -1, msg: "失败".tr);
|
||||
onFailure?.call(apiResponse);
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ class BlueteethBindController extends GetControllerEx<BlueteethBindModel> {
|
||||
RxMap selectWifi = {}.obs; //正在连接wifi信息
|
||||
|
||||
int returnPage = 0; //0返回首页 1.返回设备列表
|
||||
var shareDevice;//分享设备信息
|
||||
var shareDevice; //分享设备信息
|
||||
|
||||
// 安全展示 TopSlideNotification
|
||||
void safeShowNotification(String msg) {
|
||||
@@ -378,7 +378,7 @@ class BlueteethBindController extends GetControllerEx<BlueteethBindModel> {
|
||||
return res;
|
||||
}
|
||||
} else {
|
||||
return ApiResponse(code: -1, msg: "服务器.失败".tr);
|
||||
return ApiResponse(code: -1, msg: "失败".tr);
|
||||
}
|
||||
} catch (e) {
|
||||
EasyDartModule.logger.info("蓝牙绑定.绑定异常: $e");
|
||||
@@ -430,7 +430,7 @@ class BlueteethBindController extends GetControllerEx<BlueteethBindModel> {
|
||||
}
|
||||
apiResponse.msg = res.msg ?? apiResponse.msg;
|
||||
} else {
|
||||
return ApiResponse(code: -1, msg: "服务器.失败".tr);
|
||||
return ApiResponse(code: -1, msg: "失败".tr);
|
||||
}
|
||||
return apiResponse;
|
||||
} catch (e) {
|
||||
|
||||
@@ -46,8 +46,6 @@ class BodyDeviceController extends GetControllerEx<BodyDeviceModel> {
|
||||
|
||||
String wifiMac = "";
|
||||
|
||||
|
||||
|
||||
Future<ApiResponse> getDeviceNum() async {
|
||||
try {
|
||||
ApiResponse apiResponse = ApiResponse(code: -1, msg: "设备.设备列表请求失败".tr);
|
||||
@@ -80,7 +78,7 @@ class BodyDeviceController extends GetControllerEx<BodyDeviceModel> {
|
||||
return res;
|
||||
}
|
||||
} else {
|
||||
return ApiResponse(code: -1, msg: "服务器.失败".tr);
|
||||
return ApiResponse(code: -1, msg: "失败".tr);
|
||||
}
|
||||
return apiResponse;
|
||||
} catch (e) {
|
||||
@@ -123,7 +121,7 @@ class BodyDeviceController extends GetControllerEx<BodyDeviceModel> {
|
||||
return res;
|
||||
}
|
||||
} else {
|
||||
return ApiResponse(code: -1, msg: "服务器.失败".tr);
|
||||
return ApiResponse(code: -1, msg: "失败".tr);
|
||||
}
|
||||
return apiResponse;
|
||||
} catch (e) {
|
||||
@@ -166,7 +164,7 @@ class BodyDeviceController extends GetControllerEx<BodyDeviceModel> {
|
||||
return res;
|
||||
}
|
||||
} else {
|
||||
return ApiResponse(code: -1, msg: "服务器.失败".tr);
|
||||
return ApiResponse(code: -1, msg: "失败".tr);
|
||||
}
|
||||
return apiResponse;
|
||||
} catch (e) {
|
||||
@@ -303,7 +301,7 @@ class BodyDeviceController extends GetControllerEx<BodyDeviceModel> {
|
||||
return res;
|
||||
}
|
||||
} else {
|
||||
return ApiResponse(code: -1, msg: "服务器.失败".tr);
|
||||
return ApiResponse(code: -1, msg: "失败".tr);
|
||||
}
|
||||
return apiResponse;
|
||||
} catch (e) {
|
||||
|
||||
@@ -76,7 +76,7 @@ class DeviceShareController extends GetControllerEx<DeviceShareModel> {
|
||||
}
|
||||
return res;
|
||||
} else {
|
||||
return ApiResponse(code: -1, msg: "服务器.失败".tr);
|
||||
return ApiResponse(code: -1, msg: "失败".tr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,12 +134,12 @@ class DeviceShareController extends GetControllerEx<DeviceShareModel> {
|
||||
updateAll();
|
||||
return res;
|
||||
} else {
|
||||
return ApiResponse(code: -1, msg: "服务器.失败".tr);
|
||||
return ApiResponse(code: -1, msg: "失败".tr);
|
||||
}
|
||||
} catch (e) {
|
||||
EasyDartModule.logger.info("分享设备失败:${e.toString()}");
|
||||
DailyLogUtils.writeLog("分享设备失败:${e.toString()}");
|
||||
return ApiResponse(code: -1, msg: "服务器.失败".tr);
|
||||
return ApiResponse(code: -1, msg: "失败".tr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,12 +186,12 @@ class DeviceShareController extends GetControllerEx<DeviceShareModel> {
|
||||
MyUtils.formatResponse(res, "操作成功".tr, "操作失败".tr);
|
||||
return res;
|
||||
} else {
|
||||
return ApiResponse(code: -1, msg: "服务器.失败".tr);
|
||||
return ApiResponse(code: -1, msg: "失败".tr);
|
||||
}
|
||||
} catch (e) {
|
||||
EasyDartModule.logger.info("确认消息分享失败->$e");
|
||||
DailyLogUtils.writeLog("确认消息分享失败->$e");
|
||||
return ApiResponse(code: -1, msg: "服务器.失败".tr);
|
||||
return ApiResponse(code: -1, msg: "失败".tr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ class DeviceShareListController extends GetControllerEx<DeviceShareListModel> {
|
||||
return res;
|
||||
}
|
||||
} else {
|
||||
return ApiResponse(code: -1, msg: "服务器.失败".tr);
|
||||
return ApiResponse(code: -1, msg: "失败".tr);
|
||||
}
|
||||
return apiResponse;
|
||||
} catch (e) {
|
||||
@@ -122,7 +122,7 @@ class DeviceShareListController extends GetControllerEx<DeviceShareListModel> {
|
||||
return res;
|
||||
}
|
||||
} else {
|
||||
return ApiResponse(code: -1, msg: "服务器.失败".tr);
|
||||
return ApiResponse(code: -1, msg: "失败".tr);
|
||||
}
|
||||
return apiResponse;
|
||||
} catch (e) {
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:ef/ef.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'package:vbvs_app/common/color/ServiceConstant.dart';
|
||||
import 'package:vbvs_app/common/color/app_uri_status.dart';
|
||||
import 'package:vbvs_app/controller/mh_controller/mh_language_controller.dart';
|
||||
import 'package:vbvs_app/controller/setting/language/language_controller.dart';
|
||||
import 'package:vbvs_app/model/api_response.dart';
|
||||
|
||||
@@ -39,7 +40,7 @@ class DeviceTypeController extends GetControllerEx<DeviceTypeModel> {
|
||||
attr = GetModel(DeviceTypeModel()).obs;
|
||||
}
|
||||
RxList deviceTypeList = [].obs;
|
||||
LanguageController languageController = Get.find();
|
||||
MHLanguageController languageController = Get.find();
|
||||
|
||||
Future<ApiResponse> getDeviceType() async {
|
||||
ApiResponse apiResponse = ApiResponse(code: -1, msg: "请求失败".tr);
|
||||
@@ -75,7 +76,7 @@ class DeviceTypeController extends GetControllerEx<DeviceTypeModel> {
|
||||
}
|
||||
return res;
|
||||
} else {
|
||||
return ApiResponse(code: -1, msg: "服务器.失败".tr);
|
||||
return ApiResponse(code: -1, msg: "失败".tr);
|
||||
}
|
||||
} catch (e) {
|
||||
return apiResponse;
|
||||
|
||||
@@ -113,7 +113,7 @@ class LoginController extends GetControllerEx<LoginModel> {
|
||||
}
|
||||
return res;
|
||||
} else {
|
||||
return ApiResponse(code: -1, msg: "服务器.失败".tr);
|
||||
return ApiResponse(code: -1, msg: "失败".tr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,10 +174,10 @@ class LoginController extends GetControllerEx<LoginModel> {
|
||||
}
|
||||
return res;
|
||||
} else {
|
||||
return ApiResponse(code: -1, msg: "服务器.失败".tr);
|
||||
return ApiResponse(code: -1, msg: "失败".tr);
|
||||
}
|
||||
} catch (e) {
|
||||
return ApiResponse(code: -1, msg: "服务器.失败".tr);
|
||||
return ApiResponse(code: -1, msg: "失败".tr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ class MessageController extends GetControllerEx<MessageModel> {
|
||||
return res;
|
||||
}
|
||||
} else {
|
||||
return ApiResponse(code: -1, msg: "服务器.失败".tr);
|
||||
return ApiResponse(code: -1, msg: "失败".tr);
|
||||
}
|
||||
return apiResponse;
|
||||
} catch (e) {
|
||||
@@ -144,7 +144,7 @@ class MessageController extends GetControllerEx<MessageModel> {
|
||||
return res;
|
||||
}
|
||||
} else {
|
||||
return ApiResponse(code: -1, msg: "服务器.失败".tr);
|
||||
return ApiResponse(code: -1, msg: "失败".tr);
|
||||
}
|
||||
return apiResponse;
|
||||
} catch (e) {
|
||||
@@ -191,12 +191,12 @@ class MessageController extends GetControllerEx<MessageModel> {
|
||||
MyUtils.formatResponse(res, "操作成功".tr, "操作成功".tr);
|
||||
return res;
|
||||
} else {
|
||||
return ApiResponse(code: -1, msg: "服务器.失败".tr);
|
||||
return ApiResponse(code: -1, msg: "失败".tr);
|
||||
}
|
||||
} catch (e) {
|
||||
EasyDartModule.logger.info("更新消息已读状态->$e");
|
||||
DailyLogUtils.writeLog("更新消息已读状态->$e");
|
||||
return ApiResponse(code: -1, msg: "服务器.失败".tr);
|
||||
return ApiResponse(code: -1, msg: "失败".tr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ class MhMessageModel {
|
||||
int? type = 1; //设备类型 1:体征消息 2.系统消息
|
||||
int? body_message_read = 0; //体征消息 0:已读 1:未读
|
||||
int? system_message_read = 0; //系统消息 0:已读 1:未读
|
||||
|
||||
|
||||
MhMessageModel();
|
||||
|
||||
// 从JSON反序列化时的异常处理
|
||||
|
||||
@@ -108,7 +108,7 @@ class PersonController extends GetControllerEx<PersonModel> {
|
||||
return res;
|
||||
}
|
||||
} else {
|
||||
return ApiResponse(code: -1, msg: "服务器.失败".tr);
|
||||
return ApiResponse(code: -1, msg: "失败".tr);
|
||||
}
|
||||
return apiResponse;
|
||||
} catch (e) {
|
||||
@@ -158,7 +158,7 @@ class PersonController extends GetControllerEx<PersonModel> {
|
||||
return res;
|
||||
}
|
||||
} else {
|
||||
return ApiResponse(code: -1, msg: "服务器.失败".tr);
|
||||
return ApiResponse(code: -1, msg: "失败".tr);
|
||||
}
|
||||
return apiResponse;
|
||||
} catch (e) {
|
||||
@@ -200,7 +200,7 @@ class PersonController extends GetControllerEx<PersonModel> {
|
||||
return res;
|
||||
}
|
||||
} else {
|
||||
return ApiResponse(code: -1, msg: "服务器.失败".tr);
|
||||
return ApiResponse(code: -1, msg: "失败".tr);
|
||||
}
|
||||
return apiResponse;
|
||||
} catch (e) {
|
||||
|
||||
@@ -96,7 +96,7 @@ class RepairController extends GetControllerEx<RepairModel> {
|
||||
updateAll();
|
||||
return res;
|
||||
} else {
|
||||
return ApiResponse(code: -1, msg: "服务器.失败".tr);
|
||||
return ApiResponse(code: -1, msg: "失败".tr);
|
||||
}
|
||||
} else {
|
||||
apiResponse.msg = "我的.未选择图片".tr;
|
||||
@@ -105,7 +105,7 @@ class RepairController extends GetControllerEx<RepairModel> {
|
||||
} catch (e) {
|
||||
EasyDartModule.logger.error("上传图片失败->$e");
|
||||
DailyLogUtils.writeError("上传图片失败->$e");
|
||||
return ApiResponse(code: -1, msg: "服务器.失败".tr);
|
||||
return ApiResponse(code: -1, msg: "失败".tr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -762,7 +762,7 @@ class _AfterCalibrationPersonPageState
|
||||
failureNotifier.value = true;
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: res.msg ?? "服务器.失败".tr,
|
||||
text: res.msg ?? "失败".tr,
|
||||
textColor:
|
||||
themeController.currentColor.sc9,
|
||||
);
|
||||
@@ -829,7 +829,7 @@ class _AfterCalibrationPersonPageState
|
||||
failureNotifier.value = true;
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: res.msg ?? "服务器.失败".tr,
|
||||
text: res.msg ?? "失败".tr,
|
||||
textColor:
|
||||
themeController.currentColor.sc9,
|
||||
);
|
||||
@@ -1055,7 +1055,7 @@ class _AfterCalibrationPersonPageState
|
||||
deviceCalibrationController.cd.value = 10000;
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: res.msg ?? "服务器.失败".tr,
|
||||
text: res.msg ?? "失败".tr,
|
||||
textColor: themeController.currentColor.sc9,
|
||||
);
|
||||
},
|
||||
|
||||
@@ -90,9 +90,6 @@ class _CalibrationPageState extends State<CalibrationPage> {
|
||||
fontSize: 30.rpx,
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
|
||||
Positioned(
|
||||
left: 0,
|
||||
child: returnIconButtomAddCallback(() {
|
||||
@@ -674,7 +671,7 @@ class _CalibrationPageState extends State<CalibrationPage> {
|
||||
failureNotifier.value = true;
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: res.msg ?? "服务器.失败".tr,
|
||||
text: res.msg ?? "失败".tr,
|
||||
textColor:
|
||||
themeController.currentColor.sc9,
|
||||
);
|
||||
@@ -741,7 +738,7 @@ class _CalibrationPageState extends State<CalibrationPage> {
|
||||
failureNotifier.value = true;
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: res.msg ?? "服务器.失败".tr,
|
||||
text: res.msg ?? "失败".tr,
|
||||
textColor:
|
||||
themeController.currentColor.sc9,
|
||||
);
|
||||
@@ -969,7 +966,7 @@ class _CalibrationPageState extends State<CalibrationPage> {
|
||||
deviceCalibrationController.cd.value = 10000;
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: res.msg ?? "服务器.失败".tr,
|
||||
text: res.msg ?? "失败".tr,
|
||||
textColor: themeController.currentColor.sc9,
|
||||
);
|
||||
},
|
||||
|
||||
@@ -681,7 +681,7 @@ class _CalibrationPageState extends State<CalibrationPage> {
|
||||
failureNotifier.value = true;
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: res.msg ?? "服务器.失败".tr,
|
||||
text: res.msg ?? "失败".tr,
|
||||
textColor: themeController
|
||||
.currentColor.sc9,
|
||||
);
|
||||
@@ -705,7 +705,7 @@ class _CalibrationPageState extends State<CalibrationPage> {
|
||||
onFailure: (res) {
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: res.msg ?? "服务器.失败".tr,
|
||||
text: res.msg ?? "失败".tr,
|
||||
textColor:
|
||||
themeController.currentColor.sc9,
|
||||
);
|
||||
@@ -825,7 +825,7 @@ class _CalibrationPageState extends State<CalibrationPage> {
|
||||
failureNotifier.value = true;
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: res.msg ?? "服务器.失败".tr,
|
||||
text: res.msg ?? "失败".tr,
|
||||
textColor: themeController
|
||||
.currentColor.sc9,
|
||||
);
|
||||
@@ -849,7 +849,7 @@ class _CalibrationPageState extends State<CalibrationPage> {
|
||||
onFailure: (res) {
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: res.msg ?? "服务器.失败".tr,
|
||||
text: res.msg ?? "失败".tr,
|
||||
textColor:
|
||||
themeController.currentColor.sc9,
|
||||
);
|
||||
|
||||
@@ -673,7 +673,7 @@ class _CalibrationPersonPageState extends State<CalibrationPersonPage> {
|
||||
failureNotifier.value = true;
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: res.msg ?? "服务器.失败".tr,
|
||||
text: res.msg ?? "失败".tr,
|
||||
textColor:
|
||||
themeController.currentColor.sc9,
|
||||
);
|
||||
@@ -740,7 +740,7 @@ class _CalibrationPersonPageState extends State<CalibrationPersonPage> {
|
||||
failureNotifier.value = true;
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: res.msg ?? "服务器.失败".tr,
|
||||
text: res.msg ?? "失败".tr,
|
||||
textColor:
|
||||
themeController.currentColor.sc9,
|
||||
);
|
||||
@@ -968,7 +968,7 @@ class _CalibrationPersonPageState extends State<CalibrationPersonPage> {
|
||||
deviceCalibrationController.cd.value = 10000;
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: res.msg ?? "服务器.失败".tr,
|
||||
text: res.msg ?? "失败".tr,
|
||||
textColor: themeController.currentColor.sc9,
|
||||
);
|
||||
},
|
||||
|
||||
@@ -38,7 +38,7 @@ class _EPageState extends State<DeviceTypePage> {
|
||||
// 延迟到 widget 构建后再执行 show
|
||||
TopSlideNotification.show(
|
||||
context, // 用当前页面 context 替代 Get.context!
|
||||
text: response.msg ?? "服务器.失败".tr,
|
||||
text: response.msg ?? "失败".tr,
|
||||
textColor: themeController.currentColor.sc9,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ class _DeviceTypeListPageState extends State<DeviceTypeListPage> {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: response.msg ?? "服务器.失败".tr,
|
||||
text: response.msg ?? "失败".tr,
|
||||
textColor: themeController.currentColor.sc9,
|
||||
);
|
||||
});
|
||||
|
||||
@@ -40,7 +40,7 @@ class _MessagePageState extends State<MessagePage> {
|
||||
if (response.code != HttpStatusCodes.ok) {
|
||||
TopSlideNotification.show(
|
||||
Get.context!,
|
||||
text: response.msg ?? "服务器.失败".tr,
|
||||
text: response.msg ?? "失败".tr,
|
||||
textColor: themeController.currentColor.sc9,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||
import 'package:vbvs_app/controller/mh_controller/device_list_controller.dart';
|
||||
import 'package:vbvs_app/model/api_response.dart';
|
||||
import 'package:vbvs_app/pages/device_bind/componnet/bind_dialog.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/device/device.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/homepage/controller/mht_home_controller.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/test/WebviewTestModel.dart';
|
||||
import 'dart:ui' as ui;
|
||||
@@ -94,7 +95,8 @@ class _BluetoothPageState extends State<BluetoothPage> {
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Text(
|
||||
obsData['name']?.toString() ?? '未命名'.tr,
|
||||
obsData['name']?.toString() ??
|
||||
getNameByType(obsData.value),
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 40.rpx,
|
||||
@@ -110,7 +112,8 @@ class _BluetoothPageState extends State<BluetoothPage> {
|
||||
2 +
|
||||
_calculateTextHalfWidth(
|
||||
obsData['name']?.toString() ??
|
||||
'未命名'.tr) +
|
||||
getNameByType(
|
||||
obsData.value)) +
|
||||
22.rpx,
|
||||
top: 5.rpx,
|
||||
child: ClickableContainer(
|
||||
|
||||
@@ -102,8 +102,8 @@ class DeviceInfoWidget extends GetView {
|
||||
children: [
|
||||
_buildInfoRow(
|
||||
'设备ID'.tr,
|
||||
deviceListController
|
||||
.model.deviceList[index]["mac".tr] ??
|
||||
deviceListController.model
|
||||
.deviceList[index]["mac".tr] ??
|
||||
'',
|
||||
valueColor: (deviceListController
|
||||
.model.deviceList[index]
|
||||
@@ -410,16 +410,16 @@ class DeviceInfoWidget extends GetView {
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
getNameByType(device) {
|
||||
if (device['device_type'] == null) {
|
||||
return '未知类型设备'.tr;
|
||||
}
|
||||
if (device['device_type'] == 2) {
|
||||
return 'SWES 智能床'.tr;
|
||||
}
|
||||
if (device['device_type'] == 3) {
|
||||
return 'SWES 智能床垫'.tr;
|
||||
}
|
||||
getNameByType(device) {
|
||||
if (device['device_type'] == null) {
|
||||
return '未知类型设备'.tr;
|
||||
}
|
||||
if (device['device_type'] == 2) {
|
||||
return '智能电动床'.tr;
|
||||
}
|
||||
if (device['device_type'] == 3) {
|
||||
return '律动智能床垫'.tr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ class _MHTBindDeviceTypePageState extends State<MHTBindDeviceTypePage> {
|
||||
// 延迟到 widget 构建后再执行 show
|
||||
TopSlideNotification.show(
|
||||
context, // 用当前页面 context 替代 Get.context!
|
||||
text: response.msg ?? "服务器.失败".tr,
|
||||
text: response.msg ?? "失败".tr,
|
||||
textColor: themeController.currentColor.sc9,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -671,7 +671,7 @@ class _MHTCalibrationPageCopyState extends State<MHTCalibrationPageCopy> {
|
||||
failureNotifier.value = true;
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: res.msg ?? "服务器.失败".tr,
|
||||
text: res.msg ?? "失败".tr,
|
||||
textColor:
|
||||
themeController.currentColor.sc9,
|
||||
);
|
||||
@@ -735,7 +735,7 @@ class _MHTCalibrationPageCopyState extends State<MHTCalibrationPageCopy> {
|
||||
failureNotifier.value = true;
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: res.msg ?? "服务器.失败".tr,
|
||||
text: res.msg ?? "失败".tr,
|
||||
textColor:
|
||||
themeController.currentColor.sc9,
|
||||
);
|
||||
@@ -960,7 +960,7 @@ class _MHTCalibrationPageCopyState extends State<MHTCalibrationPageCopy> {
|
||||
deviceCalibrationController.cd.value = 10000;
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: res.msg ?? "服务器.失败".tr,
|
||||
text: res.msg ?? "失败".tr,
|
||||
textColor: themeController.currentColor.sc9,
|
||||
);
|
||||
},
|
||||
|
||||
@@ -741,7 +741,7 @@ class _MHTCalibrationPageState extends State<MHTCalibrationPage> {
|
||||
}
|
||||
|
||||
void _requestProgress(
|
||||
String serviceAddress, String progressApi, bool isSecondStep) {
|
||||
String serviceAddress, String progressApi, bool isSecondStep) {
|
||||
String cid = blueteethBindController.cid!.value;
|
||||
String progressUrl = "$serviceAddress$progressApi?id=$cid";
|
||||
|
||||
@@ -804,7 +804,7 @@ class _MHTCalibrationPageState extends State<MHTCalibrationPage> {
|
||||
}
|
||||
},
|
||||
onFailure: (res) {
|
||||
_handleCalibrationFailure(res.msg ?? "服务器.失败".tr);
|
||||
_handleCalibrationFailure(res.msg ?? "失败".tr);
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -920,7 +920,7 @@ class _MHTCalibrationPageState extends State<MHTCalibrationPage> {
|
||||
_startPollingProgress(serviceAddress, progressApi, isSecondStep);
|
||||
},
|
||||
onFailure: (res) {
|
||||
_handleCalibrationFailure(res.msg ?? "服务器.失败".tr);
|
||||
_handleCalibrationFailure(res.msg ?? "失败".tr);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -173,7 +173,6 @@ class _MHTCalibrationAfterPageState extends State<MHTCalibrationAfterPage> {
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -811,7 +810,7 @@ class _MHTCalibrationAfterPageState extends State<MHTCalibrationAfterPage> {
|
||||
}
|
||||
},
|
||||
onFailure: (res) {
|
||||
_handleCalibrationFailure(res.msg ?? "服务器.失败".tr);
|
||||
_handleCalibrationFailure(res.msg ?? "失败".tr);
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -903,8 +902,7 @@ class _MHTCalibrationAfterPageState extends State<MHTCalibrationAfterPage> {
|
||||
};
|
||||
|
||||
if (deviceCalibrationController.bed_type.value == 1) {
|
||||
data["macB"] =
|
||||
widget.deviceInfo.value['bind_mac_b'];
|
||||
data["macB"] = widget.deviceInfo.value['bind_mac_b'];
|
||||
}
|
||||
|
||||
if (isSecondStep) {
|
||||
@@ -927,7 +925,7 @@ class _MHTCalibrationAfterPageState extends State<MHTCalibrationAfterPage> {
|
||||
_startPollingProgress(serviceAddress, progressApi, isSecondStep);
|
||||
},
|
||||
onFailure: (res) {
|
||||
_handleCalibrationFailure(res.msg ?? "服务器.失败".tr);
|
||||
_handleCalibrationFailure(res.msg ?? "失败".tr);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -395,6 +395,7 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
||||
() {
|
||||
showHeightPickerDialog(
|
||||
context,
|
||||
title: "选择身高".tr,
|
||||
initialHeight: int.tryParse(
|
||||
peopleList[index]['height'] ??
|
||||
'170') ??
|
||||
@@ -461,6 +462,8 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
||||
() {
|
||||
showWeightPickerDialog(
|
||||
context,
|
||||
title: "选择体重".tr,
|
||||
|
||||
initialWeight: "50",
|
||||
onConfirm: (int selectedWeight) {
|
||||
setState(() {
|
||||
@@ -523,6 +526,7 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
||||
const Duration(milliseconds: 250),
|
||||
() {
|
||||
showDateSelectionDialog(context,
|
||||
title: "选择生日".tr,
|
||||
checkDate: peopleList[index]
|
||||
['birthday'] is DateTime
|
||||
? peopleList[index]['birthday']
|
||||
|
||||
@@ -248,7 +248,7 @@ class MHTHomeController extends GetControllerEx<MHTHomeModel> {
|
||||
return res;
|
||||
}
|
||||
} else {
|
||||
return ApiResponse(code: -1, msg: "服务器.失败".tr);
|
||||
return ApiResponse(code: -1, msg: "失败".tr);
|
||||
}
|
||||
return apiResponse;
|
||||
} catch (e) {
|
||||
@@ -385,7 +385,7 @@ class MHTHomeController extends GetControllerEx<MHTHomeModel> {
|
||||
return res;
|
||||
}
|
||||
} else {
|
||||
return ApiResponse(code: -1, msg: "服务器.失败".tr);
|
||||
return ApiResponse(code: -1, msg: "失败".tr);
|
||||
}
|
||||
return apiResponse;
|
||||
} catch (e) {
|
||||
|
||||
@@ -361,8 +361,12 @@ class _MhtSleepReportPageState extends State<MhtSleepReportPage> {
|
||||
"#FFFFFF"),
|
||||
size: 30.rpx,
|
||||
),
|
||||
fillColor: stringToColor(
|
||||
"#184468"),
|
||||
// fillColor: stringToColor(
|
||||
// "#184468"),
|
||||
// fillColor: stringToColor(
|
||||
// "##011D33"),
|
||||
fillColor:
|
||||
Color(0xFF003058),
|
||||
elevation: 2,
|
||||
borderColor:
|
||||
Colors.transparent,
|
||||
|
||||
@@ -249,7 +249,7 @@ class _NewHomePageState extends State<NewHomePage> {
|
||||
return Row(
|
||||
children: [
|
||||
Text(
|
||||
"${weatherModelController.model.cityName ?? '未知数据'.tr}",
|
||||
"${weatherModelController.model.cityName ?? '-'.tr}",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: AppConstants()
|
||||
@@ -257,7 +257,7 @@ class _NewHomePageState extends State<NewHomePage> {
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"${(weatherModelController.model.current_temperature != null && weatherModelController.model.current_temperature! > 0) ? weatherModelController.model.current_temperature : '未知数据'.tr}" +
|
||||
"${(weatherModelController.model.current_temperature != null && weatherModelController.model.current_temperature! > 0) ? weatherModelController.model.current_temperature : '-'.tr}" +
|
||||
"°C",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
@@ -266,7 +266,7 @@ class _NewHomePageState extends State<NewHomePage> {
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"${(weatherModelController.model.weather_info?.isNotEmpty ?? false) ? weatherModelController.model.weather_info : '未知数据'.tr}",
|
||||
"${(weatherModelController.model.weather_info?.isNotEmpty ?? false) ? weatherModelController.model.weather_info : '-'.tr}",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: AppConstants()
|
||||
|
||||
@@ -45,7 +45,7 @@ class _MessagePageState extends State<MessagePage> {
|
||||
TopSlideNotification.show(
|
||||
// Get.context!,
|
||||
context,
|
||||
text: response.msg ?? "服务器.失败".tr,
|
||||
text: response.msg ?? "失败".tr,
|
||||
textColor: themeController.currentColor.sc9,
|
||||
);
|
||||
}
|
||||
@@ -213,11 +213,11 @@ class _MessagePageState extends State<MessagePage> {
|
||||
child: TextButton(
|
||||
onPressed: () async {
|
||||
if (messageController.model.type == 1) {
|
||||
messageController.updateMessageReadStatus(context,"app_vsm", all: true);
|
||||
|
||||
messageController.updateMessageReadStatus(context, "app_vsm",
|
||||
all: true);
|
||||
} else {
|
||||
messageController.updateMessageReadStatus(context,"app_system", all: true);
|
||||
|
||||
messageController.updateMessageReadStatus(context, "app_system",
|
||||
all: true);
|
||||
}
|
||||
},
|
||||
child: Row(
|
||||
|
||||
@@ -110,7 +110,6 @@ class DeviceRepairPage extends GetView<RepairListController> {
|
||||
"报修须知".tr,
|
||||
style: TextStyle(
|
||||
fontSize: 30.rpx,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.white,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
|
||||
@@ -1798,7 +1798,7 @@ class MHTLoginPage extends GetView<MHTLoginController> {
|
||||
true) {
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: "登录页.未同意协议".tr,
|
||||
text: "需要同意协议".tr,
|
||||
textColor:
|
||||
themeController.currentColor.sc9,
|
||||
);
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/component/home_page/SleepDataModuleWidget.dart';
|
||||
import 'package:EasyDartModule/EasyDartModule.dart' as es;
|
||||
import 'package:vbvs_app/language/AppLanguage.dart';
|
||||
|
||||
class SleepCard extends StatefulWidget {
|
||||
final dynamic sleepReport;
|
||||
@@ -30,9 +31,10 @@ class _SleepCardState extends State<SleepCard> with TickerProviderStateMixin {
|
||||
_shouldAnimate = true;
|
||||
_initAnimation();
|
||||
}
|
||||
|
||||
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (widget.highlightItem != null && _highlightKey.currentContext != null) {
|
||||
if (widget.highlightItem != null &&
|
||||
_highlightKey.currentContext != null) {
|
||||
Scrollable.ensureVisible(
|
||||
_highlightKey.currentContext!,
|
||||
duration: Duration(milliseconds: 500),
|
||||
@@ -67,7 +69,7 @@ class _SleepCardState extends State<SleepCard> with TickerProviderStateMixin {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
_animationController!.forward();
|
||||
}
|
||||
|
||||
@@ -85,7 +87,8 @@ class _SleepCardState extends State<SleepCard> with TickerProviderStateMixin {
|
||||
widget.sleepReport.isEmpty) {
|
||||
return Container();
|
||||
}
|
||||
|
||||
String lcode = mhLanguageController.selectLanguage.value!.language_code!;
|
||||
int num = AppLanguage().isChinese() ? 3 : 2;
|
||||
List data = widget.sleepReport['bs'] ?? [];
|
||||
|
||||
return Container(
|
||||
@@ -104,11 +107,10 @@ class _SleepCardState extends State<SleepCard> with TickerProviderStateMixin {
|
||||
children: List.generate(data.length, (index) {
|
||||
final item = data[index];
|
||||
item['showTip'] = true;
|
||||
final bool isHighlighted = _shouldAnimate &&
|
||||
item['id'] == _highlightedId;
|
||||
|
||||
final bool isHighlighted =
|
||||
_shouldAnimate && item['id'] == _highlightedId;
|
||||
return SizedBox(
|
||||
width: (MediaQuery.of(context).size.width - 160.rpx) / 3,
|
||||
width: (MediaQuery.of(context).size.width - 160.rpx) / num,
|
||||
child: AnimatedBuilder(
|
||||
animation: _animationController ?? AlwaysStoppedAnimation(0),
|
||||
builder: (context, child) {
|
||||
@@ -118,13 +120,17 @@ class _SleepCardState extends State<SleepCard> with TickerProviderStateMixin {
|
||||
? BoxDecoration(
|
||||
border: Border.all(
|
||||
color: themeController.currentColor.sc2
|
||||
.withOpacity(_animationController?.value ?? 0),
|
||||
.withOpacity(
|
||||
_animationController?.value ?? 0),
|
||||
width: 1.rpx,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
)
|
||||
: null,
|
||||
child: SleepDataModuleWidget(data: item,sleepReportData: widget.sleepReport,),
|
||||
child: SleepDataModuleWidget(
|
||||
data: item,
|
||||
sleepReportData: widget.sleepReport,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
@@ -138,4 +144,4 @@ class _SleepCardState extends State<SleepCard> with TickerProviderStateMixin {
|
||||
return Container();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,12 +148,24 @@ class _SleepScoreWidgetState extends State<SleepScoreWidget> {
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"睡眠评分".tr,
|
||||
style: TextStyle(
|
||||
color: stringToColor("#FFFFFF"),
|
||||
// Text(
|
||||
// "睡眠评分".tr,
|
||||
// style: TextStyle(
|
||||
// color: stringToColor("#FFFFFF"),
|
||||
// fontSize:
|
||||
// AppConstants().normal_text_fontSize),
|
||||
// ),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: 12.rpx), // 👈 向下偏移的关键
|
||||
child: Text(
|
||||
"睡眠评分".tr,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize:
|
||||
AppConstants().normal_text_fontSize),
|
||||
AppConstants().normal_text_fontSize,
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'${widget.sleepReport['score']?['score']}',
|
||||
@@ -172,10 +184,7 @@ class _SleepScoreWidgetState extends State<SleepScoreWidget> {
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
),
|
||||
)),
|
||||
SizedBox(height: 50.rpx),
|
||||
Wrap(
|
||||
spacing: 32.rpx,
|
||||
|
||||
@@ -93,9 +93,6 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
|
||||
if (MainPageBBottomChange.getCurrentIndex() == 1) {
|
||||
TopSlideNotification.show(context,
|
||||
text: res.msg!, textColor: themeController.currentColor.sc9);
|
||||
} else {
|
||||
TopSlideNotification.show(context,
|
||||
text: res.msg!, textColor: themeController.currentColor.sc9);
|
||||
}
|
||||
} catch (_) {}
|
||||
sleepReportController.sleepReport.value = {};
|
||||
|
||||
Reference in New Issue
Block a user