日报周报月报

This commit is contained in:
czz
2025-07-09 14:37:04 +08:00
parent 143e7634d9
commit b81b7c75b8
17 changed files with 619 additions and 644 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16.54 31.09"><defs><style>.cls-1{fill:#fff;}</style></defs><title>资源 261 </title><g id="图层_2" data-name="图层 2"><g id="图层_1-2" data-name="图层 1"><path class="cls-1" d="M15.54,31.09a1,1,0,0,1-.7-.3L.29,16.25a1,1,0,0,1,0-1.41L14.84.29a1,1,0,0,1,1.41,0,1,1,0,0,1,0,1.42L2.41,15.54,16.25,29.38a1,1,0,0,1-.71,1.71Z"/></g></g></svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="30" height="30.00006103515625" viewBox="0 0 30 30.00006103515625"><g><g><g transform="matrix(0,1,-1,0,30,-30)"></g></g><g><g><g><path d="M11.342529296875,14.99966720703125C11.342529296875,14.87161720703125,11.391479496875,14.74465720703125,11.489502296875,14.646637207031251C11.489502296875,14.646637207031251,17.804439296875,8.33059720703125,17.804439296875,8.33059720703125C17.999509296875,8.13565060703125,18.316529296875,8.13565060703125,18.511479296875,8.33059720703125C18.706419296874998,8.52664220703125,18.706419296874998,8.84256020703125,18.511479296875,9.03762820703125C18.511479296875,9.03762820703125,12.549439296875,14.99966720703125,12.549439296875,14.99966720703125C12.549439296875,14.99966720703125,18.511479296875,20.96158720703125,18.511479296875,20.96158720703125C18.706419296874998,21.15758720703125,18.706419296874998,21.47368720703125,18.511479296875,21.66858720703125C18.316529296875,21.864687207031253,17.999509296875,21.864687207031253,17.804439296875,21.66858720703125C17.804439296875,21.66858720703125,11.489502296875,15.35366720703125,11.489502296875,15.35366720703125C11.391479496875,15.255647207031249,11.342529296875,15.12759720703125,11.342529296875,14.99966720703125C11.342529296875,14.99966720703125,11.342529296875,14.99966720703125,11.342529296875,14.99966720703125Z" fill="#FFFFFF" fill-opacity="1"/></g></g></g></g></svg>

Before

Width:  |  Height:  |  Size: 397 B

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 7.32 13.63"><defs><style>.cls-1{fill:#fff;}</style></defs><title>资源 274 </title><g id="图层_2" data-name="图层 2"><g id="图层_1-2" data-name="图层 1"><path class="cls-1" d="M7.32,6.82a.5.5,0,0,1-.15.35L.85,13.48a.48.48,0,0,1-.7,0,.48.48,0,0,1,0-.7l6-6-6-6a.48.48,0,0,1,0-.7.48.48,0,0,1,.7,0L7.17,6.46A.51.51,0,0,1,7.32,6.82Z"/></g></g></svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="30" height="30" viewBox="0 0 30 30"><g><g><g transform="matrix(0,-1,1,0,-30,30)"></g></g><g><g><g><path d="M18.657351015625,14.999606171875C18.657351015625,15.127536171875,18.609251015625,15.255586171874999,18.511351015625,15.353606171875C18.511351015625,15.353606171875,12.196167015625,21.668526171875,12.196167015625,21.668526171875C12.000366015625,21.864626171875003,11.684204015625,21.864626171875003,11.488159015625,21.668526171875C11.293334915625,21.473626171875,11.293334915625,21.157526171875,11.488159015625,20.961526171875C11.488159015625,20.961526171875,17.450321015625,14.999606171875,17.450321015625,14.999606171875C17.450321015625,14.999606171875,11.488159015625,9.037567171875,11.488159015625,9.037567171875C11.293334915625,8.842499171875,11.293334915625,8.526581171875,11.488159015625,8.330536171875C11.684204015625,8.135589571875,12.000366015625,8.135589571875,12.196167015625,8.330536171875C12.196167015625,8.330536171875,18.511351015625,14.646576171875001,18.511351015625,14.646576171875001C18.609251015625,14.744596171875,18.657351015625,14.871556171875,18.657351015625,14.999606171875C18.657351015625,14.999606171875,18.657351015625,14.999606171875,18.657351015625,14.999606171875Z" fill="#FFFFFF" fill-opacity="1"/></g></g></g></g></svg>

