更新版本迭代重新登录

This commit is contained in:
wyf
2025-07-25 09:25:04 +08:00
parent 617ea71fe9
commit 19568913bb
11 changed files with 256 additions and 85 deletions

View File

@@ -308,55 +308,108 @@ class _NewHomePageState extends State<NewHomePage> {
Obx(() {
if (userInfoController.model.login! == null ||
userInfoController.model.login! == 0) {
// return Padding(
// padding: EdgeInsetsDirectional.fromSTEB(
// 30.rpx, 0, 30.rpx, 80.rpx),
// child: ClickableContainer(
// backgroundColor: Colors.transparent,
// highlightColor: Colors.transparent,
// padding: EdgeInsets.all(0),
// onTap: () {
// if (userInfoController.model.login == null ||
// userInfoController.model.login == 0) {
// TopSlideNotification.show(context,
// text: "请先登录".tr,
// textColor: themeController.currentColor.sc9);
// Get.toNamed("/loginPage");
// } else {
// Get.toNamed("/mHTDeviceTypePage");
// }
// },
// child: Container(
// width: MediaQuery.sizeOf(context).width,
// height: 302.rpx,
// padding:
// EdgeInsets.only(top: 90.rpx, bottom: 80.rpx),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(borderRadius),
// border: Border.all(
// color: stringToColor("#85F5FF"), // 边框颜色
// width: 1.rpx, // 边框宽度
// ),
// ),
// child: Column(
// mainAxisSize: MainAxisSize.max,
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// SvgPicture.asset(
// 'assets/images/icon/add.svg',
// width: 42.rpx,
// height: 42.rpx,
// ),
// SizedBox(
// height: 32.rpx,
// ),
// Text(
// '添加一台新设备'.tr,
// style: TextStyle(
// color: stringToColor("#85F5FF"),
// fontSize:
// AppConstants().normal_text_fontSize,
// letterSpacing: 0,
// ),
// ),
// ],
// ),
// ),
// ),
// );
return Padding(
padding: EdgeInsetsDirectional.fromSTEB(
30.rpx, 0, 30.rpx, 80.rpx),
30.rpx, 0.rpx, 30.rpx, 100.rpx),
child: ClickableContainer(
backgroundColor: Colors.transparent,
highlightColor: Colors.transparent,
padding: EdgeInsets.all(0),
onTap: () {
if (userInfoController.model.login == null ||
userInfoController.model.login == 0) {
TopSlideNotification.show(context,
text: "请先登录".tr,
textColor: themeController.currentColor.sc9);
Get.toNamed("/loginPage");
} else {
Get.toNamed("/mHTDeviceTypePage");
}
// 点击逻辑
Get.toNamed("/mHTDeviceTypePage");
},
backgroundColor: Colors.transparent,
highlightColor: themeController.currentColor
.sc21, // 这里可以自定义高亮色,透明就用 Colors.transparent
borderRadius: borderRadius,
padding: EdgeInsetsDirectional.fromSTEB(
0.rpx, 0, 0.rpx, 0),
child: Container(
width: MediaQuery.sizeOf(context).width,
height: 302.rpx,
padding:
EdgeInsets.only(top: 90.rpx, bottom: 80.rpx),
height: 92.rpx,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(borderRadius),
border: Border.all(
color: stringToColor("#85F5FF"), // 边框颜色
width: 1.rpx, // 边框宽度
),
borderRadius: BorderRadius.circular(borderRadius),
),
child: Column(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
// Icon(
// Icons.add,
// size: 60.rpx,
// color: stringToColor("#85F5FF"),
// ),
SvgPicture.asset(
'assets/images/icon/add.svg',
width: 42.rpx,
height: 42.rpx,
),
SizedBox(
height: 32.rpx,
),
SizedBox(width: 20.rpx),
Text(
'添加一台新设备'.tr,
'添加新设备'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: stringToColor("#85F5FF"),
fontSize:
AppConstants().normal_text_fontSize,
letterSpacing: 0,
fontSize: 26.rpx,
),
),
],
@@ -381,8 +434,8 @@ class _NewHomePageState extends State<NewHomePage> {
personInfo.value = list[0];
homeController.selectPerson.value = list[0];
homeController.selectDevcie.value = list[0]["mac"];
deviceController
.getHomeSleeps(formFieldController.value);
deviceController.getHomeSleeps(
formFieldController.value, context);
homeController.updateAll();
});
}
@@ -492,7 +545,8 @@ class _NewHomePageState extends State<NewHomePage> {
deviceController
.getHomeSleeps(
formFieldController
.value);
.value,
context);
homeController
.updateAll();
}
@@ -741,59 +795,113 @@ class _NewHomePageState extends State<NewHomePage> {
),
),
if (homeController.bindDeviceNum.value == 0)
// Padding(
// padding: EdgeInsetsDirectional.fromSTEB(
// 30.rpx, 0, 30.rpx, 80.rpx),
// child: ClickableContainer(
// backgroundColor: Colors.transparent,
// highlightColor: Colors.transparent,
// padding: EdgeInsets.all(0),
// onTap: () {
// if (userInfoController.model.login ==
// null ||
// userInfoController.model.login == 0) {
// TopSlideNotification.show(context,
// text: "请先登录".tr,
// textColor:
// themeController.currentColor.sc9);
// Get.toNamed("/loginPage");
// } else {
// Get.toNamed("/mHTDeviceTypePage");
// }
// },
// child: Container(
// width: MediaQuery.sizeOf(context).width,
// height: 302.rpx,
// padding: EdgeInsets.only(
// top: 90.rpx, bottom: 80.rpx),
// decoration: BoxDecoration(
// borderRadius:
// BorderRadius.circular(borderRadius),
// border: Border.all(
// color: stringToColor("#85F5FF"), // 边框颜色
// width: 1.rpx, // 边框宽度
// ),
// ),
// child: Column(
// mainAxisSize: MainAxisSize.max,
// mainAxisAlignment:
// MainAxisAlignment.center,
// children: [
// SvgPicture.asset(
// 'assets/images/icon/add.svg',
// width: 42.rpx,
// height: 42.rpx,
// ),
// SizedBox(
// height: 32.rpx,
// ),
// Text(
// '添加一台新设备'.tr,
// style: TextStyle(
// color: stringToColor("#85F5FF"),
// fontSize: AppConstants()
// .normal_text_fontSize,
// letterSpacing: 0,
// ),
// ),
// ],
// ),
// ),
// ),
// ),
Padding(
padding: EdgeInsetsDirectional.fromSTEB(
30.rpx, 0, 30.rpx, 80.rpx),
30.rpx, 0.rpx, 30.rpx, 100.rpx),
child: ClickableContainer(
backgroundColor: Colors.transparent,
highlightColor: Colors.transparent,
padding: EdgeInsets.all(0),
onTap: () {
if (userInfoController.model.login ==
null ||
userInfoController.model.login == 0) {
TopSlideNotification.show(context,
text: "请先登录".tr,
textColor:
themeController.currentColor.sc9);
Get.toNamed("/loginPage");
} else {
Get.toNamed("/mHTDeviceTypePage");
}
// 点击逻辑
Get.toNamed("/mHTDeviceTypePage");
},
backgroundColor: Colors.transparent,
highlightColor: themeController.currentColor
.sc21, // 这里可以自定义高亮色,透明就用 Colors.transparent
borderRadius: borderRadius,
padding: EdgeInsetsDirectional.fromSTEB(
0.rpx, 0, 0.rpx, 0),
child: Container(
width: MediaQuery.sizeOf(context).width,
height: 302.rpx,
padding: EdgeInsets.only(
top: 90.rpx, bottom: 80.rpx),
height: 92.rpx,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(borderRadius),
border: Border.all(
color: stringToColor("#85F5FF"), // 边框颜色
width: 1.rpx, // 边框宽度
),
borderRadius:
BorderRadius.circular(borderRadius),
),
child: Column(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment:
MainAxisAlignment.center,
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
// Icon(
// Icons.add,
// size: 60.rpx,
// color: stringToColor("#85F5FF"),
// ),
SvgPicture.asset(
'assets/images/icon/add.svg',
width: 42.rpx,
height: 42.rpx,
),
SizedBox(
height: 32.rpx,
),
SizedBox(width: 20.rpx),
Text(
'添加一台新设备'.tr,
'添加新设备'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: stringToColor("#85F5FF"),
fontSize: AppConstants()
.normal_text_fontSize,
letterSpacing: 0,
fontSize: 26.rpx,
),
),
],