From 8731f7c335cdfcee24f3ef2edd1f84b175db5b19 Mon Sep 17 00:00:00 2001 From: czz <862977248@qq.com> Date: Fri, 15 Aug 2025 17:42:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/langs/en_US.json | 13 ++++++------ assets/langs/zh_CN.json | 3 ++- assets/langs/zh_TW.json | 4 +++- lib/controller/user_info_controller.dart | 8 ++++---- lib/pages/main_bottom/mine_page.dart | 20 ++++++++++++++----- .../component/RepairModelReadOnlyWidget.dart | 3 +-- .../repair/component/RepairModelWidget.dart | 1 + lib/pages/setting/common_mesaage_setting.dart | 2 +- .../component/WeekDataWidget.dart | 2 +- lib/pages/user/update_user_page.dart | 2 +- 10 files changed, 36 insertions(+), 22 deletions(-) diff --git a/assets/langs/en_US.json b/assets/langs/en_US.json index c016ff8..a13765e 100644 --- a/assets/langs/en_US.json +++ b/assets/langs/en_US.json @@ -270,7 +270,7 @@ "设备分享": "Device sharing", "请输入对方手机号或邮箱": "Please enter recipient's phone/email", "微信好友一键分享": "Share via WeChat", - "发送邀请": "Send invitation", + "发送邀请": "Send", "要分享的设备": "Device to share", "主设备": "Primary device:", "从设备": "Secondary device:", @@ -281,9 +281,9 @@ "体征消息": "Vital messages", "系统消息": "System messages", "无需处理": "No action needed", - "待处理": "Pending", - "已处理": "Processed", - "已超时": "Timeout", + "待处理": "Todo", + "已处理": "Done", + "已超时": "Overdue", "是否确认接受该设备": "Confirm accepting this device?", "信号强度": "Signal strength:", "设备升级": "Device upgrade", @@ -377,7 +377,7 @@ "睡眠时长": "Sleep duration", "起床时间": "Wake time", "小时": "h", - "分钟": "minutes", + "分钟": "m", "消息提醒设置": "Message notification settings", "APP消息": "APP messages", "APP消息介绍": "Open 'Taihe eCare' APP to view device messages", @@ -506,5 +506,6 @@ "选择生日": "Select Birthday", "sleep_duration": "Sleep Duration", "deep_sleep": "Deep Sleep", - "light_sleep": "Light Sleep" + "light_sleep": "Light Sleep", "女": "Female", + "男": "Male" } \ No newline at end of file diff --git a/assets/langs/zh_CN.json b/assets/langs/zh_CN.json index 8cf4c81..d7e9433 100644 --- a/assets/langs/zh_CN.json +++ b/assets/langs/zh_CN.json @@ -519,5 +519,6 @@ "选择生日": "选择生日", "sleep_duration": "睡眠时长", "deep_sleep": "深睡", - "light_sleep": "浅睡" + "light_sleep": "浅睡", "女": "女", + "男": "男" } \ No newline at end of file diff --git a/assets/langs/zh_TW.json b/assets/langs/zh_TW.json index 10353fb..2750311 100644 --- a/assets/langs/zh_TW.json +++ b/assets/langs/zh_TW.json @@ -503,5 +503,7 @@ "选择生日": "選擇生日", "sleep_duration": "睡眠時長", "deep_sleep": "深睡", - "light_sleep": "淺睡" + "light_sleep": "淺睡", + "女": "女", + "男": "男" } \ No newline at end of file diff --git a/lib/controller/user_info_controller.dart b/lib/controller/user_info_controller.dart index dc5bb94..94a186d 100644 --- a/lib/controller/user_info_controller.dart +++ b/lib/controller/user_info_controller.dart @@ -137,10 +137,10 @@ class UserInfoController extends GetControllerEx { apiResponse.msg = "昵称为空".tr; return apiResponse; } - if (user.tmpNickName!.length >= 9) { - apiResponse.msg = "最长字符为8个字".tr; - return apiResponse; - } + // if (user.tmpNickName!.length >= 9) { + // apiResponse.msg = "最长字符为8个字".tr; + // return apiResponse; + // } String serviceAddress = ServiceConstant.service_address; String serviceName = ServiceConstant.server_service; String serviceApi = ServiceConstant.user_info; diff --git a/lib/pages/main_bottom/mine_page.dart b/lib/pages/main_bottom/mine_page.dart index 4e00454..1a3ef34 100644 --- a/lib/pages/main_bottom/mine_page.dart +++ b/lib/pages/main_bottom/mine_page.dart @@ -165,11 +165,14 @@ class _MinePageState extends State { CrossAxisAlignment.start, children: [ Text( - login == 1 - ? (userInfoController.model - .user!.nick_name ?? - '未命名'.tr) - : "未命名".tr, + limitText( + login == 1 + ? userInfoController + .model.user?.nick_name + : '未命名'.tr, + AppConstants() + .text_length, // 这里设置最大长度,按你需求改,比如 6~10 字符 + ), style: TextStyle( fontFamily: 'Inter', color: themeController @@ -678,3 +681,10 @@ class _MinePageState extends State { ); } } + +String limitText(String? text, int maxLength) { + if (text == null || text.isEmpty) return ''; + if (text.characters.length <= maxLength) return text; + + return text.characters.take(maxLength).toString() + '...'; +} diff --git a/lib/pages/repair/component/RepairModelReadOnlyWidget.dart b/lib/pages/repair/component/RepairModelReadOnlyWidget.dart index 317b7ff..e09fd6c 100644 --- a/lib/pages/repair/component/RepairModelReadOnlyWidget.dart +++ b/lib/pages/repair/component/RepairModelReadOnlyWidget.dart @@ -212,7 +212,6 @@ class _RepairModelReadOnlyWidgetState extends State { isDense: true, labelStyle: TextStyle( letterSpacing: 0.0, - ), hintText: "设备参数提示".tr, hintStyle: TextStyle( @@ -293,7 +292,6 @@ class _RepairModelReadOnlyWidgetState extends State { isDense: true, labelStyle: TextStyle( letterSpacing: 0.0, - ), hintText: '问题描述'.tr, hintStyle: TextStyle( @@ -345,6 +343,7 @@ class _RepairModelReadOnlyWidgetState extends State { borderRadius: 20.rpx, padding: EdgeInsets.zero, onTap: () async { + return; ApiResponse apiResponse = await repairController.uploadImg(); print(apiResponse); if (apiResponse.code == HttpStatusCodes.ok) { diff --git a/lib/pages/repair/component/RepairModelWidget.dart b/lib/pages/repair/component/RepairModelWidget.dart index 76afdea..2be024c 100644 --- a/lib/pages/repair/component/RepairModelWidget.dart +++ b/lib/pages/repair/component/RepairModelWidget.dart @@ -287,6 +287,7 @@ class _RepairModelWidgetState extends State { // controller: TextEditingController(), autofocus: false, obscureText: false, + maxLength: 60, decoration: InputDecoration( isDense: true, labelStyle: TextStyle( diff --git a/lib/pages/setting/common_mesaage_setting.dart b/lib/pages/setting/common_mesaage_setting.dart index 2aca63b..adf57f8 100644 --- a/lib/pages/setting/common_mesaage_setting.dart +++ b/lib/pages/setting/common_mesaage_setting.dart @@ -262,7 +262,7 @@ class _CommonMessageSettingPageState extends State { ), Padding( padding: EdgeInsetsDirectional.fromSTEB( - 30.rpx, 21.rpx, 30.rpx, 0), + 0.rpx, 21.rpx, 0.rpx, 0), child: Container( decoration: BoxDecoration( color: themeController.currentColor.sc5, diff --git a/lib/pages/sleep_report/component/WeekDataWidget.dart b/lib/pages/sleep_report/component/WeekDataWidget.dart index 40e5300..7a496b6 100644 --- a/lib/pages/sleep_report/component/WeekDataWidget.dart +++ b/lib/pages/sleep_report/component/WeekDataWidget.dart @@ -104,7 +104,7 @@ Widget WeekDataWidget( displayMode: ChartDisplayMode.bar, barColors: buildWeekDatesAndPoints(sleepReport['scoreList'])['colors'], - tips: buildValueTexts(sleepReport['scoreList']['data'], '分', 1), + tips: buildValueTexts(sleepReport['scoreList']['data'], '分'.tr, 1), xUnit: sleepReport['scoreList']['yUnit'], barWidth: 0.2, ), diff --git a/lib/pages/user/update_user_page.dart b/lib/pages/user/update_user_page.dart index b76330d..c1071db 100644 --- a/lib/pages/user/update_user_page.dart +++ b/lib/pages/user/update_user_page.dart @@ -291,7 +291,7 @@ class _UpdateUserPageState extends State { ), style: TextStyle( fontFamily: 'Inter', - fontSize: 26.rpx, + fontSize: 30.rpx, letterSpacing: 0.0, color: themeController .currentColor.sc3,