Before

Width:  |  Height:  |  Size: 406 B

After

Width:  |  Height:  |  Size: 1.3 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

@@ -26,7 +26,7 @@ class _TestWidgetState extends State<NullDataWidget> {
height: MediaQuery.sizeOf(context).height * 1,
child: Column(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: EdgeInsetsDirectional.fromSTEB(0, 0.rpx, 0, 0),

View File

@@ -39,7 +39,7 @@ class _MhMessageListWidgetState extends State<MhMessageListWidget> {
highlightColor: Color(0xFF055466),
borderRadius: 20.rpx,
padding:
EdgeInsetsDirectional.fromSTEB(31.rpx, 33.rpx, 26.rpx, 26.rpx),
EdgeInsetsDirectional.fromSTEB(30.rpx, 26.rpx, 30.rpx, 26.rpx),
onTap: () {},
child: Column(
mainAxisSize: MainAxisSize.max,
@@ -47,7 +47,7 @@ class _MhMessageListWidgetState extends State<MhMessageListWidget> {
Container(
width: double.infinity,
constraints: BoxConstraints(
minHeight: 66.rpx,
minHeight: 60.rpx,
),
child: Align(
alignment: AlignmentDirectional(-1, 0),
@@ -63,12 +63,10 @@ class _MhMessageListWidgetState extends State<MhMessageListWidget> {
),
),
),
Row(
mainAxisSize: MainAxisSize.max,
children: [
Row(mainAxisSize: MainAxisSize.max, children: [
Container(
constraints: BoxConstraints(
minWidth: 30.rpx,
minWidth: 60.rpx,
maxWidth: 140.rpx,
),
child: Column(
@@ -82,7 +80,7 @@ class _MhMessageListWidgetState extends State<MhMessageListWidget> {
),
Container(
constraints: BoxConstraints(
minWidth: 30.rpx,
minWidth: 60.rpx,
),
child: Column(
mainAxisSize: MainAxisSize.max,
@@ -93,15 +91,12 @@ class _MhMessageListWidgetState extends State<MhMessageListWidget> {
.toList(),
),
),
].divide(SizedBox(width: 30.rpx)),
),
]),
if (messageInfo['type'] == 'app_system')
// // right: 26.rpx,
// left: 26.rpx,
Container(
// width: 123.rpx,
height: 61.rpx,
Padding(
padding: EdgeInsets.only(top: 28.rpx),
child: Container(
height: 60.rpx,
child: CustomCard(
borderRadius: 16.rpx, // 直角
gradientDirection: GradientDirection.vertical,
@@ -151,6 +146,7 @@ class _MhMessageListWidgetState extends State<MhMessageListWidget> {
),
),
),
)
],
),
),
@@ -161,7 +157,7 @@ class _MhMessageListWidgetState extends State<MhMessageListWidget> {
Widget _buildInfoItem(BuildContext context, String label) {
return Container(
constraints: BoxConstraints(
minHeight: 62.rpx,
minHeight: 60.rpx,
),
child: Align(
alignment: AlignmentDirectional(-1, 0),
@@ -183,7 +179,7 @@ class _MhMessageListWidgetState extends State<MhMessageListWidget> {
Widget _buildValueItem(BuildContext context, value) {
return Container(
constraints: BoxConstraints(
minHeight: 62.rpx,
minHeight: 60.rpx,
),
child: Align(
alignment: AlignmentDirectional(-1, 0),

View File

@@ -196,7 +196,7 @@ class _ApplyRepairSuccessState extends State<ApplyRepairSuccess> {
AppConstants().button_container_radius, // 圆角半径
gradientDirection: GradientDirection.vertical,
onTap: () async {
Get.toNamed("/repairListPage");
Get.toNamed("/deviceRepairPage");
},
colors: [
Color(0xFFFCFCFC),

View File

@@ -11,6 +11,7 @@ import 'package:vbvs_app/model/api_response.dart';
import 'package:vbvs_app/pages/device_bind/componnet/bind_dialog.dart';
import 'package:vbvs_app/pages/mh_page/homepage/controller/mht_home_controller.dart';
import 'package:vbvs_app/pages/mh_page/test/WebviewTestModel.dart';
import 'dart:ui' as ui;
class BluetoothPage extends StatefulWidget {
final Map data;
@@ -21,10 +22,41 @@ class BluetoothPage extends StatefulWidget {
class _BluetoothPageState extends State<BluetoothPage> {
late RxMap<String, dynamic> obsData;
double _textHalfWidth = 0;
@override
void initState() {
super.initState();
obsData = Map<String, dynamic>.from(widget.data).obs; // 复制成 obs
String text;
if (widget.data.containsKey('name') &&
widget.data['name'] != null &&
widget.data['name'].toString().isNotEmpty) {
text = widget.data['name'].toString();
} else {
text = '未命名'.tr;
}
_calculateTextHalfWidth(text);
}
void _calculateTextHalfWidth(String text) {
final textSpan = TextSpan(
text: text,
style: TextStyle(
fontSize: 40.rpx,
height: 1,
),
);
final textPainter = TextPainter(
text: textSpan,
textDirection: ui.TextDirection.ltr,
);
textPainter.layout(); // 计算文本宽度
setState(() {
_textHalfWidth = textPainter.width / 2;
});
}
BoxConstraints? bodysize;
@@ -85,8 +117,10 @@ class _BluetoothPageState extends State<BluetoothPage> {
children: [
Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
Container(
width: double.infinity,
child: Stack(
alignment: Alignment.center,
children: [
Text(
obsData['name']?.toString() ?? '未命名',
@@ -94,11 +128,21 @@ class _BluetoothPageState extends State<BluetoothPage> {
color: Colors.white,
fontSize: 40.rpx,
),
overflow:
TextOverflow.ellipsis, // 超出部分显示省略号
maxLines: 1, // 限制为单行
),
SizedBox(width: 27.rpx),
ClickableContainer(
Positioned(
left:
MediaQuery.of(context).size.width /
2 +
_textHalfWidth +
22.rpx,
top: 5.rpx,
child: ClickableContainer(
backgroundColor: Colors.transparent,
highlightColor: const Color(0xFF055466),
highlightColor:
const Color(0xFF055466),
padding: EdgeInsets.only(left: 0),
onTap: () async {
var x = await Get.toNamed(
@@ -106,7 +150,8 @@ class _BluetoothPageState extends State<BluetoothPage> {
arguments: obsData);
if (x != null) {
setState(() {
obsData.addAll(x); // 值更新后主动刷新页面
obsData
.addAll(x); // 值更新后主动刷新页面
});
}
},
@@ -116,9 +161,10 @@ class _BluetoothPageState extends State<BluetoothPage> {
child: SvgPicture.asset(
"assets/img/icon/bluetooth_edit.svg",
color: Colors.white,
)))
))))
],
),
),
const SizedBox(height: 4),
Text(obsData['mac']?.toString() ?? '未命名',
@@ -156,17 +202,17 @@ class _BluetoothPageState extends State<BluetoothPage> {
),
],
),
const SizedBox(height: 24),
Expanded(
child: ListView(
padding: EdgeInsets.symmetric(horizontal: 30.rpx),
padding: EdgeInsets.only(
left: 30.rpx, right: 30.rpx, bottom: 60.rpx),
reverse: !isBind,
children: [
if (isBind) ...[
_buildMenuButton(
context, '详情', "/devicePeopleInfo",
arguments: obsData),
if (isBind) ...[
_buildMenuButton(
context,
'人员资料',
@@ -185,164 +231,28 @@ class _BluetoothPageState extends State<BluetoothPage> {
context, '分享设备', "/deviceSharePage",
arguments: obsData),
],
if (!isBind) ...[
_buildMenuButton(
context,
obsData['bind_type'] == 1 ? '解绑' : '删除',
"",
onTap: () {
if (obsData['bind_type'] == 1) {
// 解绑弹窗
showUnbindConfirmDialog(
context: context,
title: "是否进行解绑?",
onConfirm: () async {
await deviceListController
.unbindDevice(obsData);
await deviceListController
.getDeviceList();
MHTHomeController homeController =
Get.find();
homeController.selectDevcie.value =
"";
try {
WebviewTestController
webviewTestController =
Get.find();
webviewTestController
.web.jsbridge?.dart
.unBindDevice();
} catch (e) {
ef.log("[h5]通知列表更新报错:$e");
}
Get.toNamed("/mianPageBottomChange");
// 执行解绑逻辑
},
onCancel: () {
// 点击取消后的逻辑
},
);
} else if (obsData['bind_type'] == 2) {
// 删除弹窗
showDeleteDeviceConfirmDialog(
context: context,
title: "是否进行删除?",
onConfirm: () async {
await deviceListController
.unbindDevice(
obsData,
);
await deviceListController
.getDeviceList();
Get.toNamed("/mianPageBottomChange");
},
onCancel: () {
// 点击取消后的逻辑
},
);
}
},
onTap: () {/*...*/},
),
_buildMenuButton(
context, '详情', "/devicePeopleInfo",
arguments: obsData),
],
if (isBind) ...[
_buildMenuButton(
context,
obsData['bind_type'] == 1 ? '解绑' : '删除',
"",
onTap: () {/*...*/},
),
],
],
),
),
// Expanded(
// child: Align(
// alignment: Alignment.bottomCenter,
// child: SingleChildScrollView(
// reverse: true, // 👈 optional如果你想要滚动时内容从底部弹出
// child: Column(
// crossAxisAlignment:
// CrossAxisAlignment.stretch,
// mainAxisSize: MainAxisSize.min,
// children: [
// _buildMenuButton(
// context, '详情', "/devicePeopleInfo",
// arguments: obsData),
// if (isBind) ...[
// _buildMenuButton(
// context,
// '人员资料',
// "/peopleInfoPage",
// arguments: obsData,
// ),
// _buildMenuButton(
// context, '房间选择', "/roomPickerPage",
// arguments: obsData),
// _buildMenuButton(context, '设备校准', ""),
// _buildMenuButton(context, '体征传感器', ""),
// _buildMenuButton(context, 'WIFI配置', ""),
// _buildMenuButton(
// context, '睡眠习惯', "/sleepHabitPage"),
// _buildMenuButton(
// context, '分享设备', "/deviceSharePage",
// arguments: obsData),
// ],
// _buildMenuButton(
// context,
// obsData['bind_type'] == 1 ? '解绑' : '删除',
// "",
// onTap: () {
// if (obsData['bind_type'] == 1) {
// // 解绑弹窗
// showUnbindConfirmDialog(
// context: context,
// title: "是否进行解绑?",
// onConfirm: () async {
// await deviceListController
// .unbindDevice(obsData);
// await deviceListController
// .getDeviceList();
// MHTHomeController homeController =
// Get.find();
// homeController
// .selectDevcie.value = "";
// try {
// WebviewTestController
// webviewTestController =
// Get.find();
// webviewTestController
// .web.jsbridge?.dart
// .unBindDevice();
// } catch (e) {
// ef.log("[h5]通知列表更新报错:$e");
// }
// Get.toNamed(
// "/mianPageBottomChange");
// // 执行解绑逻辑
// },
// onCancel: () {
// // 点击取消后的逻辑
// },
// );
// } else if (obsData['bind_type'] == 2) {
// // 删除弹窗
// showDeleteDeviceConfirmDialog(
// context: context,
// title: "是否进行删除?",
// onConfirm: () async {
// await deviceListController
// .unbindDevice(
// obsData,
// );
// await deviceListController
// .getDeviceList();
// Get.toNamed(
// "/mianPageBottomChange");
// },
// onCancel: () {
// // 点击取消后的逻辑
// },
// );
// }
// },
// ),
// ],
// ),
// ),
// ),
// ),
],
),
)),

View File

@@ -119,7 +119,6 @@ class LineView extends StatelessWidget {
Offset(offset.dx, 0),
barWidth,
offset.dy,
Paint()
..color = barColors!.length == 0
? Colors.white
@@ -177,7 +176,8 @@ class LineView extends StatelessWidget {
barWidth,
remainHeight,
Paint()
..color = stringToColor(remainColor).withOpacity(0.8),
..color =
stringToColor(remainColor).withOpacity(0.8),
);
}
// 若已满,不绘制灰色段、也不显示文字(不做任何处理)
@@ -185,7 +185,21 @@ class LineView extends StatelessWidget {
}
},
),
));
onTips: (view, tips) => Container(
padding: EdgeInsets.all(16.rpx), // ✅ 容器内部边距,给文字留空间
decoration: BoxDecoration(
color: themeController.currentColor.sc5,
borderRadius: BorderRadius.circular(20.rpx),
),
alignment: Alignment.center,
child: Text(
tips,
style: TextStyle(
color: Color(0XFFFFFFFF), // 多了一个 F建议改成正确格式
fontSize: 26.rpx,
),
),
)));
});
}
}

View File

@@ -357,7 +357,7 @@ class DeviceInfoWidget extends GetView {
EdgeInsetsDirectional.fromSTEB(
5, 0, 5, 0),
child: Text(
'${device['suname']?.length > 5 ? device['suname'].substring(0, 5) + '...' : device['suname']}',
'${device['source']?.length > 5 ? device['source'].substring(0, 5) + '...' : device['source']}',
style: TextStyle(
fontFamily: 'Readex Pro',
color: Color(0xFF85F5FF),

View File

@@ -900,17 +900,18 @@ class _NewHomePageState extends State<NewHomePage> {
SizedBox(width: 40.rpx),
CircleAvatar(
radius: 27.rpx, // 可根据需求调整
backgroundColor: Colors.transparent,
backgroundImage: login == 1
? (userInfoController.model.user!.avatar == null ||
userInfoController.model.user!.avatar!.isEmpty
? const AssetImage(
"assets/images/default_avatar.png",
"assets/images/mine_avatar.png",
)
: NetworkImage(
userInfoController.model.user!.avatar!,
))
: const AssetImage(
"assets/images/default_avatar.png",
"assets/images/mine_avatar.png",
),
),
SizedBox(width: 23.rpx), // 左侧头像和文本之间的间距
@@ -923,17 +924,18 @@ class _NewHomePageState extends State<NewHomePage> {
SizedBox(width: 40.rpx),
CircleAvatar(
radius: 27.rpx, // 可根据需求调整
backgroundColor: Colors.transparent,
backgroundImage: login == 1
? (userInfoController.model.user!.avatar == null ||
userInfoController.model.user!.avatar!.isEmpty
? const AssetImage(
"assets/images/default_avatar.png",
"assets/images/mine_avatar.png",
)
: NetworkImage(
userInfoController.model.user!.avatar!,
))
: const AssetImage(
"assets/images/default_avatar.png",
"assets/images/mine_avatar.png",
),
),
SizedBox(width: 23.rpx), // 左侧头像和文本之间的间距

View File

@@ -192,9 +192,8 @@ class _MessageDetailPageState extends State<MessageDetailPage> {
getStatusText(widget.data['status']),
style: TextStyle(
fontFamily: 'Readex Pro',
color: widget.data['data']['status'] == 1
? Colors.white
: Color(0xFF929699),
color:
widget.data['status'] == 1 ? Colors.white : Color(0xFF929699),
fontSize: 26.rpx,
letterSpacing: 0,
),

View File

@@ -141,7 +141,7 @@ class _MinePageState extends State<NewMinePage> {
userInfoController
.model.user!.avatar!.isEmpty
? Image.asset(
"assets/images/default_avatar.png",
"assets/images/mine_avatar.png",
fit: BoxFit.cover,
)
: Image.network(
@@ -149,7 +149,7 @@ class _MinePageState extends State<NewMinePage> {
fit: BoxFit.cover,
))
: Image.asset(
"assets/images/default_avatar.png",
"assets/images/mine_avatar.png",
fit: BoxFit.cover,
),
),

View File

@@ -64,7 +64,7 @@ class RepairHistoryWidget extends GetView<RepairInfoController> {
children: [
Text(
repairListController.model.repairList[index]['device']
[0]['mac'] ??
['mac'] ??
'',
style: TextStyle(
color: Colors.white, fontSize: 30.rpx, height: 1),

View File

@@ -193,7 +193,7 @@ Widget WeekDataWidget(
offset,
textAlign: TextAlign.center,
style: TextStyle(
color: Color(0xFFFFFFFF).withOpacity(0.6),
color: Color(0xFFFFFFFF).withOpacity(0.06),
fontSize: 18.rpx),
);
},

View File

@@ -88,7 +88,7 @@ class AvgSleepScoreWidget extends StatelessWidget {
Text(
sleepReport['score']?['max']?.toString() ?? '--',
style: TextStyle(
color: stringToColor("#FF9F66"),
color: Colors.white,
fontSize: 48.rpx,
),
),

View File

@@ -37,6 +37,7 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
final GlobalKey heartRateCardKey = GlobalKey();
final GlobalKey breatheCardKey = GlobalKey();
final ScrollController _scrollController = ScrollController();
final RxBool isRightLimit = false.obs;
@override
void didUpdateWidget(NewSleepReportPage oldWidget) {
@@ -600,8 +601,8 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
widget.data['backgroundColor'] != null
? widget.data['backgroundColor']
: themeController.currentColor.sc5,
highlightColor:
themeController.currentColor.sc5, // 或你希望的点击水波纹颜色
highlightColor: themeController
.currentColor.sc5, // 或你希望的点击水波纹颜色
borderRadius: AppConstants()
.normal_container_radius, // 如果你想加圆角可以设置 eg. 12.rpx
padding: EdgeInsets.zero,
@@ -612,7 +613,8 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
Flexible(
flex: 2,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Row(
children: [
@@ -678,7 +680,8 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
),
]
.divide(SizedBox(width: 33.rpx))
.addToStart(SizedBox(width: 37.rpx)),
.addToStart(
SizedBox(width: 37.rpx)),
),
]
.addToStart(SizedBox(height: 36.rpx))
@@ -688,7 +691,8 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
Flexible(
flex: 3,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Row(
children: [
@@ -749,7 +753,8 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
),
]
.divide(SizedBox(width: 33.rpx))
.addToStart(SizedBox(width: 37.rpx)),
.addToStart(
SizedBox(width: 37.rpx)),
),
]
.addToStart(SizedBox(height: 36.rpx))
@@ -778,7 +783,6 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
)),
);
}),
),
),
),
@@ -829,6 +833,7 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
}
void onLeftArrowTap() {
isRightLimit.value = false;
if (type == 1) {
sleepReportController.selectedDate.value =
selectedDate.subtract(const Duration(days: 1));
@@ -877,22 +882,62 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
}
void onRightArrowTap() {
final now = DateTime.now();
final today = DateTime(now.year, now.month, now.day);
DateTime targetDate = selectedDate;
if (type == 1) {
sleepReportController.selectedDate.value =
selectedDate.add(const Duration(days: 1));
final nextDate = selectedDate.add(const Duration(days: 1));
if (!nextDate.isAfter(today)) {
targetDate = nextDate;
} else {
isRightLimit.value = true;
return;
}
} else if (type == 2) {
sleepReportController.selectedDate.value =
selectedDate.add(const Duration(days: 7));
final currentWeekday = today.weekday; // 1=周一7=周日
final currentWeekEnd = today.add(Duration(days: 7 - currentWeekday));
final nextWeek = selectedDate.add(const Duration(days: 7));
if (!nextWeek.isAfter(currentWeekEnd)) {
targetDate = nextWeek;
} else {
isRightLimit.value = true;
return;
}
} else if (type == 3) {
sleepReportController.selectedDate.value = DateTime(
final currentMonthEnd = DateTime(today.year, today.month + 1, 0);
final nextMonth = DateTime(
selectedDate.year,
selectedDate.month + 1,
selectedDate.day,
);
if (!nextMonth.isAfter(currentMonthEnd)) {
final correctedDay = DateTime(
nextMonth.year,
nextMonth.month + 1,
0,
).day;
targetDate = DateTime(
nextMonth.year,
nextMonth.month,
nextMonth.day > correctedDay ? correctedDay : nextMonth.day,
);
} else {
isRightLimit.value = true;
return;
}
calendarController.selectedDate.value =
sleepReportController.selectedDate.value;
String data = MyUtils.formatDate(calendarController.selectedDate.value!);
}
// 👉 更新数据并请求
sleepReportController.selectedDate.value = targetDate;
calendarController.selectedDate.value = targetDate;
String data = MyUtils.formatDate(targetDate);
requestWithLog(
logTitle: "查询睡眠报告",
method: MyHttpMethod.get,
@@ -904,25 +949,21 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
sleepReportController.updateAll();
},
onFailure: (res) {
if (MainPageBBottomChange.getCurrentIndex() != null) {
if (MainPageBBottomChange.getCurrentIndex() == 1) {
TopSlideNotification.show(context,
text: res.msg!,
textColor: themeController.currentColor.sc9);
}
} else {
TopSlideNotification.show(context,
text: res.msg!, textColor: themeController.currentColor.sc9);
}
final msg = res.msg!;
TopSlideNotification.show(
context,
text: msg,
textColor: themeController.currentColor.sc9,
);
sleepReportController.sleepReport.value = {};
sleepReportController.updateAll();
print(res);
});
},
);
sleepReportController.updateAll();
calendarController.updateAll();
}
void onChangeArrowTap() {
if (type == 1) {
sleepReportController.selectedDate.value =
@@ -971,8 +1012,6 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
calendarController.updateAll();
}
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
@@ -985,9 +1024,9 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
padding: EdgeInsets.all(10.rpx),
borderRadius: 8.rpx,
onTap: onLeftArrowTap,
child: SizedBox(
width: 9.rpx,
height: 14.rpx,
child: Container(
width: 30.rpx,
height: 30.rpx,
child: SvgPicture.asset(
'assets/img/icon/arrow_left.svg',
color: themeController.currentColor.sc3,
@@ -1004,21 +1043,36 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
),
),
),
ClickableContainer(
// ClickableContainer(
// backgroundColor: Colors.transparent,
// highlightColor: themeController.currentColor.sc3,
// padding: EdgeInsets.all(10.rpx),
// borderRadius: 8.rpx,
// onTap: onRightArrowTap,
// child: Container(
// width: 30.rpx,
// height: 30.rpx,
// child: SvgPicture.asset(
// 'assets/img/icon/arrow_right.svg',
// color: themeController.currentColor.sc3,
// ),
// ),
// ),
Obx(() => ClickableContainer(
backgroundColor: Colors.transparent,
highlightColor: themeController.currentColor.sc3,
padding: EdgeInsets.all(10.rpx),
borderRadius: 8.rpx,
onTap: onRightArrowTap,
child: SizedBox(
width: 9.rpx,
height: 14.rpx,
child: SvgPicture.asset(
'assets/img/icon/arrow_right.svg',
color: themeController.currentColor.sc3,
),
),
onTap: isRightLimit.value ? () {} : onRightArrowTap,
child: Container(
width: 30.rpx,
height: 30.rpx,
child: SvgPicture.asset('assets/img/icon/arrow_right.svg',
color: isRightLimit.value
? Color(0xFF929699)
: Color(0xFFFFFFFF)),
),
))
],
),
ClickableContainer(