1.修复睡眠日报中睡眠规律性数据显示错误
2.更新时区设置
This commit is contained in:
@@ -25,7 +25,6 @@ import 'package:vbvs_app/enum/BindType.dart';
|
||||
import 'package:vbvs_app/model/api_response.dart';
|
||||
import 'package:vbvs_app/pages/device_bind/componnet/bind_dialog.dart';
|
||||
|
||||
|
||||
class DeviceDataComponentWidget extends StatefulWidget {
|
||||
final Map<String, dynamic> device;
|
||||
|
||||
@@ -44,6 +43,7 @@ class _DeviceDataComponentWidgetState extends State<DeviceDataComponentWidget> {
|
||||
bool _isPopupOpen = false;
|
||||
|
||||
var lisObj;
|
||||
late StreamSubscription<ScrollNotificationEvent> _scrollSubscription;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
@@ -64,6 +64,12 @@ class _DeviceDataComponentWidgetState extends State<DeviceDataComponentWidget> {
|
||||
cityController.cityList = [];
|
||||
await initializeCityData();
|
||||
});
|
||||
_scrollSubscription =
|
||||
EventBus().on<ScrollNotificationEvent>().listen((event) {
|
||||
if (_isPopupOpen) {
|
||||
_closePopup();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void _showPopup() {
|
||||
@@ -628,7 +634,7 @@ class _DeviceDataComponentWidgetState extends State<DeviceDataComponentWidget> {
|
||||
maxWidth: MediaQuery.sizeOf(context).width * 0.6,
|
||||
),
|
||||
child: Text(
|
||||
'${widget.device['person']?['name'] ?? '未命名'.tr}',
|
||||
'${(widget.device['person']?['name'] as String?)?.isNotEmpty == true ? widget.device['person']!['name'] : '体征检测设备'.tr}',
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 30.rpx,
|
||||
@@ -1180,6 +1186,8 @@ class _DeviceDataComponentWidgetState extends State<DeviceDataComponentWidget> {
|
||||
personController.dateTime =
|
||||
MyUtils.formatBirthdayTime(
|
||||
widget.device['person']['birthday']);
|
||||
personController.timeZone.value =
|
||||
widget.device['person']['UTC'] ?? '';
|
||||
if (widget.device['person']['city_id'] != null) {
|
||||
// 根据city_id查找完整的城市数据
|
||||
final int cityId =
|
||||
@@ -1208,6 +1216,7 @@ class _DeviceDataComponentWidgetState extends State<DeviceDataComponentWidget> {
|
||||
personController.weight.value = "";
|
||||
personController.diseaseList.value = [];
|
||||
personController.cityModel = null;
|
||||
personController.timeZone.value = "";
|
||||
}
|
||||
await Get.toNamed("/updatePersonPage",
|
||||
arguments: widget.device['bind_type']);
|
||||
@@ -1701,4 +1710,12 @@ class _DeviceDataComponentWidgetState extends State<DeviceDataComponentWidget> {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void _closePopup() {
|
||||
setState(() {
|
||||
_isPopupOpen = false;
|
||||
});
|
||||
_popupEntry?.remove();
|
||||
_popupEntry = null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user