From 2cca7c77169023c37ffa015302a3a28b105f0079 Mon Sep 17 00:00:00 2001 From: wyf <494641114@qq.com> Date: Tue, 19 Aug 2025 18:00:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=BE=AE=E4=BF=A1=E7=99=BB?= =?UTF-8?q?=E5=BD=95?= 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 | 7 +- assets/langs/zh_TW.json | 9 +- lib/common/color/ServiceConstant.dart | 4 +- .../component/DeviceStatusInfoWidget.dart | 2 +- lib/pages/device/instant_body_page.dart | 10 +- .../device_bind/device_share_list_page.dart | 10 + lib/pages/device_bind/device_type.dart | 1 + lib/pages/main_bottom/e_page.dart | 28 ++- .../main_bottom/main_page_bottom_change.dart | 21 +- .../mh_page/user/page/mht_login_page.dart | 182 ++++++++++++------ 11 files changed, 211 insertions(+), 76 deletions(-) diff --git a/assets/langs/en_US.json b/assets/langs/en_US.json index 001d2c6..beb7926 100644 --- a/assets/langs/en_US.json +++ b/assets/langs/en_US.json @@ -249,7 +249,7 @@ "待开发功能": "New feature coming soon", "未知数据": "Unknown", "在离床": "In/Out of bed", - "体动": "Body movement", + "体动": "Motion", "心率": "Heart rate", "打鼾": "Snoring", "呼吸": "Respiration", @@ -340,7 +340,7 @@ "申请记录": "Application records", "设备类型": "Device type", "发生时间": "Occurrence time", - "最小信号强度": "Minimum signal strength", + "最小信号强度": "Signal strength", "匹配出的外围设备": "Matched peripheral devices", "连接中...": "Connecting", "刷新": "Refresh", @@ -529,5 +529,12 @@ "公司信息": "Copyright © 2022-2025 Jiaxing Taihe Information Technology Co., Ltd. All rights reserved.", "当前属于": "Current", "绑定手机号码": "Bind mobile phone number", - "为了您的账号安全,验证手机号码后,可直接使用此手机号登录。": "For security, once your phone number is verified, you can log in with it directly." + "为了您的账号安全,验证手机号码后,可直接使用此手机号登录。": "For security, once your phone number is verified, you can log in with it directly.", + "全选": "Select All", + "删除提示": "Are you sure you want to delete?", + "完成": "OK", + "连接": "Connect", + "下一步": "Next", + "获取wifi列表成功": "WiFi List Retrieved", + "获取wifi列表失败": "Failed to Get WiFi List" } \ No newline at end of file diff --git a/assets/langs/zh_CN.json b/assets/langs/zh_CN.json index 4d21a30..6a60979 100644 --- a/assets/langs/zh_CN.json +++ b/assets/langs/zh_CN.json @@ -536,5 +536,10 @@ "icp备案号": "ICP备案号:浙ICP备14015115号-8A", "公司信息": "Copyright © 2022-2025 嘉兴太和信息技术有限责任公司 版权所有", "绑定手机号码": "绑定手机号码", - "为了您的账号安全,验证手机号码后,可直接使用此手机号登录。":"为了您的账号安全,验证手机号码后,可直接使用此手机号登录。" + "为了您的账号安全,验证手机号码后,可直接使用此手机号登录。": "为了您的账号安全,验证手机号码后,可直接使用此手机号登录。", + "全选": "全选", + "删除提示": "是否确认删除?", + "连接": "连接", + "获取wifi列表成功": "获取wifi列表成功", + "获取wifi列表失败": "获取wifi列表失败" } \ No newline at end of file diff --git a/assets/langs/zh_TW.json b/assets/langs/zh_TW.json index 7e6353f..77dbfb3 100644 --- a/assets/langs/zh_TW.json +++ b/assets/langs/zh_TW.json @@ -526,5 +526,12 @@ "公司信息": "Copyright © 2022-2025 嘉興太和信息技術有限責任公司 版權所有", "当前属于": "當前", "绑定手机号码": "綁定手機號碼", - "为了您的账号安全,验证手机号码后,可直接使用此手机号登录。": "為了您的帳號安全,驗證手機號碼後,可直接使用此手機號登入。" + "为了您的账号安全,验证手机号码后,可直接使用此手机号登录。": "為了您的帳號安全,驗證手機號碼後,可直接使用此手機號登入。", + "全选": "全選", + "刪除提示": "是否確認刪除?", + "完成": "完成", + "连接": "連接", + "下一步": "下一步", + "获取wifi列表成功": "獲取wifi列表成功", + "获取wifi列表失败": "獲取wifi列表失敗" } \ No newline at end of file diff --git a/lib/common/color/ServiceConstant.dart b/lib/common/color/ServiceConstant.dart index be35784..a94f0e8 100644 --- a/lib/common/color/ServiceConstant.dart +++ b/lib/common/color/ServiceConstant.dart @@ -1,8 +1,8 @@ class ServiceConstant { // static const String baseHost = "zhmht.swes.com.cn:27021"; //服务地址 眠花糖测试地址 // static const String baseHost = "zhmht.swes.com.cn:27020"; //服务地址 眠花糖正式地址 - // static const String baseHost = "vsbs-test.he-info.cn"; //服务地址 本地测试地址 - static const String baseHost = "vsbst-api.he-info.cn";//服务地址 + static const String baseHost = "vsbs-test.he-info.cn"; //服务地址 本地测试地址 + // static const String baseHost = "vsbst-api.he-info.cn";//服务地址 // static const String service_address = "http://$baseHost"; static const String service_address = "https://$baseHost"; diff --git a/lib/pages/device/component/DeviceStatusInfoWidget.dart b/lib/pages/device/component/DeviceStatusInfoWidget.dart index b341caa..3980db4 100644 --- a/lib/pages/device/component/DeviceStatusInfoWidget.dart +++ b/lib/pages/device/component/DeviceStatusInfoWidget.dart @@ -33,7 +33,7 @@ class DeviceStatusInfoWidget extends StatelessWidget { print('点击了 $title 模块'); }, child: Container( - width: MediaQuery.sizeOf(context).width * 0.32, + width: MediaQuery.sizeOf(context).width * 0.36, constraints: BoxConstraints( minWidth: 201.rpx, minHeight: 182.rpx, diff --git a/lib/pages/device/instant_body_page.dart b/lib/pages/device/instant_body_page.dart index ad934c4..f99c083 100644 --- a/lib/pages/device/instant_body_page.dart +++ b/lib/pages/device/instant_body_page.dart @@ -48,7 +48,7 @@ class _InstantBodyPageState extends State // String snores = "否".tr; // int heartrate = 0; String breathState = "-"; - String inBed ="-"; + String inBed = "-"; String onlineState = "离线".tr; Timer? _onlineTimer; // 添加 Timer 引用 int bodyMotion = -1; @@ -109,9 +109,9 @@ class _InstantBodyPageState extends State inBed = "-"; bodyMotion = -1; heartrate = -1; - snores ="-"; + snores = "-"; breathrate = -1; - breathState ="-"; + breathState = "-"; }); } }); @@ -252,7 +252,7 @@ class _InstantBodyPageState extends State children: [ Padding( padding: EdgeInsetsDirectional.fromSTEB( - 30.rpx, 0.rpx, 30.rpx, 120.rpx), + 30.rpx, 0.rpx, 30.rpx, 100.rpx), child: ClickableContainer( backgroundColor: themeController.currentColor.sc5, highlightColor: themeController @@ -426,7 +426,7 @@ class _InstantBodyPageState extends State children: [ Padding( padding: EdgeInsetsDirectional.fromSTEB( - 66.rpx, 0, 66.rpx, 0), + 30.rpx, 0, 30.rpx, 0), child: Container( // decoration: BoxDecoration( // image: DecorationImage( diff --git a/lib/pages/device_bind/device_share_list_page.dart b/lib/pages/device_bind/device_share_list_page.dart index 9d7118b..5f85a3fa 100644 --- a/lib/pages/device_bind/device_share_list_page.dart +++ b/lib/pages/device_bind/device_share_list_page.dart @@ -373,6 +373,16 @@ class _DeviceShareListPageState extends State { ), ClickableContainer( onTap: () async { + if (deviceShareListController.selectedShareInfo == + null || + deviceShareListController + .selectedShareInfo.isEmpty) { + TopSlideNotification.show(context, + text: "删除错误提示".tr, + textColor: + themeController.currentColor.sc9); + return; + } showConfirmDialog(context, Container(), "删除提示".tr, onConfirm: () async { if (deviceShareListController diff --git a/lib/pages/device_bind/device_type.dart b/lib/pages/device_bind/device_type.dart index 0be37fe..3be4ebe 100644 --- a/lib/pages/device_bind/device_type.dart +++ b/lib/pages/device_bind/device_type.dart @@ -267,6 +267,7 @@ class _EPageState extends State { fontFamily: 'Inter', fontSize: 26.rpx, letterSpacing: 0.0, + color: themeController.currentColor.sc3, ), ), ), diff --git a/lib/pages/main_bottom/e_page.dart b/lib/pages/main_bottom/e_page.dart index ed45fc9..7c438ba 100644 --- a/lib/pages/main_bottom/e_page.dart +++ b/lib/pages/main_bottom/e_page.dart @@ -3,8 +3,10 @@ import 'dart:convert'; import 'package:ef/ef.dart'; import 'package:flutter/material.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart'; +import 'package:vbvs_app/common/color/appConstants.dart'; import 'package:vbvs_app/common/color/app_uri_status.dart'; import 'package:vbvs_app/common/util/FitTool.dart'; +import 'package:vbvs_app/common/util/MyUtils.dart'; import 'package:vbvs_app/component/tool/TopSlideNotification.dart'; import 'package:vbvs_app/controller/device/blueteeth_bind_controller.dart'; import 'package:vbvs_app/controller/device/body_device_controller.dart'; @@ -12,6 +14,7 @@ import 'package:vbvs_app/controller/device/device_type_controller.dart'; import 'package:vbvs_app/controller/main_bottom/global_controller.dart'; import 'package:vbvs_app/controller/theme_controller/ThemeController.dart'; import 'package:vbvs_app/controller/user_info_controller.dart'; +import 'package:vbvs_app/enum/APPPackageType.dart'; import 'package:vbvs_app/enum/LoginStatus.dart'; import 'package:vbvs_app/model/api_response.dart'; @@ -23,7 +26,7 @@ class EPage extends StatefulWidget { State createState() => _EPageState(); } -class _EPageState extends State { +class _EPageState extends State with AutomaticKeepAliveClientMixin { GlobalController globalController = Get.find(); UserInfoController userInfoController = Get.find(); BlueteethBindController blueteethBindController = Get.find(); @@ -34,6 +37,9 @@ class _EPageState extends State { RxList deviceList = [].obs; RxString finalUri = RxString(''); + @override + bool get wantKeepAlive => true; // 保持页面状态 + @override void initState() { super.initState(); @@ -48,6 +54,7 @@ class _EPageState extends State { @override Widget build(BuildContext context) { + super.build(context); // ⚠️必须调用,保证 keepAlive 生效 bool isLoggedIn = userInfoController.model.login == LoginStatus.LOGIN.code; return LayoutBuilder( @@ -73,7 +80,7 @@ class _EPageState extends State { alignment: Alignment.center, children: [ Text( - '小e'.tr, + '菜单.小e'.tr, style: TextStyle( fontFamily: 'Readex Pro', color: themeController.currentColor.sc3, @@ -226,7 +233,24 @@ class _EPageState extends State { finalUri.value = widget.sleepUri; } } + String? language = ""; + if (AppConstants().ent_type == APPPackageType.MHT.code) { + if (mhLanguageController.selectLanguage != null) { + language = mhLanguageController.selectLanguage.value!.language_code; + } + } else { + if (languageController.selectLanguage != null) { + language = languageController.selectLanguage.value!.language_code; + } + } + if (language != null && language.isNotEmpty) { + if (finalUri.value.contains("?")) { + finalUri.value += "&lang=$language"; + } else { + finalUri.value += "?lang=$language"; + } + } ef.log("msg"); } } diff --git a/lib/pages/main_bottom/main_page_bottom_change.dart b/lib/pages/main_bottom/main_page_bottom_change.dart index ace7e68..84d7184 100644 --- a/lib/pages/main_bottom/main_page_bottom_change.dart +++ b/lib/pages/main_bottom/main_page_bottom_change.dart @@ -68,11 +68,11 @@ class MainPageBottomChange extends GetView { ); } - List arr = [ + List arr = [ HomePage(), // SleepReportPage(), // EPage(), - EPage(sleepUri:"https://xiaoe.he-info.cn/"), + EPage(sleepUri: "https://xiaoe.he-info.cn/"), MessagePage(), MinePage(), ]; @@ -81,7 +81,7 @@ class MainPageBottomChange extends GetView { final getStorage = GetStorage(); @override Widget build(BuildContext context) { - Future.delayed(const Duration(milliseconds: 0), () { + Future.delayed(const Duration(milliseconds: 0), () { String? isShowYingShiDialog = getStorage.read("isShowYingShiDialog"); if (isShowYingShiDialog == null || isShowYingShiDialog != "true") { String btnName = "同意".tr; @@ -134,7 +134,13 @@ class MainPageBottomChange extends GetView { () { if (globalController.model.hideBottomNavigationBar == true) { return Scaffold( - body: arr[controller.model.currentIndex], + // body: arr[controller.model.currentIndex], + body: IndexedStack( + // ✅ 改成 IndexedStack + index: controller.model.currentIndex, + children: + arr.map((page) => SizedBox.expand(child: page)).toList(), + ), floatingActionButtonAnimator: FloatingActionButtonAnimator.noAnimation, floatingActionButton: Container(), @@ -150,6 +156,13 @@ class MainPageBottomChange extends GetView { child: Scaffold( backgroundColor: Colors.transparent, body: arr[controller.model.currentIndex], + // body: IndexedStack( + // // ✅ 改成 IndexedStack + // index: controller.model.currentIndex, + // children: arr + // .map((page) => SizedBox.expand(child: page)) + // .toList(), + // ), floatingActionButtonAnimator: FloatingActionButtonAnimator.noAnimation, floatingActionButtonLocation: diff --git a/lib/pages/mh_page/user/page/mht_login_page.dart b/lib/pages/mh_page/user/page/mht_login_page.dart index a1b4f85..462a371 100644 --- a/lib/pages/mh_page/user/page/mht_login_page.dart +++ b/lib/pages/mh_page/user/page/mht_login_page.dart @@ -1751,64 +1751,132 @@ class MHTLoginPage extends GetView { ), ); }), - Divider( - color: stringToColor("#495A67"), // 线的颜色 - thickness: 1.rpx, // 线的粗细 - height: 20, // 垂直方向的占位高度 - indent: 16, // 左边缩进 - endIndent: 16, // 右边缩进 - ), - Text( - "其他登录方式".tr, - style: TextStyle( - color: Colors.white, - fontSize: AppConstants() - .normal_text_fontSize), - ), - SizedBox( - height: 30.rpx, - ), - ClickableContainer( - backgroundColor: Colors.white, // 背景色 - highlightColor: Colors.grey, // 点击水波纹颜色 - borderRadius: 999.rpx, - padding: EdgeInsets.zero, - onTap: () async { - // loginController.model.isIos == true && - MHTRegisterController registerController = - Get.find(); - if (registerController - .model.register_agree == - null || - registerController - .model.register_agree != - true) { - TopSlideNotification.show( - context, - text: "需要同意协议".tr, - textColor: - themeController.currentColor.sc9, - ); - return; - } - MHTLoginController loginController = - Get.find(); - await loginController.wxLoginSendAuth(); - // TopSlideNotification.show(context, - // text: "测试阶段,暂不支持".tr); - }, - child: Container( - width: 90.rpx, - height: 90.rpx, - decoration: BoxDecoration( - image: DecorationImage( - image: AssetImage( - 'assets/images/wechat.png'), // 本地图片 - fit: BoxFit.fill, // 填满整个 Container + // Divider( + // color: stringToColor("#495A67"), // 线的颜色 + // thickness: 1.rpx, // 线的粗细 + // height: 20, // 垂直方向的占位高度 + // indent: 16, // 左边缩进 + // endIndent: 16, // 右边缩进 + // ), + // Text( + // "其他登录方式".tr, + // style: TextStyle( + // color: Colors.white, + // fontSize: AppConstants() + // .normal_text_fontSize), + // ), + // SizedBox( + // height: 30.rpx, + // ), + // ClickableContainer( + // backgroundColor: Colors.white, // 背景色 + // highlightColor: Colors.grey, // 点击水波纹颜色 + // borderRadius: 999.rpx, + // padding: EdgeInsets.zero, + // onTap: () async { + // // loginController.model.isIos == true && + // MHTRegisterController registerController = + // Get.find(); + // if (registerController + // .model.register_agree == + // null || + // registerController + // .model.register_agree != + // true) { + // TopSlideNotification.show( + // context, + // text: "需要同意协议".tr, + // textColor: + // themeController.currentColor.sc9, + // ); + // return; + // } + // MHTLoginController loginController = + // Get.find(); + // await loginController.wxLoginSendAuth(); + // // TopSlideNotification.show(context, + // // text: "测试阶段,暂不支持".tr); + // }, + // child: Container( + // width: 90.rpx, + // height: 90.rpx, + // decoration: BoxDecoration( + // image: DecorationImage( + // image: AssetImage( + // 'assets/images/wechat.png'), // 本地图片 + // fit: BoxFit.fill, // 填满整个 Container + // ), + // ), + // ), + // ), + + Obx(() { + // 条件:iOS 且微信未安装 + if (controller.model.isIos == true && + controller.model.isWeChatNotInstalled == + true) { + return SizedBox.shrink(); // 不显示任何内容 + } + MHTRegisterController + mhtRegisterController = Get.find(); + // 显示其他登录方式 + return Column( + children: [ + Divider( + color: + stringToColor("#495A67"), // 线的颜色 + thickness: 1.rpx, // 线的粗细 + height: 20, // 垂直方向的占位高度 + indent: 16, // 左边缩进 + endIndent: 16, // 右边缩进 ), - ), - ), - ), + Text( + "其他登录方式".tr, + style: TextStyle( + color: Colors.white, + fontSize: AppConstants() + .normal_text_fontSize, + ), + ), + SizedBox(height: 30.rpx), + ClickableContainer( + backgroundColor: Colors.white, // 背景色 + highlightColor: + Colors.grey, // 点击水波纹颜色 + borderRadius: 999.rpx, + padding: EdgeInsets.zero, + onTap: () async { + if (mhtRegisterController + .model.register_agree != + true) { + TopSlideNotification.show( + context, + text: "需要同意协议".tr, + textColor: themeController + .currentColor.sc9, + ); + return; + } + final loginController = + Get.find(); + await loginController + .wxLoginSendAuth(); + }, + child: Container( + width: 90.rpx, + height: 90.rpx, + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage( + 'assets/images/wechat.png'), + fit: BoxFit.fill, + ), + ), + ), + ), + ], + ); + }) ], ), ),