更新
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 862 B After Width: | Height: | Size: 4.4 KiB |
BIN
assets/img/avatar1.png
Normal file
BIN
assets/img/avatar1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 862 B |
@@ -549,6 +549,8 @@
|
||||
"设备已被用户解绑,将取消当前分享!": "The device has been unbound by the user, and the current sharing will be cancelled.",
|
||||
"消息列表": "message list",
|
||||
"睡眠报告提示": "This page is not a medical standard, and the data is for reference only.",
|
||||
"MAC号": "MAC Address"
|
||||
|
||||
"MAC号": "MAC Address",
|
||||
"微信用户": "WeChat User",
|
||||
"其他设备正在绑定中,是否终止其他设备绑定?": "Another device is binding. Terminate?",
|
||||
"未配置网络提示": "Network Not Configured"
|
||||
}
|
||||
@@ -551,6 +551,8 @@
|
||||
"去查看": "去查看",
|
||||
"设备已被用户解绑,将取消当前分享!": "设备已被用户解绑,将取消当前分享!",
|
||||
"消息列表": "消息列表",
|
||||
"睡眠报告提示":"本页内容非医疗标准,数据仅供参考",
|
||||
"MAC号": "MAC号"
|
||||
"睡眠报告提示": "本页内容非医疗标准,数据仅供参考",
|
||||
"MAC号": "MAC号",
|
||||
"微信用户": "微信用户",
|
||||
"其他设备正在绑定中,是否终止其他设备绑定?": "其他设备正在绑定中,是否终止其他设备绑定?"
|
||||
}
|
||||
@@ -545,6 +545,9 @@
|
||||
"去查看": "去查看",
|
||||
"设备已被用户解绑,将取消当前分享!": "設備已被用戶解綁,將取消當前分享!",
|
||||
"消息列表": "消息列表",
|
||||
"睡眠报告提示":"本頁內容非醫療標準,數據僅供參考",
|
||||
"MAC号": "MAC號"
|
||||
"睡眠报告提示": "本頁內容非醫療標準,數據僅供參考",
|
||||
"MAC号": "MAC號",
|
||||
"微信用户": "微信用戶",
|
||||
"其他设备正在绑定中,是否终止其他设备绑定?": "其他設備正在綁定中,是否終止其他設備綁定?",
|
||||
"未配置网络提示": "當前設備未進行網路配置,是否確認跳過網路配置?"
|
||||
}
|
||||
23
lib/common/util/EventBus.dart
Normal file
23
lib/common/util/EventBus.dart
Normal file
@@ -0,0 +1,23 @@
|
||||
import 'dart:async';
|
||||
|
||||
class EventBus {
|
||||
static final EventBus _instance = EventBus._internal();
|
||||
factory EventBus() => _instance;
|
||||
EventBus._internal();
|
||||
|
||||
final _controller = StreamController.broadcast();
|
||||
|
||||
// 发出任意事件
|
||||
void emit(event) {
|
||||
_controller.add(event);
|
||||
}
|
||||
|
||||
// 监听指定类型的事件
|
||||
Stream<T> on<T>() {
|
||||
return _controller.stream.where((event) => event is T).cast<T>();
|
||||
}
|
||||
|
||||
void dispose() {
|
||||
_controller.close();
|
||||
}
|
||||
}
|
||||
14
lib/common/util/eventType.dart
Normal file
14
lib/common/util/eventType.dart
Normal file
@@ -0,0 +1,14 @@
|
||||
class VideoDownloadEvent {
|
||||
final bool success;
|
||||
VideoDownloadEvent(this.success);
|
||||
}
|
||||
|
||||
class BleConnectEvent {
|
||||
final bool connected;
|
||||
BleConnectEvent(this.connected);
|
||||
}
|
||||
|
||||
class SwitchLanguageEvent {
|
||||
final String language;
|
||||
SwitchLanguageEvent(this.language);
|
||||
}
|
||||
@@ -9,7 +9,9 @@ import 'package:vbvs_app/component/home_page/SleepDataModuleWidget.dart';
|
||||
import 'package:vbvs_app/component/home_page/SleepDateWidget.dart';
|
||||
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||
import 'package:vbvs_app/controller/device/body_device_controller.dart';
|
||||
import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
|
||||
import 'package:vbvs_app/enum/DataStatus.dart';
|
||||
|
||||
class DynamicReportDetailWidget extends StatefulWidget {
|
||||
final List<SleepDateWidget> sleepDateWidgets;
|
||||
@@ -32,6 +34,7 @@ class _DynamicReportDetailWidgetState extends State<DynamicReportDetailWidget> {
|
||||
final ThemeController themeController = Get.find();
|
||||
final ScrollController _scrollController = ScrollController();
|
||||
bool _hasScrolled = false;
|
||||
BodyDeviceController bodyDeviceController = Get.find();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -74,8 +77,7 @@ class _DynamicReportDetailWidgetState extends State<DynamicReportDetailWidget> {
|
||||
SizedBox(height: 33.rpx),
|
||||
_buildSleepDateWidgets(),
|
||||
SizedBox(height: 20.rpx),
|
||||
if (!AppConstants.is_test_account)
|
||||
_buildSleepDataModuleWidgets(),
|
||||
if (!AppConstants.is_test_account) _buildSleepDataModuleWidgets(),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -95,6 +97,10 @@ class _DynamicReportDetailWidgetState extends State<DynamicReportDetailWidget> {
|
||||
onTap: () async {
|
||||
await Get.toNamed("/bodyDevice", arguments: targetDevice);
|
||||
},
|
||||
child: Container(
|
||||
constraints: BoxConstraints(
|
||||
maxWidth: MediaQuery.sizeOf(context).width * 0.6,
|
||||
),
|
||||
child: Text(
|
||||
'${targetDevice['person']?['name'] == null ? '未命名'.tr : targetDevice['person']['name']}',
|
||||
style: TextStyle(
|
||||
@@ -103,6 +109,9 @@ class _DynamicReportDetailWidgetState extends State<DynamicReportDetailWidget> {
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
),
|
||||
if (!AppConstants.is_test_account)
|
||||
@@ -183,6 +192,18 @@ class _DynamicReportDetailWidgetState extends State<DynamicReportDetailWidget> {
|
||||
}
|
||||
|
||||
Widget _buildSleepDataModuleWidgets() {
|
||||
// homePageSleepFlag
|
||||
//widget.targetDevice['mac']
|
||||
if (bodyDeviceController.homePageSleepFlag[widget.targetDevice['mac']] ==
|
||||
DataStatus.Loading.code) {
|
||||
return Container(
|
||||
height: 200.rpx,
|
||||
alignment: Alignment.center,
|
||||
child: CircularProgressIndicator(
|
||||
color: themeController.currentColor.sc1,
|
||||
),
|
||||
);
|
||||
}
|
||||
if (widget.sleepDataModuleWidgets.isEmpty) {
|
||||
return Container(
|
||||
height: 200.rpx,
|
||||
@@ -207,16 +228,34 @@ class _DynamicReportDetailWidgetState extends State<DynamicReportDetailWidget> {
|
||||
// );
|
||||
// }
|
||||
|
||||
// return Container(
|
||||
// width: double.infinity,
|
||||
// height: 200.rpx,
|
||||
// child: SingleChildScrollView(
|
||||
// scrollDirection: Axis.horizontal,
|
||||
// child: Row(
|
||||
// children: widget.sleepDataModuleWidgets
|
||||
// .map((widget) => widget)
|
||||
// .toList()
|
||||
// .divide(SizedBox(width: 14.rpx)),
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
var aa = widget.sleepDataModuleWidgets
|
||||
// 过滤:当 data 中存在 'show' 且其为 false 时排除该元素
|
||||
.where((item) => item.data?['show'] != false)
|
||||
// 保持元素本身(SleepDataModuleWidget)
|
||||
.map((item) => item)
|
||||
.toList();
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
height: 200.rpx,
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: Row(
|
||||
children: widget.sleepDataModuleWidgets
|
||||
.map((widget) => widget)
|
||||
.toList()
|
||||
.divide(SizedBox(width: 14.rpx)),
|
||||
children:
|
||||
// 保留你原来的 divide 间隔处理
|
||||
aa.divide(SizedBox(width: 14.rpx)),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -11,6 +11,7 @@ import 'package:vbvs_app/common/color/app_uri_status.dart';
|
||||
import 'package:vbvs_app/common/util/DailyLogUtils.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/enum/APPPackageType.dart';
|
||||
import 'package:vbvs_app/enum/DataStatus.dart';
|
||||
import 'package:vbvs_app/model/api_response.dart';
|
||||
|
||||
part 'body_device_controller.g.dart'; // 由json_serializable自动生成的部分
|
||||
@@ -51,6 +52,8 @@ class BodyDeviceController extends GetControllerEx<BodyDeviceModel> {
|
||||
|
||||
Timer? _sleepReportTimer; // 定时器
|
||||
|
||||
RxMap homePageSleepFlag = {}.obs; //正在请求睡眠报告数据
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
@@ -220,6 +223,7 @@ class BodyDeviceController extends GetControllerEx<BodyDeviceModel> {
|
||||
try {
|
||||
ef.log("刷新睡眠报告");
|
||||
sleepReportData.value = {};
|
||||
homePageSleepFlag = {}.obs;
|
||||
ApiResponse<Map<String, List<dynamic>>> apiResponse = ApiResponse(
|
||||
code: -1,
|
||||
msg: "请求失败".tr,
|
||||
@@ -241,7 +245,7 @@ class BodyDeviceController extends GetControllerEx<BodyDeviceModel> {
|
||||
if (mac.isEmpty) continue;
|
||||
|
||||
sleepReportData[mac] = []; // 初始化当前设备的数据列表
|
||||
|
||||
homePageSleepFlag[mac] = DataStatus.Loading.code;
|
||||
String queryUrl =
|
||||
"$serviceAddress$serviceName$serviceApi?mac=$mac&time=${DateTime.now().millisecondsSinceEpoch}&sleepType=1";
|
||||
try {
|
||||
@@ -258,6 +262,7 @@ class BodyDeviceController extends GetControllerEx<BodyDeviceModel> {
|
||||
}
|
||||
var response = await EasyDartModule.dio.get(queryUrl);
|
||||
if (response != null) {
|
||||
homePageSleepFlag[mac] = DataStatus.success.code;
|
||||
var responseData = response.data is String
|
||||
? jsonDecode(response.data)
|
||||
: response.data;
|
||||
@@ -276,6 +281,7 @@ class BodyDeviceController extends GetControllerEx<BodyDeviceModel> {
|
||||
}
|
||||
} catch (e) {
|
||||
EasyDartModule.logger.warning("请求设备 $mac 的睡眠数据失败: $e");
|
||||
homePageSleepFlag[mac] = DataStatus.Fail.code;
|
||||
}
|
||||
}
|
||||
if (sleepReportData.value.isNotEmpty) {
|
||||
|
||||
@@ -152,7 +152,8 @@ class PersonController extends GetControllerEx<PersonModel> {
|
||||
}
|
||||
}
|
||||
if (name.value.isEmpty) {
|
||||
apiResponse.msg = "请输入姓名".tr;
|
||||
// apiResponse.msg = "请输入姓名".tr;
|
||||
apiResponse.code = 1;
|
||||
return apiResponse;
|
||||
}
|
||||
if (person == null) {
|
||||
|
||||
@@ -455,18 +455,19 @@ class WeatherModelController extends GetControllerEx<WeatherModel> {
|
||||
Future<void> onInit() async {
|
||||
super.onInit();
|
||||
|
||||
try {
|
||||
await getCurrentLocation();
|
||||
_weatherTimer = Timer.periodic(Duration(minutes: 10), (timer) {
|
||||
getCurrentWeather(); // 每 60 秒更新一次天气
|
||||
});
|
||||
//去掉天气
|
||||
// try {
|
||||
// await getCurrentLocation();
|
||||
// _weatherTimer = Timer.periodic(Duration(minutes: 10), (timer) {
|
||||
// getCurrentWeather(); // 每 60 秒更新一次天气
|
||||
// });
|
||||
|
||||
_locationTimer = Timer.periodic(Duration(minutes: 10), (timer) {
|
||||
getCurrentLocation(); // 每 10 分钟更新一次位置
|
||||
});
|
||||
} catch (e) {
|
||||
ef.log("[天气和定位请求失败]");
|
||||
}
|
||||
// _locationTimer = Timer.periodic(Duration(minutes: 10), (timer) {
|
||||
// getCurrentLocation(); // 每 10 分钟更新一次位置
|
||||
// });
|
||||
// } catch (e) {
|
||||
// ef.log("[天气和定位请求失败]");
|
||||
// }
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
10
lib/enum/DataStatus.dart
Normal file
10
lib/enum/DataStatus.dart
Normal file
@@ -0,0 +1,10 @@
|
||||
enum DataStatus {
|
||||
Loading(1, '加载中'),
|
||||
Fail(2, '失败'),
|
||||
success(3, '成功');
|
||||
|
||||
final int code;
|
||||
final String description;
|
||||
|
||||
const DataStatus(this.code, this.description);
|
||||
}
|
||||
@@ -274,7 +274,8 @@ class _DeviceDataComponentWidgetState extends State<DeviceDataComponentWidget> {
|
||||
),
|
||||
];
|
||||
|
||||
if (widget.device['bind_type'] == BindType.active.code && !AppConstants.is_test_account) {
|
||||
if (widget.device['bind_type'] == BindType.active.code &&
|
||||
!AppConstants.is_test_account) {
|
||||
items.addAll([
|
||||
_buildMenuItem(
|
||||
text: "WIFI配置".tr,
|
||||
@@ -413,12 +414,17 @@ class _DeviceDataComponentWidgetState extends State<DeviceDataComponentWidget> {
|
||||
alignment: AlignmentDirectional(-1, 0),
|
||||
child: TextFormField(
|
||||
onChanged: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
personController.name.value = "体征监测设备".tr;
|
||||
} else {
|
||||
personController.name.value = value;
|
||||
}
|
||||
},
|
||||
autofocus: false,
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
hintText: '请输入人员名称'.tr,
|
||||
// hintText: '请输入人员名称'.tr,
|
||||
hintText: "体征监测设备".tr,
|
||||
hintStyle: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
@@ -447,6 +453,10 @@ class _DeviceDataComponentWidgetState extends State<DeviceDataComponentWidget> {
|
||||
color: Colors.black,
|
||||
),
|
||||
cursorColor: Colors.white,
|
||||
initialValue: widget.device['person']['name'] == null ||
|
||||
widget.device['person']['name'] == ""
|
||||
? "体征监测设备".tr
|
||||
: widget.device['person']['name'],
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -521,8 +531,12 @@ class _DeviceDataComponentWidgetState extends State<DeviceDataComponentWidget> {
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
// 'TH689564522DL',
|
||||
Container(
|
||||
constraints: BoxConstraints(
|
||||
// maxWidth: MediaQuery.sizeOf(context).width - 200.rpx,
|
||||
maxWidth: MediaQuery.sizeOf(context).width * 0.6,
|
||||
),
|
||||
child: Text(
|
||||
'${widget.device['person']?['name'] ?? '未命名'.tr}',
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
@@ -530,6 +544,9 @@ class _DeviceDataComponentWidgetState extends State<DeviceDataComponentWidget> {
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
// ClickableContainer(
|
||||
// key: _arrowKey,
|
||||
|
||||
@@ -695,7 +695,7 @@ void showSingleConfirmDialog(
|
||||
// padding:
|
||||
// EdgeInsetsDirectional.fromSTEB(0, 33.rpx, 0, 0.rpx),
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
33.rpx, 33.rpx, 33.rpx, 33.rpx),
|
||||
33.rpx, 64.rpx, 33.rpx, 33.rpx),
|
||||
child: SvgPicture.asset(
|
||||
'assets/img/icon/close.svg',
|
||||
width: 25.rpx,
|
||||
@@ -710,7 +710,7 @@ void showSingleConfirmDialog(
|
||||
alignment: AlignmentDirectional(0, 0),
|
||||
child: Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
33.rpx, 60.rpx, 33.rpx, 33.rpx),
|
||||
33.rpx, 33.rpx, 33.rpx, 33.rpx),
|
||||
child: Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
|
||||
@@ -33,7 +33,8 @@ class _CalibrationPageState extends State<CalibrationPage> {
|
||||
Timer? _pollingTimer;
|
||||
|
||||
bool exit = false;
|
||||
bool start = false;
|
||||
bool start = false;//是否开始进行校准
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
@@ -572,7 +572,7 @@ class _OtherLoginPageState extends State<OtherLoginPage> {
|
||||
color: themeController
|
||||
.currentColor.sc2,
|
||||
fontSize: AppConstants()
|
||||
.title_text_fontSize,
|
||||
.middler_text_fontSize,
|
||||
letterSpacing: 0,
|
||||
),
|
||||
),
|
||||
@@ -597,9 +597,10 @@ class _OtherLoginPageState extends State<OtherLoginPage> {
|
||||
onTap: () async {
|
||||
try {
|
||||
DailyLogUtils.writeLog("点击登录");
|
||||
bool agree =
|
||||
loginController.model.register_agree!;
|
||||
if (!agree) {
|
||||
if (loginController.model.register_agree ==
|
||||
null ||
|
||||
loginController.model.register_agree! ==
|
||||
false) {
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: "登录页.未同意协议".tr,
|
||||
|
||||
@@ -112,7 +112,8 @@ class _MessageWidgetWidgetState extends State<MessageWidgetWidget> {
|
||||
themeController.currentColor.sc1,
|
||||
themeController.currentColor.sc2
|
||||
]
|
||||
: [themeController.currentColor.sc4], // 单色背景
|
||||
// : [themeController.currentColor.sc4], // 单色背景
|
||||
: [Colors.grey.withOpacity(0.2)], // 单色背景
|
||||
enableAnimation: true, // 有点击缩放动画
|
||||
enableGradient: false, // 不用渐变
|
||||
onTap: () {
|
||||
@@ -148,7 +149,9 @@ class _MessageWidgetWidgetState extends State<MessageWidgetWidget> {
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: Colors.white,
|
||||
color: messageInfo['status'] == 1
|
||||
? Colors.white
|
||||
: Colors.grey,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -18,7 +18,6 @@ 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';
|
||||
import 'package:vbvs_app/controller/home/home_controller.dart';
|
||||
import 'package:vbvs_app/controller/main_bottom/global_controller.dart';
|
||||
import 'package:vbvs_app/controller/person/person_controller.dart';
|
||||
import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
|
||||
import 'package:vbvs_app/controller/user_info_controller.dart';
|
||||
@@ -222,7 +221,7 @@ class _HomePageState extends State<HomePage> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
weatherModelController.getCurrentWeather();
|
||||
// weatherModelController.getCurrentWeather();
|
||||
return LayoutBuilder(
|
||||
builder: (context, bodySize) => GestureDetector(
|
||||
onTap: () {
|
||||
@@ -320,7 +319,12 @@ class _HomePageState extends State<HomePage> {
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
Container(
|
||||
constraints: BoxConstraints(
|
||||
maxWidth:
|
||||
bodySize.maxWidth *
|
||||
0.6),
|
||||
child: Text(
|
||||
userInfoController.model.user!
|
||||
.nick_name ??
|
||||
'未命名'.tr,
|
||||
@@ -330,67 +334,71 @@ class _HomePageState extends State<HomePage> {
|
||||
fontSize: AppConstants()
|
||||
.normal_text_fontSize,
|
||||
),
|
||||
),
|
||||
Obx(() {
|
||||
return Row(
|
||||
children: [
|
||||
Text(
|
||||
"${weatherModelController.model.cityName ?? '未知数据'.tr}",
|
||||
style: TextStyle(
|
||||
color: themeController
|
||||
.currentColor.sc4,
|
||||
fontSize: AppConstants()
|
||||
.normal_text_fontSize,
|
||||
maxLines: 1,
|
||||
overflow:
|
||||
TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"${(weatherModelController.model.current_temperature != null && weatherModelController.model.current_temperature! > 0) ? weatherModelController.model.current_temperature : '未知数据'.tr}" +
|
||||
"°C",
|
||||
style: TextStyle(
|
||||
color: themeController
|
||||
.currentColor.sc4,
|
||||
fontSize: AppConstants()
|
||||
.normal_text_fontSize,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"${(weatherModelController.model.weather_info?.isNotEmpty ?? false) ? weatherModelController.model.weather_info : '未知数据'.tr}",
|
||||
style: TextStyle(
|
||||
color: themeController
|
||||
.currentColor.sc4,
|
||||
fontSize: AppConstants()
|
||||
.normal_text_fontSize,
|
||||
),
|
||||
),
|
||||
if (weatherModelController
|
||||
.model
|
||||
.weatherIconurl !=
|
||||
null &&
|
||||
weatherModelController
|
||||
.model
|
||||
.weatherIconurl!
|
||||
.isNotEmpty)
|
||||
Container(
|
||||
width: 35.rpx,
|
||||
height: 26.rpx,
|
||||
clipBehavior:
|
||||
Clip.antiAlias,
|
||||
decoration:
|
||||
BoxDecoration(
|
||||
shape: BoxShape
|
||||
.circle),
|
||||
child: SvgPicture.asset(
|
||||
"assets/images/weather/${weatherModelController.model.weatherIconurl}-fill.svg",
|
||||
// fit: BoxFit.cover,
|
||||
color: themeController
|
||||
.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(
|
||||
width: 20.rpx,
|
||||
)),
|
||||
);
|
||||
}),
|
||||
// Obx(() {
|
||||
// return Row(
|
||||
// children: [
|
||||
// Text(
|
||||
// "${weatherModelController.model.cityName ?? '未知数据'.tr}",
|
||||
// style: TextStyle(
|
||||
// color: themeController
|
||||
// .currentColor.sc4,
|
||||
// fontSize: AppConstants()
|
||||
// .normal_text_fontSize,
|
||||
// ),
|
||||
// ),
|
||||
// Text(
|
||||
// "${(weatherModelController.model.current_temperature != null && weatherModelController.model.current_temperature! > 0) ? weatherModelController.model.current_temperature : '未知数据'.tr}" +
|
||||
// "°C",
|
||||
// style: TextStyle(
|
||||
// color: themeController
|
||||
// .currentColor.sc4,
|
||||
// fontSize: AppConstants()
|
||||
// .normal_text_fontSize,
|
||||
// ),
|
||||
// ),
|
||||
// Text(
|
||||
// "${(weatherModelController.model.weather_info?.isNotEmpty ?? false) ? weatherModelController.model.weather_info : '未知数据'.tr}",
|
||||
// style: TextStyle(
|
||||
// color: themeController
|
||||
// .currentColor.sc4,
|
||||
// fontSize: AppConstants()
|
||||
// .normal_text_fontSize,
|
||||
// ),
|
||||
// ),
|
||||
// if (weatherModelController
|
||||
// .model
|
||||
// .weatherIconurl !=
|
||||
// null &&
|
||||
// weatherModelController
|
||||
// .model
|
||||
// .weatherIconurl!
|
||||
// .isNotEmpty)
|
||||
// Container(
|
||||
// width: 35.rpx,
|
||||
// height: 26.rpx,
|
||||
// clipBehavior:
|
||||
// Clip.antiAlias,
|
||||
// decoration:
|
||||
// BoxDecoration(
|
||||
// shape: BoxShape
|
||||
// .circle),
|
||||
// child: SvgPicture.asset(
|
||||
// "assets/images/weather/${weatherModelController.model.weatherIconurl}-fill.svg",
|
||||
// // fit: BoxFit.cover,
|
||||
// color: themeController
|
||||
// .currentColor.sc4,
|
||||
// ),
|
||||
// ),
|
||||
// ].divide(SizedBox(
|
||||
// width: 20.rpx,
|
||||
// )),
|
||||
// );
|
||||
// }),
|
||||
],
|
||||
),
|
||||
);
|
||||
@@ -1066,6 +1074,7 @@ class _HomePageState extends State<HomePage> {
|
||||
})
|
||||
: [],
|
||||
),
|
||||
|
||||
SizedBox(
|
||||
height:
|
||||
26.rpx), // 每个 widget 下方间距(包括最后一个)
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:ef/ef.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.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/EventBus.dart';
|
||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/common/util/eventType.dart';
|
||||
import 'package:vbvs_app/component/NullDataComponentWidget.dart';
|
||||
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||
@@ -29,6 +33,13 @@ class _MessagePageState extends State<MessagePage> {
|
||||
_pageController =
|
||||
PageController(initialPage: messageController.model.type == 1 ? 0 : 1);
|
||||
messageController.getMessageStatus();
|
||||
late StreamSubscription<SwitchLanguageEvent> subscription;
|
||||
|
||||
// 监听切换语言
|
||||
subscription = EventBus().on<SwitchLanguageEvent>().listen((event) {
|
||||
ef.log("切换语言事件通知");
|
||||
_fetchMessageData();
|
||||
});
|
||||
_fetchMessageData();
|
||||
}
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ class _ApplyRepairPageState extends State<ApplyRepairPage> {
|
||||
.map((e) => (e['_id']) as String)
|
||||
.toList();
|
||||
repairController.deviceListIdLabel = bodyDeviceController.deviceList
|
||||
.map((e) => (e['code']??e['mac']) as String)
|
||||
.map((e) => (e['code'] ?? e['mac']) as String)
|
||||
.toList();
|
||||
}
|
||||
return LayoutBuilder(
|
||||
@@ -197,12 +197,15 @@ class _ApplyRepairPageState extends State<ApplyRepairPage> {
|
||||
themeController.currentColor.sc2,
|
||||
]
|
||||
: [themeController.currentColor.sc5],
|
||||
child: Padding(
|
||||
padding: EdgeInsets.fromLTRB(
|
||||
32.rpx, 0, 32.rpx, 0),
|
||||
child: Container(
|
||||
width: (MediaQuery.sizeOf(context).width *
|
||||
0.284)
|
||||
.rpx,
|
||||
// width: (MediaQuery.sizeOf(context).width *
|
||||
// 0.284)
|
||||
// .rpx,
|
||||
constraints: BoxConstraints(
|
||||
minWidth: 213.rpx,
|
||||
// minWidth: 213.rpx,
|
||||
minHeight: 91.rpx,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
@@ -224,6 +227,7 @@ class _ApplyRepairPageState extends State<ApplyRepairPage> {
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
.toList()
|
||||
.divide(SizedBox(width: 25.rpx)),
|
||||
|
||||
@@ -265,34 +265,108 @@ class _RepairModelWidgetState extends State<RepairModelWidget> {
|
||||
].divide(SizedBox(width: 24.rpx)),
|
||||
),
|
||||
),
|
||||
// Container(
|
||||
// width: double.infinity,
|
||||
// // height: 151.rpx,
|
||||
// height: 200.rpx,
|
||||
// decoration: BoxDecoration(
|
||||
// color: themeController.currentColor.sc15,
|
||||
// borderRadius: BorderRadius.circular(20.rpx),
|
||||
// ),
|
||||
// child: Container(
|
||||
// width: 200.rpx,
|
||||
// child: TextFormField(
|
||||
// controller: repairController.onReDraw(
|
||||
// TextEditingController(text: widget.model['issue']),
|
||||
// (textEditingController) {
|
||||
// textEditingController.text = widget.model['issue'];
|
||||
// }),
|
||||
// onChanged: (value) {
|
||||
// widget.model['issue'] = value;
|
||||
// },
|
||||
// maxLines: null, // 👈 支持无限行
|
||||
// // controller: TextEditingController(),
|
||||
// autofocus: false,
|
||||
// obscureText: false,
|
||||
// maxLength: 60,
|
||||
// decoration: InputDecoration(
|
||||
// isDense: true,
|
||||
// labelStyle: TextStyle(
|
||||
// letterSpacing: 0.0,
|
||||
// ),
|
||||
// hintText: '问题描述'.tr,
|
||||
// hintStyle: TextStyle(
|
||||
// fontSize: 26.rpx,
|
||||
// letterSpacing: 0.0,
|
||||
// color: themeController.currentColor.sc4,
|
||||
// ),
|
||||
// enabledBorder: OutlineInputBorder(
|
||||
// borderSide: BorderSide(
|
||||
// color: Color(0x00000000),
|
||||
// width: 1,
|
||||
// ),
|
||||
// borderRadius: BorderRadius.circular(8.rpx),
|
||||
// ),
|
||||
// focusedBorder: OutlineInputBorder(
|
||||
// borderSide: BorderSide(
|
||||
// color: Color(0x00000000),
|
||||
// width: 1,
|
||||
// ),
|
||||
// borderRadius: BorderRadius.circular(8.rpx),
|
||||
// ),
|
||||
// errorBorder: OutlineInputBorder(
|
||||
// borderSide: BorderSide(
|
||||
// //
|
||||
// width: 1,
|
||||
// ),
|
||||
// borderRadius: BorderRadius.circular(8.rpx),
|
||||
// ),
|
||||
// focusedErrorBorder: OutlineInputBorder(
|
||||
// borderSide: BorderSide(
|
||||
// //
|
||||
// width: 1,
|
||||
// ),
|
||||
// borderRadius: BorderRadius.circular(8.rpx),
|
||||
// ),
|
||||
// filled: false,
|
||||
// contentPadding: EdgeInsets.symmetric(
|
||||
// vertical: 20.rpx, horizontal: 20.rpx),
|
||||
// ),
|
||||
// style: TextStyle(
|
||||
// color: themeController.currentColor.sc3,
|
||||
// fontSize: AppConstants().normal_text_fontSize,
|
||||
// ),
|
||||
// cursorColor: themeController.currentColor.sc3,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
|
||||
Container(
|
||||
width: double.infinity,
|
||||
height: 151.rpx,
|
||||
height: 170.rpx,
|
||||
decoration: BoxDecoration(
|
||||
color: themeController.currentColor.sc15,
|
||||
borderRadius: BorderRadius.circular(20.rpx),
|
||||
),
|
||||
child: Container(
|
||||
width: 200.rpx,
|
||||
child: Padding(
|
||||
// 👇 给输入框整体加点内边距
|
||||
padding: EdgeInsets.only(bottom: 10.rpx, right: 10.rpx),
|
||||
child: TextFormField(
|
||||
controller: repairController.onReDraw(
|
||||
TextEditingController(text: widget.model['issue']),
|
||||
(textEditingController) {
|
||||
textEditingController.text = widget.model['issue'];
|
||||
}),
|
||||
},
|
||||
),
|
||||
onChanged: (value) {
|
||||
widget.model['issue'] = value;
|
||||
},
|
||||
maxLines: null, // 👈 支持无限行
|
||||
// controller: TextEditingController(),
|
||||
maxLines: null,
|
||||
autofocus: false,
|
||||
obscureText: false,
|
||||
maxLength: 60,
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
labelStyle: TextStyle(
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
hintText: '问题描述'.tr,
|
||||
hintStyle: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
@@ -300,36 +374,28 @@ class _RepairModelWidgetState extends State<RepairModelWidget> {
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Color(0x00000000),
|
||||
width: 1,
|
||||
),
|
||||
borderSide:
|
||||
BorderSide(color: Colors.transparent, width: 1),
|
||||
borderRadius: BorderRadius.circular(8.rpx),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Color(0x00000000),
|
||||
width: 1,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8.rpx),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
//
|
||||
width: 1,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8.rpx),
|
||||
),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
//
|
||||
width: 1,
|
||||
),
|
||||
borderSide:
|
||||
BorderSide(color: Colors.transparent, width: 1),
|
||||
borderRadius: BorderRadius.circular(8.rpx),
|
||||
),
|
||||
filled: false,
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 20.rpx, horizontal: 20.rpx),
|
||||
|
||||
// 👇 调整输入区域与计数器的间距
|
||||
contentPadding:
|
||||
EdgeInsets.fromLTRB(20.rpx, 20.rpx, 20.rpx, 40.rpx),
|
||||
|
||||
// 👇 调整计数器样式和位置(上浮一点,不贴边)
|
||||
counterStyle: TextStyle(
|
||||
height: 1.2, // 控制计数器与下边的距离
|
||||
fontSize: 22.rpx,
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
alignLabelWithHint: true,
|
||||
),
|
||||
style: TextStyle(
|
||||
color: themeController.currentColor.sc3,
|
||||
@@ -339,6 +405,7 @@ class _RepairModelWidgetState extends State<RepairModelWidget> {
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
ClickableContainer(
|
||||
backgroundColor: themeController.currentColor.sc15,
|
||||
highlightColor: themeController.currentColor.sc21,
|
||||
|
||||
@@ -2,8 +2,10 @@ import 'package:ef/ef.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/EventBus.dart';
|
||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/common/util/eventType.dart';
|
||||
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||
import 'package:vbvs_app/component/tool/CustomCard.dart';
|
||||
import 'package:vbvs_app/controller/device/body_device_controller.dart';
|
||||
@@ -125,6 +127,9 @@ class _LanguageSettingState extends State<LanguageSetting> {
|
||||
languageController
|
||||
.selectLanguage
|
||||
.value = language;
|
||||
EventBus().emit(
|
||||
SwitchLanguageEvent(
|
||||
language.language_code));
|
||||
await AppLanguage()
|
||||
.loadLanguage(language
|
||||
.language_code); // 加载语言
|
||||
|
||||
@@ -53,7 +53,7 @@ Widget DailyDataWidget(
|
||||
sleepReport: sleepReport,
|
||||
highlightItem: data['itemName'],
|
||||
),
|
||||
SnoreViewWidgetWidget(sleepReport: sleepReport),
|
||||
// SnoreViewWidgetWidget(sleepReport: sleepReport),
|
||||
BreathePauseNewWidget(sleepReport: sleepReport),
|
||||
HeartHealthWidget(sleepReport: sleepReport),
|
||||
DiseasePercentsWidget(sleepReport: sleepReport),
|
||||
|
||||
@@ -99,7 +99,10 @@ class _SleepCardState extends State<SleepCard> with TickerProviderStateMixin {
|
||||
}
|
||||
}
|
||||
int num = AppLanguage().isChinese() ? 3 : 2;
|
||||
List data = widget.sleepReport['bs'] ?? [];
|
||||
// List data = widget.sleepReport['bs'] ?? [];
|
||||
List data = (widget.sleepReport['bs'] ?? [])
|
||||
.where((item) => item['show'] != false)
|
||||
.toList();
|
||||
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
|
||||
Reference in New Issue
Block a user