多语言

This commit is contained in:
czz
2025-07-30 16:48:48 +08:00
parent 92b6896176
commit 300e3b31f6
96 changed files with 3741 additions and 2710 deletions

View File

@@ -1,6 +1,7 @@
import 'package:ef/ef.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutterflow_ui/flutterflow_ui.dart';
import 'package:vbvs_app/common/color/appConstants.dart';
import 'package:vbvs_app/common/util/FitTool.dart';
@@ -53,16 +54,17 @@ getOnePicker(BuildContext context, List arr, int checkIndex,
);
}
//支持选中时文字变色
getOnePickers(
Widget getOnePickers(
BuildContext context,
List arr,
RxInt selectedIndex, {
String unit = '',
bool looping = false,
void Function(int)? onChanged,
bool isMonthName = false,
}) {
ThemeController themeController = Get.find();
final bool isEn = Get.locale?.languageCode.startsWith('en') ?? false;
return Obx(() {
return CupertinoPicker.builder(
@@ -71,24 +73,33 @@ getOnePickers(
magnification: 1,
diameterRatio: 3,
squeeze: 1,
// looping: looping,
scrollController:
FixedExtentScrollController(initialItem: selectedIndex.value),
selectionOverlay: Container(),
onSelectedItemChanged: (int index) {
selectedIndex.value = index;
if (onChanged != null) onChanged(index);
},
childCount: arr.length,
itemBuilder: (context, index) {
bool isSelected = index == selectedIndex.value;
// 处理显示文本
String displayText;
if (isMonthName && isEn && arr[index] is int) {
displayText = DateFormat.MMMM('en').format(DateTime(0, arr[index]));
} else {
displayText = isEn ? "${arr[index]}" : "${arr[index]}$unit"; // 中文附带单位
}
return Center(
child: Text(
"${arr[index]}$unit",
displayText,
style: TextStyle(
fontFamily: 'Readex Pro',
color: isSelected
? const Color(0xFF011D33) // ✅ 选中项颜色
: Color(0xFF9AA0B3), // 未选中颜色
? const Color(0xFF011D33)
: const Color(0xFF9AA0B3),
fontSize: 30.rpx,
fontWeight: FontWeight.normal,
),
@@ -99,11 +110,14 @@ getOnePickers(
});
}
Future showDateSelectionDialog(BuildContext context,
{required DateTime checkDate,
Function? checkChange,
String title = "选择生日"}) {
ThemeController themeController = Get.find();
final bool isEn = Get.locale?.languageCode.startsWith('en') ?? false;
Color checkColor = stringToColor("#D3B684");
final List<int> years = List.generate(100, (i) => DateTime.now().year - i)
@@ -162,10 +176,10 @@ Future showDateSelectionDialog(BuildContext context,
padding: EdgeInsets.zero,
onTap: () => Navigator.of(context).pop(),
child: Container(
width: 100.rpx,
width: 110.rpx,
height: 60.rpx,
alignment: Alignment.center,
child: Text("取消",
child: Text("取消".tr,
style: TextStyle(
fontSize: 30.rpx, color: Colors.white)),
),
@@ -192,10 +206,10 @@ Future showDateSelectionDialog(BuildContext context,
Get.back();
},
child: Container(
width: 100.rpx,
width: 110.rpx,
height: 60.rpx,
alignment: Alignment.center,
child: Text("确定",
child: Text("确定".tr,
style: TextStyle(
fontSize: 30.rpx,
color: stringToColor("#84F5FF"))),
@@ -226,34 +240,61 @@ Future showDateSelectionDialog(BuildContext context,
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 95.rpx),
child: Row(
children: [
Expanded(
child: getOnePickers(
context,
years,
yearIndex,
unit: "",
onChanged: (_) => updateDays(),
),
),
Expanded(
child: getOnePickers(
context,
months,
monthIndex,
unit: "",
onChanged: (_) => updateDays(),
),
),
Expanded(
child: getOnePickers(
context,
daysSelect,
dayIndex,
unit: "",
),
),
],
children: isEn
? [
Expanded(
child: getOnePickers(
context,
months,
monthIndex,
isMonthName: true,
onChanged: (_) => updateDays(),
),
),
Expanded(
child: getOnePickers(
context,
daysSelect,
dayIndex,
),
),
Expanded(
child: getOnePickers(
context,
years,
yearIndex,
onChanged: (_) => updateDays(),
),
),
]
: [
Expanded(
child: getOnePickers(
context,
years,
yearIndex,
unit: "",
onChanged: (_) => updateDays(),
),
),
Expanded(
child: getOnePickers(
context,
months,
monthIndex,
unit: "",
onChanged: (_) => updateDays(),
),
),
Expanded(
child: getOnePickers(
context,
daysSelect,
dayIndex,
unit: "",
),
),
],
),
),
),
@@ -271,153 +312,6 @@ Future showDateSelectionDialog(BuildContext context,
);
}
// Future showMonthSelectionDialog(
// BuildContext context, {
// required DateTime checkDate,
// Function(DateTime)? checkChange,
// String title = "选择月份",
// }) {
// ThemeController themeController = Get.find();
// final List<int> years = List.generate(100, (i) => DateTime.now().year - i)
// ..sort();
// final List<int> months = List.generate(12, (i) => i + 1);
// final RxInt yearIndex = years.indexOf(checkDate.year).obs;
// final RxInt monthIndex = months.indexOf(checkDate.month).obs;
// return showDialog(
// context: context,
// barrierDismissible: true,
// builder: (BuildContext context) {
// return Stack(
// children: [
// Positioned(
// bottom: 0,
// left: 0,
// right: 0,
// child: Material(
// color: Colors.transparent,
// child: Dialog(
// backgroundColor: const Color(0xFF003058),
// insetPadding: EdgeInsets.zero,
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(0),
// ),
// child: Container(
// width: double.infinity,
// padding: EdgeInsets.fromLTRB(30.rpx, 10.rpx, 30.rpx, 90.rpx),
// child: Column(
// mainAxisSize: MainAxisSize.min,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: <Widget>[
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// ClickableContainer(
// backgroundColor: Colors.transparent,
// highlightColor: Colors.transparent,
// padding: EdgeInsets.zero,
// onTap: () => Navigator.of(context).pop(),
// child: Container(
// width: 100.rpx,
// height: 60.rpx,
// alignment: Alignment.center,
// child: Text("取消",
// style: TextStyle(
// fontSize: 30.rpx, color: Colors.white)),
// ),
// ),
// Text(
// title,
// style: TextStyle(
// fontFamily: 'Readex Pro',
// color: themeController.currentColor.sc3,
// fontSize: 30.rpx,
// ),
// ),
// ClickableContainer(
// backgroundColor: Colors.transparent,
// highlightColor: Colors.transparent,
// padding: EdgeInsets.zero,
// onTap: () {
// final selectedDate = DateTime(
// years[yearIndex.value],
// months[monthIndex.value],
// );
// Navigator.of(context).pop();
// checkChange?.call(selectedDate);
// },
// child: Container(
// width: 100.rpx,
// height: 60.rpx,
// alignment: Alignment.center,
// child: Text("确定",
// style: TextStyle(
// fontSize: 30.rpx,
// color: stringToColor("#84F5FF"))),
// ),
// ),
// ],
// ),
// SizedBox(height: 20.rpx),
// Stack(
// children: [
// Positioned.fill(
// child: IgnorePointer(
// child: Center(
// child: Container(
// height: 90.rpx,
// margin:
// EdgeInsets.symmetric(horizontal: 95.rpx),
// decoration: BoxDecoration(
// color: const Color(0xFF84F5FF),
// borderRadius: BorderRadius.circular(16.rpx),
// ),
// ),
// ),
// ),
// ),
// SizedBox(
// height: 240.rpx,
// child: Padding(
// padding: EdgeInsets.symmetric(horizontal: 95.rpx),
// child: Row(
// children: [
// Expanded(
// child: getOnePickers(
// context,
// years,
// yearIndex,
// unit: "年",
// ),
// ),
// Expanded(
// child: getOnePickers(
// context,
// months,
// monthIndex,
// unit: "月",
// ),
// ),
// ],
// ),
// ),
// ),
// ],
// ),
// ],
// ),
// ),
// ),
// ),
// ),
// ],
// );
// },
// );
// }
Future showMonthSelectionDialog(
BuildContext context, {
required DateTime checkDate,
@@ -498,11 +392,11 @@ Future showMonthSelectionDialog(
padding: EdgeInsets.zero,
onTap: () => Navigator.of(context).pop(),
child: Container(
width: 100.rpx,
width: 110.rpx,
height: 60.rpx,
alignment: Alignment.center,
child: Text(
"取消",
"取消".tr,
style: TextStyle(
fontSize: 30.rpx,
color: Colors.white,
@@ -531,11 +425,11 @@ Future showMonthSelectionDialog(
checkChange?.call(selectedDate);
},
child: Container(
width: 100.rpx,
width: 110.rpx,
height: 60.rpx,
alignment: Alignment.center,
child: Text(
"确定",
"确定".tr,
style: TextStyle(
fontSize: 30.rpx,
color: stringToColor("#84F5FF"),
@@ -576,7 +470,7 @@ Future showMonthSelectionDialog(
context,
years,
yearIndex,
unit: "",
unit: "".tr,
),
),
Expanded(
@@ -584,7 +478,7 @@ Future showMonthSelectionDialog(
context,
months, // 注意这里取 .value
monthIndex,
unit: "",
unit: "".tr,
),
),
],
@@ -653,10 +547,10 @@ Future<void> showWeightPickerDialog(
},
child: Container(
alignment: Alignment.center,
width: 100.rpx,
width: 110.rpx,
height: 60.rpx,
child: Text(
"取消",
"取消".tr,
style: TextStyle(
fontSize: 30.rpx,
color: Colors.white,
@@ -680,10 +574,10 @@ Future<void> showWeightPickerDialog(
},
child: Container(
alignment: Alignment.center,
width: 100.rpx,
width: 110.rpx,
height: 60.rpx,
child: Text(
"确定",
"确定".tr,
style: TextStyle(
fontSize: 30.rpx,
color: stringToColor("#84F5FF"),
@@ -780,10 +674,10 @@ Future<void> showHeightPickerDialog(
},
child: Container(
alignment: Alignment.center,
width: 100.rpx,
width: 110.rpx,
height: 60.rpx,
child: Text(
"取消",
"取消".tr,
style: TextStyle(
fontSize: 30.rpx,
color: Colors.white,
@@ -807,10 +701,10 @@ Future<void> showHeightPickerDialog(
},
child: Container(
alignment: Alignment.center,
width: 100.rpx,
width: 110.rpx,
height: 60.rpx,
child: Text(
"确定",
"确定".tr,
style: TextStyle(
fontSize: 30.rpx,
color: stringToColor("#84F5FF"),
@@ -1046,7 +940,7 @@ Future showDayTimeSelectionDialog(
padding: EdgeInsets.zero,
onTap: () => Navigator.of(context).pop(),
child: Container(
width: 100.rpx,
width: 110.rpx,
height: 60.rpx,
alignment: Alignment.center,
child: Text("取消".tr,
@@ -1074,7 +968,7 @@ Future showDayTimeSelectionDialog(
Get.back();
},
child: Container(
width: 100.rpx,
width: 110.rpx,
height: 60.rpx,
alignment: Alignment.center,
child: Text("确定".tr,
@@ -1190,7 +1084,7 @@ Future showOneSelectionDialog(
onTap: () => Get.back(),
child: Container(
alignment: Alignment.center,
width: 100.rpx,
width: 110.rpx,
height: 60.rpx,
child: Text("取消".tr,
style: TextStyle(
@@ -1213,7 +1107,7 @@ Future showOneSelectionDialog(
},
child: Container(
alignment: Alignment.center,
width: 100.rpx,
width: 110.rpx,
height: 60.rpx,
child: Text("确定".tr,
style: TextStyle(

View File

@@ -56,7 +56,7 @@ void showBindDoubleDialog(
padding:
EdgeInsetsDirectional.fromSTEB(0.rpx, 93.rpx, 0, 0),
child: Text(
'蓝牙绑定.双人版绑定标题'.tr,
'双人版绑定标题'.tr,
style: TextStyle(
fontFamily: 'Inter',
fontSize: 30.rpx,
@@ -69,7 +69,7 @@ void showBindDoubleDialog(
// 全选
_buildCheckboxRow(
context,
title: '蓝牙绑定.绑定全部'.tr,
title: '绑定全部'.tr,
value: () => blueteethBindController.model.deviceIndex0!,
onChanged: (v) {
if (!blueteethBindController.model.deviceIndex0!) {
@@ -83,7 +83,7 @@ void showBindDoubleDialog(
// 主设备
_buildCheckboxRow(
context,
title: '蓝牙绑定.主设备'.tr +
title: '主设备'.tr +
"${devices[0].mac}" +
(devices[0].bind == false ? "可绑定".tr : "已被绑定".tr),
value: () => blueteethBindController.model.deviceIndex1!,
@@ -99,7 +99,7 @@ void showBindDoubleDialog(
// 从设备
_buildCheckboxRow(
context,
title: '蓝牙绑定.从设备'.tr +
title: '从设备'.tr +
"${devices[1].mac}" +
(devices[1].bind == false ? "可绑定".tr : "已被绑定".tr),
value: () => blueteethBindController.model.deviceIndex2!,
@@ -119,7 +119,7 @@ void showBindDoubleDialog(
60.rpx, 100.rpx, 60.rpx, 0),
child: _buildActionButton(
context,
text: '蓝牙绑定.确定'.tr,
text: '确定'.tr,
onTap: () {
Get.back();
@@ -140,7 +140,7 @@ void showBindDoubleDialog(
60.rpx, 19.rpx, 60.rpx, 60.rpx),
child: _buildActionButton(
context,
text: '蓝牙绑定.取消'.tr,
text: '取消'.tr,
onTap: () {
Get.back();
onCancel();
@@ -186,7 +186,7 @@ Future<void> 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<void> 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,
@@ -248,7 +248,7 @@ Future<void> showHaveBindDialog(BuildContext context) async {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'蓝牙绑定.知道了'.tr,
'知道了'.tr,
style: TextStyle(
color: themeController.currentColor.sc3,
fontFamily: 'Inter',
@@ -301,7 +301,7 @@ void showLoadingDialog(BuildContext context, {String? title}) {
// padding: EdgeInsetsDirectional.fromSTEB(
// 0.rpx, 93.rpx, 0.rpx, 0.rpx),
// child: Text(
// '蓝牙绑定.无法绑定'.tr,
// '无法绑定'.tr,
// style: TextStyle(
// fontFamily: 'Inter',
// fontSize: 30.rpx,
@@ -428,7 +428,7 @@ Widget _buildActionButton(
return CustomCard(
borderRadius: AppConstants().button_container_radius,
onTap: onTap,
colors: '蓝牙绑定.确定'.tr == text
colors: '确定'.tr == text
? [
themeController.currentColor.sc1,
themeController.currentColor.sc2,
@@ -441,7 +441,7 @@ Widget _buildActionButton(
minWidth: 500.rpx,
minHeight: 90.rpx,
),
decoration: '蓝牙绑定.确定'.tr == text
decoration: '确定'.tr == text
? BoxDecoration()
: BoxDecoration(
border: Border.all(
@@ -579,7 +579,7 @@ void showConfirmDialog(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"蓝牙绑定.".tr,
"".tr,
style: TextStyle(
color: themeController.currentColor.sc3,
fontFamily: 'Inter',
@@ -615,7 +615,7 @@ void showConfirmDialog(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"蓝牙绑定.".tr,
"".tr,
style: TextStyle(
color: themeController.currentColor.sc3,
fontFamily: 'Inter',
@@ -890,7 +890,7 @@ void showWifiDialog(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"蓝牙绑定.连接".tr,
"连接".tr,
style: TextStyle(
color: themeController.currentColor.sc3,
fontFamily: 'Inter',
@@ -978,7 +978,7 @@ Future<void> showTipDialog(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'蓝牙绑定.知道了'.tr,
'知道了'.tr,
style: TextStyle(
color: themeController.currentColor.sc3,
fontFamily: 'Inter',
@@ -1171,14 +1171,14 @@ Future<void> showUnbindConfirmDialog({
style: TextStyle(fontSize: 26.rpx, color: Colors.black87),
children: [
TextSpan(
text: '该设备只可被一个用户绑定,',
text: '该设备只可被一个用户绑定,'.tr,
style: TextStyle(fontSize: 26.rpx)),
TextSpan(
text: '解绑后',
text: '解绑后'.tr,
style: TextStyle(color: Colors.red, fontSize: 26.rpx),
),
TextSpan(
text: '其他用户才可以绑定',
text: '其他用户才可以绑定'.tr,
style: TextStyle(fontSize: 26.rpx)),
],
),
@@ -1204,7 +1204,7 @@ Future<void> showUnbindConfirmDialog({
height: 90.rpx,
alignment: Alignment.center,
child: Text(
'取消',
'取消'.tr,
style: TextStyle(
fontSize: 26.rpx, color: Colors.white),
),
@@ -1225,7 +1225,7 @@ Future<void> showUnbindConfirmDialog({
height: 90.rpx,
alignment: Alignment.center,
child: Text(
'解绑',
'解绑'.tr,
style: TextStyle(
fontSize: 26.rpx, color: Colors.white),
),

View File

@@ -7,6 +7,7 @@ import 'package:flutter/services.dart';
import 'package:vbvs_app/common/util/CommonVariables.dart';
import 'package:vbvs_app/component/NullDataComponentWidget.dart';
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
import 'package:vbvs_app/controller/mh_controller/mh_language_controller.dart';
import 'package:vbvs_app/controller/user_info_controller.dart';
import 'package:vbvs_app/model/WebSocketMessage.dart';
import 'package:vbvs_app/pages/common/bezier_bottom_navigation_bar.dart';
@@ -17,14 +18,35 @@ import 'package:vbvs_app/pages/mh_page/new_mine_page.dart';
import 'package:vbvs_app/pages/mh_page/test/WebviewTestModel.dart';
import 'package:EasyDartModule/EasyDartModule.dart' as edm;
// class MainPageBBottomChange extends StatefulWidget {
// // 全局 key用于静态访问 _HomePageState
// static final GlobalKey<_HomePageState> globalKey =
// GlobalKey<_HomePageState>();
// MainPageBBottomChange({Key? key}) : super(key: globalKey);
// // 静态方法:外部调用,跳转 tab
// static void jumpTo(int index) {
// final state = globalKey.currentState;
// if (state != null) {
// state.switchTab(index);
// }
// }
// static int? getCurrentIndex() {
// final state = globalKey.currentState;
// return state?.selectedIndex;
// }
// @override
// _HomePageState createState() => _HomePageState();
// }
class MainPageBBottomChange extends StatefulWidget {
// 全局 key用于静态访问 _HomePageState
static final GlobalKey<_HomePageState> globalKey =
GlobalKey<_HomePageState>();
final GlobalKey<_HomePageState>? externalKey;
MainPageBBottomChange({Key? key}) : super(key: globalKey);
MainPageBBottomChange({Key? key, this.externalKey})
: super(key: key ?? externalKey);
// 静态方法:外部调用,跳转 tab
static void jumpTo(int index) {
final state = globalKey.currentState;
if (state != null) {
@@ -37,6 +59,9 @@ class MainPageBBottomChange extends StatefulWidget {
return state?.selectedIndex;
}
static final GlobalKey<_HomePageState> globalKey =
GlobalKey<_HomePageState>();
@override
_HomePageState createState() => _HomePageState();
}
@@ -47,8 +72,8 @@ class _HomePageState extends State<MainPageBBottomChange>
late AnimationController _controller;
late Animation<double> _positionAnimation;
double currentPosition = 0.0;
final List<String> titles = ['首页', '报告', '控制', '我的'];
MHLanguageController languageController = Get.find();
List<String> get titles => ['首页', '报告', '控制', '我的'];
final List<String> path = [
"assets/images/bar_home.svg",
"assets/images/bar_heart.svg",
@@ -113,11 +138,15 @@ class _HomePageState extends State<MainPageBBottomChange>
DateTime? _lastBackPressedTime; // 记录上一次返回的时间
@override
Widget build(BuildContext context) {
return PopScope(
return Obx(() {
final currentLanguage =
languageController.selectLanguage.value; // 监听此变量变化
return PopScope(
canPop: false,
onPopInvokedWithResult: (disposition, result) async {
if (Platform.isAndroid) {
var flag = await _handleBackPressed(context); // 自定义返回逻辑
var flag = await _handleBackPressed(context);
if (flag) {
SystemNavigator.pop();
}
@@ -134,9 +163,13 @@ class _HomePageState extends State<MainPageBBottomChange>
animatedPosition: _positionAnimation.value,
onTap: _onTabTapped,
path: path,
titles: titles,
titles: titles
.map((title) => title.tr) // 这里依赖 .tr 会自动根据 Get.locale 变化刷新
.toList(),
),
));
),
);
});
}
void switchTab(int index) {
@@ -226,7 +259,7 @@ class _HomePageState extends State<MainPageBBottomChange>
//如果当前没有连接该设备,则返回
return;
}
if (webviewTestController.selectDevice['blueToothStatus']!=2) {
if (webviewTestController.selectDevice['blueToothStatus'] != 2) {
return;
}
edm.EasyDartModule.websocket.sendData(jsonEncode(WebSocketMessage(

View File

@@ -994,86 +994,9 @@ class _HomePageState extends State<HomePage> {
);
}
// return Expanded(
// child: SingleChildScrollView(
// child: Column(
// children: List.generate(
// deviceList.length,
// (i) {
// String mac = macList[i];
// List<dynamic> dailyDataList =
// reportData[mac]!;
// Map? targetDevice =
// deviceList.firstWhereOrNull(
// (device) => device['mac'] == mac,
// );
// List stateModule = [];
// String currentTime = "";
// String goalMac = targetDevice?['mac'];
// var person = targetDevice?['person'];
// return DynamicReportDetailWidget(
// key: ValueKey(
// '${targetDevice!['mac']}_${homeController.model.type}'), // 添加唯一key
// targetDevice: targetDevice!,
// sleepDateWidgets: List.generate(
// dailyDataList.length,
// (j) {
// var dayData = dailyDataList[j];
// DateTime date =
// DateTime.fromMillisecondsSinceEpoch(
// dayData['time'] is String
// ? int.parse(dayData['time'])
// : dayData['time'],
// );
// if (dayData['selected'] != null &&
// dayData['selected'] == true &&
// dayData['state'] != null) {
// stateModule = dayData['state'];
// currentTime = dayData['time'];
// }
// return SleepDateWidget(
// mac: mac,
// time: dayData['time'],
// date: date,
// score: dayData['score']?['socre']
// ?.toString() ??
// '',
// comment: dayData['score']?['name'],
// textColor: dayData['score']
// ?['color'] ==
// null
// ? null
// : stringToColor(
// dayData['score']?['color']),
// isSelected: dayData['selected'],
// );
// },
// ),
// sleepDataModuleWidgets: stateModule
// .isNotEmpty
// ? List.generate(
// stateModule.length,
// (j) {
// stateModule[j]['onto'] = true;
// stateModule[j]['time'] =
// currentTime;
// stateModule[j]['mac'] = goalMac;
// stateModule[j]['person'] = person;
// return SleepDataModuleWidget(
// data: stateModule[j],
// );
// },
// )
// : [],
// );
// },
// ),
// ),
// ),
// );
return Expanded(
child: SingleChildScrollView(
child: Column(
child: SingleChildScrollView(child:
Column(
children: [
SizedBox(height: 26.rpx), // 第一个上方间距
...List.generate(deviceList.length, (i) {
@@ -1097,6 +1020,8 @@ class _HomePageState extends State<HomePage> {
targetDevice: targetDevice!,
sleepDateWidgets: List.generate(
dailyDataList.length, (j) {
var dayData = dailyDataList[j];
DateTime date = DateTime
.fromMillisecondsSinceEpoch(
@@ -1148,7 +1073,7 @@ class _HomePageState extends State<HomePage> {
);
}),
],
),
)
),
);
}),

View File

@@ -40,7 +40,7 @@ class _BackMovementPageState extends State<BackMovementPage> {
children: [
// 中间居中的标题
Text(
'背部律动',
'背部律动'.tr,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
@@ -69,7 +69,7 @@ class _BackMovementPageState extends State<BackMovementPage> {
children: [
SizedBox(height: 30.rpx),
Text(
'力度调节',
'力度调节'.tr,
style: TextStyle(color: Colors.grey, fontSize: 30.rpx),
),
SizedBox(height: 148.rpx),
@@ -92,10 +92,10 @@ class _BackMovementPageState extends State<BackMovementPage> {
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text('',
Text(''.tr,
style: TextStyle(
color: Colors.grey, fontSize: 30.rpx)),
Text('',
Text(''.tr,
style: TextStyle(
color: Colors.grey, fontSize: 30.rpx)),
],
@@ -153,7 +153,7 @@ class _BackMovementPageState extends State<BackMovementPage> {
child: Align(
alignment: Alignment.centerLeft,
child: Text(
'按摩定时',
'按摩定时'.tr,
style:
TextStyle(color: Colors.white70, fontSize: 30.rpx),
),
@@ -209,7 +209,7 @@ class _BackMovementPageState extends State<BackMovementPage> {
borderRadius: BorderRadius.circular(6),
),
),
child: const Text('恢复到默认设置'),
child: Text('恢复到默认设置'.tr),
),
),
],

View File

@@ -48,7 +48,7 @@ class _HomeDeviceTypeState extends State<HomeDeviceType> {
children: [
// 中间居中的标题
Text(
'添加设备',
'添加设备'.tr,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
@@ -86,7 +86,7 @@ class _HomeDeviceTypeState extends State<HomeDeviceType> {
padding:
EdgeInsetsDirectional.fromSTEB(48.rpx, 24.rpx, 0, 0),
child: Text(
'选择类型',
'选择类型'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Colors.white,
@@ -111,14 +111,14 @@ Widget _buildControlCard(BuildContext context) {
final List<Map<String, dynamic>> deviceTypeList = [
{
"id": 1,
"name": "智能床垫",
"name": "智能床垫".tr,
"desc": "SWES01 MHT01 SWES01 MHT01 SWES01 MHT01 ",
"img": "assets/images/device_bed.png",
"page": 1,
},
{
"id": 2,
"name": "智能电动床",
"name": "智能电动床".tr,
"desc": "M300",
"img": "assets/images/electric_bed.png",
"page": 2,

View File

@@ -9,6 +9,7 @@ import 'package:vbvs_app/component/tool/CustomCard.dart';
import 'package:vbvs_app/controller/mh_controller/mh_language_controller.dart';
import 'package:vbvs_app/language/AppLanguage.dart';
import 'package:vbvs_app/pages/device_bind/componnet/FancyCircleCheckbox.dart';
import 'package:vbvs_app/pages/mh_page/homepage/controller/mht_home_controller.dart';
class LanguagePage extends StatefulWidget {
const LanguagePage({super.key});
@@ -19,6 +20,7 @@ class LanguagePage extends StatefulWidget {
class _LanguagePageState extends State<LanguagePage> {
MHLanguageController languageController = Get.find();
MHTHomeController deviceController = Get.find();
@override
void initState() {
// languageController.initLanuageList();
@@ -65,7 +67,7 @@ class _LanguagePageState extends State<LanguagePage> {
),
Positioned(
left: 0,
child: returnIconButtom,
child: returnIconButtomNew(),
),
],
),
@@ -120,14 +122,20 @@ class _LanguagePageState extends State<LanguagePage> {
lang.selected = (lang ==
language); // 根据选择更新状态
}
await AppLanguage()
.loadLanguage(
language.language_code,
project: "mht"); // 加载语言
languageController
.updateAll(); // 更新操作
languageController
.selectLanguage
.value = language;
await AppLanguage()
.loadLanguage(language
.language_code); // 加载语言
languageController
.updateAll(); // 更新操作
final list = deviceController
.personnelList.value;
deviceController.getHomeSleeps(
list[0]["mac"], context);
},
child: Row(
mainAxisSize: MainAxisSize.max,
@@ -167,14 +175,26 @@ class _LanguagePageState extends State<LanguagePage> {
lang.selected = (lang ==
language); // 更新选中状态
}
await AppLanguage()
.loadLanguage(
language
.language_code,
project:
"mht"); // 加载语言
languageController
.updateAll(); // 更新操作
languageController
.selectLanguage
.value = language;
await AppLanguage()
.loadLanguage(language
.language_code); // 加载语言
languageController
.updateAll(); // 更新操作
final list =
deviceController
.personnelList
.value;
deviceController
.getHomeSleeps(
list[0]["mac"],
context);
},
),
].divide(SizedBox(

View File

@@ -86,7 +86,7 @@ class _MattressControlPageState extends State<MattressControlPage> {
final tabWidth = screenWidth / tabCount;
final sideMargin = (tabWidth - thirdWidth) / 2;
final labels = ['', '全局', ''];
final labels = [''.tr, '全局'.tr, ''.tr];
return Padding(
padding: EdgeInsets.symmetric(horizontal: 30.rpx),
@@ -154,15 +154,15 @@ class _MattressControlPageState extends State<MattressControlPage> {
final spacing = 20.0.rpx;
final List<Map<String, dynamic>> allCards = [
{'title': '一键助眠', 'time': '30:00'},
{'title': '疲劳缓解', 'time': '20:00'},
{'title': '全身放松', 'time': '20:00'},
{'title': '背部律动', 'time': '10:00'},
{'title': '腿部律动', 'time': '30:00'},
{'title': '垂直律动', 'time': ''},
{'title': '加热', 'time': '30:00'},
{'title': '柔性唤醒', 'time': 'PM 08:00'},
{'title': '记忆', 'time': ''},
{'title': '一键助眠'.tr, 'time': '30:00'},
{'title': '疲劳缓解'.tr, 'time': '20:00'},
{'title': '全身放松'.tr, 'time': '20:00'},
{'title': '背部律动'.tr, 'time': '10:00'},
{'title': '腿部律动'.tr, 'time': '30:00'},
{'title': '垂直律动'.tr, 'time': ''},
{'title': '加热'.tr, 'time': '30:00'},
{'title': '柔性唤醒'.tr, 'time': 'PM 08:00'},
{'title': '记忆'.tr, 'time': ''},
];
final firstRow = allCards.sublist(0, 3);

View File

@@ -145,7 +145,7 @@ class _MhMessageListWidgetState extends State<MhMessageListWidget> {
child: Center(
child: Text(
// getMessageStatus(messageInfo['status']),
"查看详情",
"查看详情".tr,
style: TextStyle(
fontFamily: 'Inter',
fontSize: 26.rpx,

View File

@@ -62,7 +62,7 @@ class ShareDeviceDetailWidget extends GetView {
children: [
// 中间居中的标题
Text(
'详情',
'详情'.tr,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
@@ -80,7 +80,7 @@ class ShareDeviceDetailWidget extends GetView {
String queryUrl =
"$serviceAddress$serviceName$serviceApi";
await requestWithLog(
logTitle: "更新设备信息",
logTitle: "更新设备信息".tr,
method: MyHttpMethod.put,
queryUrl: queryUrl,
data: {
@@ -129,7 +129,7 @@ class ShareDeviceDetailWidget extends GetView {
String serviceApi = ServiceConstant.device_show;
String queryUrl = "$serviceAddress$serviceName$serviceApi";
await requestWithLog(
logTitle: "更新设备信息",
logTitle: "更新设备信息".tr,
method: MyHttpMethod.put,
queryUrl: queryUrl,
data: {"id": data['info'][4]["id"], "opType": opType.value},
@@ -423,7 +423,7 @@ class ShareDeviceDetailWidget extends GetView {
gradientDirection: GradientDirection.vertical,
onTap: () async {
deviceListController.unbindShareDevice(
data['info'][5]['uid'], data['mac'], context);
data['info'][5]['uid'], data['mac'.tr], context);
},
colors: const [
Color(0xFFFCFCFC),

View File

@@ -23,7 +23,7 @@ class ShareUserWidget extends GetView {
return InkWell(
onTap: () {
Get.toNamed('/shareDeviceDetail',
arguments: {"mac": mac, "info": info});
arguments: {"mac".tr: mac, "info": info});
},
child: Container(
width: MediaQuery.sizeOf(context).width,

View File

@@ -33,7 +33,7 @@ class _VitalSignsSensorState extends State<VitalSignsSensorPage> {
}
_fetchDeviceList() async {
await controller.getVitalList(widget.data['mac']);
await controller.getVitalList(widget.data['mac'.tr]);
}
@override
@@ -70,7 +70,7 @@ class _VitalSignsSensorState extends State<VitalSignsSensorPage> {
children: [
// 中间居中的标题
Text(
"体征传感器",
"体征传感器".tr,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
@@ -109,7 +109,8 @@ class _VitalSignsSensorState extends State<VitalSignsSensorPage> {
SizedBox(height: 30.rpx),
...List.generate(dataList.length, (index) {
final item = dataList[index];
final title = "体征传感器${index == 0 ? "A" : "B"}"; // ✅ 只处理 A/B 场景
final title =
index == 0 ? '体征传感器A'.tr : '体征传感器B'.tr; // ✅ 只处理 A/B 场景
return VitalWidget(title: title, data: item);
}).divide(SizedBox(height: 30.rpx)),
SizedBox(height: 30.rpx),
@@ -128,7 +129,7 @@ class VitalWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
final String id = data['mac'] ?? '--';
final String id = data['mac'.tr] ?? '--';
final int? timestamp = data['status']['updateTime'];
final String time = (timestamp != null)
? DateFormat('yyyy-MM-dd HH:mm')
@@ -171,7 +172,7 @@ class VitalWidget extends StatelessWidget {
width: MediaQuery.sizeOf(context).width * 0.14,
constraints: BoxConstraints(minWidth: 106.rpx),
child: Text(
"设备ID",
"设备ID".tr,
style: TextStyle(
color: stringToColor("#929699"),
fontSize: 26.rpx,
@@ -193,7 +194,7 @@ class VitalWidget extends StatelessWidget {
width: MediaQuery.sizeOf(context).width * 0.14,
constraints: BoxConstraints(minWidth: 106.rpx),
child: Text(
"更新时间",
"更新时间".tr,
style: TextStyle(
color: stringToColor("#929699"),
fontSize: 26.rpx,

View File

@@ -35,7 +35,7 @@ class _MhAboutUsPageState extends State<MhAboutUsPage> {
widget.webView = MyWebView(
url: url,
onLoad: () {
print('网页载入完毕');
print('网页载入完毕'.tr);
},
);
}

View File

@@ -47,7 +47,7 @@ class AddressListPage extends GetView<AddressListController> {
children: [
// 中间居中的标题
Text(
'地址管理',
'地址管理'.tr,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
@@ -184,7 +184,7 @@ class AddressListPage extends GetView<AddressListController> {
SizedBox(width: 10), // 加号和文字间距
Text(
'添加新地址',
'添加新地址'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Color(0xFF85F5FF),

View File

@@ -108,7 +108,7 @@ class AddressModuleWidget extends GetView {
child: ElevatedButton(
onPressed: () {},
child: Text(
'默认',
'默认'.tr,
style: TextStyle(
color: Color(0XFF6BFDAC),
fontSize: 20.rpx,
@@ -131,7 +131,7 @@ class AddressModuleWidget extends GetView {
addressListController.model
.addressList[index]['address']?.isEmpty ??
true
? '无详细地址'
? '无详细地址'.tr
: addressListController.model.addressList[index]
['address'],
style: TextStyle(
@@ -172,7 +172,7 @@ class AddressModuleWidget extends GetView {
child: Align(
alignment: AlignmentDirectional(1, 0),
child: Text(
'编辑',
'编辑'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Color(0xFF84F5FF),

View File

@@ -1,3 +1,4 @@
import 'package:ef/ef.dart';
import 'package:map_launcher/map_launcher.dart';
class AppMapLocation {
@@ -10,25 +11,25 @@ class AppMapLocation {
String v = "";
switch (m.mapType) {
case MapType.baidu:
v = '百度地图';
v = '百度地图'.tr;
break;
case MapType.tencent:
v = '腾讯地图';
v = '腾讯地图'.tr;
break;
case MapType.amap:
v = '高德地图';
v = '高德地图'.tr;
break;
case MapType.apple:
v = 'Apple地图';
v = 'Apple地图'.tr;
break;
case MapType.google:
v = 'Google地图';
v = 'Google地图'.tr;
break;
case MapType.googleGo:
v = 'Google地图Go';
v = 'Google地图Go'.tr;
break;
case MapType.petal:
v = 'Petal地图';
v = 'Petal地图'.tr;
break;
default:
v = m.mapName;

View File

@@ -70,7 +70,7 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
children: [
// 中间居中的标题
Text(
'申请报修',
'申请报修'.tr,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
@@ -147,7 +147,7 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
const AlignmentDirectional(
0, -1),
child: Text(
'选择需要报修的设备',
'选择需要报修的设备'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
letterSpacing: 0,
@@ -193,7 +193,7 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
const AlignmentDirectional(
-1, 0),
child: Text(
'已绑设备',
'已绑设备'.tr,
style: TextStyle(
fontFamily:
'Readex Pro',
@@ -201,6 +201,7 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
26.rpx,
letterSpacing:
0,
height: 1,
color: Colors
.white),
),
@@ -221,138 +222,6 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
color: Colors
.white,
),
// child: Obx(
// () {
// List<Map<String, String>> deviceOptions = controller
// .model
// .device_list!
// .map((device) => {
// 'mac': device['mac'].toString(), // 提取设备 Mac
// 'name': device['name'].toString(), // 提取设备名称
// 'type': device['device_type'].toString()
// })
// .toList();
// // 提取 optionsLabel 和 optionsValue
// // List<String> deviceNames = deviceOptions
// // .map((device) => device['name']!) // 用于显示的名称列表
// // .toList();
// List<String>
// deviceNames =
// controller.model.device_list!.map((device) {
// final mac =
// device['mac']?.toString() ?? '';
// final name =
// device['name']?.toString() ?? '';
// final type =
// getDeviceTypeName(int.tryParse('${device['device_type']}'));
// return name.isNotEmpty
// ? '$name-MAC$mac'
// : '$type-MAC$mac';
// }).toList();
// List<String> deviceMacs = deviceOptions
// .map((device) => device['mac']!) // 用于匹配的 ID 列表
// .toList();
// return FlutterFlowDropDown<
// String>(
// controller:
// tmpcontroller,
// fillColor:
// Colors.white, // 控件区域背景色
// options:
// deviceMacs, // 下拉菜单选项为设备的 ID
// optionLabels:
// deviceNames, // 下拉菜单显示的内容为设备名称
// onChanged:
// (val) {
// // var selectedDevice = controller.model.device_list!.firstWhere((device) => device['mac'].toString() == val);
// // controller.model.select_device = val;
// // controller.model.device_type = selectedDevice['device_type'];
// // // controller.model.device_category = selectedDevice['deviceSeries']['name'] ?? '未知型号'; // 获取设备型号
// // controller.model.device_category = '未知型号';
// // controller.model.device_id = selectedDevice['mac'] ?? '未知设备mac'; // 获取设备ID
// // controller.model.device_name = selectedDevice['name'] ?? '未知设备'; // 获取设备名称
// // controller.updateAll();
// var selectedDevice = controller.model.device_list!.firstWhere((device) => device['mac'].toString() == val);
// final mac = selectedDevice['mac']?.toString() ?? '未知MAC';
// final name = selectedDevice['name']?.toString();
// final type = int.tryParse('${selectedDevice['device_type']}');
// final typeName = getDeviceTypeName(type);
// controller.model.select_device = mac;
// controller.model.device_type = selectedDevice['device_type'];
// controller.model.device_category = '未知型号'; // 后续可替换成设备系列
// // 如果 name 不为空则用 name否则用 typeName-mac
// controller.model.device_name = (name != null && name.isNotEmpty) ? name : '$typeName-MAC$mac';
// controller.model.device_id = mac;
// controller.updateAll();
// },
// width:
// 300,
// height:
// 56,
// searchHintTextStyle:
// const TextStyle(
// fontFamily: 'Readex Pro',
// letterSpacing: 0,
// ),
// searchTextStyle:
// const TextStyle(
// fontFamily: 'Readex Pro',
// letterSpacing: 0,
// ),
// textStyle:
// TextStyle(
// fontFamily: 'Readex Pro',
// color: Colors.black,
// fontSize: 26.rpx,
// letterSpacing: 0,
// ),
// hintText:
// '请选择绑定设备',
// searchHintText:
// '查找',
// icon:
// const Icon(
// Icons.keyboard_arrow_down_rounded,
// color: Colors.black,
// size: 24,
// ),
// // fillColor:
// // FlutterFlowTheme.of(context).secondaryBackground,
// elevation:
// 2,
// borderColor:
// Colors.white,
// borderWidth:
// 0,
// borderRadius:
// 8,
// margin: const EdgeInsetsDirectional.fromSTEB(
// 10,
// 4,
// 10,
// 4),
// hidesUnderline:
// true,
// isOverButton:
// false,
// isSearchable:
// false,
// isMultiSelect:
// false,
// );
// })
child: Obx(() {
final isDeviceListEmpty = controller
.model
@@ -367,7 +236,7 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
.device_list!
.map((device) =>
{
'mac': device['mac'].toString(),
'mac'.tr: device['mac'.tr].toString(),
'name': device['name'].toString(),
'type': device['device_type'].toString()
})
@@ -381,7 +250,7 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
.map(
(device) {
final mac =
device['mac']?.toString() ??
device['mac'.tr]?.toString() ??
'';
final name =
device['name']?.toString() ??
@@ -400,7 +269,7 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
deviceMacs =
deviceOptions
.map((device) =>
device['mac']!)
device['mac'.tr]!)
.toList();
return AbsorbPointer(
@@ -428,12 +297,12 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
.model
.device_list!
.firstWhere((device) =>
device['mac'].toString() ==
device['mac'.tr].toString() ==
val);
final mac =
selectedDevice['mac']?.toString() ??
'未知MAC';
selectedDevice['mac'.tr]?.toString() ??
'未知MAC'.tr;
final name =
selectedDevice['name']?.toString();
final type =
@@ -449,7 +318,7 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
.device_type = selectedDevice['device_type'];
controller
.model
.device_category = '未知型号';
.device_category = '未知型号'.tr;
controller
.model
.device_name = (name != null &&
@@ -481,9 +350,11 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
),
hintText: isDeviceListEmpty
? '暂无可选设备'
: '请选择绑定设备',
.tr
: '请选择绑定设备'
.tr,
searchHintText:
'查找',
'查找'.tr,
icon:
Icon(
Icons
@@ -546,15 +417,16 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
.height *
0.038,
constraints:
const BoxConstraints(
minWidth: 60,
BoxConstraints(
minWidth: 62,
),
child: Align(
alignment:
const AlignmentDirectional(
-1, 0),
child: Text(
'设备系列',
'设备系列'.tr,
maxLines: 2,
style: TextStyle(
fontFamily:
'Readex Pro',
@@ -562,6 +434,7 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
26.rpx,
letterSpacing:
0,
height: 1,
color: Colors
.white),
),
@@ -730,7 +603,7 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
const AlignmentDirectional(
-1, 0),
child: Text(
'产品型号',
'产品型号'.tr,
style: TextStyle(
fontFamily:
'Readex Pro',
@@ -738,6 +611,7 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
26.rpx,
letterSpacing:
0,
height: 1,
color: Colors
.white),
),
@@ -898,15 +772,16 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
.height *
0.038,
constraints:
const BoxConstraints(
minWidth: 60,
),
BoxConstraints(
minWidth: 60,
minHeight:
60.rpx),
child: Align(
alignment:
const AlignmentDirectional(
-1, 0),
child: Text(
'序列号',
'序列号'.tr,
style: TextStyle(
fontFamily:
'Readex Pro',
@@ -914,6 +789,7 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
26.rpx,
letterSpacing:
0,
height: 1,
color: Colors
.white),
),
@@ -1182,7 +1058,7 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
const AlignmentDirectional(
0, 0),
child: Text(
'上传设备故障照片',
'上传设备故障照片'.tr,
style: TextStyle(
fontFamily:
'Readex Pro',
@@ -1393,7 +1269,7 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
padding: const EdgeInsetsDirectional
.fromSTEB(0, 15, 0, 16),
child: Text(
'请描述一下您的问题',
'请描述一下您的问题'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Colors.white,
@@ -1432,7 +1308,7 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
obscureText: false,
decoration: InputDecoration(
hintText: '问题描述100个字以内',
hintText: '问题描述100个字以内'.tr,
labelStyle: TextStyle(
fontFamily: 'Readex Pro',
fontSize: AppFontsize
@@ -1530,13 +1406,12 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
padding: EdgeInsetsDirectional.fromSTEB(
0, 48.rpx, 0, 48.rpx),
child: Text(
'联系方式',
'联系方式'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Colors.white,
fontSize: 30.rpx,
letterSpacing: 0,
),
),
),
@@ -1592,7 +1467,7 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
MainAxisSize.max,
children: [
Text(
'联系人',
'联系人'.tr,
style: TextStyle(
fontFamily:
'Readex Pro',
@@ -1756,7 +1631,7 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
MainAxisSize.max,
children: [
Text(
'手机号码',
'手机号码'.tr,
style: TextStyle(
fontFamily:
'Readex Pro',
@@ -1807,6 +1682,8 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
letterSpacing:
0,
),
// hintText:
// "请输入手机号".tr,
hintStyle:
TextStyle(
fontFamily:
@@ -1932,7 +1809,7 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
},
"device": [
{
"mac": controller.model.device_id,
"mac".tr: controller.model.device_id,
"desc": controller.model.desc,
"img": controller.model.issue_img,
"category": controller.model.device_category,
@@ -1942,7 +1819,7 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
],
};
ApiResponse apiResponse = await requestWithLog(
logTitle: "提交报修信息",
logTitle: "提交报修信息".tr,
method: MyHttpMethod.post,
queryUrl: queryUrl,
data: data,
@@ -1979,7 +1856,7 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
borderRadius: BorderRadius.circular(6),
),
child: Text(
"提交申请",
"提交申请".tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: stringToColor("#011D33"),
@@ -2016,53 +1893,52 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
return images;
}
String checkRepairParam() {
String message = "";
if (controller.model.device_type == null ||
controller.model.device_series!.isEmpty) {
message = '请输入设备系列!';
message = '请输入设备系列!'.tr;
return message;
}
if (controller.model.device_category == null ||
controller.model.device_category!.isEmpty) {
message = '请输入设备型号!';
message = '请输入设备型号!'.tr;
return message;
}
if (controller.model.device_id == null ||
controller.model.device_id!.isEmpty) {
message = '请输入设备序列号id';
message = '请输入设备序列号id'.tr;
return message;
}
if (controller.model.apply_name == null ||
controller.model.apply_name!.isEmpty) {
message = '请输入姓名!';
message = '请输入姓名!'.tr;
return message;
}
RegExp nameRegExp = RegExp(r'^[\u4e00-\u9fa5]{2,4}$');
if (!nameRegExp.hasMatch(controller.model.apply_name!)) {
message = '姓名必须为2到4个汉字';
message = '姓名必须为2到4个汉字'.tr;
return message;
}
if (controller.model.tel == null || controller.model.tel!.isEmpty) {
message = '请输入手机号!';
message = '请输入手机号!'.tr;
return message;
}
if (!MyUtils.isValidPhoneNumber(controller.model.tel!)) {
message = '无效的手机号!';
message = '无效的手机号!'.tr;
return message;
}
if (controller.model.desc == null || controller.model.desc!.isEmpty) {
message = '请输入问题描述!';
message = '请输入问题描述!'.tr;
return message;
}
if (controller.model.issue_img == null ||
controller.model.issue_img!.isEmpty) {
message = '请至少上传一张问题图片!';
message = '请至少上传一张问题图片!'.tr;
return message;
}
return message;
@@ -2083,13 +1959,13 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
if (type == null) return '';
switch (type) {
case 1:
return '体征检测设备';
return '体征检测设备'.tr;
case 2:
return '智能床';
return '智能床'.tr;
case 3:
return '智能床垫';
return '智能床垫'.tr;
default:
return '未知设备';
return '未知设备'.tr;
}
}
}

View File

@@ -61,7 +61,7 @@ class _BluetoothPageState extends State<BluetoothPage> {
children: [
// 中间居中的标题
Text(
'设置',
'设置'.tr,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
@@ -94,7 +94,7 @@ class _BluetoothPageState extends State<BluetoothPage> {
alignment: Alignment.center,
children: [
Text(
obsData['name']?.toString() ?? '未命名',
obsData['name']?.toString() ?? '未命名'.tr,
style: TextStyle(
color: Colors.white,
fontSize: 40.rpx,
@@ -110,7 +110,7 @@ class _BluetoothPageState extends State<BluetoothPage> {
2 +
_calculateTextHalfWidth(
obsData['name']?.toString() ??
'未命名') +
'未命名'.tr) +
22.rpx,
top: 5.rpx,
child: ClickableContainer(
@@ -141,7 +141,7 @@ class _BluetoothPageState extends State<BluetoothPage> {
),
const SizedBox(height: 4),
Text(obsData['mac']?.toString() ?? '未命名',
Text(obsData['mac'.tr]?.toString() ?? '未命名'.tr,
style: TextStyle(
color: Colors.white70, fontSize: 26.rpx)),
@@ -165,8 +165,8 @@ class _BluetoothPageState extends State<BluetoothPage> {
//下面文字和颜色也根据上面变化
Text(
obsData['blueToothStatus'] == 2
? '已连接'
: '未连接',
? '已连接'.tr
: '未连接'.tr,
style: TextStyle(
color: obsData['blueToothStatus'] == 2
? Color(0xFF6BFDAC)
@@ -185,16 +185,16 @@ class _BluetoothPageState extends State<BluetoothPage> {
children: [
if (isBind) ...[
_buildMenuButton(
context, '详情', "/devicePeopleInfo",
context, '详情'.tr, "/devicePeopleInfo",
arguments: obsData),
_buildMenuButton(
context,
'人员资料',
'人员资料'.tr,
"/peopleInfoPage",
arguments: obsData,
),
_buildMenuButton(
context, '房间选择', "/roomPickerPage",
context, '房间选择'.tr, "/roomPickerPage",
arguments: obsData, onResult: (result) {
if (result != null && result is Map) {
final Map<String, dynamic> safeMap =
@@ -209,29 +209,29 @@ class _BluetoothPageState extends State<BluetoothPage> {
}),
_buildMenuButton(
context,
'设备校准',
'设备校准'.tr,
"/mhtCalibrationAfterPage",
arguments: obsData,
),
_buildMenuButton(
context, '体征传感器', "/vitalSignsSensorPage",
context, '体征传感器'.tr, "/vitalSignsSensorPage",
arguments: obsData),
_buildMenuButton(
context,
'WIFI配置',
'WIFI配置'.tr,
"/mhtWifiAfterPage",
arguments: obsData,
),
// _buildMenuButton(
// context, '睡眠习惯', "/sleepHabitPage"),
_buildMenuButton(
context, '分享设备', "/deviceSharePage",
context, '分享设备'.tr, "/deviceSharePage",
arguments: obsData),
],
if (!isBind) ...[
_buildMenuButton(
context,
obsData['bind_type'] == 1 ? '解绑' : '删除',
obsData['bind_type'] == 1 ? '解绑'.tr : '删除'.tr,
"",
onTap: () async {
// await deviceListController
@@ -255,7 +255,7 @@ class _BluetoothPageState extends State<BluetoothPage> {
// 解绑弹窗
showUnbindConfirmDialog(
context: context,
title: "是否进行解绑?",
title: "是否进行解绑?".tr,
onConfirm: () async {
await deviceListController
.unbindDevice(obsData);
@@ -288,7 +288,7 @@ class _BluetoothPageState extends State<BluetoothPage> {
// 删除弹窗
showDeleteDeviceConfirmDialog(
context: context,
title: "是否进行删除?",
title: "是否进行删除?".tr,
onConfirm: () async {
await deviceListController
.unbindDevice(
@@ -307,20 +307,20 @@ class _BluetoothPageState extends State<BluetoothPage> {
},
),
_buildMenuButton(
context, '详情', "/devicePeopleInfo",
context, '详情'.tr, "/devicePeopleInfo",
arguments: obsData),
],
if (isBind) ...[
_buildMenuButton(
context,
obsData['bind_type'] == 1 ? '解绑' : '删除',
obsData['bind_type'] == 1 ? '解绑'.tr : '删除'.tr,
"",
onTap: () {
if (obsData['bind_type'] == 1) {
// 解绑弹窗
showUnbindConfirmDialog(
context: context,
title: "是否进行解绑?",
title: "是否进行解绑?".tr,
onConfirm: () async {
await deviceListController
.unbindDevice(obsData);
@@ -353,7 +353,7 @@ class _BluetoothPageState extends State<BluetoothPage> {
// 删除弹窗
showDeleteDeviceConfirmDialog(
context: context,
title: "是否进行删除?",
title: "是否进行删除?".tr,
onConfirm: () async {
await deviceListController
.unbindDevice(

View File

@@ -54,7 +54,7 @@ class BookInfoPage extends GetView<BookInfoController> {
children: [
// 中间居中的标题
Text(
'我要预约',
'我要预约'.tr,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
@@ -141,7 +141,7 @@ class BookInfoPage extends GetView<BookInfoController> {
height: 136.rpx,
alignment: Alignment.centerLeft,
child: Text(
'体验日期',
'体验日期'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
fontSize: 30.rpx,
@@ -178,7 +178,7 @@ class BookInfoPage extends GetView<BookInfoController> {
MainAxisAlignment.spaceBetween,
children: [
Text(
'体验时段',
'体验时段'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
fontSize: 30.rpx,
@@ -210,7 +210,7 @@ class BookInfoPage extends GetView<BookInfoController> {
index;
controller.updateAll();
}, title: '请选择时间');
}, title: '请选择时间'.tr);
});
},
child: Container(
@@ -234,7 +234,7 @@ class BookInfoPage extends GetView<BookInfoController> {
.select_time_index !=
null
? "${controller.model.time_period?[controller.model.select_time_index!]?["timeStr"]}"
: '请选择时间',
: '请选择时间'.tr,
style: TextStyle(
fontFamily:
'Readex Pro',
@@ -279,7 +279,7 @@ class BookInfoPage extends GetView<BookInfoController> {
MainAxisAlignment.spaceBetween,
children: [
Text(
'体验人员',
'体验人员'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
fontSize: 30.rpx,
@@ -327,7 +327,7 @@ class BookInfoPage extends GetView<BookInfoController> {
.normal_text_size,
letterSpacing: 0,
),
hintText: '输入姓名',
hintText: '输入姓名'.tr,
hintStyle: TextStyle(
fontFamily: 'Readex Pro',
fontSize: AppFontsize
@@ -413,7 +413,7 @@ class BookInfoPage extends GetView<BookInfoController> {
MainAxisAlignment.spaceBetween,
children: [
Text(
'手机号',
'手机号'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
fontSize: 30.rpx,
@@ -462,7 +462,7 @@ class BookInfoPage extends GetView<BookInfoController> {
.normal_text_size,
letterSpacing: 0,
),
hintText: '输入手机号',
hintText: '输入手机号'.tr,
hintStyle: TextStyle(
fontFamily: 'Readex Pro',
fontSize: AppFontsize
@@ -660,7 +660,7 @@ class BookInfoPage extends GetView<BookInfoController> {
borderRadius: BorderRadius.circular(6),
),
child: Text(
"提交预约",
"提交预约".tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: stringToColor("#011D33"),

View File

@@ -11,12 +11,12 @@ class BookSuccessPage extends GetView {
Map data;
BookSuccessPage({required this.data});
final infoList = [
{"label": "预约编号:", "value": "54648614654646"},
{"label": "预约人员:", "value": "张大大"},
{"label": "手机号码:", "value": "139****5699"},
{"label": "体验时间:", "value": "2024-02-15 07:30"},
{"label": "预约门店:", "value": "SWES眠花糖杭州南星桥旗舰店"},
{"label": "门店地址:", "value": "浙江省杭州市上城区飞云江路45号一层"},
{"label": "预约编号:".tr, "value": "54648614654646"},
{"label": "预约人员:".tr, "value": "张大大".tr},
{"label": "手机号码:".tr, "value": "139****5699"},
{"label": "体验时间:".tr, "value": "2024-02-15 07:30"},
{"label": "预约门店:".tr, "value": "SWES眠花糖杭州南星桥旗舰店".tr},
{"label": "门店地址:".tr, "value": "浙江省杭州市上城区飞云江路45号一层".tr},
];
@override
@@ -53,7 +53,7 @@ class BookSuccessPage extends GetView {
children: [
// 中间居中的标题
Text(
'我要预约',
'我要预约'.tr,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
@@ -101,7 +101,7 @@ class BookSuccessPage extends GetView {
Align(
alignment: const AlignmentDirectional(0, 0),
child: Text(
'预约成功!',
'预约成功!'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
fontSize: 30.rpx,
@@ -174,7 +174,7 @@ class BookSuccessPage extends GetView {
child: Center(
// 保证文字居中
child: Text(
"关闭",
"关闭".tr,
style: TextStyle(
color: Color(0XFF011D33),
fontSize: 26.rpx,
@@ -199,7 +199,7 @@ class BookSuccessPage extends GetView {
child: Center(
// 保证文字居中
child: Text(
"我的预约",
"我的预约".tr,
style: TextStyle(
color: Color(0XFF011D33),
fontSize: 26.rpx,

View File

@@ -40,7 +40,7 @@ class DeletedAccountPage extends GetView {
children: [
// 中间居中的标题
Text(
'注销账号',
'注销账号'.tr,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
@@ -104,8 +104,8 @@ class DeletedAccountPage extends GetView {
color: Color(0XFF84F5FF),
),
),
const Text(
"注销智慧眠花糖账号",
Text(
"注销智慧眠花糖账号".tr,
style: TextStyle(
fontSize: 20, // 设置字体大小
color: Color(0xFFFFFFFF),
@@ -121,7 +121,7 @@ class DeletedAccountPage extends GetView {
children: [
RichText(
text: TextSpan(
text: "账号注销后,你将无法使用以下功能,",
text: "账号注销后,你将无法使用以下功能,".tr,
style: TextStyle(
fontSize: AppFontsize
.normal_text_size, // 设置字体大小
@@ -131,7 +131,7 @@ class DeletedAccountPage extends GetView {
children: [
TextSpan(
text:
"并且当前有绑定以及被分享的智能床、智能床垫等设备的账号不能注销",
"并且当前有绑定以及被分享的智能床、智能床垫等设备的账号不能注销".tr,
style: TextStyle(
fontSize: AppFontsize
.normal_text_size,
@@ -140,7 +140,7 @@ class DeletedAccountPage extends GetView {
),
),
TextSpan(
text: ",可先进行解绑后再进行注销操作。",
text: ",可先进行解绑后再进行注销操作。".tr,
style: TextStyle(
fontSize: AppFontsize
.normal_text_size,
@@ -154,7 +154,7 @@ class DeletedAccountPage extends GetView {
height: 24,
),
Text(
"无法控制智能床、智能床垫等设备",
"无法控制智能床、智能床垫等设备".tr,
style: TextStyle(
fontSize: AppFontsize
.title_size, // 设置字体大小
@@ -165,7 +165,7 @@ class DeletedAccountPage extends GetView {
height: 6,
),
Text(
"你将无法控制你的智能床、智能床垫等设备,以及与其相关的各种操作。",
"你将无法控制你的智能床、智能床垫等设备,以及与其相关的各种操作。".tr,
style: TextStyle(
fontSize: AppFontsize
.normal_text_size, // 设置字体大小
@@ -176,7 +176,7 @@ class DeletedAccountPage extends GetView {
height: 24,
),
Text(
"无法查询睡眠报告和体征数据",
"无法查询睡眠报告和体征数据".tr,
style: TextStyle(
fontSize: AppFontsize
.title_size, // 设置字体大小
@@ -187,7 +187,7 @@ class DeletedAccountPage extends GetView {
height: 6,
),
Text(
"注销账号后你将查询不到你以前的睡眠报告和实时数据。",
"注销账号后你将查询不到你以前的睡眠报告和实时数据。".tr,
style: TextStyle(
fontSize: AppFontsize
.normal_text_size, // 设置字体大小
@@ -198,7 +198,7 @@ class DeletedAccountPage extends GetView {
height: 24,
),
Text(
"无法使用的其他功能",
"无法使用的其他功能".tr,
style: TextStyle(
fontSize: AppFontsize
.title_size, // 设置字体大小
@@ -209,7 +209,7 @@ class DeletedAccountPage extends GetView {
height: 6,
),
Text(
"包含设备报修、门店体验预约等。",
"包含设备报修、门店体验预约等。".tr,
style: TextStyle(
fontSize: AppFontsize
.normal_text_size, // 设置字体大小
@@ -278,7 +278,7 @@ class DeletedAccountPage extends GetView {
// }
// });
},
text: '注销账号',
text: '注销账号'.tr,
options: FFButtonOptions(
height: 40,
padding: const EdgeInsetsDirectional.fromSTEB(

View File

@@ -47,7 +47,7 @@ class _DeviceComponentWidgetState extends State<DeviceComponentWidget> {
Widget build(BuildContext context) {
Map device = {
"name": widget.bleDevice.name,
"mac": widget.bleDevice.mac,
"mac".tr: widget.bleDevice.mac,
"rssi": widget.bleDevice.scanResult.rssi,
"bind": widget.bleDevice.bind,
};
@@ -74,7 +74,7 @@ class _DeviceComponentWidgetState extends State<DeviceComponentWidget> {
),
Obx(() {
if (blueteethBindController.currentDeviceMac.value ==
device['mac']) {
device['mac'.tr]) {
return SizedBox(
width: 24.rpx,
height: 24.rpx,
@@ -185,7 +185,7 @@ class _DeviceComponentWidgetState extends State<DeviceComponentWidget> {
blueteethBindController
.currentDeviceMac!.value.isNotEmpty) {
if (blueteethBindController.currentDeviceMac?.value !=
device['mac']) {
device['mac'.tr]) {
showConfirmDialog(
context, Container(), "其他设备正在绑定中,是否终止其他设备绑定?".tr,
onConfirm: () {
@@ -198,7 +198,7 @@ class _DeviceComponentWidgetState extends State<DeviceComponentWidget> {
}
blueteethBindController.currentDeviceMac?.value =
device['mac']!;
device['mac'.tr]!;
blueteethBindController.updateAll();
if (device['bind'] == true) {
@@ -294,7 +294,7 @@ class _DeviceComponentWidgetState extends State<DeviceComponentWidget> {
blueteethBindController.resumeScanning();
},
onCancel: () {
print('用户点击了取消');
print('用户点击了取消'.tr);
blueteethBindController.currentDeviceMac.value = "";
blueteethBindController.resumeScanning();
blueteethBindController.updateAll();
@@ -347,14 +347,14 @@ class _DeviceComponentWidgetState extends State<DeviceComponentWidget> {
String queryUrl = "${serviceAddress}${serviceName}${serviceApi}";
Map<String, dynamic> data = {
"type": type,
"mac": mac,
"mac".tr: mac,
"wifi": false,
"celibration": false,
"person_info": false,
"time": DateTime.now().millisecondsSinceEpoch,
};
requestWithLog(
logTitle: "更新用户绑定流程",
logTitle: "更新用户绑定流程".tr,
method: MyHttpMethod.put,
queryUrl: queryUrl,
data: data,
@@ -505,14 +505,14 @@ class _DeviceComponentWidgetState extends State<DeviceComponentWidget> {
await bledevice.connect();
var res2 = bledevice.isConnected;
if (!res2) {
edm.EasyDartModule.logger.error("蓝牙连接失败");
DailyLogUtils.printLog("蓝牙连接失败");
edm.EasyDartModule.logger.error("蓝牙连接失败".tr);
DailyLogUtils.printLog("蓝牙连接失败".tr);
TopSlideNotification.show(
context,
text: "蓝牙连接失败".tr,
textColor: themeController.currentColor.sc9,
);
throw Exception("蓝牙连接失败");
throw Exception("蓝牙连接失败".tr);
}
blueteethBindController.blueConnectFlag.value = 2;
blueteethBindController.currentDevice = bledevice;
@@ -525,11 +525,11 @@ class _DeviceComponentWidgetState extends State<DeviceComponentWidget> {
//智能床
macAddress = await getMacFromType2(bledevice, timeout);
} else {
throw Exception("不支持的设备类型");
throw Exception("不支持的设备类型".tr);
}
if (macAddress == null) {
throw Exception("未能获取到MAC地址");
throw Exception("未能获取到MAC地址".tr);
}
// device.macA = macAddress;
@@ -565,7 +565,7 @@ class _DeviceComponentWidgetState extends State<DeviceComponentWidget> {
}
await requestWithLog(
logTitle: "获取设备状态",
logTitle: "获取设备状态".tr,
method: MyHttpMethod.get,
queryUrl: queryUrl,
onSuccess: (res) {
@@ -578,11 +578,11 @@ class _DeviceComponentWidgetState extends State<DeviceComponentWidget> {
// 查找当前MAC对应的数据
String macKey = mac.replaceAll(':', '').toUpperCase();
for (var item in responseList) {
if (item['mac'].toString().toUpperCase() == macKey) {
if (item['mac'.tr].toString().toUpperCase() == macKey) {
// 更新 bleDevice 的状态
//如果传感器已经绑定 暂时不处理
// bleDevice.bind = item['bind'] ?? bleDevice.bind;
bleDevice.macA = item['mac'];
bleDevice.macA = item['mac'.tr];
if (item['bindMac'] != null &&
item['bindMac'].toString().isNotEmpty) {
bleDevice.macB = item['bindMac'];
@@ -634,10 +634,10 @@ class _DeviceComponentWidgetState extends State<DeviceComponentWidget> {
try {
final mac = await completer.future.timeout(timeout);
if (mac == null || mac.isEmpty) {
throw Exception("获取MAC失败");
throw Exception("获取MAC失败".tr);
}
if (mac == "000000000000") {
throw Exception("获取MAC失败");
throw Exception("获取MAC失败".tr);
}
await subscription.cancel();
return mac;
@@ -646,7 +646,7 @@ class _DeviceComponentWidgetState extends State<DeviceComponentWidget> {
if (attempt == maxRetries - 1) rethrow;
}
}
throw Exception("获取MAC超时");
throw Exception("获取MAC超时".tr);
}
Future<String> getMacFromType2(THapp bledevice, Duration timeout) async {
@@ -685,7 +685,7 @@ class _DeviceComponentWidgetState extends State<DeviceComponentWidget> {
ef.log("[获取设备 MAC]:失败:$e");
}
throw Exception("获取MAC超时");
throw Exception("获取MAC超时".tr);
}
}
@@ -705,18 +705,18 @@ String parseMacFromBleResponse(List<int> data) {
.join('');
return macAddress;
} else {
throw Exception("BLE返回数据格式不正确");
throw Exception("BLE返回数据格式不正确".tr);
}
}
String parseMacFromTH2Response(List<int> data) {
if (data.length < 17) {
throw Exception("数据长度不足无法解析MAC");
throw Exception("数据长度不足无法解析MAC".tr);
}
int status = data[8];
if (status != 0x03 && status != 0x04) {
throw Exception("未连接心率带");
throw Exception("未连接心率带".tr);
}
// 提取9~14字节的MAC地址

View File

@@ -77,7 +77,7 @@ class MHTBlueToothController extends GetControllerEx<MHTBlueToothModel> {
if (res.code == HttpStatusCodes.ok) {
updateAll();
} else {
safeShowNotification(res.msg ?? "获取设备状态异常");
safeShowNotification(res.msg ?? "获取设备状态异常".tr);
EasyDartModule.logger.info("获取设备状态异常: $res");
DailyLogUtils.writeLog("获取设备状态异常: $res");
}
@@ -89,13 +89,13 @@ class MHTBlueToothController extends GetControllerEx<MHTBlueToothModel> {
if (res.code == HttpStatusCodes.ok) {
updateAll();
} else {
safeShowNotification(res.msg ?? "获取设备状态异常");
safeShowNotification(res.msg ?? "获取设备状态异常".tr);
EasyDartModule.logger.info("获取设备状态异常: $res");
DailyLogUtils.writeLog("获取设备状态异常: $res");
}
}).catchError((e, stack) {
print("updateDeviceStatus 执行异常: $e\n$stack");
safeShowNotification("设备状态请求失败");
safeShowNotification("设备状态请求失败".tr);
EasyDartModule.logger.info("设备状态异常: $e");
DailyLogUtils.writeLog("设备状态异常: $e");
});
@@ -165,7 +165,7 @@ class MHTBlueToothController extends GetControllerEx<MHTBlueToothModel> {
// 新建一个 Map便于快速通过 mac 查找返回的设备状态
final Map<String, dynamic> responseMap = {
for (var item in responseList)
item['mac'].toString().toUpperCase(): item
item['mac'.tr].toString().toUpperCase(): item
};
// 遍历 blueRawData更新 bind 状态
@@ -214,7 +214,7 @@ class MHTBlueToothController extends GetControllerEx<MHTBlueToothModel> {
String queryUrl = "$serviceAddress$serviceName$serviceApi";
var data = {
"deviceType": model.deviceType,
"mac": bleDevice.mac,
"mac".tr: bleDevice.mac,
"macA": bleDevice.macA,
if (bleDevice.macB != null && bleDevice.macB!.isNotEmpty)
"macB": bleDevice.macB,
@@ -266,12 +266,12 @@ class MHTBlueToothController extends GetControllerEx<MHTBlueToothModel> {
String queryUrl = "${serviceAddress}${serviceName}${serviceApi}";
var data = {
"type": type,
"mac": sleepData['mac'],
"mac".tr: sleepData['mac'.tr],
"time": DateTime.now().millisecondsSinceEpoch,
"data": sleepData,
};
await requestWithLog(
logTitle: "更新睡眠习惯",
logTitle: "更新睡眠习惯".tr,
method: MyHttpMethod.put,
queryUrl: queryUrl,
data: data,
@@ -290,7 +290,7 @@ class MHTBlueToothController extends GetControllerEx<MHTBlueToothModel> {
Map<String, dynamic> result = {};
await requestWithLog(
logTitle: "更新睡眠习惯",
logTitle: "更新睡眠习惯".tr,
method: MyHttpMethod.get,
queryUrl: queryUrl,
onSuccess: (res) {
@@ -319,7 +319,7 @@ void safeShowNotification(String msg) {
textColor: themeController.currentColor.sc9,
);
} else {
print("TopSlideNotification 未显示context 不可用或未挂载");
print("TopSlideNotification 未显示context 不可用或未挂载".tr);
}
} catch (e, stack) {
// print("TopSlideNotification 显示异常: $e\n$stack");

View File

@@ -101,9 +101,9 @@ class DeviceInfoWidget extends GetView {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_buildInfoRow(
'设备ID',
'设备ID'.tr,
deviceListController
.model.deviceList[index]["mac"] ??
.model.deviceList[index]["mac".tr] ??
'',
valueColor: (deviceListController
.model.deviceList[index]
@@ -112,10 +112,10 @@ class DeviceInfoWidget extends GetView {
? Color(0xFF929699)
: null),
_buildInfoRow(
'房间',
'房间'.tr,
deviceListController.model
.deviceList[index]["roomName"] ??
'未分配房间',
'未分配房间'.tr,
valueColor: (deviceListController
.model.deviceList[index]
["status"]?["status"]) ==
@@ -123,13 +123,13 @@ class DeviceInfoWidget extends GetView {
? Color(0xFF929699)
: null),
_buildInfoRow(
'设备状态',
'设备状态'.tr,
(deviceListController
.model.deviceList[index]
["status"]?["status"]) ==
1
? '已绑定'
: '已绑定',
? '已绑定'.tr
: '已绑定'.tr,
valueColor: (deviceListController
.model.deviceList[index]
["status"]?["status"]) ==
@@ -165,7 +165,7 @@ class DeviceInfoWidget extends GetView {
DailyLogUtils.writeError("发生异常: $e");
}
},
text: '控制',
text: '控制'.tr,
options: FFButtonOptions(
color: Color(0XFF85F5FF),
textStyle: TextStyle(
@@ -245,7 +245,7 @@ class DeviceInfoWidget extends GetView {
children: [
if (device['bind_type'] == 1)
Text(
'已分享:',
'已分享:'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
fontSize: 21.rpx,
@@ -274,7 +274,7 @@ class DeviceInfoWidget extends GetView {
),
if (device['bind_type'] == 1)
Text(
'',
''.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
fontSize: 21.rpx,
@@ -284,7 +284,7 @@ class DeviceInfoWidget extends GetView {
),
if (device['bind_type'] == 2)
Text(
'来自',
'来自'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
fontSize: 21.rpx,
@@ -309,7 +309,7 @@ class DeviceInfoWidget extends GetView {
),
if (device['bind_type'] == 2)
Text(
'的分享',
'的分享'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
fontSize: 21.rpx,
@@ -359,7 +359,7 @@ class DeviceInfoWidget extends GetView {
),
SizedBox(width: 5),
Text(
'睡眠报告',
'睡眠报告'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Colors.white,

View File

@@ -67,7 +67,7 @@ class _MHTBindDeviceSuccessState extends State<MHTBindDeviceSuccess> {
children: [
/// 居中标题
Text(
'绑定成功.标题'.tr,
'标题'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: themeController.currentColor.sc3,
@@ -187,7 +187,7 @@ class _MHTBindDeviceSuccessState extends State<MHTBindDeviceSuccess> {
child: Align(
alignment: AlignmentDirectional(0, 0),
child: Text(
'绑定成功.绑定成功'.tr,
'绑定成功'.tr,
style: TextStyle(
fontFamily: 'Inter',
fontSize: 48.rpx,
@@ -206,7 +206,7 @@ class _MHTBindDeviceSuccessState extends State<MHTBindDeviceSuccess> {
child: Align(
alignment: AlignmentDirectional(0, 0),
child: Text(
'绑定成功.分享标题'.tr,
'分享标题'.tr,
style: TextStyle(
fontFamily: 'Inter',
fontSize: 30.rpx,
@@ -225,7 +225,7 @@ class _MHTBindDeviceSuccessState extends State<MHTBindDeviceSuccess> {
child: Align(
alignment: AlignmentDirectional(-1, 0),
child: Text(
'绑定成功.分享内容'.tr,
'分享内容'.tr,
style: TextStyle(
fontFamily: 'Inter',
fontSize: 26.rpx,
@@ -245,40 +245,9 @@ class _MHTBindDeviceSuccessState extends State<MHTBindDeviceSuccess> {
Map editeData;
BlueToothDataModel data =
blueteethBindController.shareDevice;
editeData = {"mac": data.mac};
editeData = {"mac".tr: data.mac};
Get.toNamed("/deviceSharePage", arguments: editeData);
// // TopSlideNotification.show(
// // context,
// // text: "功能开发中...",
// // );
// // return;
// PersonController personController = Get.find();
// String deviceID =
// personController.currentPersonId.value;
// BodyDeviceController bodyDeviceController =
// Get.find();
// await bodyDeviceController.getDeviceList();
// List deviceList =
// bodyDeviceController.deviceList.value;
// if (deviceList != null && deviceList.isNotEmpty) {
// // 查找第一个 _id 匹配的设备
// final matchedDevice = deviceList.firstWhere(
// (element) => element['_id'] == deviceID,
// orElse: () => null,
// );
// if (matchedDevice != null) {
// // 跳转并传入设备
// Get.toNamed("/deviceSharePage",
// arguments: matchedDevice);
// } else {
// print("未找到匹配的设备");
// }
// } else {
// print("设备列表为空");
// }
},
colors: AppConstants().mhtButtongradientColors,
gradientDirection: GradientDirection.vertical,
@@ -300,7 +269,7 @@ class _MHTBindDeviceSuccessState extends State<MHTBindDeviceSuccess> {
color: stringToColor("#003058"),
),
Text(
'绑定成功.立即分享'.tr,
'立即分享'.tr,
style: TextStyle(
color: stringToColor("#003058"),
fontFamily: 'Inter',
@@ -385,7 +354,7 @@ class _MHTBindDeviceSuccessState extends State<MHTBindDeviceSuccess> {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'绑定成功.返回'.tr,
'返回'.tr,
style: TextStyle(
color: stringToColor("#003058"),
fontFamily: 'Inter',

View File

@@ -110,7 +110,7 @@ class _MHTBindDeviceTypePageState extends State<MHTBindDeviceTypePage> {
// 使用 Obx 来监听 deviceTypeList 的变化
SizedBox(height: 26.rpx), // 开始的间隔
Text(
"选择类型",
"选择类型".tr,
style: TextStyle(color: Colors.white, fontSize: 30.rpx),
),
SizedBox(height: 32.rpx), // 开始的间隔

View File

@@ -626,7 +626,7 @@ class _MHTBlueteethDevicePageState extends State<MHTBlueteethDevicePage> {
padding: EdgeInsets.all(0),
keyword: mhtBlueToothController.search.value,
color: Colors.red,
hint: "检索设备",
hint: "检索设备".tr,
onChange: (d) {
mhtBlueToothController.search.value = d;
},

View File

@@ -648,7 +648,7 @@ class _MHTCalibrationPageCopyState extends State<MHTCalibrationPageCopy> {
// 发起校准请求
requestWithLog(
logTitle: "设备校准",
logTitle: "设备校准".tr,
method: MyHttpMethod.post,
queryUrl: queryUrl,
data: data,
@@ -711,7 +711,7 @@ class _MHTCalibrationPageCopyState extends State<MHTCalibrationPageCopy> {
// 发起校准请求
requestWithLog(
logTitle: "设备校准",
logTitle: "设备校准".tr,
method: MyHttpMethod.post,
queryUrl: queryUrl,
data: data,
@@ -863,7 +863,7 @@ class _MHTCalibrationPageCopyState extends State<MHTCalibrationPageCopy> {
String progressUrl = "$serviceAddress$progressApi?id=$cid";
requestWithLog(
logTitle: "设备校准进度",
logTitle: "设备校准进度".tr,
method: MyHttpMethod.get,
queryUrl: progressUrl,
onSuccess: (res) {
@@ -1022,21 +1022,21 @@ class _MHTCalibrationPageCopyState extends State<MHTCalibrationPageCopy> {
String queryUrl =
"${serviceAddress}${serviceName}${serviceApi}?type=${type}";
requestWithLog(
logTitle: "查询绑定流程",
logTitle: "查询绑定流程".tr,
method: MyHttpMethod.get,
queryUrl: queryUrl,
onSuccess: (res) {
print(res);
Map<String, dynamic> data = {
"type": type,
"mac": mac,
"mac".tr: mac,
"wifi": res.data['wifi'],
"celibration": true,
"person_info": false,
"time": DateTime.now().millisecondsSinceEpoch,
};
requestWithLog(
logTitle: "更新绑定流程",
logTitle: "更新绑定流程".tr,
method: MyHttpMethod.put,
queryUrl: queryUrl,
data: data,

View File

@@ -746,7 +746,7 @@ class _MHTCalibrationPageState extends State<MHTCalibrationPage> {
String progressUrl = "$serviceAddress$progressApi?id=$cid";
requestWithLog(
logTitle: "设备校准进度",
logTitle: "设备校准进度".tr,
method: MyHttpMethod.get,
queryUrl: progressUrl,
onSuccess: (res) {
@@ -908,7 +908,7 @@ class _MHTCalibrationPageState extends State<MHTCalibrationPage> {
}
// data['cancel'] = true;
requestWithLog(
logTitle: "设备校准",
logTitle: "设备校准".tr,
method: MyHttpMethod.post,
queryUrl: queryUrl,
data: data,
@@ -982,20 +982,20 @@ class _MHTCalibrationPageState extends State<MHTCalibrationPage> {
"${serviceAddress}${serviceName}${serviceApi}?type=${type}";
requestWithLog(
logTitle: "查询绑定流程",
logTitle: "查询绑定流程".tr,
method: MyHttpMethod.get,
queryUrl: queryUrl,
onSuccess: (res) {
Map<String, dynamic> data = {
"type": type,
"mac": mac,
"mac".tr: mac,
"wifi": res.data['wifi'],
"celibration": true,
"person_info": false,
"time": DateTime.now().millisecondsSinceEpoch,
};
requestWithLog(
logTitle: "更新绑定流程",
logTitle: "更新绑定流程".tr,
method: MyHttpMethod.put,
queryUrl: queryUrl,
data: data,

View File

@@ -753,7 +753,7 @@ class _MHTCalibrationAfterPageState extends State<MHTCalibrationAfterPage> {
String progressUrl = "$serviceAddress$progressApi?id=$cid";
requestWithLog(
logTitle: "设备校准进度",
logTitle: "设备校准进度".tr,
method: MyHttpMethod.get,
queryUrl: progressUrl,
onSuccess: (res) {
@@ -915,7 +915,7 @@ class _MHTCalibrationAfterPageState extends State<MHTCalibrationAfterPage> {
}
// data['cancel'] = true;
requestWithLog(
logTitle: "设备校准",
logTitle: "设备校准".tr,
method: MyHttpMethod.post,
queryUrl: queryUrl,
data: data,
@@ -989,20 +989,20 @@ class _MHTCalibrationAfterPageState extends State<MHTCalibrationAfterPage> {
"${serviceAddress}${serviceName}${serviceApi}?type=${type}";
requestWithLog(
logTitle: "查询绑定流程",
logTitle: "查询绑定流程".tr,
method: MyHttpMethod.get,
queryUrl: queryUrl,
onSuccess: (res) {
Map<String, dynamic> data = {
"type": type,
"mac": mac,
"mac".tr: mac,
"wifi": res.data['wifi'],
"celibration": true,
"person_info": false,
"time": DateTime.now().millisecondsSinceEpoch,
};
requestWithLog(
logTitle: "更新绑定流程",
logTitle: "更新绑定流程".tr,
method: MyHttpMethod.put,
queryUrl: queryUrl,
data: data,

View File

@@ -38,7 +38,7 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
//todo 初始化传感器id
// Initialize person A
peopleList.add({
'mac': device?.macA,
'mac'.tr: device?.macA,
'gender': 1,
'id': device!.macAID,
});
@@ -46,7 +46,7 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
// Initialize person B if exists
if (device?.macB != null && device!.macB!.isNotEmpty) {
peopleList.add({
'mac': device.macB,
'mac'.tr: device.macB,
'gender': 1,
'id': device!.macBID,
});
@@ -105,7 +105,7 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
try {
var body = {
'mac': personData['mac'],
'mac'.tr: personData['mac'.tr],
'name': personData['name'],
'gender': personData['gender'],
'height': personData['height'],
@@ -117,7 +117,7 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
'id': personData['id'],
};
await requestWithLog(
logTitle: "保存用户信息",
logTitle: "保存用户信息".tr,
method: MyHttpMethod.put,
queryUrl: queryUrl,
data: body,
@@ -171,7 +171,7 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
alignment: Alignment.center,
children: [
Text(
'人员资料',
'人员资料'.tr,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
@@ -192,7 +192,7 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
for (var person in peopleList) {
await _savePersonData(person, context);
}
TopSlideNotification.show(context, text: "保存成功");
TopSlideNotification.show(context, text: "保存成功".tr);
MHTHomeController mhtHomeController = Get.find();
mhtHomeController.getPersonList();
// Get.offNamed("/bindDeviceSuccess");
@@ -214,7 +214,7 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
height: 60.rpx,
alignment: Alignment.center,
child: Text(
"下一步",
"下一步".tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Color(0XFF011D33),
@@ -251,7 +251,9 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
top: index == 0 ? 30.rpx : 90.rpx,
bottom: 20.rpx),
child: Text(
"人员资料${index == 0 ? "A" : "B"}",
index == 0
? 'person_info_A'.tr
: 'person_info_B'.tr,
style: TextStyle(
color: Colors.white, fontSize: 30.rpx),
),
@@ -272,7 +274,7 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
MainAxisAlignment.spaceBetween,
children: [
Text(
'姓名',
'姓名'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Color(0xFF9EA4B7),
@@ -289,10 +291,10 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
style: TextStyle(
fontSize: 30.rpx,
color: Colors.white),
decoration: const InputDecoration(
decoration: InputDecoration(
fillColor: Colors.transparent,
filled: true,
hintText: "请输入姓名",
hintText: "请输入姓名".tr,
hintStyle: TextStyle(
color: Colors.white),
border: InputBorder.none,
@@ -323,12 +325,11 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
const Duration(milliseconds: 250),
() {
showOneSelectionDialog(context,
arr: ["", ""],
title: "选择性别".tr,
arr: ["".tr, "".tr],
checkIndex: peopleList[index]
['gender'] ==
""
? 0
: 1, checkChange: (sindex) {
['gender'],
checkChange: (sindex) {
setState(() {
peopleList[index]['gender'] =
sindex;
@@ -342,7 +343,7 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
MainAxisAlignment.spaceBetween,
children: [
Text(
'性别',
'性别'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Color(0xFF9EA4B7),
@@ -356,7 +357,7 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
Container(
width: 200.rpx,
child: Text(
'${peopleList[index]['gender'] == 1 ? '' : ''}',
'${peopleList[index]['gender'] == 1 ? ''.tr : ''.tr}',
textAlign: TextAlign.right,
style: TextStyle(
fontFamily: 'Readex Pro',
@@ -413,7 +414,7 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
MainAxisAlignment.spaceBetween,
children: [
Text(
'身高(cm)',
'身高(cm)'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Color(0xFF9EA4B7),
@@ -476,7 +477,7 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
MainAxisAlignment.spaceBetween,
children: [
Text(
'体重(kg)',
'体重(kg)'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Color(0xFF9EA4B7),
@@ -543,7 +544,7 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
MainAxisAlignment.spaceBetween,
children: [
Text(
'生日',
'生日'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Color(0xFF9EA4B7),
@@ -563,7 +564,7 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
? time_08_Formatter_pattern(
peopleList[index]
['birthday'],
"yyyy年MM月dd日")
"yyyy年MM月dd日".tr)
: '',
textAlign: TextAlign.right,
style: TextStyle(
@@ -622,7 +623,7 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
decoration: InputDecoration(
fillColor: Colors.transparent,
filled: true,
hintText: "请输入联系方式",
hintText: "请输入联系方式".tr,
hintStyle: TextStyle(
color: Colors.white),
border: InputBorder.none,

View File

@@ -587,7 +587,7 @@ class _MHTWifiPageState extends State<MHTWifiPage> {
TopSlideNotification
.show(
context,
text: "wifi页.配网成功".tr,
text: "配网成功".tr,
textColor:
themeController
.currentColor
@@ -597,7 +597,7 @@ class _MHTWifiPageState extends State<MHTWifiPage> {
TopSlideNotification
.show(
context,
text: "wifi页.配网失败".tr,
text: "配网失败".tr,
textColor:
themeController
.currentColor
@@ -607,7 +607,7 @@ class _MHTWifiPageState extends State<MHTWifiPage> {
} else {
TopSlideNotification.show(
context,
text: "wifi页.配网失败".tr,
text: "配网失败".tr,
textColor:
themeController
.currentColor
@@ -1078,21 +1078,21 @@ class _MHTWifiPageState extends State<MHTWifiPage> {
String queryUrl =
"${serviceAddress}${serviceName}${serviceApi}?type=${type}";
requestWithLog(
logTitle: "查询绑定流程",
logTitle: "查询绑定流程".tr,
method: MyHttpMethod.get,
queryUrl: queryUrl,
onSuccess: (res) {
print(res);
Map<String, dynamic> data = {
"type": type,
"mac": mac,
"mac".tr: mac,
"wifi": true,
"celibration": res.data['celibration'],
"person_info": res.data['person_info'],
"time": DateTime.now().millisecondsSinceEpoch,
};
requestWithLog(
logTitle: "更新绑定流程",
logTitle: "更新绑定流程".tr,
method: MyHttpMethod.put,
queryUrl: queryUrl,
data: data,
@@ -1108,7 +1108,7 @@ class _MHTWifiPageState extends State<MHTWifiPage> {
try {
THapp bledevice = THapp(device: widget.deviceInfo.scanResult.device);
await bledevice.disconnect();
DailyLogUtils.writeLog("关闭蓝牙连接成功");
DailyLogUtils.writeLog("关闭蓝牙连接成功".tr);
} catch (e) {
DailyLogUtils.writeError("关闭蓝牙连接失败: $e");
}

View File

@@ -560,7 +560,7 @@ class _MHTWifiAfterPageState extends State<MHTWifiAfterPage> {
TopSlideNotification
.show(
context,
text: "wifi页.配网成功".tr,
text: "配网成功".tr,
textColor:
themeController
.currentColor
@@ -570,7 +570,7 @@ class _MHTWifiAfterPageState extends State<MHTWifiAfterPage> {
TopSlideNotification
.show(
context,
text: "wifi页.配网失败".tr,
text: "配网失败".tr,
textColor:
themeController
.currentColor
@@ -580,7 +580,7 @@ class _MHTWifiAfterPageState extends State<MHTWifiAfterPage> {
} else {
TopSlideNotification.show(
context,
text: "wifi页.配网失败".tr,
text: "配网失败".tr,
textColor:
themeController
.currentColor
@@ -1051,21 +1051,21 @@ class _MHTWifiAfterPageState extends State<MHTWifiAfterPage> {
String queryUrl =
"${serviceAddress}${serviceName}${serviceApi}?type=${type}";
requestWithLog(
logTitle: "查询绑定流程",
logTitle: "查询绑定流程".tr,
method: MyHttpMethod.get,
queryUrl: queryUrl,
onSuccess: (res) {
print(res);
Map<String, dynamic> data = {
"type": type,
"mac": mac,
"mac".tr: mac,
"wifi": true,
"celibration": res.data['celibration'],
"person_info": res.data['person_info'],
"time": DateTime.now().millisecondsSinceEpoch,
};
requestWithLog(
logTitle: "更新绑定流程",
logTitle: "更新绑定流程".tr,
method: MyHttpMethod.put,
queryUrl: queryUrl,
data: data,
@@ -1081,7 +1081,7 @@ class _MHTWifiAfterPageState extends State<MHTWifiAfterPage> {
try {
THapp bledevice = THapp(device: widget.deviceInfo.scanResult.device);
await bledevice.disconnect();
DailyLogUtils.writeLog("关闭蓝牙连接成功");
DailyLogUtils.writeLog("关闭蓝牙连接成功".tr);
} catch (e) {
DailyLogUtils.writeError("关闭蓝牙连接失败: $e");
}

View File

@@ -61,7 +61,7 @@ class _DeviceListPageState extends State<DeviceListPage> {
children: [
// 中间居中的标题
Text(
'设备列表',
'设备列表'.tr,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
@@ -90,7 +90,7 @@ class _DeviceListPageState extends State<DeviceListPage> {
child: SearchWidget(
keyword: controller.model.keyword,
color: controller.model.color,
hint: "检索设备",
hint: "检索设备".tr,
onChange: (d) {
controller.model.keyword = d;
},

View File

@@ -1,13 +1,9 @@
import 'package:ef/ef.dart';
import 'package:flutter/material.dart';
import 'package:flutterflow_ui/flutterflow_ui.dart';
import 'package:vbvs_app/common/color/ServiceConstant.dart';
import 'package:vbvs_app/common/util/FitTool.dart';
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<PeopleInfoController> {
@@ -15,28 +11,59 @@ class DevicePeopleInfo extends GetView<PeopleInfoController> {
DevicePeopleInfo({required this.data});
PeopleInfoController controller = Get.put(PeopleInfoController());
getInfoRow(context, String str) {
return Container(
width: double.infinity,
height: 60.rpx,
decoration: BoxDecoration(),
alignment: Alignment.centerLeft,
child: Text(
'$str',
style: TextStyle(
fontFamily: 'Readex Pro',
color: Colors.white,
fontSize: 26.rpx,
letterSpacing: 0,
getInfoRow(context, String k, String str) {
return Row(
mainAxisSize: MainAxisSize.max,
children: [
Container(
constraints: BoxConstraints(
minWidth: 30.rpx,
maxWidth: 140.rpx,
minHeight: 62.rpx,
),
child: Align(
alignment: AlignmentDirectional(-1, 0),
child: Text(
overflow: TextOverflow.ellipsis,
maxLines: 2,
k,
style: TextStyle(
fontFamily: 'Inter',
fontSize: 26.rpx,
letterSpacing: 0.0,
color: Color(0xFF929699),
),
),
),
),
),
Container(
constraints: BoxConstraints(
minWidth: 30.rpx,
minHeight: 62.rpx,
),
child: Align(
alignment: AlignmentDirectional(-1, 0),
child: Text(
overflow: TextOverflow.ellipsis,
maxLines: 1,
str,
style: TextStyle(
fontFamily: 'Inter',
fontSize: 26.rpx,
letterSpacing: 0.0,
color: Colors.white,
),
),
),
)
].divide(SizedBox(width: 0.rpx)),
);
}
@override
Widget build(BuildContext context) {
WidgetsBinding.instance.addPostFrameCallback((_) {
controller.getPeoples(data['mac']);
controller.getPeoples(data['mac'.tr]);
});
return LayoutBuilder(
builder: (context, boxConstraints) => GestureDetector(
@@ -68,7 +95,7 @@ class DevicePeopleInfo extends GetView<PeopleInfoController> {
children: [
// 中间居中的标题
Text(
'详情',
'详情'.tr,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
@@ -123,7 +150,7 @@ class DevicePeopleInfo extends GetView<PeopleInfoController> {
Container(
alignment: Alignment.centerLeft,
child: Text(
'设备信息',
'设备信息'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Colors.white,
@@ -131,16 +158,17 @@ class DevicePeopleInfo extends GetView<PeopleInfoController> {
),
),
),
getInfoRow(
context, "名称:${data["name"] ?? "-"}"),
getInfoRow(
context, "房间:${data["roomName"] ?? "-"}"),
getInfoRow(context, "设备名称".tr,
"${data["name"] ?? "-"}"),
getInfoRow(context, "房间".tr,
"${data["roomName"] ?? "-"}"),
getInfoRow(
context,
"设备状态${data["status"]?["status"] == 1 ? "已绑定" : data["status"]?["status"] == 0 ? "已绑定" : "-"}",
"设备状态".tr,
"${data["status"]?["status"] == 1 ? "已绑定" : data["status"]?["status"] == 0 ? "已绑定" : "-"}",
),
getInfoRow(
context, "MAC${data["mac"] ?? "-"}"),
context, "MAC", "${data["mac"] ?? "-"}"),
],
),
)),
@@ -169,7 +197,9 @@ class DevicePeopleInfo extends GetView<PeopleInfoController> {
width: double.infinity,
alignment: Alignment.centerLeft,
child: Text(
'人员资料${index == 0 ? "A" : "B"}',
index == 0
? 'person_info_A'.tr
: 'person_info_B'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Colors.white,
@@ -178,18 +208,18 @@ class DevicePeopleInfo extends GetView<PeopleInfoController> {
),
),
),
getInfoRow(
context, "姓名:${person["name"] ?? "-"}"),
getInfoRow(context,
"性别:${person["gender"] == null ? "-" : (person["gender"] == 1 ? "" : "")}"),
getInfoRow(context,
"身高:${person["height"] == null ? "-" : "${person["height"]}cm"}"),
getInfoRow(context,
"体重:${person["weight"] == null ? "-" : "${person["weight"]}kg"}"),
getInfoRow(context,
"生日:${person["birthday"] == null ? "-" : time_08_Formatter_pattern(person["birthday"], "yyyy年MM月dd日")}"),
getInfoRow(context,
"联系方式:${person["contact"] ?? "-"}"),
getInfoRow(context, "姓名".tr,
"${person["name"] ?? "-"}"),
getInfoRow(context, "性别".tr,
"${person["gender"] == null ? "-" : (person["gender"] == 1 ? "" : "")}"),
getInfoRow(context, "身高".tr,
"${person["height"] == null ? "-" : "${person["height"]}cm"}"),
getInfoRow(context, "体重".tr,
"${person["weight"] == null ? "-" : "${person["weight"]}kg"}"),
getInfoRow(context, "生日".tr,
"${person["birthday"] == null ? "-" : time_08_Formatter_pattern(person["birthday"], "yyyy年MM月dd日")}"),
getInfoRow(context, "联系方式".tr,
"${person["contact"] ?? "-"}"),
],
),
);

View File

@@ -23,7 +23,7 @@ class ShareDeviceWidget extends GetView<MHDeviceShareController> {
final _phoneController = TextEditingController();
fetchData() async {
await controller.shareDeviceList(data["mac"]);
await controller.shareDeviceList(data["mac".tr]);
}
@override
@@ -56,7 +56,7 @@ class ShareDeviceWidget extends GetView<MHDeviceShareController> {
children: [
// 中间居中的标题
Text(
'分享设备',
'分享设备'.tr,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
@@ -105,7 +105,7 @@ class ShareDeviceWidget extends GetView<MHDeviceShareController> {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
'将以下设备分享给您的家人或朋友 ',
'将以下设备分享给您的家人或朋友'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Colors.white,
@@ -114,15 +114,29 @@ class ShareDeviceWidget extends GetView<MHDeviceShareController> {
height: 1,
),
),
Text(
'设备ID${data['mac']}',
style: TextStyle(
fontFamily: 'Readex Pro',
color: const Color(0xFF6BFDAC),
fontSize: 26.rpx,
letterSpacing: 0.0,
height: 1),
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"设备ID".tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: const Color(0xFF6BFDAC),
fontSize: 26.rpx,
letterSpacing: 0.0,
height: 1),
),
Text(
data['mac'],
style: TextStyle(
fontFamily: 'Readex Pro',
color: const Color(0xFF6BFDAC),
fontSize: 26.rpx,
letterSpacing: 0.0,
height: 1),
),
],
)
].divide(SizedBox(height: 65.rpx)),
),
Padding(
@@ -145,7 +159,7 @@ class ShareDeviceWidget extends GetView<MHDeviceShareController> {
controller: _phoneController,
textAlign: TextAlign.center,
decoration: InputDecoration(
hintText: '请输入对方手机号/邮箱号',
hintText: '请输入对方手机号/邮箱号'.tr,
hintStyle: TextStyle(
fontFamily: 'Readex Pro',
color: const Color(0xFF929699),
@@ -204,7 +218,7 @@ class ShareDeviceWidget extends GetView<MHDeviceShareController> {
),
),
child: Text(
'点击复制APP下载链接',
'点击复制APP下载链接'.tr,
style: TextStyle(
color: Color(0xFF85F5FF), // 蓝色文字
@@ -366,7 +380,7 @@ class ShareDeviceWidget extends GetView<MHDeviceShareController> {
//todo 1:验证用户是否存在 2发送邀请
ApiResponse apiResponse =
await controller
.shareDevice(data['mac']);
.shareDevice(data['mac'.tr]);
if (apiResponse.code ==
HttpStatusCodes.ok) {
TopSlideNotification.show(context,
@@ -464,7 +478,7 @@ class ShareDeviceWidget extends GetView<MHDeviceShareController> {
.entries
.map((e) => ShareUserWidget(
index: e.key,
mac: data['mac'],
mac: data['mac'.tr],
repairListController:
controller))
.toList() as List<Widget>)

File diff suppressed because it is too large Load Diff

View File

@@ -75,7 +75,7 @@ class _EditBedPageState extends State<EditBedPage> {
children: [
// 中间居中的标题
Text(
'智能设备名称',
'智能设备名称'.tr,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
@@ -103,9 +103,9 @@ class _EditBedPageState extends State<EditBedPage> {
if (editedData['name'] == null ||
editedData['name'] == '') {
if (device!.type == 2) {
editedData['name'] = '智能电动床';
editedData['name'] = '智能电动床'.tr;
} else {
editedData['name'] = '律动智能床垫';
editedData['name'] = '律动智能床垫'.tr;
}
}
String serviceAddress =
@@ -115,7 +115,7 @@ class _EditBedPageState extends State<EditBedPage> {
String queryUrl =
"$serviceAddress$serviceName$serviceApi";
await requestWithLog(
logTitle: "更新设备信息",
logTitle: "更新设备信息".tr,
method: MyHttpMethod.put,
queryUrl: queryUrl,
data: {
@@ -145,7 +145,7 @@ class _EditBedPageState extends State<EditBedPage> {
height: 60.rpx,
alignment: Alignment.center,
child: Text(
"下一步",
"下一步".tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Color(0XFF011D33),
@@ -201,7 +201,7 @@ class _EditBedPageState extends State<EditBedPage> {
textAlign: TextAlign.center,
maxLength: AppConstants().text_length,
decoration: InputDecoration(
hintText: "请输入设备的名称",
hintText: "请输入设备的名称".tr,
contentPadding:
const EdgeInsetsDirectional
.fromSTEB(10, 0, 10, 0),
@@ -282,13 +282,13 @@ class _EditBedPageState extends State<EditBedPage> {
if (editedData['name'] == null ||
editedData['name'] == '') {
if (editedData['device_type'] == 2) {
editedData['name'] = '智能电动床';
editedData['name'] = '智能电动床'.tr;
} else {
editedData['name'] = '律动智能床垫';
editedData['name'] = '律动智能床垫'.tr;
}
}
await requestWithLog(
logTitle: "更新设备信息",
logTitle: "更新设备信息".tr,
method: MyHttpMethod.put,
queryUrl: queryUrl,
data: {

View File

@@ -86,7 +86,7 @@ class _ExperienceStorePageState extends State<ExperienceStorePage> {
children: [
// 中间居中的标题
Text(
'预约体验',
'预约体验'.tr,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
@@ -135,7 +135,7 @@ class _ExperienceStorePageState extends State<ExperienceStorePage> {
child: SearchWidget(
keyword: controller.model.keyword,
color: controller.model.color,
hint: "请输入门店名称",
hint: "请输入门店名称".tr,
onChange: (d) {
controller.model.keyword = d;
},

View File

@@ -146,8 +146,8 @@ class ExperienceStoreWidget extends GetView {
child: Container(
width: MediaQuery.sizeOf(context).width * 0.105,
height: MediaQuery.sizeOf(context).height * 0.038,
constraints: const BoxConstraints(
minWidth: 50,
constraints: BoxConstraints(
minWidth: 150.rpx,
),
child: Row(
mainAxisSize: MainAxisSize.max,
@@ -166,7 +166,7 @@ class ExperienceStoreWidget extends GetView {
),
),
Text(
'咨询',
'咨询'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Colors.white,
@@ -185,10 +185,10 @@ class ExperienceStoreWidget extends GetView {
AppMapLocation.checkInstalledApps().then((d) {
if (AppMapLocation
.availableMapsToNames.isEmpty) {
showToast("未检测到导航软件");
showToast("未检测到导航软件".tr);
} else {
showOneSelectionDialog(context,
title: "选择地图",
title: "选择地图".tr,
arr: AppMapLocation.availableMapsToNames,
checkChange: (index) {
AppMapLocation.launchMap(
@@ -203,8 +203,8 @@ class ExperienceStoreWidget extends GetView {
child: Container(
width: MediaQuery.sizeOf(context).width * 0.105,
height: MediaQuery.sizeOf(context).height * 0.038,
constraints: const BoxConstraints(
minWidth: 50,
constraints: BoxConstraints(
minWidth: 150.rpx,
),
child: Row(
mainAxisSize: MainAxisSize.max,
@@ -223,7 +223,7 @@ class ExperienceStoreWidget extends GetView {
),
),
Text(
'导航',
'导航'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Colors.white,
@@ -255,7 +255,7 @@ class ExperienceStoreWidget extends GetView {
Get.toNamed("/bookInfoPage",
arguments: {"data": data});
},
text: '预约',
text: '预约'.tr,
options: FFButtonOptions(
padding: const EdgeInsetsDirectional.fromSTEB(
0, 0, 0, 0),
@@ -275,7 +275,7 @@ class ExperienceStoreWidget extends GetView {
),
),
),
].divide(const SizedBox(width: 26)),
].divide(SizedBox(width: 26.rpx)),
),
),
),

View File

@@ -41,7 +41,7 @@ class _HelpArticleState extends State<HelpArticle> {
children: [
// 中间居中的标题
Text(
'问题与帮助',
'问题与帮助'.tr,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,

View File

@@ -230,7 +230,7 @@ class MHTHomeController extends GetControllerEx<MHTHomeModel> {
}
}
final data = {
"mac": device['mac'],
"mac".tr: device['mac'.tr],
};
var response =
await EasyDartModule.dio.delete(queryUrl, data: jsonEncode(data));
@@ -251,8 +251,8 @@ class MHTHomeController extends GetControllerEx<MHTHomeModel> {
EasyDartModule.logger.info("解绑设备: $e");
DailyLogUtils.writeLog("解绑设备: $e");
} finally {
EasyDartModule.logger.info("用户操作:解绑设备");
DailyLogUtils.writeLog("用户操作:解绑设备");
EasyDartModule.logger.info("用户操作:解绑设备".tr);
DailyLogUtils.writeLog("用户操作:解绑设备".tr);
}
return ApiResponse(code: -1, msg: "未知错误".tr); // Default return statement
}
@@ -401,7 +401,7 @@ class MHTHomeController extends GetControllerEx<MHTHomeModel> {
// 初始URL
String queryUrl = "$serviceAddress$serviceName$serviceApi";
await requestWithLog(
logTitle: "请求人员信息列表",
logTitle: "请求人员信息列表".tr,
method: MyHttpMethod.get,
queryUrl: queryUrl,
onSuccess: (res) {
@@ -436,7 +436,7 @@ class MHTHomeController extends GetControllerEx<MHTHomeModel> {
}
await requestWithLog(
logTitle: "请求睡眠信息列表",
logTitle: "请求睡眠信息列表".tr,
method: MyHttpMethod.get,
queryUrl: queryUrl,
onSuccess: (res) {
@@ -504,7 +504,7 @@ class MHTHomeController extends GetControllerEx<MHTHomeModel> {
}
await requestWithLog(
logTitle: "请求睡眠信息列表",
logTitle: "请求睡眠信息列表".tr,
method: MyHttpMethod.get,
queryUrl: queryUrl,
onSuccess: (res) {
@@ -563,11 +563,11 @@ class MHTHomeController extends GetControllerEx<MHTHomeModel> {
var data = {
"type": type,
"duration": tmp['duration'],
"mac": tmp['mac'],
"mac".tr: tmp['mac'.tr],
"time": tmp['startTime'],
};
requestWithLog(
logTitle: "更新控制倒计时",
logTitle: "更新控制倒计时".tr,
method: MyHttpMethod.put,
queryUrl: queryUrl,
data: data,
@@ -585,11 +585,11 @@ class MHTHomeController extends GetControllerEx<MHTHomeModel> {
var data = {
"type": type,
"duration": 0,
"mac": tmp['mac'],
"mac".tr: tmp['mac'.tr],
"time": tmp['startTime'],
};
requestWithLog(
logTitle: "查询控制倒计时",
logTitle: "查询控制倒计时".tr,
method: MyHttpMethod.put,
queryUrl: queryUrl,
data: data,
@@ -608,7 +608,7 @@ class MHTHomeController extends GetControllerEx<MHTHomeModel> {
String queryUrl =
"${serviceAddress}${serviceName}${serviceApi}?type=$type";
await requestWithLog(
logTitle: "查询控制倒计时",
logTitle: "查询控制倒计时".tr,
method: MyHttpMethod.get,
queryUrl: queryUrl,
onSuccess: (res) {

View File

@@ -103,7 +103,7 @@ class _MhtSleepReportPageState extends State<MhtSleepReportPage> {
text: TextSpan(
children: [
TextSpan(
text: "请先",
text: "请先".tr,
style: TextStyle(
color: Colors.white,
fontSize: 30.rpx,
@@ -113,7 +113,7 @@ class _MhtSleepReportPageState extends State<MhtSleepReportPage> {
child: Stack(
children: [
Text(
"登录",
"登录".tr,
style: TextStyle(
color: stringToColor("#84F5FF"),
fontSize: 30.rpx,
@@ -132,7 +132,7 @@ class _MhtSleepReportPageState extends State<MhtSleepReportPage> {
),
),
TextSpan(
text: "后,再查看睡眠报告",
text: "后,再查看睡眠报告".tr,
style: TextStyle(
color: Colors.white,
fontSize: 30.rpx,
@@ -153,10 +153,10 @@ class _MhtSleepReportPageState extends State<MhtSleepReportPage> {
final list = deviceController.personnelList.value;
if (list.isNotEmpty) {
WidgetsBinding.instance.addPostFrameCallback((_) {
formFieldController.value = list[0]["mac"];
formFieldController.value = list[0]["mac".tr];
personInfo.value = list[0];
homeController.selectPerson.value = list[0];
homeController.selectDevcie.value = list[0]["mac"];
homeController.selectDevcie.value = list[0]["mac".tr];
deviceController
.getSleeps(formFieldController.value);
homeController.updateAll();
@@ -236,7 +236,7 @@ class _MhtSleepReportPageState extends State<MhtSleepReportPage> {
.personnelList.value
.map<String>((d) {
var s =
d["name"] ?? d["mac"];
d["name"] ?? d["mac".tr];
if (s == null) {
return "";
} else {
@@ -251,7 +251,7 @@ class _MhtSleepReportPageState extends State<MhtSleepReportPage> {
final selectedPerson =
list.firstWhere(
(element) =>
element['mac'] ==
element['mac'.tr] ==
val,
orElse: () => null,
);
@@ -342,7 +342,7 @@ class _MhtSleepReportPageState extends State<MhtSleepReportPage> {
data: {
"tag": "123",
'date': DateTime.now().millisecondsSinceEpoch,
'mac': homeController.selectDevcie.value,
'mac'.tr: homeController.selectDevcie.value,
'person': homeController.selectPerson.value,
'backgroundImg':
'assets/images/new_background.png',

View File

@@ -79,18 +79,18 @@ class _MhtSleepReportReturnPageState extends State<MhtSleepReportReturnPage> {
final list = deviceController.personnelList.value;
final filteredList = list
.where(
(p) => p['mac'] == macA || p['mac'] == macB)
(p) => p['mac'.tr] == macA || p['mac'.tr] == macB)
.toList();
// 默认只赋值一次
if (formFieldController.value == null &&
filteredList.isNotEmpty) {
final defaultMac = filteredList.first['mac'];
final defaultMac = filteredList.first['mac'.tr];
WidgetsBinding.instance.addPostFrameCallback((_) {
formFieldController.value = defaultMac;
final selectedPerson = filteredList.firstWhere(
(element) => element['mac'] == defaultMac,
(element) => element['mac'.tr] == defaultMac,
orElse: () => null,
);
homeController.selectPerson.value =
@@ -118,14 +118,14 @@ class _MhtSleepReportReturnPageState extends State<MhtSleepReportReturnPage> {
.map<String>((d) => "${d["mac"]}")
.toList(),
optionLabels: filteredList
.map<String>((d) => d["name"] ?? d["mac"])
.map<String>((d) => d["name"] ?? d["mac".tr])
.toList(),
onChanged: (val) {
WidgetsBinding.instance
.addPostFrameCallback((_) {
final selectedPerson =
filteredList.firstWhere(
(element) => element['mac'] == val,
(element) => element['mac'.tr] == val,
orElse: () => null,
);
homeController.selectPerson.value =
@@ -238,7 +238,7 @@ class _MhtSleepReportReturnPageState extends State<MhtSleepReportReturnPage> {
data: {
"tag": "444",
'date': DateTime.now().millisecondsSinceEpoch,
'mac': device['bind_mac_a'],
'mac'.tr: device['bind_mac_a'],
'person': homeController.selectPerson.value,
'backgroundImg': 'assets/images/new_background.png',
'arrow': false,
@@ -251,7 +251,7 @@ class _MhtSleepReportReturnPageState extends State<MhtSleepReportReturnPage> {
);
}
return Center(
child: Text('暂无数据', style: TextStyle(color: Colors.white)),
child: Text('暂无数据'.tr, style: TextStyle(color: Colors.white)),
);
},
),

View File

@@ -11,8 +11,6 @@ import 'package:vbvs_app/common/util/FitTool.dart';
import 'package:vbvs_app/common/util/MyUtils.dart';
import 'package:vbvs_app/component/NullDataComponentWidget.dart';
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
import 'package:vbvs_app/controller/main_bottom/global_controller.dart';
import 'package:vbvs_app/controller/user_info_controller.dart';
import 'package:vbvs_app/controller/weather/weather_controller.dart';
import 'package:vbvs_app/pages/mh_page/FloatingSvgIcon.dart';
@@ -34,7 +32,7 @@ class _NewHomePageState extends State<NewHomePage> {
var formFieldController = FormFieldController<String>(null);
var personInfo = {}.obs;
GlobalController gloablController = Get.find();
// GlobalController gloablController = Get.find();
WeatherModelController weatherModelController = Get.find();
// var selectedDayIndex = (6).obs;
StreamSubscription? _newVersionSubscription;
@@ -82,12 +80,12 @@ class _NewHomePageState extends State<NewHomePage> {
context: context,
builder: (context) {
return AlertDialog(
title: Text("发现新版本"),
title: Text("发现新版本".tr),
content: Text("新版本号:${pkg.version}"),
actions: [
TextButton(
onPressed: () => Navigator.of(context).pop(),
child: Text("知道了"),
child: Text("知道了".tr),
),
],
);
@@ -103,25 +101,25 @@ class _NewHomePageState extends State<NewHomePage> {
String v = "";
switch (i) {
case 1:
v = "周一";
v = "周一".tr;
break;
case 2:
v = "周二";
v = "周二".tr;
break;
case 3:
v = "周三";
v = "周三".tr;
break;
case 4:
v = "周四";
v = "周四".tr;
break;
case 5:
v = "周五";
v = "周五".tr;
break;
case 6:
v = "周六";
v = "周六".tr;
break;
case 7:
v = "周日";
v = "周日".tr;
break;
}
return v;
@@ -308,63 +306,6 @@ class _NewHomePageState extends State<NewHomePage> {
Obx(() {
if (userInfoController.model.login! == null ||
userInfoController.model.login! == 0) {
// return Padding(
// padding: EdgeInsetsDirectional.fromSTEB(
// 30.rpx, 0, 30.rpx, 80.rpx),
// child: ClickableContainer(
// backgroundColor: Colors.transparent,
// highlightColor: Colors.transparent,
// padding: EdgeInsets.all(0),
// onTap: () {
// if (userInfoController.model.login == null ||
// userInfoController.model.login == 0) {
// TopSlideNotification.show(context,
// text: "请先登录".tr,
// textColor: themeController.currentColor.sc9);
// Get.toNamed("/loginPage");
// } else {
// Get.toNamed("/mHTDeviceTypePage");
// }
// },
// child: Container(
// width: MediaQuery.sizeOf(context).width,
// height: 302.rpx,
// padding:
// EdgeInsets.only(top: 90.rpx, bottom: 80.rpx),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(borderRadius),
// border: Border.all(
// color: stringToColor("#85F5FF"), // 边框颜色
// width: 1.rpx, // 边框宽度
// ),
// ),
// child: Column(
// mainAxisSize: MainAxisSize.max,
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// SvgPicture.asset(
// 'assets/images/icon/add.svg',
// width: 42.rpx,
// height: 42.rpx,
// ),
// SizedBox(
// height: 32.rpx,
// ),
// Text(
// '添加一台新设备'.tr,
// style: TextStyle(
// color: stringToColor("#85F5FF"),
// fontSize:
// AppConstants().normal_text_fontSize,
// letterSpacing: 0,
// ),
// ),
// ],
// ),
// ),
// ),
// );
return Padding(
padding: EdgeInsetsDirectional.fromSTEB(
30.rpx, 0.rpx, 30.rpx, 100.rpx),
@@ -500,8 +441,8 @@ class _NewHomePageState extends State<NewHomePage> {
deviceController
.personnelList.value
.map<String>((d) {
var s =
d["name"] ?? d["mac"];
var s = d["name"] ??
d["mac"];
if (s == null) {
return "";
} else {
@@ -795,67 +736,6 @@ class _NewHomePageState extends State<NewHomePage> {
),
),
if (homeController.bindDeviceNum.value == 0)
// Padding(
// padding: EdgeInsetsDirectional.fromSTEB(
// 30.rpx, 0, 30.rpx, 80.rpx),
// child: ClickableContainer(
// backgroundColor: Colors.transparent,
// highlightColor: Colors.transparent,
// padding: EdgeInsets.all(0),
// onTap: () {
// if (userInfoController.model.login ==
// null ||
// userInfoController.model.login == 0) {
// TopSlideNotification.show(context,
// text: "请先登录".tr,
// textColor:
// themeController.currentColor.sc9);
// Get.toNamed("/loginPage");
// } else {
// Get.toNamed("/mHTDeviceTypePage");
// }
// },
// child: Container(
// width: MediaQuery.sizeOf(context).width,
// height: 302.rpx,
// padding: EdgeInsets.only(
// top: 90.rpx, bottom: 80.rpx),
// decoration: BoxDecoration(
// borderRadius:
// BorderRadius.circular(borderRadius),
// border: Border.all(
// color: stringToColor("#85F5FF"), // 边框颜色
// width: 1.rpx, // 边框宽度
// ),
// ),
// child: Column(
// mainAxisSize: MainAxisSize.max,
// mainAxisAlignment:
// MainAxisAlignment.center,
// children: [
// SvgPicture.asset(
// 'assets/images/icon/add.svg',
// width: 42.rpx,
// height: 42.rpx,
// ),
// SizedBox(
// height: 32.rpx,
// ),
// Text(
// '添加一台新设备'.tr,
// style: TextStyle(
// color: stringToColor("#85F5FF"),
// fontSize: AppConstants()
// .normal_text_fontSize,
// letterSpacing: 0,
// ),
// ),
// ],
// ),
// ),
// ),
// ),
Padding(
padding: EdgeInsetsDirectional.fromSTEB(
30.rpx, 0.rpx, 30.rpx, 100.rpx),

View File

@@ -55,7 +55,7 @@ class IssueListPage extends GetView<IssueListController> {
children: [
// 中间居中的标题
Text(
'问题与帮助',
'问题与帮助'.tr,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
@@ -95,7 +95,7 @@ class IssueListPage extends GetView<IssueListController> {
child: Align(
alignment: AlignmentDirectional(-1, 0),
child: Text(
'暂无内容!',
'暂无内容!'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Color(0xFF9EA4B7),

View File

@@ -55,7 +55,7 @@ class _MessageDetailPageState extends State<MessageDetailPage> {
children: [
// 中间居中的标题
Text(
'消息详情',
'消息详情'.tr,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
@@ -291,13 +291,13 @@ class _MessageDetailPageState extends State<MessageDetailPage> {
String getStatusText(int status) {
switch (status) {
case 1:
return '同意';
return '同意'.tr;
case 2:
return '已同意';
return '已同意'.tr;
case 3:
return '已过期';
return '已过期'.tr;
default:
return '未知状态';
return '未知状态'.tr;
}
}
}

View File

@@ -106,7 +106,7 @@ class _MessagePageState extends State<MessagePage> {
children: [
// 中间居中的标题
Text(
'消息中心',
'消息中心'.tr,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
@@ -233,7 +233,7 @@ class _MessagePageState extends State<MessagePage> {
)),
SizedBox(width: 14.rpx), // 加号和文字间距
Text(
'全部已读',
'全部已读'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Colors.white,

View File

@@ -79,7 +79,7 @@ class _MyExperiencePageState extends State<MyExperiencePage> {
children: [
// 中间居中的标题
Text(
'我的预约',
'我的预约'.tr,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,

View File

@@ -208,7 +208,7 @@ class MyExperienceWidget extends GetView {
),
),
Text(
'咨询',
'咨询'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
// color: Color(0xFF9EA4B7),
@@ -229,10 +229,10 @@ class MyExperienceWidget extends GetView {
.then((d) {
if (AppMapLocation
.availableMapsToNames.isEmpty) {
showToast("未检测到导航软件");
showToast("未检测到导航软件".tr);
} else {
showOneSelectionDialog(context,
title: "选择地图",
title: "选择地图".tr,
arr: AppMapLocation
.availableMapsToNames,
checkChange: (index) {
@@ -268,7 +268,7 @@ class MyExperienceWidget extends GetView {
),
),
Text(
'导航',
'导航'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
// color: Color(0xFF9EA4B7),
@@ -330,7 +330,7 @@ class MyExperienceWidget extends GetView {
.model.bookInfoList[index]
["status"] ==
2
? '取消预约'
? '取消预约'.tr
: bookExperienceListController
.model.bookInfoList[index]
["statusName"],

View File

@@ -290,36 +290,36 @@ class _MinePageState extends State<NewMinePage> {
child: Column(
children: [
_buildListTile('assets/img/icon/mydevice.svg',
"我的智能设备", "我绑定或关联的智能床,智能床垫等智能设备",
"我的智能设备".tr, "我绑定或关联的智能床,智能床垫等智能设备".tr,
showTopLine: true, path: "/deviceListPage"),
// _buildListTile('assets/img/icon/order.svg',
// '我的订单', '快捷查看我在网上的订单记录',
// path: ""),
_buildListTile('assets/img/icon/store.svg',
'门店体验', '如果想免费体验智能设备,可在此进行提前预约',
'门店体验'.tr, '如果想免费体验智能设备,可在此进行提前预约'.tr,
path: "/experienceStorePage"),
_buildListTile(
'assets/img/icon/repair.svg',
'设备报修',
'当您的智能设备需要报修时,可以通过该功能联系解决,',
'设备报修'.tr,
'当您的智能设备需要报修时,可以通过该功能联系解决,'.tr,
path: '/deviceRepairPage',
),
_buildListTile('assets/img/icon/mall.svg', '网上商城',
'最新的智能产品线上购买服务',
_buildListTile('assets/img/icon/mall.svg', '网上商城'.tr,
'最新的智能产品线上购买服务'.tr,
path: "", onTap: () {
JDLauncher.openShop(
"https://mall.jd.com/index-14587480.html");
}),
_buildListTile('assets/img/icon/address.svg',
'地址管理', '用于收货和报修时联系您',
'地址管理'.tr, '用于收货和报修时联系您'.tr,
path: "/addressListPage"),
_buildListTile('assets/img/icon/help.svg',
'问题与帮助', '常见的问题汇总,如:智能床连接流程、如何查看睡眠报告',
'问题与帮助'.tr, '常见的问题汇总,如:智能床连接流程、如何查看睡眠报告'.tr,
path: "/issueListpage"),
_buildListTile(
'assets/img/icon/customer_service.svg',
'在线客服',
'购买和使用智能床过程中,如果遇到疑问可与客服进行联系',
'在线客服'.tr,
'购买和使用智能床过程中,如果遇到疑问可与客服进行联系'.tr,
path: "",
onTap: () async {
UserInfoController userInfoController =
@@ -475,7 +475,7 @@ class _MinePageState extends State<NewMinePage> {
borderRadius: BorderRadius.circular(10.rpx)),
),
child:
Text('设置', style: TextStyle(fontSize: 26.rpx, color: Colors.white)),
Text('设置'.tr, style: TextStyle(fontSize: 26.rpx, color: Colors.white)),
),
);
}

View File

@@ -54,7 +54,7 @@ class _SettingPageState extends State<SettingPage> {
children: [
// 中间居中的标题
Text(
'设置',
'设置'.tr,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
@@ -117,7 +117,7 @@ class _SettingPageState extends State<SettingPage> {
Row(
mainAxisSize: MainAxisSize.max,
children: [
Text('修改密码',
Text('修改密码'.tr,
style: TextStyle(
fontSize: 30.rpx,
color: Colors.white,
@@ -164,7 +164,7 @@ class _SettingPageState extends State<SettingPage> {
padding: EdgeInsetsDirectional.fromSTEB(
0.rpx, 0.rpx, 0.rpx, 0.rpx),
onTap: () {
print('点击了容器');
print('点击了容器'.tr);
Get.toNamed("/aboutUsPage");
},
child: Container(
@@ -180,7 +180,7 @@ class _SettingPageState extends State<SettingPage> {
mainAxisSize: MainAxisSize.max,
children: [
Text(
'当前版本',
'当前版本'.tr,
style: TextStyle(
fontFamily: 'Inter',
color: Colors.white,
@@ -235,7 +235,7 @@ class _SettingPageState extends State<SettingPage> {
mainAxisSize: MainAxisSize.max,
children: [
Text(
'切换语言',
'切换语言'.tr,
style: TextStyle(
fontFamily: 'Inter',
color: Colors.white,
@@ -256,7 +256,7 @@ class _SettingPageState extends State<SettingPage> {
.selectLanguage
.value
?.language_name ??
'简体中文',
'简体中文'.tr,
style: TextStyle(
fontFamily: 'Inter',
color: Color(0xFFD9E3EB),
@@ -304,7 +304,7 @@ class _SettingPageState extends State<SettingPage> {
mainAxisSize: MainAxisSize.max,
children: [
Text(
'设置页.关于我们'.tr,
'关于我们'.tr,
style: TextStyle(
fontFamily: 'Inter',
color: Colors.white,
@@ -352,7 +352,7 @@ class _SettingPageState extends State<SettingPage> {
mainAxisSize: MainAxisSize.max,
children: [
Text(
'设置页.用户协议'.tr,
'用户协议'.tr,
style: TextStyle(
fontFamily: 'Inter',
color: Colors.white,
@@ -400,7 +400,7 @@ class _SettingPageState extends State<SettingPage> {
mainAxisSize: MainAxisSize.max,
children: [
Text(
'设置页.隐私协议'.tr,
'隐私协议'.tr,
style: TextStyle(
fontFamily: 'Inter',
color: Colors.white,
@@ -471,7 +471,7 @@ class _SettingPageState extends State<SettingPage> {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'设置页.退出登录'.tr,
'退出登录'.tr,
style: TextStyle(
color: Color(0xFF003058),
fontFamily: 'Inter',
@@ -516,7 +516,7 @@ class _SettingPageState extends State<SettingPage> {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'设置页.注销账号'.tr,
'注销账号'.tr,
style: TextStyle(
color: themeController.currentColor.sc9,
fontFamily: 'Inter',
@@ -571,7 +571,7 @@ class _SettingPageState extends State<SettingPage> {
AppConstants().ent_type == 1
? 'Copyright © 202-2025 嘉兴太和信息技术有限责任公司 版权所有'
.tr
: "Copyright © 202-2025 杭州欢睡科技有限公司 版权所有",
: "Copyright © 202-2025 杭州欢睡科技有限公司 版权所有".tr,
style: TextStyle(
color: themeController.currentColor.sc4,
fontFamily: 'Inter',

View File

@@ -89,7 +89,7 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
i < controller.model.peopleList.length;
i++) {
var d = controller.model.peopleList[i];
String prefix = "人员信息${i == 0 ? "A" : "B"}";
// String prefix = "人员信息${i == 0 ? "A" : "B"}";
if (d['height'] != null &&
d['height'].toString().isNotEmpty &&
@@ -211,17 +211,18 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(
left: 18.rpx,
top: index == 0 ? 30.rpx : 90.rpx,
bottom: 20.rpx),
child: Text(
"人员资料${index == 0 ? "A" : "B"}",
style: TextStyle(
color: Colors.white,
fontSize: 30.rpx),
),
),
margin: EdgeInsets.only(
left: 18.rpx,
top: index == 0 ? 30.rpx : 90.rpx,
bottom: 20.rpx),
child: Text(
index == 0
? 'person_info_A'.tr
: 'person_info_B'.tr,
style: TextStyle(
color: Colors.white,
fontSize: 30.rpx),
)),
Container(
child: Column(
children: [
@@ -242,7 +243,7 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
.spaceBetween,
children: [
Text(
'姓名',
'姓名'.tr,
style: TextStyle(
fontFamily:
'Readex Pro',
@@ -262,23 +263,20 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
fontSize: 30.rpx,
color:
Colors.white),
decoration:
const InputDecoration(
fillColor: Colors
.transparent,
filled: true,
hintText:
"请输入姓名",
hintStyle: TextStyle(
color: Colors
.white),
border:
InputBorder
.none,
contentPadding:
EdgeInsets
.all(
0)),
decoration: InputDecoration(
fillColor: Colors
.transparent,
filled: true,
hintText:
"请输入姓名".tr,
hintStyle: TextStyle(
color: Colors
.white),
border: InputBorder
.none,
contentPadding:
EdgeInsets.all(
0)),
onChanged: (value) {
controller.model
.peopleList[
@@ -321,7 +319,8 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
() {
showOneSelectionDialog(
context,
arr: ["", ""],
title: "选择性别".tr,
arr: ["".tr, "".tr],
checkIndex: controller
.model
.peopleList[
@@ -349,7 +348,7 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
.spaceBetween,
children: [
Text(
'性别',
'性别'.tr,
style: TextStyle(
fontFamily:
'Readex Pro',
@@ -371,8 +370,8 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
[
'gender'] ==
0
? ''
: '',
? ''.tr
: ''.tr,
textAlign:
TextAlign
.right,
@@ -429,6 +428,7 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
milliseconds: 250), () {
showHeightPickerDialog(
context,
title: "选择身高".tr,
initialHeight:
initialHeight,
onConfirm:
@@ -459,7 +459,7 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
.spaceBetween,
children: [
Text(
'身高(cm)',
'身高(cm)'.tr,
style: TextStyle(
fontFamily:
'Readex Pro',
@@ -515,6 +515,7 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
() {
showWeightPickerDialog(
context,
title: "选择体重".tr,
initialWeight: controller
.model
.peopleList[
@@ -547,7 +548,7 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
.spaceBetween,
children: [
Text(
'体重(kg)',
'体重(kg)'.tr,
style: TextStyle(
fontFamily:
'Readex Pro',
@@ -606,6 +607,7 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
() {
showDateSelectionDialog(
context,
title: "选择生日".tr,
checkDate: controller
.model
.peopleList[index]
@@ -642,7 +644,7 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
.spaceBetween,
children: [
Text(
'生日',
'生日'.tr,
style: TextStyle(
fontFamily:
'Readex Pro',
@@ -662,15 +664,14 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
minWidth:
200.rpx),
child: Text(
controller.model.peopleList[index]
[
'birthday'] !=
controller.model.peopleList[index]['birthday'] !=
null
? time_08_Formatter_pattern(
controller
.model
.peopleList[index]['birthday'],
"yyyy年MM月dd日")
controller.model.peopleList[index]
[
'birthday'],
"yyyy年MM月dd日"
.tr)
: '',
textAlign:
TextAlign
@@ -721,7 +722,7 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
.spaceBetween,
children: [
Text(
'联系方式',
'联系方式'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Color(0xFF9EA4B7),
@@ -746,7 +747,8 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
fillColor: Colors
.transparent,
filled: true,
hintText: "请输入联系方式",
hintText:
"请输入联系方式".tr,
hintStyle: TextStyle(
color:
Colors.white),
@@ -814,6 +816,7 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
Future<void> getPersonData() async {
PeopleInfoController peopleInfoController = Get.find();
await peopleInfoController.getPeoples(Get.arguments['mac']); // 控制器创建时立即执行
await peopleInfoController
.getPeoples(Get.arguments['mac'.tr]); // 控制器创建时立即执行
}
}

View File

@@ -15,14 +15,15 @@ class PrivacyPolicyPage extends StatefulWidget {
class _PrivacyPolicyPageState extends State<PrivacyPolicyPage> {
PrivacyPdfController pdfController = Get.find();
// MHLanguageController languageController = Get.find();
@override
void initState() {
super.initState();
String language = "zh_CN"; // 默认语言
int ent_type = AppConstants().ent_type;
if (languageController.selectLanguage?.value?.language_code != null) {
language = languageController.selectLanguage!.value!.language_code!;
if (mhLanguageController.selectLanguage.value?.language_code != null) {
language = mhLanguageController.selectLanguage.value!.language_code!;
} // 根据 ent_type 拼接不同的文件名
String pdfName =
ent_type == 1 ? "$language.pdf" : "${language}_$ent_type.pdf";

View File

@@ -52,7 +52,7 @@ class RepairHistoryListPage extends GetView<RepairInfoController> {
children: [
// 中间居中的标题
Text(
'详情',
'详情'.tr,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
@@ -125,7 +125,7 @@ class RepairHistoryListPage extends GetView<RepairInfoController> {
const AlignmentDirectional(
-1, 0),
child: Text(
'系列' +
'系列:'.tr +
(data['device'][0]
['category'] ??
'-'),
@@ -143,7 +143,7 @@ class RepairHistoryListPage extends GetView<RepairInfoController> {
const AlignmentDirectional(
-1, 0),
child: Text(
'型号' +
'型号:'.tr +
(data['device'][0]
['series'] ??
'-'),
@@ -161,8 +161,9 @@ class RepairHistoryListPage extends GetView<RepairInfoController> {
const AlignmentDirectional(
-1, 0),
child: Text(
'序列号' +
(data['device'][0]['mac'] ??
'序列号:'.tr +
(data['device'][0]
['mac'.tr] ??
'-'),
style: TextStyle(
fontFamily: 'Readex Pro',
@@ -178,7 +179,8 @@ class RepairHistoryListPage extends GetView<RepairInfoController> {
const AlignmentDirectional(
-1, 0),
child: Text(
'报修单号' + (data['_id'] ?? '-'),
'报修单号:'.tr +
(data['_id'] ?? '-'),
style: TextStyle(
fontFamily: 'Readex Pro',
color:
@@ -193,7 +195,7 @@ class RepairHistoryListPage extends GetView<RepairInfoController> {
const AlignmentDirectional(
-1, 0),
child: Text(
'提交时间' +
'提交时间:'.tr +
(MyUtils
.timestampToDateString(
data[
@@ -212,10 +214,10 @@ class RepairHistoryListPage extends GetView<RepairInfoController> {
const AlignmentDirectional(
-1, 0),
child: Text(
'问题描述' +
'问题描述:'.tr +
(data['device'][0]
['desc'] ??
'未命名'),
'未命名'.tr),
style: TextStyle(
fontFamily: 'Readex Pro',
color:
@@ -278,7 +280,7 @@ class RepairHistoryListPage extends GetView<RepairInfoController> {
alignment:
AlignmentDirectional.centerStart, // 文字左对齐
child: Text(
'报修状态',
'报修状态'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Colors.white,
@@ -640,7 +642,7 @@ class RepairHistoryListPage extends GetView<RepairInfoController> {
)),
onWillPop: () async {
// 处理返回事件,比如弹出提示框等
print("页面返回事件");
print("页面返回事件".tr);
return true; // 返回 true 允许页面返回,返回 false 阻止页面返回
},
);

View File

@@ -71,7 +71,7 @@ class RepairHistoryWidget extends GetView<RepairInfoController> {
),
const SizedBox(height: 4),
Text(
"提交时间:" +
"提交时间:".tr +
(MyUtils.formatTimestamp(repairListController
.model.repairList[index]["create_time"]) ??
''),
@@ -116,19 +116,19 @@ class RepairHistoryWidget extends GetView<RepairInfoController> {
String getStatusText(dynamic status) {
switch (status?.toString()) {
case '1':
return '审核中';
return '审核中'.tr;
case '2':
return '审核通过';
return '审核通过'.tr;
case '3':
return '维修中';
return '维修中'.tr;
case '4':
return '维修完成';
return '维修完成'.tr;
case '5':
return '已完成';
return '已完成'.tr;
case '6':
return '已评价';
return '已评价'.tr;
default:
return '未知状态';
return '未知状态'.tr;
}
}
}

View File

@@ -66,7 +66,7 @@ class DeviceRepairPage extends GetView<RepairListController> {
children: [
// 中间居中的标题
Text(
'设备报修',
'设备报修'.tr,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
@@ -107,7 +107,7 @@ class DeviceRepairPage extends GetView<RepairListController> {
children: [
// 固定的标题部分
Text(
"报修须知",
"报修须知".tr,
style: TextStyle(
fontSize: 30.rpx,
fontWeight: FontWeight.bold,
@@ -128,7 +128,8 @@ class DeviceRepairPage extends GetView<RepairListController> {
children: [
TextSpan(
text:
"尊敬的用户感谢您选择我司产品。在使用过程中如果设备出现故障需要维修请首先确认设备是否正确连接控制器或网络检查设置是否正常排除误操作问题。若问题依然存在请记录下设备名称、设备编号、和具体故障内容方便我们快速地为您提供帮助。您可以通过智慧棉花糖APP保修页面直接报修或拨打 ",
"尊敬的用户感谢您选择我司产品。在使用过程中如果设备出现故障需要维修请首先确认设备是否正确连接控制器或网络检查设置是否正常排除误操作问题。若问题依然存在请记录下设备名称、设备编号、和具体故障内容方便我们快速地为您提供帮助。您可以通过智慧棉花糖APP保修页面直接报修或拨打 "
.tr,
style: TextStyle(
color: Color(0XFF929699),
fontSize: 26.rpx,
@@ -150,7 +151,7 @@ class DeviceRepairPage extends GetView<RepairListController> {
},
),
TextSpan(
text: " 反馈。",
text: " 反馈。".tr,
style: TextStyle(
color: Color(0XFF929699),
fontSize: 26.rpx,
@@ -186,7 +187,7 @@ class DeviceRepairPage extends GetView<RepairListController> {
borderRadius: BorderRadius.circular(6),
),
child: Text(
"我要报修",
"我要报修".tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: stringToColor("#011D33"),
@@ -200,7 +201,7 @@ class DeviceRepairPage extends GetView<RepairListController> {
// 报修历史标题
Container(
width: double.infinity,
child: Text("报修历史",
child: Text("报修历史".tr,
style: TextStyle(
color: Colors.white,
fontSize: 30.rpx,

View File

@@ -20,7 +20,7 @@ class RepairStatusWidget extends GetView {
MyUtils.timestampToDateString(data["create_time"]),
style: TextStyle(
fontFamily: 'Readex Pro',
fontSize: 21.rpx,
fontSize: 26.rpx,
letterSpacing: 0,
color: Colors.white,
// index ==
@@ -36,7 +36,7 @@ class RepairStatusWidget extends GetView {
mapStatusText(data['status']),
style: TextStyle(
fontFamily: 'Readex Pro',
fontSize: 26.rpx,
fontSize: 30.rpx,
letterSpacing: 0,
color: Colors.white,
// repairInfoController
@@ -85,19 +85,19 @@ class RepairStatusWidget extends GetView {
static String mapStatusText(int status) {
switch (status) {
case 1:
return '审核中';
return '审核中'.tr;
case 2:
return '亩核通过';
return '亩核通过'.tr;
case 3:
return '维修中';
return '维修中'.tr;
case 4:
return '维修完成';
return '维修完成'.tr;
case 5:
return '已完成';
return '已完成'.tr;
case 6:
return '已评价';
return '已评价'.tr;
default:
return '未知状态';
return '未知状态'.tr;
}
}
}

View File

@@ -38,7 +38,7 @@ class _RoomPickerPageState extends State<RoomPickerPage> {
String queryUrl = "$serviceAddress$serviceName$serviceApi";
await requestWithLog(
logTitle: '查询房间列表',
logTitle: '查询房间列表'.tr,
method: MyHttpMethod.get,
queryUrl: queryUrl,
onSuccess: (res) {
@@ -93,7 +93,7 @@ class _RoomPickerPageState extends State<RoomPickerPage> {
children: [
// 中间居中的标题
Text(
'房间选择',
'房间选择'.tr,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
@@ -125,7 +125,7 @@ class _RoomPickerPageState extends State<RoomPickerPage> {
String queryUrl =
"$serviceAddress$serviceName$serviceApi";
await requestWithLog(
logTitle: "更新设备信息",
logTitle: "更新设备信息".tr,
method: MyHttpMethod.put,
queryUrl: queryUrl,
data: {
@@ -163,7 +163,7 @@ class _RoomPickerPageState extends State<RoomPickerPage> {
height: 60.rpx,
alignment: Alignment.center,
child: Text(
"下一步",
"下一步".tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Color(0XFF011D33),
@@ -274,7 +274,7 @@ class _RoomPickerPageState extends State<RoomPickerPage> {
String queryUrl =
"$serviceAddress$serviceName$serviceApi";
await requestWithLog(
logTitle: "更新设备信息",
logTitle: "更新设备信息".tr,
method: MyHttpMethod.put,
queryUrl: queryUrl,
data: {

View File

@@ -244,31 +244,31 @@ class ScorePage extends GetView<mh.ScoreController> {
String scoreText;
Color scoreColor;
if (controller.model.score == 1) {
scoreText = '';
scoreText = ''.tr;
scoreColor =
stringToColor("#E55E92");
} else if (controller.model.score ==
2) {
scoreText = '较差';
scoreText = '较差'.tr;
scoreColor =
stringToColor("#E55E92");
} else if (controller.model.score ==
3) {
scoreText = '一般';
scoreText = '一般'.tr;
scoreColor =
stringToColor("#07C160");
} else if (controller.model.score ==
4) {
scoreText = '优秀';
scoreText = '优秀'.tr;
scoreColor =
stringToColor("#F8AE00");
} else if (controller.model.score ==
5) {
scoreText = '完美';
scoreText = '完美'.tr;
scoreColor =
stringToColor("#F8AE00");
} else {
scoreText = '未评分'; // 如果没有评分显示默认文字
scoreText = '未评分'.tr; // 如果没有评分显示默认文字
scoreColor = Colors.grey; // 默认颜色
}
return Text(
@@ -289,7 +289,7 @@ class ScorePage extends GetView<mh.ScoreController> {
EdgeInsetsDirectional.fromSTEB(
0, 17, 0, 0),
child: Text(
'再多的溢美之词都比不上您真心的评价。我们愿付出200%的努力只为您100%的满意~感谢您的支持与厚爱!',
'再多的溢美之词都比不上您真心的评价。我们愿付出200%的努力只为您100%的满意~感谢您的支持与厚爱!'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
fontSize: 26.rpx,
@@ -409,7 +409,7 @@ class ScorePage extends GetView<mh.ScoreController> {
borderRadius: BorderRadius.circular(16.rpx),
),
child: Text(
"提交",
"提交".tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: stringToColor("#011D33"),

View File

@@ -68,13 +68,13 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
await queryPersonInfoByMac();
if (selectDevice != null &&
selectDevice.isNotEmpty &&
selectDevice['mac'] != null &&
(selectDevice['mac'] != args[0]['mac'])) {
selectDevice['mac'.tr] != null &&
(selectDevice['mac'.tr] != args[0]['mac'.tr])) {
lastSelectDevice = selectDevice;
}
edm.EasyDartModule.websocket.sendData(jsonEncode(
WebSocketMessage(path: "/smartbed/connect", type: 5, data: {
'mac': selectDevice['mac'],
'mac'.tr: selectDevice['mac'.tr],
})));
dealInstantData(selectDevice);
} catch (e) {
@@ -201,7 +201,7 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
"${serviceAddress}${serviceName}${serviceApi}?mac=${selectDevice['mac']}";
try {
final res = await requestWithLog(
logTitle: "查询设备绑定人员列表",
logTitle: "查询设备绑定人员列表".tr,
method: MyHttpMethod.get,
queryUrl: queryUrl,
onSuccess: (res) {
@@ -229,14 +229,14 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
} else if (data is Map<String, dynamic>) {
tmp = data; // 直接用
} else {
print("未知数据格式");
print("未知数据格式".tr);
}
if (tmp['data'] != null && tmp['data'] is Map) {
var newData = tmp['data'];
var mac = newData['mac'];
var mac = newData['mac'.tr];
if (mac != null) {
// 删除已有的同 mac 项
instantData.removeWhere((element) => element['mac'] == mac);
instantData.removeWhere((element) => element['mac'.tr] == mac);
// 添加新的数据
instantData.add(newData);
}
@@ -259,7 +259,7 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
bool success = ws.send({
"type": 2,
"path": "/vsbs/web/rt/marttress",
"data": {"mac": mac},
"data": {"mac".tr: mac},
});
if (success) {
ef.log("✅ 已取消监听:$mac");
@@ -282,7 +282,7 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
bool success = ws.send({
"type": 1,
"path": "/vsbs/web/rt/marttress",
"data": {"mac": mac},
"data": {"mac".tr: mac},
});
if (success) {
ef.log("✅ 开始监听新设备:$mac");
@@ -329,10 +329,12 @@ class WebviewTestView extends GetComponent<WebviewTestController> {
@override
WebviewTestController newinstance() {
if (ef.kvRoot.WebviewTestController == null) {
ef.kvRoot.WebviewTestController = WebviewTestController();
if (Get.isRegistered<WebviewTestController>() == false) {
Get.put<WebviewTestController>(ef.kvRoot.WebviewTestController);
WebviewTestController webviewTestController = Get.find();
webviewTestController.global=true;
return webviewTestController;
}
}
@@ -346,8 +348,8 @@ class WebviewTestView extends GetComponent<WebviewTestController> {
deviceController.getDeviceList().then((x) {
if (controller.web.jsbridge!.inited) {
//发送测试消息给webview
controller.web.jsbridge!.dart
.updateDeviceList(deviceController.deviceList.values);
// controller.web.jsbridge!.dart
// .updateDeviceList(deviceController.deviceList.values);
}
});
return Scaffold(
@@ -371,7 +373,7 @@ class WebviewTestView extends GetComponent<WebviewTestController> {
text: TextSpan(
children: [
TextSpan(
text: "请先",
text: "请先".tr,
style: TextStyle(
color: Colors.white,
fontSize: 30.rpx,
@@ -381,7 +383,7 @@ class WebviewTestView extends GetComponent<WebviewTestController> {
child: Stack(
children: [
Text(
"登录",
"登录".tr,
style: TextStyle(
color: stringToColor("#84F5FF"),
fontSize: 30.rpx,
@@ -400,7 +402,7 @@ class WebviewTestView extends GetComponent<WebviewTestController> {
),
),
TextSpan(
text: "后,再进行设备控制",
text: "后,再进行设备控制".tr,
style: TextStyle(
color: Colors.white,
fontSize: 30.rpx,

View File

@@ -147,7 +147,7 @@ class MHTLoginController extends GetControllerEx<LoginModel> {
String serviceApi = ServiceConstant.login;
String queryUrl = "${serviceAddress}${serviceName}${serviceApi}";
await requestWithLog(
logTitle: "用户登录",
logTitle: "用户登录".tr,
method: MyHttpMethod.post,
queryUrl: queryUrl,
data: data,
@@ -206,7 +206,7 @@ class MHTLoginController extends GetControllerEx<LoginModel> {
data['code'] = "mht";
await requestWithLog(
data: data,
logTitle: "发送验证码",
logTitle: "发送验证码".tr,
method: MyHttpMethod.post,
queryUrl: queryUrl,
onSuccess: (res) {
@@ -233,7 +233,7 @@ class MHTLoginController extends GetControllerEx<LoginModel> {
bool isWeChatInstalled = await fluwx.isWeChatInstalled;
debugPrint('is wechat installed: $isWeChatInstalled');
if (!isWeChatInstalled) {
showToast("请先安装微信APP再使用微信登录");
showToast("请先安装微信APP再使用微信登录".tr);
return;
}
}
@@ -266,7 +266,7 @@ class MHTLoginController extends GetControllerEx<LoginModel> {
"khCode": "mht",
};
ApiResponse apiResponse = await requestWithLog(
logTitle: "微信登录",
logTitle: "微信登录".tr,
method: MyHttpMethod.post,
queryUrl: queryUrl,
data: data);

View File

@@ -115,7 +115,7 @@ class MHTRegisterController extends GetControllerEx<RegisterModel> {
"verify": model.register_code!
};
await requestWithLog(
logTitle: "用户注册",
logTitle: "用户注册".tr,
method: MyHttpMethod.post,
queryUrl: queryUrl,
data: data,
@@ -154,7 +154,7 @@ class MHTRegisterController extends GetControllerEx<RegisterModel> {
'type':4,
};
await requestWithLog(
logTitle: "获取验证码",
logTitle: "获取验证码".tr,
method: MyHttpMethod.post,
queryUrl: queryUrl,
data: data,

View File

@@ -108,7 +108,7 @@ class UpdatePasswordController extends GetControllerEx<UpdatePasswordModel> {
"verify": model.code
};
await requestWithLog(
logTitle: "修改密码",
logTitle: "修改密码".tr,
method: MyHttpMethod.put,
queryUrl: queryUrl,
data: data,
@@ -146,7 +146,7 @@ class UpdatePasswordController extends GetControllerEx<UpdatePasswordModel> {
var data = {"userName": model.phone, "type": 3};
await requestWithLog(
data: data,
logTitle: "发送验证码",
logTitle: "发送验证码".tr,
method: MyHttpMethod.post,
queryUrl: queryUrl,
onSuccess: (res) {

View File

@@ -418,7 +418,7 @@ class FindPasswordPage extends GetView<FindPasswordController> {
fontSize: 26.rpx,
letterSpacing: 0,
),
hintText: '确认新密码',
hintText: '确认新密码'.tr,
hintStyle: TextStyle(
fontFamily: 'Readex Pro',
color: Color(0xFF929699),
@@ -527,7 +527,7 @@ class FindPasswordPage extends GetView<FindPasswordController> {
BorderRadius.circular(16.rpx),
),
child: Text(
"提交",
"提交".tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Color(0XFF003058),

View File

@@ -123,10 +123,10 @@ class MHTLoginPage extends GetView<MHTLoginController> {
Future.delayed(const Duration(milliseconds: 300), () {
String? isShowYingShiDialog = getStorage.read("isShowYingShiDialog");
if (isShowYingShiDialog == null || isShowYingShiDialog != "true") {
String btnName = "同意";
String cancelName = "取消";
String btnName = "同意".tr;
String cancelName = "取消".tr;
if (Platform.isAndroid) {
cancelName = "退出";
cancelName = "退出".tr;
}
}
});
@@ -696,7 +696,7 @@ class MHTLoginPage extends GetView<MHTLoginController> {
.normal_text_size,
letterSpacing: 0,
),
hintText: '请输入账号',
hintText: '请输入账号'.tr,
hintStyle: TextStyle(
fontFamily: 'Readex Pro',
color: Color(0xFFD2D2D2),
@@ -778,7 +778,7 @@ class MHTLoginPage extends GetView<MHTLoginController> {
.normal_text_size,
letterSpacing: 0,
),
hintText: '请输入密码',
hintText: '请输入密码'.tr,
hintStyle: TextStyle(
fontFamily:
'Readex Pro',
@@ -1082,7 +1082,7 @@ class MHTLoginPage extends GetView<MHTLoginController> {
.normal_text_size,
letterSpacing: 0,
),
hintText: '请输入验证码',
hintText: '请输入验证码'.tr,
hintStyle: TextStyle(
fontFamily:
'Readex Pro',
@@ -1198,7 +1198,7 @@ class MHTLoginPage extends GetView<MHTLoginController> {
.countdown
.value ==
0
? '获取验证码'
? '获取验证码'.tr
: '${countdownController.countdown.value}' +
''.tr,
style: TextStyle(
@@ -1700,7 +1700,7 @@ class MHTLoginPage extends GetView<MHTLoginController> {
TextSpan(
children: [
TextSpan(
text: "还没有账号? ".tr,
text: "还没有账号?".tr,
style: TextStyle(
color: Colors
.white, // 设置"还没有账号?"为白色
@@ -1731,7 +1731,7 @@ class MHTLoginPage extends GetView<MHTLoginController> {
"/findPasswordPage");
},
child: Text(
'找回密码 '.tr,
'找回密码'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: stringToColor(
@@ -1872,7 +1872,7 @@ class MHTLoginPage extends GetView<MHTLoginController> {
Align(
alignment: AlignmentDirectional(0, 0),
child: Text(
'合肥眠花糖家具有限责任公司版权所有',
'合肥眠花糖家具有限责任公司版权所有'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Color(0xFF9EA4B7),

View File

@@ -49,7 +49,7 @@ class RegisterPage extends GetView<MHTRegisterController> {
alignment: Alignment.center,
children: [
Text(
'用户注册',
'用户注册'.tr,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
@@ -191,7 +191,7 @@ class RegisterPage extends GetView<MHTRegisterController> {
.normal_text_size,
letterSpacing: 0,
),
hintText: '请输入密码',
hintText: '请输入密码'.tr,
hintStyle: TextStyle(
fontFamily:
'Readex Pro',
@@ -387,7 +387,7 @@ class RegisterPage extends GetView<MHTRegisterController> {
.normal_text_size,
letterSpacing: 0,
),
hintText: '请确认密码',
hintText: '请确认密码'.tr,
hintStyle: TextStyle(
fontFamily:
'Readex Pro',
@@ -680,7 +680,7 @@ class RegisterPage extends GetView<MHTRegisterController> {
.normal_text_size,
letterSpacing: 0,
),
hintText: '请输入验证码',
hintText: '请输入验证码'.tr,
hintStyle: TextStyle(
fontFamily: 'Readex Pro',
color: Color(0xFF929699),
@@ -786,7 +786,7 @@ class RegisterPage extends GetView<MHTRegisterController> {
.countdown
.value ==
0
? '获取验证码'
? '获取验证码'.tr
: '${countdownController.countdown.value}' +
''.tr,
style: TextStyle(

View File

@@ -23,7 +23,7 @@ class RxhxMht extends StatefulWidget {
class _RxhxMhtState extends State<RxhxMht> {
get controller => Get.find<SleepingHabitController>();
get bedController => Get.find<BedController>();
List location = ["床垫全局", "床垫左侧", "床垫右侧"];
List location = ["床垫全局".tr, "床垫左侧".tr, "床垫右侧".tr];
@override
void initState() {
@@ -175,7 +175,7 @@ class _RxhxMhtState extends State<RxhxMht> {
);
}
List weeks = ["周一", "周二", "周三", "周四", "周五", "周六", "周日"];
List weeks = ["周一".tr, "周二".tr, "周三".tr, "周四".tr, "周五".tr, "周六".tr, "周日".tr];
@override
Widget build(BuildContext context) {
@@ -204,7 +204,7 @@ class _RxhxMhtState extends State<RxhxMht> {
children: [
// 中间居中的标题
Text(
'柔性唤醒',
'柔性唤醒'.tr,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
@@ -242,7 +242,7 @@ class _RxhxMhtState extends State<RxhxMht> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'柔性唤醒功能',
'柔性唤醒功能'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Colors.white,
@@ -301,7 +301,7 @@ class _RxhxMhtState extends State<RxhxMht> {
onTap: () async {
showDayTimeSelectionDialog(context,
dayTimeArr: controller.model.rxhxWakeTime,
title: "唤醒时间", checkChange: (d) {
title: "唤醒时间".tr, checkChange: (d) {
controller.attr.update((getmodel) {
getmodel.model.rxhxWakeTime = [
int.parse("${d[0]}"),
@@ -321,7 +321,7 @@ class _RxhxMhtState extends State<RxhxMht> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'唤醒时间',
'唤醒时间'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Colors.white,
@@ -362,9 +362,9 @@ class _RxhxMhtState extends State<RxhxMht> {
onTap: () {
showOneSelectionDialog(
context,
arr: ['', ""],
arr: [''.tr, "".tr],
checkIndex: controller.model.rxhxIsAnMo ? 0 : 1,
title: "按摩",
title: "按摩".tr,
checkChange: (index) {
controller.attr.update((getmodel) {
getmodel.model.rxhxIsAnMo =
@@ -383,7 +383,7 @@ class _RxhxMhtState extends State<RxhxMht> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'按摩',
'按摩'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Colors.white,
@@ -395,7 +395,7 @@ class _RxhxMhtState extends State<RxhxMht> {
mainAxisSize: MainAxisSize.max,
children: [
Text(
controller.model.rxhxIsAnMo ? '' : '',
controller.model.rxhxIsAnMo ? ''.tr : ''.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Colors.white,
@@ -425,7 +425,7 @@ class _RxhxMhtState extends State<RxhxMht> {
context,
arr: location,
checkIndex: controller.model.rxhxLocation,
title: "唤醒部位",
title: "唤醒部位".tr,
checkChange: (index) {
controller.attr.update((getmodel) {
getmodel.model.rxhxLocation = index;
@@ -443,7 +443,7 @@ class _RxhxMhtState extends State<RxhxMht> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'唤醒部位',
'唤醒部位'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Colors.white,
@@ -493,7 +493,7 @@ class _RxhxMhtState extends State<RxhxMht> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'自定义',
'自定义'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Colors.white,
@@ -622,7 +622,7 @@ class _RxhxMhtState extends State<RxhxMht> {
width: double.infinity,
decoration: const BoxDecoration(),
child: Text(
'*注:开启该功能后,在设置的时间点,设备将启动一段固定时长的柔性唤醒功能。',
'*注:开启该功能后,在设置的时间点,设备将启动一段固定时长的柔性唤醒功能。'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Color(0xFF929699),
@@ -652,7 +652,7 @@ class _RxhxMhtState extends State<RxhxMht> {
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6),
),
child: Text("完成",
child: Text("完成".tr,
style: TextStyle(
color: const Color(0xFF003058),
fontSize: 26.rpx)),

View File

@@ -270,7 +270,7 @@ class UpdatePasswordPage extends GetView<UpdatePasswordController> {
AlignmentDirectional(
-1, 0),
child: Text(
'输入验证码',
'输入验证码'.tr,
style: TextStyle(
fontFamily:
'Readex Pro',
@@ -346,7 +346,8 @@ class UpdatePasswordPage extends GetView<UpdatePasswordController> {
0,
),
hintText:
'请输验证码',
'请输验证码'
.tr,
hintStyle:
TextStyle(
fontFamily:
@@ -465,7 +466,7 @@ class UpdatePasswordPage extends GetView<UpdatePasswordController> {
Text(
countdownController.countdown.value ==
0
? '获取验证码'
? '获取验证码'.tr
: '${countdownController.countdown.value}',
style:
TextStyle(
@@ -497,15 +498,16 @@ class UpdatePasswordPage extends GetView<UpdatePasswordController> {
children: [
Container(
constraints: BoxConstraints(
minWidth:
158.rpx, // 设置最小宽度为 100
),
minWidth: 158.rpx,
maxWidth:
158.rpx // 设置最小宽度为 100
),
child: Align(
alignment:
AlignmentDirectional(
-1, 0),
child: Text(
'输入新密码',
'输入新密码'.tr,
style: TextStyle(
fontFamily:
'Readex Pro',
@@ -661,15 +663,17 @@ class UpdatePasswordPage extends GetView<UpdatePasswordController> {
children: [
Container(
constraints: BoxConstraints(
minWidth:
158.rpx, // 设置最小宽度为 100
),
minWidth: 158.rpx,
maxWidth:
158.rpx // 设置最小宽度为 100
),
child: Align(
alignment:
AlignmentDirectional(
-1, 0),
child: Text(
'确认新密码',
'确认新密码'.tr,
maxLines: 2,
style: TextStyle(
fontFamily:
'Readex Pro',

View File

@@ -21,8 +21,8 @@ class _UserAgreementPageState extends State<UserAgreementPage> {
super.initState();
String language = "zh_CN"; // 默认语言
if (languageController.selectLanguage?.value?.language_code != null) {
language = languageController.selectLanguage!.value!.language_code!;
if (mhLanguageController.selectLanguage?.value?.language_code != null) {
language = mhLanguageController.selectLanguage!.value!.language_code!;
}
int ent_type = AppConstants().ent_type;

View File

@@ -6,6 +6,7 @@ import 'package:vbvs_app/common/util/FitTool.dart';
import 'package:vbvs_app/common/util/MyUtils.dart';
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
import 'package:vbvs_app/component/tool/CustomCard.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/language/AppLanguage.dart';
import 'package:vbvs_app/pages/device_bind/componnet/FancyCircleCheckbox.dart';
@@ -18,7 +19,7 @@ class LanguageSetting extends StatefulWidget {
}
class _LanguageSettingState extends State<LanguageSetting> {
LanguageController languageController = Get.find();
MHLanguageController languageController = Get.find();
@override
void initState() {
// languageController.initLanuageList();

View File

@@ -115,28 +115,28 @@ class _HeartChangeWidgetState extends State<HeartChangeWidget> {
DataShowWidget(
alignment: MainAxisAlignment.center,
widget1: Text(
"名称",
"名称".tr,
style: TextStyle(
color: themeController.currentColor.sc4,
fontSize: AppConstants().normal_text_fontSize,
),
),
widget2: Text(
"测量值",
"测量值".tr,
style: TextStyle(
color: themeController.currentColor.sc4,
fontSize: AppConstants().normal_text_fontSize,
),
),
widget3: Text(
"参考范围",
"参考范围".tr,
style: TextStyle(
color: themeController.currentColor.sc4,
fontSize: AppConstants().normal_text_fontSize,
),
),
widget4: Text(
"趋势",
"趋势".tr,
style: TextStyle(
color: themeController.currentColor.sc4,
fontSize: AppConstants().normal_text_fontSize,

View File

@@ -1,4 +1,5 @@
import 'package:ef/base/chart/drawer.dart';
import 'package:ef/ef.dart';
import 'package:flutter/material.dart';
import 'package:vbvs_app/common/util/FitTool.dart';
import 'package:vbvs_app/pages/mh_page/component/easychart.dart';
@@ -19,11 +20,11 @@ Widget MonthDataWidget(
return [
AvgSleepScoreWidget(
sleepReport: sleepReport,
mediumLabel: "本月平均分",
mediumLabel: "本月平均分".tr,
), //睡眠评分
SleepChartContainer(
title: "每日得分",
tipText: "用户本月睡眠分数的汇总。",
title: "每日得分".tr,
tipText: "用户本月睡眠分数的汇总。".tr,
sleepReport: sleepReport,
chartContent: LineView(
xLabels: [
@@ -75,7 +76,7 @@ Widget MonthDataWidget(
},
),
],
tips: buildValueTexts(sleepReport['scoreList']['data'], '', 1),
tips: buildValueTexts(sleepReport['scoreList']['data'], ''.tr, 1),
xCount: buildMonthlyChartData(sleepReport['scoreList'])['daysInMonth']
.toInt(),
yCount: sleepReport['scoreList']['yLable'].length,
@@ -92,9 +93,9 @@ Widget MonthDataWidget(
highlightItem: data['itemName'],
),
IndicatorCompareCard(
title: "与上月对比",
headers: ["名称", "上月", "本月", "参考范围"],
tooltip: "睡眠分数与上月分数进行对比,是通过量化分析近期睡眠质量变化,可了解自身睡眠状态的波动情况,进而调整用户的作息习惯。",
title: "与上月对比".tr,
headers: ["名称".tr, "上月".tr, "本月".tr, "参考范围".tr],
tooltip: "睡眠分数与上月分数进行对比,是通过量化分析近期睡眠质量变化,可了解自身睡眠状态的波动情况,进而调整用户的作息习惯。".tr,
rows: (sleepReport['cwl'] ?? []).map<List<Widget>>((item) {
return [
Text(
@@ -120,8 +121,8 @@ Widget MonthDataWidget(
}).toList(),
),
SleepChartContainer(
title: "本月睡眠时长",
tipText: "本月睡眠时长是指从月初到月末,用户每天实际睡眠的时间总和",
title: "本月睡眠时长".tr,
tipText: "本月睡眠时长是指从月初到月末,用户每天实际睡眠的时间总和".tr,
sleepReport: sleepReport,
chartContent: LineView(
xLabels: [
@@ -172,7 +173,14 @@ Widget MonthDataWidget(
},
),
],
tips: buildSleepValueTexts(sleepReport['csd']['data'], '小时', 1),
tips: buildSleepValueTexts(
sleepReport['csd']['data'],
'小时'.tr,
1,
sleepDurationLabel: 'sleep_duration'.tr,
deepSleepLabel: 'deep_sleep'.tr,
lightSleepLabel: 'light_sleep'.tr,
),
xCount: buildMonthlyChartData(sleepReport['scoreList'])['daysInMonth']
.toInt(),
yCount: sleepReport['csd']['yLable'].length,
@@ -239,7 +247,8 @@ Widget MonthDataWidget(
},
),
],
tips: buildValueTexts(sleepReport['dysp'][0]['value'], '入睡时间:', 0),
tips:
buildValueTexts(sleepReport['dysp'][0]['value'], '入睡时间:'.tr, 0),
xCount:
buildMonthlyChartData(sleepReport['scoreList'])['daysInMonth']
.toInt(),
@@ -305,7 +314,8 @@ Widget MonthDataWidget(
},
),
],
tips: buildValueTexts(sleepReport['dysp'][1]['value'], '起床时间:', 0),
tips:
buildValueTexts(sleepReport['dysp'][1]['value'], '起床时间:'.tr, 0),
xCount:
buildMonthlyChartData(sleepReport['scoreList'])['daysInMonth']
.toInt(),
@@ -371,7 +381,7 @@ Widget MonthDataWidget(
},
),
],
tips: buildValueTexts(sleepReport['dysp'][2]['value'], '', 1),
tips: buildValueTexts(sleepReport['dysp'][2]['value'], ''.tr, 1),
xCount:
buildMonthlyChartData(sleepReport['scoreList'])['daysInMonth']
.toInt(),
@@ -437,7 +447,7 @@ Widget MonthDataWidget(
},
),
],
tips: buildValueTexts(sleepReport['dysp'][3]['value'], '毫秒', 1),
tips: buildValueTexts(sleepReport['dysp'][3]['value'], '毫秒'.tr, 1),
xCount:
buildMonthlyChartData(sleepReport['scoreList'])['daysInMonth']
.toInt(),
@@ -503,7 +513,7 @@ Widget MonthDataWidget(
},
),
],
tips: buildValueTexts(sleepReport['dysp'][4]['value'], '次/分', 1),
tips: buildValueTexts(sleepReport['dysp'][4]['value'], '次/分'.tr, 1),
xCount:
buildMonthlyChartData(sleepReport['scoreList'])['daysInMonth']
.toInt(),
@@ -561,10 +571,10 @@ List<String> buildValueTexts(
}
List<String> buildSleepValueTexts(
List<dynamic> data,
String unit,
int direction, // 0 左侧1 右侧
) {
List<dynamic> data, String unit, int direction, // 0 左侧1 右侧
{required String sleepDurationLabel,
required String deepSleepLabel,
required String lightSleepLabel}) {
if (data.isEmpty) return [];
return data.map((item) {
@@ -575,22 +585,13 @@ List<String> buildSleepValueTexts(
final prefix = direction == 1 ? '' : unit;
final suffix = direction == 1 ? unit : '';
// 格式化日期(不带时间)
String dateStr = '';
if (item['st'] != null) {
final dt = DateTime.fromMillisecondsSinceEpoch(item['st']);
dateStr =
"${dt.year}${dt.month.toString().padLeft(2, '0')}${dt.day.toString().padLeft(2, '0')}";
}
var lines = [
'$sleepDurationLabel$prefix$slt$suffix',
'$deepSleepLabel$prefix$dst$suffix',
'$lightSleepLabel$prefix$lst$suffix',
].join('\n');
var q = [
"睡眠时长:$prefix$slt$suffix",
"深睡:$prefix$dst$suffix",
"浅睡:$prefix$lst$suffix",
dateStr,
].join("\n");
print(q);
return q;
return lines;
}).toList();
}

View File

@@ -174,105 +174,7 @@ class _SleepScoreWidgetState extends State<SleepScoreWidget> {
],
)
// Row(
// mainAxisSize: MainAxisSize.max,
// children: [
// Container(
// decoration: BoxDecoration(),
// child: Column(
// mainAxisSize: MainAxisSize.max,
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Container(
// constraints: BoxConstraints(maxWidth: 150.rpx),
// child: Text(
// '30天平均分'.tr,
// style: TextStyle(
// color: Color(0xFFD3D3D3),
// fontSize: 26.rpx,
// letterSpacing: 0.0,
// ),
// maxLines: 1,
// ),
// ),
// Text(
// '${widget.sleepReport['score']?['avg']}',
// style: TextStyle(
// color: Colors.white,
// fontSize: 48.rpx,
// letterSpacing: 0.0,
// ),
// ),
// ].divide(SizedBox(height: 56.rpx)),
// ),
// ),
// Expanded(
// child: Container(
// decoration: BoxDecoration(),
// child: SegmentedCircleWithCenterWidget(
// // segments: [
// // SegmentData(color: Colors.red, value: 30),
// // SegmentData(color: Colors.green, value: 20),
// // SegmentData(color: Colors.blue, value: 40),
// // SegmentData(color: Colors.orange, value: 10),
// // ],
// segments: segments,
// strokeWidth: 8,
// gapAngle: 8,
// centerWidget: Container(
// child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Text(
// "睡眠评分".tr,
// style: TextStyle(
// color: stringToColor("#FFFFFF"),
// fontSize:
// AppConstants().normal_text_fontSize),
// ),
// Text(
// '${widget.sleepReport['score']?['score']}',
// style: TextStyle(
// color: stringToColor("#FF9F66"),
// fontSize: 100.rpx),
// ),
// ],
// ),
// ),
// trend: widget.sleepReport['score']?['trend'],
// ),
// ),
// ),
// Container(
// decoration: BoxDecoration(),
// child: Column(
// mainAxisSize: MainAxisSize.max,
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Text(
// '睡眠等级'.tr,
// style: TextStyle(
// color: Color(0xFFD3D3D3),
// fontSize: 26.rpx,
// letterSpacing: 0.0,
// ),
// ),
// Text(
// '${getSleepLevel(widget.sleepReport)}',
// style: TextStyle(
// color: stringToColor("#FF9F66"),
// fontSize: 48.rpx,
// letterSpacing: 0.0,
// ),
// ),
// ].divide(SizedBox(height: 56.rpx)),
// ),
// ),
// ].divide(SizedBox(
// width: 33.rpx,
// )),
// ),
),
SizedBox(height: 50.rpx),
Wrap(

View File

@@ -98,7 +98,7 @@ class _SleepViewWidgetState extends State<SleepViewWidget> {
context,
Container(
child: Text(
"睡眠规律性是指个体睡眠模式在时间、时长、环境等方面呈现出的稳定性和一致性,是衡量睡眠质量的重要指标之一。",
"睡眠规律性是指个体睡眠模式在时间、时长、环境等方面呈现出的稳定性和一致性,是衡量睡眠质量的重要指标之一。".tr,
style: TextStyle(
fontSize: 26.rpx,
color: themeController.currentColor.sc3,
@@ -194,7 +194,7 @@ class _SleepViewWidgetState extends State<SleepViewWidget> {
),
),
TextSpan(
text: "小时",
text: "小时".tr,
style: TextStyle(
color: themeController.currentColor.sc3,
fontSize:
@@ -210,7 +210,7 @@ class _SleepViewWidgetState extends State<SleepViewWidget> {
),
),
TextSpan(
text: "分钟",
text: "分钟".tr,
style: TextStyle(
color: themeController.currentColor.sc3,
fontSize:

View File

@@ -1,4 +1,5 @@
import 'package:ef/base/chart/drawer.dart';
import 'package:ef/ef.dart';
import 'package:flutter/material.dart';
import 'package:vbvs_app/common/util/FitTool.dart';
import 'package:vbvs_app/pages/mh_page/component/easychart.dart';
@@ -22,8 +23,8 @@ Widget WeekDataWidget(
sleepReport: sleepReport,
),
SleepChartContainer(
title: "每日得分",
tipText: "用户本周睡眠分数的汇总",
title: "每日得分".tr,
tipText: "用户本周睡眠分数的汇总".tr,
sleepReport: sleepReport,
chartContent: LineView(
xLabels: [
@@ -51,7 +52,15 @@ Widget WeekDataWidget(
min: 0, //最小值0
max: 7, //最大值30
q: 6, //labels第一个与最后一个的真实距离也就是30-1 = 29
labels: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
labels: [
'周一'.tr,
'周二'.tr,
'周三'.tr,
'周四'.tr,
'周五'.tr,
'周六'.tr,
'周日'.tr
],
indexs: [0, 1, 2, 3, 4, 5, 6], //每一个标签的对应在X轴的真实位置
offset: Offset(0, -50.rpx), //标签相对于原点的偏移下方60像素位置
ondrawer: (canvas, offset, index, label, align, style) {
@@ -105,9 +114,9 @@ Widget WeekDataWidget(
highlightItem: data['itemName'],
),
IndicatorCompareCard(
title: "与上周对比",
headers: ["名称", "上周", "本周", "参考范围"],
tooltip: "睡眠分数与上周分数进行对比,是通过量化分析近期睡眠质量变化,可了解自身睡眠状态的波动情况,进而调整用户的作息习惯。",
title: "与上周对比".tr,
headers: ["名称".tr, "上周".tr, "本周".tr, "参考范围".tr],
tooltip: "睡眠分数与上周分数进行对比,是通过量化分析近期睡眠质量变化,可了解自身睡眠状态的波动情况,进而调整用户的作息习惯。".tr,
rows: (sleepReport['cwl'] ?? []).map<List<Widget>>((item) {
return [
Text(
@@ -133,8 +142,8 @@ Widget WeekDataWidget(
}).toList(),
),
SleepChartContainer(
title: "本周睡眠时长",
tipText: "本周睡眠时长是指从周一到周日内,每天实际睡眠的时间总和。",
title: "本周睡眠时长".tr,
tipText: "本周睡眠时长是指从周一到周日内,每天实际睡眠的时间总和。".tr,
sleepReport: sleepReport,
chartContent: LineView(
xLabels: [
@@ -162,7 +171,15 @@ Widget WeekDataWidget(
min: 0, //最小值0
max: 7, //最大值30
q: 6, //labels第一个与最后一个的真实距离也就是30-1 = 29
labels: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
labels: [
'周一'.tr,
'周二'.tr,
'周三'.tr,
'周四'.tr,
'周五'.tr,
'周六'.tr,
'周日'.tr
],
indexs: [0, 1, 2, 3, 4, 5, 6], //每一个标签的对应在X轴的真实位置
offset: Offset(0, -50.rpx), //标签相对于原点的偏移下方60像素位置
ondrawer: (canvas, offset, index, label, align, style) {
@@ -204,7 +221,14 @@ Widget WeekDataWidget(
dualBarPoints: buildTripleBarData(sleepReport['csd']),
displayMode: ChartDisplayMode.dualBar,
xUnit: sleepReport['csd']['yUnit'],
tips: buildSleepValueTexts(sleepReport['csd']['data'], '小时', 1),
tips: buildSleepValueTexts(
sleepReport['csd']['data'],
'小时'.tr,
1,
sleepDurationLabel: 'sleep_duration'.tr,
deepSleepLabel: 'deep_sleep'.tr,
lightSleepLabel: 'light_sleep'.tr,
),
barWidth: 0.2,
),
showLabel: sleepReport['csd']['type'],
@@ -239,7 +263,15 @@ Widget WeekDataWidget(
min: 0, //最小值0
max: 7, //最大值30
q: 6, //labels第一个与最后一个的真实距离也就是30-1 = 29
labels: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
labels: [
'周一'.tr,
'周二'.tr,
'周三'.tr,
'周四'.tr,
'周五'.tr,
'周六'.tr,
'周日'.tr
],
indexs: [0, 1, 2, 3, 4, 5, 6], //每一个标签的对应在X轴的真实位置
offset: Offset(0, -50.rpx), //标签相对于原点的偏移下方60像素位置
ondrawer: (canvas, offset, index, label, align, style) {
@@ -277,7 +309,8 @@ Widget WeekDataWidget(
},
),
],
tips: buildValueTexts(sleepReport['dysp'][0]['value'], '入睡时间:', 0),
tips:
buildValueTexts(sleepReport['dysp'][0]['value'], '入睡时间:'.tr, 0),
xCount: 7,
yCount: sleepReport['dysp'][0]['yLable'].length,
points: buildGeneralPoints(sleepReport['dysp'][0]),
@@ -317,7 +350,15 @@ Widget WeekDataWidget(
min: 0, //最小值0
max: 7, //最大值30
q: 6, //labels第一个与最后一个的真实距离也就是30-1 = 29
labels: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
labels: [
'周一'.tr,
'周二'.tr,
'周三'.tr,
'周四'.tr,
'周五'.tr,
'周六'.tr,
'周日'.tr
],
indexs: [0, 1, 2, 3, 4, 5, 6], //每一个标签的对应在X轴的真实位置
offset: Offset(0, -50.rpx), //标签相对于原点的偏移下方60像素位置
ondrawer: (canvas, offset, index, label, align, style) {
@@ -355,7 +396,8 @@ Widget WeekDataWidget(
},
),
],
tips: buildValueTexts(sleepReport['dysp'][1]['value'], '起床时间:', 0),
tips:
buildValueTexts(sleepReport['dysp'][1]['value'], '起床时间:'.tr, 0),
xCount: 7,
yCount: sleepReport['dysp'][1]['yLable'].length,
points: buildGeneralPoints(sleepReport['dysp'][1]),
@@ -395,7 +437,15 @@ Widget WeekDataWidget(
min: 0, //最小值0
max: 7, //最大值30
q: 6, //labels第一个与最后一个的真实距离也就是30-1 = 29
labels: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
labels: [
'周一'.tr,
'周二'.tr,
'周三'.tr,
'周四'.tr,
'周五'.tr,
'周六'.tr,
'周日'.tr
],
indexs: [0, 1, 2, 3, 4, 5, 6], //每一个标签的对应在X轴的真实位置
offset: Offset(0, -50.rpx), //标签相对于原点的偏移下方60像素位置
ondrawer: (canvas, offset, index, label, align, style) {
@@ -433,7 +483,7 @@ Widget WeekDataWidget(
},
),
],
tips: buildValueTexts(sleepReport['dysp'][2]['value'], '', 1),
tips: buildValueTexts(sleepReport['dysp'][2]['value'], ''.tr, 1),
xCount: 7,
yCount: sleepReport['dysp'][2]['yLable'].length,
points: buildGeneralPoints(sleepReport['dysp'][2]),
@@ -473,7 +523,15 @@ Widget WeekDataWidget(
min: 0, //最小值0
max: 7, //最大值30
q: 6, //labels第一个与最后一个的真实距离也就是30-1 = 29
labels: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
labels: [
'周一'.tr,
'周二'.tr,
'周三'.tr,
'周四'.tr,
'周五'.tr,
'周六'.tr,
'周日'.tr
],
indexs: [0, 1, 2, 3, 4, 5, 6], //每一个标签的对应在X轴的真实位置
offset: Offset(0, -50.rpx), //标签相对于原点的偏移下方60像素位置
ondrawer: (canvas, offset, index, label, align, style) {
@@ -511,7 +569,7 @@ Widget WeekDataWidget(
},
),
],
tips: buildValueTexts(sleepReport['dysp'][3]['value'], '毫秒', 1),
tips: buildValueTexts(sleepReport['dysp'][3]['value'], '毫秒'.tr, 1),
xCount: 7,
yCount: sleepReport['dysp'][3]['yLable'].length,
points: buildGeneralPoints(sleepReport['dysp'][3]),
@@ -551,7 +609,15 @@ Widget WeekDataWidget(
min: 0, //最小值0
max: 7, //最大值30
q: 6, //labels第一个与最后一个的真实距离也就是30-1 = 29
labels: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
labels: [
'周一'.tr,
'周二'.tr,
'周三'.tr,
'周四'.tr,
'周五'.tr,
'周六'.tr,
'周日'.tr
],
indexs: [0, 1, 2, 3, 4, 5, 6], //每一个标签的对应在X轴的真实位置
offset: Offset(0, -50.rpx), //标签相对于原点的偏移下方60像素位置
ondrawer: (canvas, offset, index, label, align, style) {
@@ -589,7 +655,7 @@ Widget WeekDataWidget(
},
),
],
tips: buildValueTexts(sleepReport['dysp'][4]['value'], '次/分', 1),
tips: buildValueTexts(sleepReport['dysp'][4]['value'], '次/分'.tr, 1),
xCount: 7,
yCount: sleepReport['dysp'][4]['yLable'].length,
points: buildGeneralPoints(sleepReport['dysp'][4]),
@@ -653,10 +719,10 @@ List<String> buildValueTexts(
//多个关键点标签
List<String> buildSleepValueTexts(
List<dynamic> data,
String unit,
int direction, // 0 左侧1 右侧
) {
List<dynamic> data, String unit, int direction, // 0 左侧1 右侧
{required String sleepDurationLabel,
required String deepSleepLabel,
required String lightSleepLabel}) {
if (data.isEmpty) return [];
return data.map((item) {
@@ -667,13 +733,13 @@ List<String> buildSleepValueTexts(
final prefix = direction == 1 ? '' : unit;
final suffix = direction == 1 ? unit : '';
var q = [
"睡眠时长$prefix$slt$suffix",
"深睡$prefix$dst$suffix",
"浅睡$prefix$lst$suffix",
].join("\n");
print(q);
return q;
var lines = [
'$sleepDurationLabel$prefix$slt$suffix',
'$deepSleepLabel$prefix$dst$suffix',
'$lightSleepLabel$prefix$lst$suffix',
].join('\n');
return lines;
}).toList();
}

View File

@@ -18,7 +18,7 @@ class AvgSleepScoreWidget extends StatelessWidget {
Key? key,
required this.sleepReport,
this.leftLabel = '最低分',
this.mediumLabel = '本周',
this.mediumLabel = '本周平均',
this.rightLabel = '最高分',
this.unknownText = '未知数据',
}) : super(key: key);

View File

@@ -84,16 +84,20 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
_scrollToTargetComponent(sleepReportController.sleepReport);
},
onFailure: (res) {
if (MainPageBBottomChange.getCurrentIndex() != null) {
if (MainPageBBottomChange.getCurrentIndex() == 1) {
try {
if (MainPageBBottomChange.getCurrentIndex() != null) {
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);
}
} else {
TopSlideNotification.show(context,
text: res.msg!, textColor: themeController.currentColor.sc9);
} catch (e) {
e;
}
sleepReportController.sleepReport.value = {};
sleepReportController.updateAll();
print(res);
@@ -144,10 +148,7 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
TopSlideNotification.show(context,
text: res.msg!, textColor: themeController.currentColor.sc9);
}
} else {
TopSlideNotification.show(context,
text: res.msg!, textColor: themeController.currentColor.sc9);
}
} else {}
sleepReportController.sleepReport.value = {};
sleepReportController.updateAll();
print(res);
@@ -441,7 +442,7 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
width: double.infinity,
child: Padding(
padding: EdgeInsetsDirectional.fromSTEB(
30.rpx, 32.rpx, 30.rpx, 32.rpx),
0.rpx, 32.rpx, 30.rpx, 32.rpx),
child: getTimeWidget(),
),
),
@@ -1332,21 +1333,6 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
),
),
),
// ClickableContainer(
// backgroundColor: Colors.transparent,
// highlightColor: themeController.currentColor.sc3,
// padding: EdgeInsets.all(10.rpx),
// borderRadius: 8.rpx,
// onTap: onRightArrowTap,
// child: Container(
// width: 30.rpx,
// height: 30.rpx,
// child: SvgPicture.asset(
// 'assets/img/icon/arrow_right.svg',
// color: themeController.currentColor.sc3,
// ),
// ),
// ),
Obx(() => ClickableContainer(
backgroundColor: Colors.transparent,
highlightColor: themeController.currentColor.sc3,
@@ -1371,8 +1357,9 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
borderRadius: 8,
onTap: () {
sleepReportController.model.type == 3
? showMonthSelectionDialog(context, checkDate: selectedDate,
checkChange: (DateTime d) {
? showMonthSelectionDialog(context,
checkDate: selectedDate,
title: "选择月份".tr, checkChange: (DateTime d) {
sleepReportController.selectedDate.value = d;
calendarController.selectedDate.value = d;