隐藏未实现功能

This commit is contained in:
wyf
2025-08-21 09:52:37 +08:00
parent a69209db72
commit 4fba3eb3a4
6 changed files with 83 additions and 73 deletions

View File

@@ -248,7 +248,7 @@
"必须登录提示": "Please login first!", "必须登录提示": "Please login first!",
"待开发功能": "New feature coming soon", "待开发功能": "New feature coming soon",
"未知数据": "Unknown", "未知数据": "Unknown",
"在离床": "In/Out of bed", "在离床": "In/Out",
"体动": "Motion", "体动": "Motion",
"心率": "Heart rate", "心率": "Heart rate",
"打鼾": "Snoring", "打鼾": "Snoring",
@@ -289,8 +289,8 @@
"设备升级": "Device upgrade", "设备升级": "Device upgrade",
"设备故障": "Device malfunction!", "设备故障": "Device malfunction!",
"是否在床": "In bed:", "是否在床": "In bed:",
"在床": "In bed", "在床": "In",
"离床": "Out of bed", "离床": "Out",
"较弱": "Weak", "较弱": "Weak",
"弱": "Fair", "弱": "Fair",
"一般": "Average", "一般": "Average",

View File

@@ -60,7 +60,7 @@ class WeatherModelController extends GetControllerEx<WeatherModel> {
try { try {
await _getCurrentLocation(); await _getCurrentLocation();
_weatherTimer = Timer.periodic(Duration(seconds: 5), (timer) { _weatherTimer = Timer.periodic(Duration(seconds: 5), (timer) {
_getCurrentWeather(); // 每 5 秒更新一次天气 getCurrentWeather(); // 每 5 秒更新一次天气
}); });
_locationTimer = Timer.periodic(Duration(minutes: 10), (timer) { _locationTimer = Timer.periodic(Duration(minutes: 10), (timer) {
@@ -116,7 +116,7 @@ class WeatherModelController extends GetControllerEx<WeatherModel> {
} }
// 调用获取天气方法 // 调用获取天气方法
_getCurrentWeather(); getCurrentWeather();
} catch (e) { } catch (e) {
print(e); print(e);
EasyDartModule.logger.error("获取位置失败: $e"); EasyDartModule.logger.error("获取位置失败: $e");
@@ -168,15 +168,15 @@ class WeatherModelController extends GetControllerEx<WeatherModel> {
} }
// 获取天气信息 // 获取天气信息
Future<void> _getCurrentWeather() async { Future<void> getCurrentWeather() async {
if (model.latitude == null || model.longitude == null) { if (model.latitude == null || model.longitude == null) {
EasyDartModule.logger.error("获取天气失败:位置数据获取失败"); EasyDartModule.logger.error("获取天气失败:位置数据获取失败");
return; // 如果位置数据没有获取到,则不更新天气 return; // 如果位置数据没有获取到,则不更新天气
} }
String? language = "zh_CN"; // String? language = "zh_CN";
if (languageController.selectLanguage != null) { // if (languageController.selectLanguage != null) {
language = languageController.selectLanguage.value!.language_code; // language = languageController.selectLanguage.value!.language_code;
} // }
List<Placemark> placemarks = []; List<Placemark> placemarks = [];
// placemarks = await placemarkFromCoordinates(model.latitude!, model.longitude!, // placemarks = await placemarkFromCoordinates(model.latitude!, model.longitude!,
// localeIdentifier: language); // localeIdentifier: language);

View File

@@ -59,7 +59,7 @@ class DeviceStatusInfoWidget extends StatelessWidget {
// ), // ),
), ),
Text( Text(
value, value.tr,
style: TextStyle( style: TextStyle(
fontFamily: 'Inter', fontFamily: 'Inter',
fontSize: 48.rpx, fontSize: 48.rpx,
@@ -72,7 +72,7 @@ class DeviceStatusInfoWidget extends StatelessWidget {
.addToStart(SizedBox(width: 31.rpx)), .addToStart(SizedBox(width: 31.rpx)),
), ),
Text( Text(
title, title.tr,
style: TextStyle( style: TextStyle(
fontFamily: 'Inter', fontFamily: 'Inter',
fontSize: 30.rpx, fontSize: 30.rpx,

View File

@@ -123,18 +123,23 @@ class _InstantBodyPageState extends State<InstantBodyPage>
CommonVariables.callMap["/vsbs/web/rt/marttress"] = (data) { CommonVariables.callMap["/vsbs/web/rt/marttress"] = (data) {
inBed = data["inBed"]; inBed = data["inBed"];
// 心率 呼吸 体动 呼吸暂停 // 心率 呼吸 体动 呼吸暂停
if ("离床" == inBed) { if ("离床".tr == inBed) {
breathState = ""; breathState = "".tr;
bodyMotion = 0; bodyMotion = 0;
breathrate = 0; breathrate = 0;
heartrate = 0; heartrate = 0;
snores = ""; snores = "".tr;
} else { } else {
breathState = data["breathState"]; breathState = data["breathState"] == null || data["breathState"] == ""
bodyMotion = data['bodyMotion']; ? "-"
breathrate = data["breathRate"]; : data["breathState"].toString().tr;
heartrate = data['heartRate'];
snores = data['snores']; bodyMotion = data['bodyMotion'] == null ? 0 : data['bodyMotion'];
breathrate = data["breathRate"] == null ? 0 : data["breathRate"];
heartrate = data['heartRate'] == null ? 0 : data['heartRate'];
snores = data['snores'] == null || data['snores'] == ""
? "".tr
: data['snores'].tr;
} }
if (mounted) { if (mounted) {
@@ -142,7 +147,6 @@ class _InstantBodyPageState extends State<InstantBodyPage>
onlineState = "在线".tr; // 接收到数据,设置为在线 onlineState = "在线".tr; // 接收到数据,设置为在线
}); });
} }
_startOnlineTimer(); // 重置定时器 _startOnlineTimer(); // 重置定时器
}; };
@@ -184,7 +188,7 @@ class _InstantBodyPageState extends State<InstantBodyPage>
TextSpan( TextSpan(
text: "${onlineState}", text: "${onlineState}",
style: TextStyle( style: TextStyle(
color: onlineState == '在线' color: onlineState == '在线'.tr
? themeController.currentColor.sc2 ? themeController.currentColor.sc2
: themeController : themeController
.currentColor.sc9, // 👈 单独设置颜色 .currentColor.sc9, // 👈 单独设置颜色
@@ -454,7 +458,7 @@ class _InstantBodyPageState extends State<InstantBodyPage>
title: "体动".tr, title: "体动".tr,
iconAsset: iconAsset:
"assets/img/icon/bodymotion.svg", "assets/img/icon/bodymotion.svg",
value: inBed == "离床" value: inBed == "离床".tr
? ("-") ? ("-")
: (bodyMotion == null || : (bodyMotion == null ||
bodyMotion == -1) bodyMotion == -1)
@@ -471,7 +475,7 @@ class _InstantBodyPageState extends State<InstantBodyPage>
title: "心率".tr, title: "心率".tr,
iconAsset: iconAsset:
"assets/img/icon/heart.svg", "assets/img/icon/heart.svg",
value: inBed == "离床" value: inBed == "离床".tr
? "-" ? "-"
: ((heartrate == null || : ((heartrate == null ||
heartrate == -1) heartrate == -1)
@@ -482,7 +486,7 @@ class _InstantBodyPageState extends State<InstantBodyPage>
title: "打鼾".tr, title: "打鼾".tr,
iconAsset: iconAsset:
"assets/img/icon/snore.svg", "assets/img/icon/snore.svg",
value: inBed == "离床" value: inBed == "离床".tr
? "-" ? "-"
: ('${snores}'.tr), : ('${snores}'.tr),
), ),
@@ -496,7 +500,7 @@ class _InstantBodyPageState extends State<InstantBodyPage>
title: "呼吸".tr, title: "呼吸".tr,
iconAsset: iconAsset:
"assets/img/icon/breathe.svg", "assets/img/icon/breathe.svg",
value: inBed == "离床" value: inBed == "离床".tr
? ("-") ? ("-")
: ((breathrate == null || : ((breathrate == null ||
breathrate == -1) breathrate == -1)
@@ -507,7 +511,7 @@ class _InstantBodyPageState extends State<InstantBodyPage>
title: "呼吸暂停".tr, title: "呼吸暂停".tr,
iconAsset: iconAsset:
"assets/img/icon/breathe_pause.svg", "assets/img/icon/breathe_pause.svg",
value: inBed == "离床" value: inBed == "离床".tr
? "-" ? "-"
: ('${breathState}'), : ('${breathState}'),
), ),

View File

@@ -951,52 +951,52 @@ class _OtherLoginPageState extends State<OtherLoginPage> {
), ),
), ),
), ),
ClickableContainer( // ClickableContainer(
backgroundColor: Colors.white, // backgroundColor: Colors.white,
highlightColor: Colors.grey, // highlightColor: Colors.grey,
borderRadius: 999.rpx, // borderRadius: 999.rpx,
padding: EdgeInsets.zero, // padding: EdgeInsets.zero,
onTap: () { // onTap: () {
TopSlideNotification.show(context, // TopSlideNotification.show(context,
text: "待开发功能".tr); // text: "待开发功能".tr);
}, // },
child: Container( // child: Container(
width: 91.rpx, // width: 91.rpx,
height: 91.rpx, // height: 91.rpx,
clipBehavior: Clip.antiAlias, // clipBehavior: Clip.antiAlias,
decoration: BoxDecoration( // decoration: BoxDecoration(
shape: BoxShape.circle, // shape: BoxShape.circle,
), // ),
child: Image.asset( // child: Image.asset(
"assets/img/tel.png", // "assets/img/tel.png",
width: 30.rpx, // width: 30.rpx,
height: 30.rpx, // height: 30.rpx,
), // ),
), // ),
), // ),
ClickableContainer( // ClickableContainer(
backgroundColor: Colors.white, // backgroundColor: Colors.white,
highlightColor: Colors.grey, // highlightColor: Colors.grey,
borderRadius: 999.rpx, // borderRadius: 999.rpx,
padding: EdgeInsets.zero, // padding: EdgeInsets.zero,
onTap: () { // onTap: () {
TopSlideNotification.show(context, // TopSlideNotification.show(context,
text: "待开发功能".tr); // text: "待开发功能".tr);
}, // },
child: Container( // child: Container(
width: 91.rpx, // width: 91.rpx,
height: 91.rpx, // height: 91.rpx,
clipBehavior: Clip.antiAlias, // clipBehavior: Clip.antiAlias,
decoration: BoxDecoration( // decoration: BoxDecoration(
shape: BoxShape.circle, // shape: BoxShape.circle,
), // ),
child: Image.asset( // child: Image.asset(
"assets/img/google.png", // "assets/img/google.png",
width: 30.rpx, // width: 30.rpx,
height: 30.rpx, // height: 30.rpx,
), // ),
), // ),
), // ),
].divide(SizedBox(width: 35.rpx)), ].divide(SizedBox(width: 35.rpx)),
), ),
], ],

View File

@@ -7,6 +7,7 @@ import 'package:vbvs_app/common/util/MyUtils.dart';
import 'package:vbvs_app/component/tool/ClickableContainer.dart'; import 'package:vbvs_app/component/tool/ClickableContainer.dart';
import 'package:vbvs_app/component/tool/CustomCard.dart'; import 'package:vbvs_app/component/tool/CustomCard.dart';
import 'package:vbvs_app/controller/setting/language/language_controller.dart'; import 'package:vbvs_app/controller/setting/language/language_controller.dart';
import 'package:vbvs_app/controller/weather/weather_controller.dart';
import 'package:vbvs_app/language/AppLanguage.dart'; import 'package:vbvs_app/language/AppLanguage.dart';
import 'package:vbvs_app/pages/device_bind/componnet/FancyCircleCheckbox.dart'; import 'package:vbvs_app/pages/device_bind/componnet/FancyCircleCheckbox.dart';
@@ -132,6 +133,11 @@ class _LanguageSettingState extends State<LanguageSetting> {
await ef.kvdb.write( await ef.kvdb.write(
"th/language", "th/language",
language.language_code); language.language_code);
WeatherModelController
weatherModelController =
Get.find();
weatherModelController
.getCurrentWeather();
} catch (e) { } catch (e) {
print(e); print(e);
} }