更新特殊处理测试账号

This commit is contained in:
wyf
2025-10-16 10:10:15 +08:00
parent aae9e551d3
commit 6862b97e17
10 changed files with 553 additions and 360 deletions

View File

@@ -74,7 +74,8 @@ class _DynamicReportDetailWidgetState extends State<DynamicReportDetailWidget> {
SizedBox(height: 33.rpx),
_buildSleepDateWidgets(),
SizedBox(height: 20.rpx),
_buildSleepDataModuleWidgets(),
if (!AppConstants.is_test_account)
_buildSleepDataModuleWidgets(),
],
),
),
@@ -104,62 +105,63 @@ class _DynamicReportDetailWidgetState extends State<DynamicReportDetailWidget> {
),
),
),
ClickableContainer(
backgroundColor: Colors.transparent,
highlightColor: themeController.currentColor.sc3,
borderRadius: 0,
padding: EdgeInsets.zero,
onTap: () {
String mac = targetDevice['mac'];
List<SleepDateWidget> selectedWidgets = widget.sleepDateWidgets
.where((w) => w.isSelected == true)
.toList();
if (selectedWidgets.isNotEmpty) {
DateTime dateTime = DateTime.fromMillisecondsSinceEpoch(
int.parse(selectedWidgets[0].time!));
String time = MyUtils.formatBindTime(dateTime);
// String sleepReportUrl =
// "${ServiceConstant.sleep_report_url}?mac=$mac&token=${ServiceConstant.sleep_token}&date=$time";
// Get.toNamed("/sleepReportPage", arguments: sleepReportUrl);
Get.toNamed("/newSleepReportPage", arguments: {
'date': dateTime != null
? dateTime.millisecondsSinceEpoch
: DateTime.now().millisecondsSinceEpoch,
"mac": mac,
'type': 1,
'name': 'sleep', //'sleep', 'heartRate' 或 'breathe'
// 'itemName': widget.data['id'],
'person': widget.targetDevice['person'],
});
} else {
TopSlideNotification.show(context,
text: "当前暂无数据".tr,
textColor: themeController.currentColor.sc9);
}
},
child: Row(
children: [
Text(
'首页.报告详情'.tr,
style: TextStyle(
fontFamily: 'Inter',
fontSize: 26.rpx,
letterSpacing: 0.0,
color: themeController.currentColor.sc3,
if (!AppConstants.is_test_account)
ClickableContainer(
backgroundColor: Colors.transparent,
highlightColor: themeController.currentColor.sc3,
borderRadius: 0,
padding: EdgeInsets.zero,
onTap: () {
String mac = targetDevice['mac'];
List<SleepDateWidget> selectedWidgets = widget.sleepDateWidgets
.where((w) => w.isSelected == true)
.toList();
if (selectedWidgets.isNotEmpty) {
DateTime dateTime = DateTime.fromMillisecondsSinceEpoch(
int.parse(selectedWidgets[0].time!));
String time = MyUtils.formatBindTime(dateTime);
// String sleepReportUrl =
// "${ServiceConstant.sleep_report_url}?mac=$mac&token=${ServiceConstant.sleep_token}&date=$time";
// Get.toNamed("/sleepReportPage", arguments: sleepReportUrl);
Get.toNamed("/newSleepReportPage", arguments: {
'date': dateTime != null
? dateTime.millisecondsSinceEpoch
: DateTime.now().millisecondsSinceEpoch,
"mac": mac,
'type': 1,
'name': 'sleep', //'sleep', 'heartRate' 或 'breathe'
// 'itemName': widget.data['id'],
'person': widget.targetDevice['person'],
});
} else {
TopSlideNotification.show(context,
text: "当前暂无数据".tr,
textColor: themeController.currentColor.sc9);
}
},
child: Row(
children: [
Text(
'首页.报告详情'.tr,
style: TextStyle(
fontFamily: 'Inter',
fontSize: 26.rpx,
letterSpacing: 0.0,
color: themeController.currentColor.sc3,
),
),
),
Padding(
padding: EdgeInsetsDirectional.fromSTEB(0, 6.rpx, 0, 0.rpx),
child: SvgPicture.asset(
'assets/img/icon/arrow_right.svg',
width: 14.rpx,
height: 14.rpx,
color: themeController.currentColor.sc3,
Padding(
padding: EdgeInsetsDirectional.fromSTEB(0, 6.rpx, 0, 0.rpx),
child: SvgPicture.asset(
'assets/img/icon/arrow_right.svg',
width: 14.rpx,
height: 14.rpx,
color: themeController.currentColor.sc3,
),
),
),
].divide(SizedBox(width: 22.rpx)),
].divide(SizedBox(width: 22.rpx)),
),
),
),
],
);
}

View File

@@ -140,37 +140,38 @@ class _SleepDateWidgetState extends State<SleepDateWidget> {
],
),
),
Container(
width: 0.2.rpx,
height: 2.4.rpx,
constraints: BoxConstraints(
minWidth: 123.rpx,
minHeight: 47.rpx,
),
child: FFButtonWidget(
onPressed: () {
print('合格按钮点击');
},
text: (widget.comment?.trim().isEmpty ?? true)
? '暂无'.tr
: widget.comment!,
options: FFButtonOptions(
height: 40.rpx,
padding:
EdgeInsetsDirectional.fromSTEB(16.rpx, 0, 16.rpx, 0),
iconPadding: EdgeInsetsDirectional.fromSTEB(0, 0, 0, 0),
color:
widget.textColor ?? themeController.currentColor.sc4,
textStyle: TextStyle(
// fontFamily: 'Inter Tight',
color: themeController.currentColor.sc3,
letterSpacing: 0.0,
if (!AppConstants.is_test_account)
Container(
width: 0.2.rpx,
height: 2.4.rpx,
constraints: BoxConstraints(
minWidth: 123.rpx,
minHeight: 47.rpx,
),
child: FFButtonWidget(
onPressed: () {
print('合格按钮点击');
},
text: (widget.comment?.trim().isEmpty ?? true)
? '暂无'.tr
: widget.comment!,
options: FFButtonOptions(
height: 40.rpx,
padding: EdgeInsetsDirectional.fromSTEB(
16.rpx, 0, 16.rpx, 0),
iconPadding: EdgeInsetsDirectional.fromSTEB(0, 0, 0, 0),
color: widget.textColor ??
themeController.currentColor.sc4,
textStyle: TextStyle(
// fontFamily: 'Inter Tight',
color: themeController.currentColor.sc3,
letterSpacing: 0.0,
),
elevation: 0,
borderRadius: BorderRadius.circular(50.rpx),
),
elevation: 0,
borderRadius: BorderRadius.circular(50.rpx),
),
),
),
],
)),
),