更新分享
This commit is contained in:
168
lib/pages/main_bottom/component/MessageWidgetWidget.dart
Normal file
168
lib/pages/main_bottom/component/MessageWidgetWidget.dart
Normal file
@@ -0,0 +1,168 @@
|
||||
import 'package:ef/ef.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
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/component/tool/ClickableContainer.dart';
|
||||
import 'package:vbvs_app/component/tool/CustomCard.dart';
|
||||
import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
|
||||
|
||||
class MessageWidgetWidget extends StatefulWidget {
|
||||
const MessageWidgetWidget({super.key});
|
||||
|
||||
@override
|
||||
State<MessageWidgetWidget> createState() => _MessageWidgetWidgetState();
|
||||
}
|
||||
|
||||
class _MessageWidgetWidgetState extends State<MessageWidgetWidget> {
|
||||
ThemeController themeController = Get.find();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Stack(
|
||||
children: [
|
||||
ClickableContainer(
|
||||
backgroundColor: themeController.currentColor.sc5,
|
||||
highlightColor: themeController.currentColor.sc3,
|
||||
borderRadius: 20.rpx,
|
||||
padding:
|
||||
EdgeInsetsDirectional.fromSTEB(31.rpx, 33.rpx, 0.rpx, 33.rpx),
|
||||
onTap: () {},
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Container(
|
||||
width: double.infinity,
|
||||
constraints: BoxConstraints(
|
||||
minHeight: 66.rpx,
|
||||
),
|
||||
child: Align(
|
||||
alignment: AlignmentDirectional(-1, 0),
|
||||
child: Text(
|
||||
'实时监测结果通知'.tr,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 30.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Container(
|
||||
constraints: BoxConstraints(
|
||||
minWidth: 30.rpx,
|
||||
maxWidth: 120.rpx,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
_buildInfoItem(context, '设备ID'),
|
||||
_buildInfoItem(context, '使用人员'),
|
||||
_buildInfoItem(context, '消息类型'),
|
||||
_buildInfoItem(context, '检测数值'),
|
||||
_buildInfoItem(context, '发生时间'),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
constraints: BoxConstraints(
|
||||
minWidth: 30.rpx,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
_buildValueItem(context, '设备ID'),
|
||||
_buildValueItem(context, '使用人员'),
|
||||
_buildValueItem(context, '消息类型'),
|
||||
_buildValueItem(context, '检测数值'),
|
||||
_buildValueItem(context, '发生时间'),
|
||||
],
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(width: 35.rpx)),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
bottom: 46.rpx,
|
||||
right: 20.rpx,
|
||||
child: Container(
|
||||
width: 123.rpx,
|
||||
height: 47.rpx,
|
||||
child: CustomCard(
|
||||
borderRadius: AppConstants().button_container_radius, // 直角
|
||||
colors: [
|
||||
themeController.currentColor.sc1,
|
||||
themeController.currentColor.sc2
|
||||
], // 单色背景
|
||||
enableAnimation: true, // 有点击缩放动画
|
||||
enableGradient: false, // 不用渐变
|
||||
onTap: () {
|
||||
// 点击处理逻辑
|
||||
print('处理按钮点击了');
|
||||
},
|
||||
child: Center(
|
||||
child: Text(
|
||||
'处理'.tr,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildInfoItem(BuildContext context, String label) {
|
||||
return Container(
|
||||
constraints: BoxConstraints(
|
||||
minHeight: 62.rpx,
|
||||
),
|
||||
child: Align(
|
||||
alignment: AlignmentDirectional(-1, 0),
|
||||
child: Text(
|
||||
label.tr,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildValueItem(BuildContext context, String value) {
|
||||
return Container(
|
||||
constraints: BoxConstraints(
|
||||
minHeight: 62.rpx,
|
||||
),
|
||||
child: Align(
|
||||
alignment: AlignmentDirectional(-1, 0),
|
||||
child: Text(
|
||||
value,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -7,9 +7,12 @@ import 'package:flutter/services.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||
import 'package:vbvs_app/controller/main_bottom/global_controller.dart';
|
||||
import 'package:vbvs_app/controller/main_bottom/main_page_controller.dart';
|
||||
import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
|
||||
import 'package:vbvs_app/controller/user_info_controller.dart';
|
||||
import 'package:vbvs_app/enum/LoginStatus.dart';
|
||||
import 'package:vbvs_app/pages/main_bottom/e_page.dart';
|
||||
import 'package:vbvs_app/pages/main_bottom/home_page.dart';
|
||||
import 'package:vbvs_app/pages/main_bottom/message_page.dart';
|
||||
@@ -33,7 +36,7 @@ class MainPageBottomChange extends GetView<MainPageController> {
|
||||
width: size,
|
||||
height: size,
|
||||
),
|
||||
),
|
||||
),
|
||||
activeIcon: Padding(
|
||||
padding: EdgeInsets.only(bottom: 6.rpx),
|
||||
child: isEmpty
|
||||
@@ -105,15 +108,40 @@ class MainPageBottomChange extends GetView<MainPageController> {
|
||||
type: BottomNavigationBarType.fixed,
|
||||
currentIndex: controller.model.currentIndex,
|
||||
onTap: (index) {
|
||||
Future.delayed(const Duration(milliseconds: 500), () {
|
||||
if (controller.model.currentIndex != 1) {
|
||||
Future.delayed(const Duration(milliseconds: 100), () {
|
||||
UserInfoController userInfoController = Get.find();
|
||||
bool isLoggedIn = userInfoController.model.login ==
|
||||
LoginStatus.LOGIN.code;
|
||||
|
||||
// 需要登录的页面
|
||||
if ((index == 1 || index == 2) && !isLoggedIn) {
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: "必须登录提示".tr,
|
||||
textColor: themeController.currentColor.sc9,
|
||||
);
|
||||
Future.delayed(Duration(milliseconds: 50), () {
|
||||
if (Get.currentRoute == '/ePage' ||
|
||||
Get.currentRoute == '/messagePage') {
|
||||
Get.back();
|
||||
}
|
||||
Future.delayed(Duration(milliseconds: 100), () {
|
||||
Get.toNamed("/loginPage");
|
||||
});
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// 已登录 或 index 是不需要登录的页面,正常跳转
|
||||
if (controller.model.currentIndex != index) {
|
||||
globalController.model.hideBottomNavigationBar =
|
||||
false;
|
||||
globalController.updateAll();
|
||||
}
|
||||
|
||||
controller.model.currentIndex = index;
|
||||
controller.updateAll();
|
||||
});
|
||||
controller.model.currentIndex = index;
|
||||
controller.updateAll();
|
||||
},
|
||||
items: [
|
||||
getBottomNavigationBarItem("assets/img/menu/home.svg",
|
||||
|
||||
@@ -1,7 +1,15 @@
|
||||
import 'package:ef/ef.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:vbvs_app/controller/main_bottom/global_controller.dart';
|
||||
import 'package:vbvs_app/controller/user_info_controller.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
||||
import 'package:vbvs_app/common/color/appConstants.dart';
|
||||
import 'package:vbvs_app/common/color/app_uri_status.dart';
|
||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||
import 'package:vbvs_app/controller/message/message_controller.dart';
|
||||
import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
|
||||
import 'package:vbvs_app/pages/main_bottom/component/MessageWidgetWidget.dart';
|
||||
|
||||
class MessagePage extends StatefulWidget {
|
||||
const MessagePage({super.key});
|
||||
@@ -11,17 +19,209 @@ class MessagePage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _MessagePageState extends State<MessagePage> {
|
||||
GlobalController globalController = Get.find();
|
||||
UserInfoController userInfoController = Get.find();
|
||||
ThemeController themeController = Get.find();
|
||||
MessageController messageController = Get.find();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
messageController.getMessageList().then((response) {
|
||||
if (response.code != HttpStatusCodes.ok) {
|
||||
TopSlideNotification.show(
|
||||
Get.context!,
|
||||
text: response.msg ?? "服务器.失败".tr,
|
||||
textColor: themeController.currentColor.sc9,
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
|
||||
statusBarColor: Colors.transparent, // 这里设置你希望的颜色
|
||||
statusBarIconBrightness: Brightness.light, // 状态栏图标的亮度
|
||||
));
|
||||
return LayoutBuilder(
|
||||
builder: (context, boxConstraints) => GestureDetector(
|
||||
onTap: () => FocusScope.of(context).unfocus(),
|
||||
child: Scaffold(
|
||||
body: SafeArea(
|
||||
top: true,
|
||||
child: Text("消息"),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage('assets/img/bgNoImg.png'), // 本地图片
|
||||
fit: BoxFit.fill, // 填满整个 Container
|
||||
),
|
||||
),
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: themeController.currentColor.sc17,
|
||||
automaticallyImplyLeading: false,
|
||||
iconTheme: IconThemeData(
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
toolbarHeight: 140.rpx,
|
||||
titleSpacing: 0,
|
||||
title: Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
40.rpx,
|
||||
0.rpx,
|
||||
0.rpx,
|
||||
0.rpx,
|
||||
),
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
height: 140.rpx, // 👈 明确告诉 Flutter 高度
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: 40.rpx), // 上边距
|
||||
Expanded(
|
||||
child: Stack(
|
||||
alignment: Alignment.bottomLeft,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Obx(() {
|
||||
return ClickableContainer(
|
||||
backgroundColor: Colors.transparent,
|
||||
highlightColor:
|
||||
themeController.currentColor.sc3,
|
||||
borderRadius: 8.rpx,
|
||||
padding: EdgeInsets.all(0),
|
||||
onTap: () async {
|
||||
messageController.model.type = 1;
|
||||
await messageController.getMessageList();
|
||||
messageController.updateAll();
|
||||
},
|
||||
child: Container(
|
||||
width: 160.rpx,
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
'体征消息'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: AppConstants()
|
||||
.title_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
color:
|
||||
messageController
|
||||
.model.type ==
|
||||
2
|
||||
? themeController
|
||||
.currentColor.sc3
|
||||
: themeController
|
||||
.currentColor.sc2,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
Obx(() {
|
||||
return ClickableContainer(
|
||||
backgroundColor: Colors.transparent,
|
||||
highlightColor:
|
||||
themeController.currentColor.sc3,
|
||||
borderRadius: 8.rpx,
|
||||
padding: EdgeInsets.all(0),
|
||||
onTap: () async {
|
||||
messageController.model.type = 2;
|
||||
await messageController.getMessageList();
|
||||
messageController.updateAll();
|
||||
},
|
||||
child: Container(
|
||||
width: 160.rpx,
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
'系统消息'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: AppConstants()
|
||||
.title_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
color:
|
||||
messageController
|
||||
.model.type ==
|
||||
1
|
||||
? themeController
|
||||
.currentColor.sc3
|
||||
: themeController
|
||||
.currentColor.sc2,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
],
|
||||
),
|
||||
Obx(() {
|
||||
double lineWidth = 160.rpx;
|
||||
return AnimatedPositioned(
|
||||
duration: Duration(milliseconds: 300),
|
||||
curve: Curves.easeInOut,
|
||||
bottom: 0, // 👈 现在 Stack 够大,线能放得下
|
||||
left: messageController.model.type == 1
|
||||
? 0
|
||||
: 160.rpx,
|
||||
child: Container(
|
||||
width: lineWidth,
|
||||
height: 4.rpx,
|
||||
decoration: BoxDecoration(
|
||||
color: themeController.currentColor.sc2,
|
||||
borderRadius: BorderRadius.circular(2.rpx),
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 17.rpx), // 上边距
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
actions: [],
|
||||
centerTitle: false,
|
||||
),
|
||||
backgroundColor: Colors.transparent,
|
||||
body: SafeArea(
|
||||
top: true,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(),
|
||||
child: Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
30.rpx,
|
||||
0.rpx,
|
||||
30.rpx,
|
||||
0.rpx,
|
||||
),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
MessageWidgetWidget(),
|
||||
MessageWidgetWidget(),
|
||||
MessageWidgetWidget(),
|
||||
]
|
||||
.divide(SizedBox(height: 30.rpx))
|
||||
.addToStart(SizedBox(height: 30.rpx))
|
||||
.addToEnd(SizedBox(height: 30.rpx)),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -8,9 +8,11 @@ import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||
import 'package:vbvs_app/component/tool/CustomCard.dart';
|
||||
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||
import 'package:vbvs_app/controller/main_bottom/global_controller.dart';
|
||||
import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
|
||||
import 'package:vbvs_app/controller/user_info_controller.dart';
|
||||
import 'package:vbvs_app/enum/LoginStatus.dart';
|
||||
|
||||
class MinePage extends StatefulWidget {
|
||||
const MinePage({super.key});
|
||||
@@ -30,6 +32,7 @@ class _MinePageState extends State<MinePage> {
|
||||
statusBarColor: Colors.transparent, // 这里设置你希望的颜色
|
||||
statusBarIconBrightness: Brightness.light, // 状态栏图标的亮度
|
||||
));
|
||||
int login = userInfoController.model.login!;
|
||||
return LayoutBuilder(
|
||||
builder: (context, bodySize) => GestureDetector(
|
||||
onTap: () => FocusScope.of(context).unfocus(),
|
||||
@@ -75,18 +78,6 @@ class _MinePageState extends State<MinePage> {
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
'assets/img/icon/earphone.svg',
|
||||
width: 29.rpx,
|
||||
height: 29.rpx, // 如果 SVG 中没有固定颜色,可以这样设置
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
// SvgPicture.asset(
|
||||
// 'assets/img/icon/setting.svg',
|
||||
// width: 29.rpx,
|
||||
// height: 29.rpx, // 如果 SVG 中没有固定颜色,可以这样设置
|
||||
// color: themeController.currentColor.sc3,
|
||||
// ),
|
||||
ClickableContainer(
|
||||
backgroundColor:
|
||||
Colors.transparent, // 容器背景色
|
||||
@@ -95,7 +86,53 @@ class _MinePageState extends State<MinePage> {
|
||||
padding: EdgeInsets
|
||||
.zero, // 这里去掉外部的 padding,避免影响点击范围
|
||||
onTap: () {
|
||||
Get.toNamed("/settingPage");
|
||||
if (userInfoController.model.login ==
|
||||
LoginStatus.LOGIN.code) {
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: "待开发功能".tr,
|
||||
);
|
||||
} else {
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: "必须登录提示".tr,
|
||||
textColor:
|
||||
themeController.currentColor.sc9,
|
||||
);
|
||||
Get.toNamed("/loginPage");
|
||||
}
|
||||
},
|
||||
child: Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
0.rpx, 0.rpx, 0.rpx, 0.rpx),
|
||||
child: SvgPicture.asset(
|
||||
'assets/img/icon/earphone.svg',
|
||||
width: 29.rpx,
|
||||
height: 29.rpx, // 如果 SVG 中没有固定颜色,可以这样设置
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
),
|
||||
ClickableContainer(
|
||||
backgroundColor:
|
||||
Colors.transparent, // 容器背景色
|
||||
highlightColor: themeController
|
||||
.currentColor.sc21, // 点击时的背景色
|
||||
padding: EdgeInsets
|
||||
.zero, // 这里去掉外部的 padding,避免影响点击范围
|
||||
onTap: () {
|
||||
if (userInfoController.model.login ==
|
||||
LoginStatus.LOGIN.code) {
|
||||
Get.toNamed("/settingPage");
|
||||
} else {
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: "必须登录提示".tr,
|
||||
textColor:
|
||||
themeController.currentColor.sc9,
|
||||
);
|
||||
Get.toNamed("/loginPage");
|
||||
}
|
||||
},
|
||||
child: Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
@@ -130,10 +167,25 @@ class _MinePageState extends State<MinePage> {
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: Image.network(
|
||||
'https://picsum.photos/seed/270/600',
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
child: login == 1
|
||||
? (userInfoController.model.user!
|
||||
.avatar ==
|
||||
null ||
|
||||
userInfoController.model
|
||||
.user!.avatar!.isEmpty
|
||||
? Image.asset(
|
||||
"assets/img/avatar.png",
|
||||
fit: BoxFit.cover,
|
||||
)
|
||||
: Image.network(
|
||||
userInfoController
|
||||
.model.user!.avatar!,
|
||||
fit: BoxFit.cover,
|
||||
))
|
||||
: Image.asset(
|
||||
"assets/img/avatar.png",
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
@@ -141,7 +193,11 @@ class _MinePageState extends State<MinePage> {
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'张天爱',
|
||||
login == 1
|
||||
? (userInfoController.model
|
||||
.user!.nick_name ??
|
||||
'未命名'.tr)
|
||||
: "我的.未登录".tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
@@ -154,7 +210,16 @@ class _MinePageState extends State<MinePage> {
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'账号:135****2598',
|
||||
login == 1
|
||||
? (userInfoController.model
|
||||
.user!.email !=
|
||||
null
|
||||
? userInfoController
|
||||
.model.user!.email!
|
||||
: MyUtils.hidePhoneNumber(
|
||||
userInfoController.model
|
||||
.user!.phone!))
|
||||
: "我的.未登录".tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
@@ -173,7 +238,11 @@ class _MinePageState extends State<MinePage> {
|
||||
CustomCard(
|
||||
borderRadius: 0,
|
||||
onTap: () {
|
||||
Get.toNamed("/updateUserPage");
|
||||
if (login == 1) {
|
||||
Get.toNamed("/updateUserPage");
|
||||
} else {
|
||||
Get.toNamed("/loginPage");
|
||||
}
|
||||
},
|
||||
// colors: [themeController.currentColor.sc5],
|
||||
colors: [Colors.transparent],
|
||||
@@ -181,7 +250,9 @@ class _MinePageState extends State<MinePage> {
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Text(
|
||||
'我的.个人信息'.tr,
|
||||
login == 1
|
||||
? '我的.个人信息'.tr
|
||||
: '我的.去登录'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
@@ -239,7 +310,20 @@ class _MinePageState extends State<MinePage> {
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
40.rpx, 0.rpx, 40.rpx, 0.rpx),
|
||||
onTap: () {
|
||||
Get.toNamed("/deviceType",arguments:1);
|
||||
UserInfoController userInfoController =
|
||||
Get.find();
|
||||
if (userInfoController.model.login !=
|
||||
LoginStatus.LOGIN.code) {
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: "必须登录提示".tr,
|
||||
textColor:
|
||||
themeController.currentColor.sc9,
|
||||
);
|
||||
Get.toNamed("/loginPage");
|
||||
} else {
|
||||
Get.toNamed("/deviceTypeList");
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
child: Padding(
|
||||
@@ -296,7 +380,25 @@ class _MinePageState extends State<MinePage> {
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
0.rpx, 0.rpx, 0.rpx, 0.rpx),
|
||||
onTap: () {
|
||||
print('点击了容器');
|
||||
UserInfoController userInfoController =
|
||||
Get.find();
|
||||
if (userInfoController.model.login !=
|
||||
LoginStatus.LOGIN.code) {
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: "必须登录提示".tr,
|
||||
textColor:
|
||||
themeController.currentColor.sc9,
|
||||
);
|
||||
Get.toNamed("/loginPage");
|
||||
} else {
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: "待开发.提示".tr,
|
||||
textColor:
|
||||
themeController.currentColor.sc2,
|
||||
);
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
child: Padding(
|
||||
@@ -353,7 +455,25 @@ class _MinePageState extends State<MinePage> {
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
0.rpx, 0.rpx, 0.rpx, 0.rpx),
|
||||
onTap: () {
|
||||
print('点击了容器');
|
||||
UserInfoController userInfoController =
|
||||
Get.find();
|
||||
if (userInfoController.model.login !=
|
||||
LoginStatus.LOGIN.code) {
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: "必须登录提示".tr,
|
||||
textColor:
|
||||
themeController.currentColor.sc9,
|
||||
);
|
||||
Get.toNamed("/loginPage");
|
||||
} else {
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: "待开发.提示".tr,
|
||||
textColor:
|
||||
themeController.currentColor.sc2,
|
||||
);
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
child: Padding(
|
||||
@@ -410,7 +530,25 @@ class _MinePageState extends State<MinePage> {
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
40.rpx, 0.rpx, 40.rpx, 0.rpx),
|
||||
onTap: () {
|
||||
print('点击了容器');
|
||||
UserInfoController userInfoController =
|
||||
Get.find();
|
||||
if (userInfoController.model.login !=
|
||||
LoginStatus.LOGIN.code) {
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: "必须登录提示".tr,
|
||||
textColor:
|
||||
themeController.currentColor.sc9,
|
||||
);
|
||||
Get.toNamed("/loginPage");
|
||||
} else {
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: "待开发.提示".tr,
|
||||
textColor:
|
||||
themeController.currentColor.sc2,
|
||||
);
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
child: Padding(
|
||||
@@ -467,7 +605,25 @@ class _MinePageState extends State<MinePage> {
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
40.rpx, 0.rpx, 40.rpx, 0.rpx),
|
||||
onTap: () {
|
||||
print('点击了容器');
|
||||
UserInfoController userInfoController =
|
||||
Get.find();
|
||||
if (userInfoController.model.login !=
|
||||
LoginStatus.LOGIN.code) {
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: "必须登录提示".tr,
|
||||
textColor:
|
||||
themeController.currentColor.sc9,
|
||||
);
|
||||
Get.toNamed("/loginPage");
|
||||
} else {
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: "待开发.提示".tr,
|
||||
textColor:
|
||||
themeController.currentColor.sc2,
|
||||
);
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
child: Padding(
|
||||
@@ -508,7 +664,7 @@ class _MinePageState extends State<MinePage> {
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Text(
|
||||
'1.0.0',
|
||||
'V1.0.2504.12',
|
||||
style:
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
import 'package:ef/ef.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:vbvs_app/controller/main_bottom/global_controller.dart';
|
||||
import 'package:vbvs_app/controller/user_info_controller.dart';
|
||||
// import 'package:ef/ef.dart';
|
||||
// import 'package:flutter/material.dart';
|
||||
// import 'package:vbvs_app/controller/main_bottom/global_controller.dart';
|
||||
// import 'package:vbvs_app/controller/user_info_controller.dart';
|
||||
|
||||
class SleepReportPage extends StatefulWidget {
|
||||
const SleepReportPage({super.key});
|
||||
// class SleepReportPage extends StatefulWidget {
|
||||
// const SleepReportPage({super.key});
|
||||
|
||||
@override
|
||||
State<SleepReportPage> createState() => _SleepReportPageState();
|
||||
}
|
||||
// @override
|
||||
// State<SleepReportPage> createState() => _SleepReportPageState();
|
||||
// }
|
||||
|
||||
class _SleepReportPageState extends State<SleepReportPage> {
|
||||
GlobalController globalController = Get.find();
|
||||
UserInfoController userInfoController = Get.find();
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return LayoutBuilder(
|
||||
builder: (context, boxConstraints) => GestureDetector(
|
||||
onTap: () => FocusScope.of(context).unfocus(),
|
||||
child: Scaffold(
|
||||
// class _SleepReportPageState extends State<SleepReportPage> {
|
||||
// GlobalController globalController = Get.find();
|
||||
// UserInfoController userInfoController = Get.find();
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// return LayoutBuilder(
|
||||
// builder: (context, boxConstraints) => GestureDetector(
|
||||
// onTap: () => FocusScope.of(context).unfocus(),
|
||||
// child: Scaffold(
|
||||
|
||||
body: SafeArea(
|
||||
top: true,
|
||||
child: Text("睡眠报告"),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
// body: SafeArea(
|
||||
// top: true,
|
||||
// child: Text("睡眠报告"),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user