更新页面
This commit is contained in:
@@ -5,6 +5,8 @@ import 'package:flutterflow_ui/flutterflow_ui.dart';
|
||||
import 'package:vbvs_app/common/color/appConstants.dart';
|
||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
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/CustomCard.dart';
|
||||
import 'package:vbvs_app/controller/main_bottom/global_controller.dart';
|
||||
@@ -53,6 +55,7 @@ class _HomePageState extends State<HomePage> {
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Padding(
|
||||
//用户信息
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
AppConstants().content_left_right_padding,
|
||||
0,
|
||||
@@ -64,36 +67,60 @@ class _HomePageState extends State<HomePage> {
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
CustomCard(
|
||||
borderRadius: 20.rpx,
|
||||
onTap: () async {
|
||||
Get.toNamed("/loginPage");
|
||||
},
|
||||
title: '首页.登录'
|
||||
.tr, // 虽然 title 传入了,但当前组件里没用它(可忽略或用于调试)
|
||||
colors: [
|
||||
themeController.currentColor.sc1,
|
||||
themeController.currentColor.sc2,
|
||||
],
|
||||
child: Container(
|
||||
width: 100.rpx,
|
||||
height: 60.rpx,
|
||||
alignment: Alignment.center,
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
16.rpx, 0, 16.rpx, 0),
|
||||
child: Text(
|
||||
'首页.登录'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.titleSmall
|
||||
.override(
|
||||
fontFamily: 'Inter Tight',
|
||||
color: themeController
|
||||
.currentColor.sc19,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
Obx(() {
|
||||
return Visibility(
|
||||
visible:
|
||||
userInfoController.model.login == 0,
|
||||
child: CustomCard(
|
||||
borderRadius: 20.rpx,
|
||||
onTap: () async {
|
||||
Get.toNamed("/loginPage");
|
||||
},
|
||||
colors: [
|
||||
themeController.currentColor.sc1,
|
||||
themeController.currentColor.sc2,
|
||||
],
|
||||
child: Container(
|
||||
width: 100.rpx,
|
||||
height: 60.rpx,
|
||||
alignment: Alignment.center,
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
16.rpx, 0, 16.rpx, 0),
|
||||
child: Text(
|
||||
'首页.登录'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.titleSmall
|
||||
.override(
|
||||
fontFamily: 'Inter Tight',
|
||||
color: themeController
|
||||
.currentColor.sc19,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
Obx(() {
|
||||
return Visibility(
|
||||
visible:
|
||||
userInfoController.model.login == 1,
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"飞行的鱼",
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
Text(
|
||||
"嘉兴 晴",
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}),
|
||||
SvgPicture.asset(
|
||||
'assets/img/icon/add.svg',
|
||||
width: 39.rpx,
|
||||
@@ -106,6 +133,7 @@ class _HomePageState extends State<HomePage> {
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
//绑定数量
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
19.rpx, 34.rpx, 0, 21.rpx),
|
||||
child: ClickableContainer(
|
||||
@@ -116,42 +144,67 @@ class _HomePageState extends State<HomePage> {
|
||||
},
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
0.rpx, 10.rpx, 0, 10.rpx),
|
||||
child: Container(
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'首页.已关联体征监测设备'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize:
|
||||
AppConstants().title_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
//todo 颜色
|
||||
color: themeController.currentColor.sc3,
|
||||
Container(
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
'首页.已关联体征监测设备'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: AppConstants()
|
||||
.title_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
//todo 颜色
|
||||
color: themeController
|
||||
.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'0',
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: AppConstants()
|
||||
.title_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor.sc8,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(
|
||||
width: 6.rpx,
|
||||
)),
|
||||
)),
|
||||
Obx(() {
|
||||
return Visibility(
|
||||
visible: userInfoController
|
||||
.model.deviceBindNum! >
|
||||
0,
|
||||
child: Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
0, 0.rpx, 8.rpx, 0.rpx),
|
||||
child: SvgPicture.asset(
|
||||
'assets/img/icon/arrow_right.svg',
|
||||
width: 14.rpx,
|
||||
height: 14.rpx, // 如果 SVG 中没有固定颜色,可以这样设置
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'0',
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize:
|
||||
AppConstants().title_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc8,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(
|
||||
width: 6.rpx,
|
||||
)),
|
||||
)),
|
||||
),
|
||||
);
|
||||
}),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
//未绑定布局
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
height: MediaQuery.sizeOf(context).height * 0.277,
|
||||
constraints: BoxConstraints(
|
||||
@@ -178,8 +231,7 @@ class _HomePageState extends State<HomePage> {
|
||||
themeController.currentColor.sc1,
|
||||
themeController.currentColor.sc2,
|
||||
],
|
||||
title:
|
||||
'首页.蓝牙绑定'.tr, // 可选,虽然这个 title 没用,但可以作为调试用
|
||||
|
||||
child: Container(
|
||||
width:
|
||||
MediaQuery.sizeOf(context).width * 0.66,
|
||||
@@ -229,8 +281,7 @@ class _HomePageState extends State<HomePage> {
|
||||
themeController.currentColor.sc1,
|
||||
themeController.currentColor.sc2,
|
||||
], // 渐变色是同一个色,也可以根据需要调整
|
||||
title:
|
||||
'首页.蓝牙绑定'.tr, // 可选,虽然这个 title 没用,但可以作为调试用
|
||||
|
||||
child: Container(
|
||||
width:
|
||||
MediaQuery.sizeOf(context).width * 0.66,
|
||||
@@ -278,6 +329,7 @@ class _HomePageState extends State<HomePage> {
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
//未绑定标语
|
||||
padding:
|
||||
EdgeInsetsDirectional.fromSTEB(0, 26.rpx, 0, 0),
|
||||
child: Container(
|
||||
@@ -374,6 +426,213 @@ class _HomePageState extends State<HomePage> {
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding:
|
||||
EdgeInsetsDirectional.fromSTEB(0, 26.rpx, 0, 0),
|
||||
child: Container(
|
||||
// color: Colors.red,
|
||||
width: bodySize.maxWidth,
|
||||
height: bodySize.maxHeight * 0.107,
|
||||
constraints: BoxConstraints(
|
||||
minHeight: 240.rpx,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
ClickableContainer(
|
||||
backgroundColor:
|
||||
themeController.currentColor.sc5,
|
||||
highlightColor:
|
||||
themeController.currentColor.sc3,
|
||||
borderRadius:
|
||||
AppConstants().normal_container_radius,
|
||||
padding:
|
||||
EdgeInsets.zero, // 原始Container没有padding
|
||||
onTap: () {
|
||||
// 点击逻辑放这里
|
||||
},
|
||||
child: Container(
|
||||
width: bodySize.maxWidth * 0.445,
|
||||
child: Column(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(height: 32.rpx),
|
||||
Container(
|
||||
width: 120.rpx,
|
||||
height: 120.rpx,
|
||||
child: Image.asset(
|
||||
"assets/img/netlove.png",
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"首页.我的e护".tr,
|
||||
style: TextStyle(
|
||||
color: themeController
|
||||
.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 32.rpx),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
ClickableContainer(
|
||||
backgroundColor:
|
||||
themeController.currentColor.sc5,
|
||||
highlightColor:
|
||||
themeController.currentColor.sc3,
|
||||
borderRadius:
|
||||
AppConstants().normal_container_radius,
|
||||
padding: EdgeInsets
|
||||
.zero, // 原本的Container没有 padding,这里设置为 zero
|
||||
onTap: () {
|
||||
// TODO: 替换为你需要的点击事件逻辑
|
||||
print("云关爱 被点击");
|
||||
},
|
||||
child: SizedBox(
|
||||
width: bodySize.maxWidth * 0.445,
|
||||
child: Column(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
width: 120.rpx,
|
||||
height: 120.rpx,
|
||||
child: Image.asset(
|
||||
"assets/img/mye.png",
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"首页.云关爱".tr,
|
||||
style: TextStyle(
|
||||
color: themeController
|
||||
.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
]
|
||||
.addToStart(SizedBox(height: 32.rpx))
|
||||
.addToEnd(SizedBox(height: 32.rpx)),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
// Generated code for this Container Widget...
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
0, 25.rpx, 0, 25.rpx),
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: themeController.currentColor.sc5,
|
||||
borderRadius: BorderRadius.circular(
|
||||
AppConstants().normal_container_radius),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
30.rpx, 30.rpx, 30.rpx, 30.rpx),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Container(
|
||||
width: double.infinity,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'次卧/1201/李小北',
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 30.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Text(
|
||||
'首页.报告详情'.tr,
|
||||
style:
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
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, // 如果 SVG 中没有固定颜色,可以这样设置
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(width: 22.rpx)),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(),
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
SleepDateWidget(),
|
||||
SleepDateWidget(),
|
||||
SleepDateWidget(),
|
||||
SleepDateWidget(),
|
||||
SleepDateWidget(),
|
||||
SleepDateWidget(),
|
||||
].divide(SizedBox(
|
||||
width: 20.rpx,
|
||||
)),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(),
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
SleepDataModuleWidget(),
|
||||
SleepDataModuleWidget(),
|
||||
SleepDataModuleWidget(),
|
||||
SleepDataModuleWidget(),
|
||||
SleepDataModuleWidget(),
|
||||
].divide(SizedBox(
|
||||
width: 14.rpx)), // ✅ 这里加了 .rpx
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user