更新部分显示样式
This commit is contained in:
@@ -225,7 +225,8 @@ class _SettingPageState extends State<SettingPage> {
|
||||
.language_name!,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
color: Color(0xFFD9E3EB),
|
||||
color: themeController
|
||||
.currentColor.sc2,
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
@@ -609,7 +610,7 @@ class _SettingPageState extends State<SettingPage> {
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
0.rpx, 50.rpx, 0.rpx, 100.rpx),
|
||||
0.rpx, 100.rpx, 0.rpx, 100.rpx),
|
||||
child: ClickableContainer(
|
||||
borderRadius:
|
||||
AppConstants().button_container_radius, // 圆角半径
|
||||
@@ -656,7 +657,7 @@ class _SettingPageState extends State<SettingPage> {
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(
|
||||
height: 17.rpx,
|
||||
height: 4.rpx,
|
||||
))),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -116,8 +116,10 @@ class _UpdateUserEmailPageState extends State<UpdateUserEmailPage> {
|
||||
userInfoController.model.user!.tmpNickName = null;
|
||||
loginController.model.updatePhone = null;
|
||||
await userInfoController.getUserInfo();
|
||||
userInfoController.model.user!.tmpNickName = userInfoController.model.user!.nick_name;
|
||||
userInfoController.model.user!.tmpHead = userInfoController.model.user!.avatar;
|
||||
userInfoController.model.user!.tmpNickName =
|
||||
userInfoController.model.user!.nick_name;
|
||||
userInfoController.model.user!.tmpHead =
|
||||
userInfoController.model.user!.avatar;
|
||||
userInfoController.updateAll();
|
||||
Get.back();
|
||||
}
|
||||
@@ -177,7 +179,7 @@ class _UpdateUserEmailPageState extends State<UpdateUserEmailPage> {
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
60.rpx, 0, 35.rpx, 0),
|
||||
child: Text(
|
||||
"原邮箱号" + ":" + "${getHideEmail()}",
|
||||
"原邮箱号".tr + ":" + "${getHideEmail()}",
|
||||
style: TextStyle(
|
||||
color: themeController.currentColor.sc3,
|
||||
fontSize: AppConstants().normal_text_fontSize,
|
||||
@@ -199,7 +201,7 @@ class _UpdateUserEmailPageState extends State<UpdateUserEmailPage> {
|
||||
alignment: AlignmentDirectional(-1, 0),
|
||||
child: Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
0, 0.rpx, 0, 20.rpx),
|
||||
0, 20.rpx, 0, 20.rpx),
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
height: bodySize.maxHeight * 0.056,
|
||||
@@ -354,7 +356,7 @@ class _UpdateUserEmailPageState extends State<UpdateUserEmailPage> {
|
||||
alignment: AlignmentDirectional(-1, 0),
|
||||
child: Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
0, 0.rpx, 0, 0),
|
||||
0, 0.rpx, 0, 20.rpx),
|
||||
child: Container(
|
||||
height: bodySize.maxHeight * 0.056,
|
||||
width: double.infinity,
|
||||
|
||||
@@ -418,7 +418,9 @@ class _UpdateUserPageState extends State<UpdateUserPage> {
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(width: 22.rpx)),
|
||||
SizedBox(width: 22.rpx),
|
||||
getNowInfoByType('phone'),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
@@ -427,9 +429,8 @@ class _UpdateUserPageState extends State<UpdateUserPage> {
|
||||
getTextByUserInfo('phone'),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
// color: Color(0xFFD9E3EB),
|
||||
color: themeController
|
||||
.currentColor.sc2,
|
||||
color: getColorByUserInfo(
|
||||
'phone'),
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
@@ -485,7 +486,9 @@ class _UpdateUserPageState extends State<UpdateUserPage> {
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(width: 22.rpx)),
|
||||
SizedBox(width: 22.rpx),
|
||||
getNowInfoByType('email'),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
@@ -495,8 +498,8 @@ class _UpdateUserPageState extends State<UpdateUserPage> {
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
// color: Color(0xFFD9E3EB),
|
||||
color: themeController
|
||||
.currentColor.sc2,
|
||||
color: getColorByUserInfo(
|
||||
'email'),
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
@@ -589,13 +592,8 @@ class _UpdateUserPageState extends State<UpdateUserPage> {
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
// color: Color(0xFFD9E3EB),
|
||||
color: getTextByUserInfo(
|
||||
'wechat') ==
|
||||
"解绑".tr
|
||||
? themeController
|
||||
.currentColor.sc4
|
||||
: themeController
|
||||
.currentColor.sc2,
|
||||
color: getColorByUserInfo(
|
||||
'wechat'),
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
@@ -621,7 +619,6 @@ class _UpdateUserPageState extends State<UpdateUserPage> {
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -669,25 +666,95 @@ class _UpdateUserPageState extends State<UpdateUserPage> {
|
||||
}
|
||||
if (type == "phone") {
|
||||
if (userInfo.phone == null || userInfo.phone!.isEmpty) {
|
||||
return "更换".tr;
|
||||
return "去绑定".tr;
|
||||
} else {
|
||||
return "换绑".tr;
|
||||
}
|
||||
}
|
||||
if (type == "email") {
|
||||
if (userInfo.email == null || userInfo.email!.isEmpty) {
|
||||
return "绑定".tr;
|
||||
return "去绑定".tr;
|
||||
} else {
|
||||
return "换绑".tr;
|
||||
}
|
||||
}
|
||||
if (type == "wechat") {
|
||||
if (userInfo.bindWx == null || userInfo.bindWx == false) {
|
||||
return "绑定".tr;
|
||||
return "去绑定".tr;
|
||||
} else {
|
||||
return "解绑".tr;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
Color getColorByUserInfo(String type) {
|
||||
final text = getTextByUserInfo(type);
|
||||
// 去绑定 = 未绑定
|
||||
return text == "去绑定".tr
|
||||
? themeController.currentColor.sc4
|
||||
: themeController.currentColor.sc2;
|
||||
}
|
||||
|
||||
getNowInfoByType(String type) {
|
||||
UserInfoController userInfoController = Get.find();
|
||||
UserModel userInfo = userInfoController.model.user!;
|
||||
if (type == "phone") {
|
||||
if (userInfo.phone == null || userInfo.phone!.isEmpty) {
|
||||
return Text(
|
||||
"(" + "暂未绑定".tr + ")",
|
||||
style: TextStyle(
|
||||
color: themeController.currentColor.sc4,
|
||||
fontSize: AppConstants().normal_text_fontSize,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return Text(
|
||||
"(" + "${getHidePhone()}" + ")",
|
||||
style: TextStyle(
|
||||
color: themeController.currentColor.sc4,
|
||||
fontSize: AppConstants().normal_text_fontSize,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
if (type == "email") {
|
||||
if (userInfo.email == null || userInfo.email!.isEmpty) {
|
||||
return Text(
|
||||
"(" + "暂未绑定".tr + ")",
|
||||
style: TextStyle(
|
||||
color: themeController.currentColor.sc4,
|
||||
fontSize: AppConstants().normal_text_fontSize,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return Text(
|
||||
"(" + "${getHideEmail()}" + ")",
|
||||
style: TextStyle(
|
||||
color: themeController.currentColor.sc4,
|
||||
fontSize: AppConstants().normal_text_fontSize,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return Container();
|
||||
}
|
||||
|
||||
getHidePhone() {
|
||||
UserModel userModel = userInfoController.model.user!;
|
||||
if (userModel.phone == null || userModel.phone == "") {
|
||||
return "暂无".tr;
|
||||
}
|
||||
return "${userModel.phone!.substring(0, 3)}****${userModel.phone!.substring(7, 11)}";
|
||||
}
|
||||
|
||||
getHideEmail() {
|
||||
UserModel userModel = userInfoController.model.user!;
|
||||
if (userModel.email == null || userModel.email == "") {
|
||||
return "暂无".tr;
|
||||
}
|
||||
return userModel.email!
|
||||
.replaceRange(3, userModel.email!.length - 3, "****");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user