This commit is contained in:
wyf
2025-08-02 14:10:07 +08:00
parent 9dc0f55ab6
commit ff00ed60c0
40 changed files with 150 additions and 126 deletions

View File

@@ -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(

View File

@@ -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;
}
}

View File

@@ -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,
);
}

View File

@@ -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,
);
},

View File

@@ -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);
},
);
}

View File

@@ -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);
},
);
}

View File

@@ -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']

View File

@@ -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) {

View File

@@ -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,

View File

@@ -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()

View File

@@ -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(

View File

@@ -110,7 +110,6 @@ class DeviceRepairPage extends GetView<RepairListController> {
"报修须知".tr,
style: TextStyle(
fontSize: 30.rpx,
fontWeight: FontWeight.bold,
color: Colors.white,
),
textAlign: TextAlign.center,

View File

@@ -1798,7 +1798,7 @@ class MHTLoginPage extends GetView<MHTLoginController> {
true) {
TopSlideNotification.show(
context,
text: "登录页.未同意协议".tr,
text: "需要同意协议".tr,
textColor:
themeController.currentColor.sc9,
);