更新分享
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user