更新部分显示样式
This commit is contained in:
@@ -571,7 +571,7 @@
|
|||||||
"输入关键词": "Enter keywords",
|
"输入关键词": "Enter keywords",
|
||||||
"输入国家、省份或城市": "Enter country, province, or city",
|
"输入国家、省份或城市": "Enter country, province, or city",
|
||||||
"手机号码": "Phone number",
|
"手机号码": "Phone number",
|
||||||
"邮箱": "email",
|
"邮箱": "Email",
|
||||||
"微信": "WeChat",
|
"微信": "WeChat",
|
||||||
"更换": "Change",
|
"更换": "Change",
|
||||||
"换绑": "Rebind",
|
"换绑": "Rebind",
|
||||||
@@ -608,5 +608,9 @@
|
|||||||
"离床时长": "Bed Exit Duration",
|
"离床时长": "Bed Exit Duration",
|
||||||
"已关闭": "Disabled",
|
"已关闭": "Disabled",
|
||||||
"时": " h",
|
"时": " h",
|
||||||
"允许对方配置wifi": "Allow other to configure WiFi"
|
"允许对方配置wifi": "Allow other to configure WiFi",
|
||||||
|
"去绑定": "Go Bind",
|
||||||
|
"解除分享": "Unshare",
|
||||||
|
"详情": "Detail",
|
||||||
|
"更新成功": "Update Success"
|
||||||
}
|
}
|
||||||
@@ -608,5 +608,8 @@
|
|||||||
"离床时长": "离床时长",
|
"离床时长": "离床时长",
|
||||||
"已关闭": "已关闭",
|
"已关闭": "已关闭",
|
||||||
"时": "时",
|
"时": "时",
|
||||||
"允许对方配置wifi": "允许对方配置wifi"
|
"允许对方配置wifi": "允许对方配置wifi",
|
||||||
|
"去绑定": "去绑定",
|
||||||
|
"解除分享": "解除分享",
|
||||||
|
"详情": "详情"
|
||||||
}
|
}
|
||||||
@@ -604,5 +604,9 @@
|
|||||||
"离床时长": "離床時長",
|
"离床时长": "離床時長",
|
||||||
"已关闭": "已關閉",
|
"已关闭": "已關閉",
|
||||||
"时": "時",
|
"时": "時",
|
||||||
"允许对方配置wifi": "允許對方設定wifi"
|
"允许对方配置wifi": "允許對方設定wifi",
|
||||||
|
"去绑定": "去綁定",
|
||||||
|
"解除分享": "解除分享",
|
||||||
|
"详情": "詳情",
|
||||||
|
"更新成功": "更新成功"
|
||||||
}
|
}
|
||||||
@@ -159,7 +159,7 @@ class _DynamicReportDetailWidgetState extends State<DynamicReportDetailWidget> {
|
|||||||
fontFamily: 'Inter',
|
fontFamily: 'Inter',
|
||||||
fontSize: 26.rpx,
|
fontSize: 26.rpx,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
color: themeController.currentColor.sc3,
|
color: themeController.currentColor.sc2,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
|
|||||||
@@ -146,7 +146,12 @@ class UserInfoController extends GetControllerEx<UserInfoModel> {
|
|||||||
LoginController loginController = Get.find();
|
LoginController loginController = Get.find();
|
||||||
ApiResponse apiResponse = ApiResponse(code: -1, msg: "保存失败".tr);
|
ApiResponse apiResponse = ApiResponse(code: -1, msg: "保存失败".tr);
|
||||||
UserModel user = model.user!;
|
UserModel user = model.user!;
|
||||||
if (user.tmpNickName == null || user.tmpNickName!.isEmpty) {
|
final bool hasContactUpdate = (phone != null && phone.isNotEmpty) ||
|
||||||
|
(email != null && email.isNotEmpty);
|
||||||
|
|
||||||
|
/// 只有在【没有更新 phone/email】时,才要求昵称不为空
|
||||||
|
if (!hasContactUpdate &&
|
||||||
|
(user.tmpNickName == null || user.tmpNickName!.isEmpty)) {
|
||||||
apiResponse.msg = "昵称为空".tr;
|
apiResponse.msg = "昵称为空".tr;
|
||||||
return apiResponse;
|
return apiResponse;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -143,8 +143,8 @@ void initServiceAddress() {
|
|||||||
ServiceConstant.baseHost = "zhmht.swes.com.cn:27020";
|
ServiceConstant.baseHost = "zhmht.swes.com.cn:27020";
|
||||||
} else if (AppConstants().ent_type == APPPackageType.TH.code) {
|
} else if (AppConstants().ent_type == APPPackageType.TH.code) {
|
||||||
// 太和
|
// 太和
|
||||||
// ServiceConstant.baseHost = "vsbst-api.he-info.com";
|
ServiceConstant.baseHost = "vsbst-api.he-info.com";
|
||||||
ServiceConstant.baseHost = "vsbs-test.he-info.cn";
|
// ServiceConstant.baseHost = "vsbs-test.he-info.cn";
|
||||||
} else {
|
} else {
|
||||||
//默认
|
//默认
|
||||||
ServiceConstant.baseHost = "vsbst-api.he-info.com";
|
ServiceConstant.baseHost = "vsbst-api.he-info.com";
|
||||||
|
|||||||
@@ -56,66 +56,6 @@ getOnePicker(BuildContext context, List arr, int checkIndex,
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Widget getOnePickers(
|
|
||||||
// BuildContext context,
|
|
||||||
// List arr,
|
|
||||||
// RxInt selectedIndex, {
|
|
||||||
// String unit = '',
|
|
||||||
// bool looping = false,
|
|
||||||
// void Function(int)? onChanged,
|
|
||||||
// bool isMonthName = false,
|
|
||||||
// Key? pickerKey,
|
|
||||||
// }) {
|
|
||||||
// ThemeController themeController = Get.find();
|
|
||||||
// final bool isEn = Get.locale?.languageCode.startsWith('en') ?? false;
|
|
||||||
|
|
||||||
// return Obx(() {
|
|
||||||
// final dynamicKey = ValueKey('picker_${arr.length}_${selectedIndex.value}');
|
|
||||||
// return CupertinoPicker.builder(
|
|
||||||
// key: pickerKey ?? dynamicKey,
|
|
||||||
// itemExtent: 90.rpx,
|
|
||||||
// useMagnifier: false,
|
|
||||||
// magnification: 1,
|
|
||||||
// diameterRatio: 1.3,
|
|
||||||
// squeeze: 1,
|
|
||||||
// scrollController:
|
|
||||||
// FixedExtentScrollController(initialItem: selectedIndex.value),
|
|
||||||
// selectionOverlay: Container(),
|
|
||||||
// onSelectedItemChanged: (int index) {
|
|
||||||
// selectedIndex.value = index;
|
|
||||||
// if (onChanged != null) onChanged(index);
|
|
||||||
// },
|
|
||||||
// childCount: arr.length,
|
|
||||||
// itemBuilder: (context, index) {
|
|
||||||
// bool isSelected = index == selectedIndex.value;
|
|
||||||
|
|
||||||
// // 处理显示文本
|
|
||||||
// String displayText;
|
|
||||||
// if (isMonthName && isEn && arr[index] is int) {
|
|
||||||
// displayText = DateFormat.MMMM('en').format(DateTime(0, arr[index]));
|
|
||||||
// } else {
|
|
||||||
// // displayText = isEn ? "${arr[index]}" : "${arr[index]}$unit"; // 中文附带单位
|
|
||||||
// displayText = "${arr[index]}$unit"; // 中文附带单位
|
|
||||||
// }
|
|
||||||
|
|
||||||
// return Center(
|
|
||||||
// child: Text(
|
|
||||||
// displayText,
|
|
||||||
// style: TextStyle(
|
|
||||||
// fontFamily: 'Readex Pro',
|
|
||||||
// color: isSelected
|
|
||||||
// ? themeController.currentColor.sc3
|
|
||||||
// : const Color(0xFF9AA0B3),
|
|
||||||
// fontSize: 30.rpx,
|
|
||||||
// fontWeight: FontWeight.normal,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// );
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
Widget getOnePickers(
|
Widget getOnePickers(
|
||||||
BuildContext context,
|
BuildContext context,
|
||||||
List arr,
|
List arr,
|
||||||
@@ -125,6 +65,66 @@ Widget getOnePickers(
|
|||||||
void Function(int)? onChanged,
|
void Function(int)? onChanged,
|
||||||
bool isMonthName = false,
|
bool isMonthName = false,
|
||||||
Key? pickerKey,
|
Key? pickerKey,
|
||||||
|
}) {
|
||||||
|
ThemeController themeController = Get.find();
|
||||||
|
final bool isEn = Get.locale?.languageCode.startsWith('en') ?? false;
|
||||||
|
|
||||||
|
return Obx(() {
|
||||||
|
final dynamicKey = ValueKey('picker_${arr.length}_${selectedIndex.value}');
|
||||||
|
return CupertinoPicker.builder(
|
||||||
|
key: pickerKey ?? dynamicKey,
|
||||||
|
itemExtent: 90.rpx,
|
||||||
|
useMagnifier: false,
|
||||||
|
magnification: 1,
|
||||||
|
diameterRatio: 1.3,
|
||||||
|
squeeze: 1,
|
||||||
|
scrollController:
|
||||||
|
FixedExtentScrollController(initialItem: selectedIndex.value),
|
||||||
|
selectionOverlay: Container(),
|
||||||
|
onSelectedItemChanged: (int index) {
|
||||||
|
selectedIndex.value = index;
|
||||||
|
if (onChanged != null) onChanged(index);
|
||||||
|
},
|
||||||
|
childCount: arr.length,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
bool isSelected = index == selectedIndex.value;
|
||||||
|
|
||||||
|
// 处理显示文本
|
||||||
|
String displayText;
|
||||||
|
if (isMonthName && isEn && arr[index] is int) {
|
||||||
|
displayText = DateFormat.MMMM('en').format(DateTime(0, arr[index]));
|
||||||
|
} else {
|
||||||
|
// displayText = isEn ? "${arr[index]}" : "${arr[index]}$unit"; // 中文附带单位
|
||||||
|
displayText = "${arr[index]}$unit"; // 中文附带单位
|
||||||
|
}
|
||||||
|
|
||||||
|
return Center(
|
||||||
|
child: Text(
|
||||||
|
displayText,
|
||||||
|
style: TextStyle(
|
||||||
|
fontFamily: 'Readex Pro',
|
||||||
|
color: isSelected
|
||||||
|
? themeController.currentColor.sc3
|
||||||
|
: const Color(0xFF9AA0B3),
|
||||||
|
fontSize: 30.rpx,
|
||||||
|
fontWeight: FontWeight.normal,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget getOnePickersSpe(
|
||||||
|
BuildContext context,
|
||||||
|
List arr,
|
||||||
|
RxInt selectedIndex, {
|
||||||
|
String unit = '',
|
||||||
|
bool looping = false,
|
||||||
|
void Function(int)? onChanged,
|
||||||
|
bool isMonthName = false,
|
||||||
|
Key? pickerKey,
|
||||||
|
|
||||||
/// ⭐ 新增:可选的自定义显示,但不影响旧用法
|
/// ⭐ 新增:可选的自定义显示,但不影响旧用法
|
||||||
String Function(dynamic value)? customDisplay,
|
String Function(dynamic value)? customDisplay,
|
||||||
|
|||||||
@@ -207,6 +207,7 @@ class THShareDeviceDetailWidget extends GetView {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await _updateDeviceInfo(context);
|
await _updateDeviceInfo(context);
|
||||||
|
Get.back();
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
width: MediaQuery.sizeOf(context).width,
|
width: MediaQuery.sizeOf(context).width,
|
||||||
@@ -341,10 +342,10 @@ class THShareDeviceDetailWidget extends GetView {
|
|||||||
),
|
),
|
||||||
// 解除分享按钮
|
// 解除分享按钮
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: EdgeInsetsDirectional.fromSTEB(
|
||||||
0,
|
100.rpx,
|
||||||
0,
|
|
||||||
0,
|
0,
|
||||||
|
100.rpx,
|
||||||
AppConstants.page_button_bottom_padding,
|
AppConstants.page_button_bottom_padding,
|
||||||
),
|
),
|
||||||
child: Container(
|
child: Container(
|
||||||
@@ -352,12 +353,13 @@ class THShareDeviceDetailWidget extends GetView {
|
|||||||
height: MediaQuery.sizeOf(context).height * 0.056,
|
height: MediaQuery.sizeOf(context).height * 0.056,
|
||||||
constraints: const BoxConstraints(minHeight: 46),
|
constraints: const BoxConstraints(minHeight: 46),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color:
|
color: Colors.transparent,
|
||||||
FlutterFlowTheme.of(context).secondaryBackground,
|
|
||||||
borderRadius: BorderRadius.circular(16.rpx),
|
borderRadius: BorderRadius.circular(16.rpx),
|
||||||
),
|
),
|
||||||
child: CustomCard(
|
child: CustomCard(
|
||||||
borderRadius: 16.rpx,
|
// borderRadius: 16.rpx,
|
||||||
|
borderRadius:
|
||||||
|
AppConstants().button_container_radius, // 圆角半径
|
||||||
gradientDirection: GradientDirection.vertical,
|
gradientDirection: GradientDirection.vertical,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
if (uid != null) {
|
if (uid != null) {
|
||||||
@@ -402,12 +404,8 @@ class THShareDeviceDetailWidget extends GetView {
|
|||||||
}, onCancel: () {});
|
}, onCancel: () {});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
colors: const [
|
colors: [
|
||||||
Color(0xFFFCFCFC),
|
themeController.currentColor.sc9,
|
||||||
Color(0xFFF8FAF9),
|
|
||||||
Color(0XFFECF6F3),
|
|
||||||
Color(0XFFD9F0E9),
|
|
||||||
Color(0xFFCEECE3)
|
|
||||||
],
|
],
|
||||||
child: Container(
|
child: Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
@@ -419,7 +417,7 @@ class THShareDeviceDetailWidget extends GetView {
|
|||||||
child: Text(
|
child: Text(
|
||||||
"解除分享".tr,
|
"解除分享".tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: const Color(0xFF003058),
|
color: themeController.currentColor.sc3,
|
||||||
fontSize: 30.rpx,
|
fontSize: 30.rpx,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -440,6 +438,7 @@ class THShareDeviceDetailWidget extends GetView {
|
|||||||
// 构建数据项列表(k:v格式)
|
// 构建数据项列表(k:v格式)
|
||||||
List<Widget> _buildDataItems() {
|
List<Widget> _buildDataItems() {
|
||||||
List<Widget> widgets = [];
|
List<Widget> widgets = [];
|
||||||
|
bool isFirst = true; // 标记第一个有效元素
|
||||||
|
|
||||||
for (var item in dataList) {
|
for (var item in dataList) {
|
||||||
// 只显示包含k和v的项
|
// 只显示包含k和v的项
|
||||||
@@ -450,7 +449,7 @@ class THShareDeviceDetailWidget extends GetView {
|
|||||||
String key = item['k'].toString();
|
String key = item['k'].toString();
|
||||||
String value = item['v'].toString();
|
String value = item['v'].toString();
|
||||||
|
|
||||||
// 跳过opType相关的显示,因为我们在下面单独处理了
|
// 跳过 opType
|
||||||
if (key.toLowerCase().contains('optype')) {
|
if (key.toLowerCase().contains('optype')) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -462,13 +461,17 @@ class THShareDeviceDetailWidget extends GetView {
|
|||||||
'$key: $value',
|
'$key: $value',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily: 'Readex Pro',
|
fontFamily: 'Readex Pro',
|
||||||
color: key == '名称' ? Color(0xFFFFFFFF) : Color(0xFF9EA4B7),
|
color:
|
||||||
fontSize: key == '名称' ? 28.rpx : 20.rpx,
|
isFirst ? const Color(0xFFFFFFFF) : const Color(0xFF9EA4B7),
|
||||||
|
fontSize: isFirst ? 28.rpx : 20.rpx,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// 第一个有效元素处理完后,标记为 false
|
||||||
|
isFirst = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1787,7 +1787,8 @@ Future<String?> showMessageConfirmDialog({
|
|||||||
enableBorder: true,
|
enableBorder: true,
|
||||||
borderColor: themeController.currentColor.sc4,
|
borderColor: themeController.currentColor.sc4,
|
||||||
gradientDirection: GradientDirection.vertical,
|
gradientDirection: GradientDirection.vertical,
|
||||||
borderRadius: 16.rpx,
|
// borderRadius: 16.rpx,
|
||||||
|
borderRadius: AppConstants().button_container_radius,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.back(result: 'cancel');
|
Get.back(result: 'cancel');
|
||||||
},
|
},
|
||||||
@@ -1798,12 +1799,13 @@ Future<String?> showMessageConfirmDialog({
|
|||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: Text(
|
child: Text(
|
||||||
'取消'.tr,
|
'取消'.tr,
|
||||||
style: TextStyle(fontSize: 26.rpx, color: Colors.black),
|
style: TextStyle(fontSize: 26.rpx, color: Colors.white),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
CustomCard(
|
CustomCard(
|
||||||
borderRadius: 16.rpx,
|
// borderRadius: 16.rpx,
|
||||||
|
borderRadius: AppConstants().button_container_radius,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.back(result: 'confirm');
|
Get.back(result: 'confirm');
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -216,8 +216,7 @@ class _DeviceSharePageState extends State<DeviceSharePage> {
|
|||||||
height:
|
height:
|
||||||
33.rpx *
|
33.rpx *
|
||||||
0.6,
|
0.6,
|
||||||
color: const Color(
|
color: themeController.currentColor.sc2,
|
||||||
0xFF6BFDAC),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -187,8 +187,21 @@ class _MinePageState extends State<MinePage> {
|
|||||||
Text(
|
Text(
|
||||||
limitText(
|
limitText(
|
||||||
login == 1
|
login == 1
|
||||||
? userInfoController
|
? (userInfoController
|
||||||
.model.user?.nick_name
|
.model
|
||||||
|
.user
|
||||||
|
?.nick_name ==
|
||||||
|
null ||
|
||||||
|
userInfoController
|
||||||
|
.model
|
||||||
|
.user
|
||||||
|
?.nick_name ==
|
||||||
|
""
|
||||||
|
? '未命名'.tr
|
||||||
|
: userInfoController
|
||||||
|
.model
|
||||||
|
.user
|
||||||
|
?.nick_name)
|
||||||
: '未命名'.tr,
|
: '未命名'.tr,
|
||||||
AppConstants()
|
AppConstants()
|
||||||
.text_length, // 这里设置最大长度,按你需求改,比如 6~10 字符
|
.text_length, // 这里设置最大长度,按你需求改,比如 6~10 字符
|
||||||
@@ -259,7 +272,7 @@ class _MinePageState extends State<MinePage> {
|
|||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily: 'Inter',
|
fontFamily: 'Inter',
|
||||||
color: themeController
|
color: themeController
|
||||||
.currentColor.sc3,
|
.currentColor.sc2,
|
||||||
fontSize: AppConstants()
|
fontSize: AppConstants()
|
||||||
.normal_text_fontSize,
|
.normal_text_fontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
@@ -690,7 +703,7 @@ class _MinePageState extends State<MinePage> {
|
|||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'V1.0.2512.08',
|
'V1.0.2512.09',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily: 'Inter',
|
fontFamily: 'Inter',
|
||||||
// color: Color(0xFFD9E3EB),
|
// color: Color(0xFFD9E3EB),
|
||||||
|
|||||||
@@ -564,7 +564,6 @@ Future<void> showHeightPickerDialog(
|
|||||||
// int tempIndex = selectedIndex;
|
// int tempIndex = selectedIndex;
|
||||||
final RxInt tempIndex = RxInt(selectedIndex); // ✅ 改为 RxInt
|
final RxInt tempIndex = RxInt(selectedIndex); // ✅ 改为 RxInt
|
||||||
ThemeController themeController = Get.find();
|
ThemeController themeController = Get.find();
|
||||||
|
|
||||||
await showDialog(
|
await showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
barrierDismissible: true,
|
barrierDismissible: true,
|
||||||
@@ -1134,11 +1133,10 @@ Future<void> showIntervalPickerDialog(
|
|||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 240.rpx,
|
height: 240.rpx,
|
||||||
child: getOnePickers(
|
child: getOnePickersSpe(
|
||||||
context,
|
context,
|
||||||
values,
|
values,
|
||||||
tempIndex,
|
tempIndex,
|
||||||
|
|
||||||
/// → 替换显示文本(核心)
|
/// → 替换显示文本(核心)
|
||||||
customDisplay: (val) => formatValue(val),
|
customDisplay: (val) => formatValue(val),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -225,7 +225,8 @@ class _SettingPageState extends State<SettingPage> {
|
|||||||
.language_name!,
|
.language_name!,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily: 'Inter',
|
fontFamily: 'Inter',
|
||||||
color: Color(0xFFD9E3EB),
|
color: themeController
|
||||||
|
.currentColor.sc2,
|
||||||
fontSize: 26.rpx,
|
fontSize: 26.rpx,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
),
|
),
|
||||||
@@ -609,7 +610,7 @@ class _SettingPageState extends State<SettingPage> {
|
|||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsetsDirectional.fromSTEB(
|
padding: EdgeInsetsDirectional.fromSTEB(
|
||||||
0.rpx, 50.rpx, 0.rpx, 100.rpx),
|
0.rpx, 100.rpx, 0.rpx, 100.rpx),
|
||||||
child: ClickableContainer(
|
child: ClickableContainer(
|
||||||
borderRadius:
|
borderRadius:
|
||||||
AppConstants().button_container_radius, // 圆角半径
|
AppConstants().button_container_radius, // 圆角半径
|
||||||
@@ -656,7 +657,7 @@ class _SettingPageState extends State<SettingPage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
].divide(SizedBox(
|
].divide(SizedBox(
|
||||||
height: 17.rpx,
|
height: 4.rpx,
|
||||||
))),
|
))),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -116,8 +116,10 @@ class _UpdateUserEmailPageState extends State<UpdateUserEmailPage> {
|
|||||||
userInfoController.model.user!.tmpNickName = null;
|
userInfoController.model.user!.tmpNickName = null;
|
||||||
loginController.model.updatePhone = null;
|
loginController.model.updatePhone = null;
|
||||||
await userInfoController.getUserInfo();
|
await userInfoController.getUserInfo();
|
||||||
userInfoController.model.user!.tmpNickName = userInfoController.model.user!.nick_name;
|
userInfoController.model.user!.tmpNickName =
|
||||||
userInfoController.model.user!.tmpHead = userInfoController.model.user!.avatar;
|
userInfoController.model.user!.nick_name;
|
||||||
|
userInfoController.model.user!.tmpHead =
|
||||||
|
userInfoController.model.user!.avatar;
|
||||||
userInfoController.updateAll();
|
userInfoController.updateAll();
|
||||||
Get.back();
|
Get.back();
|
||||||
}
|
}
|
||||||
@@ -177,7 +179,7 @@ class _UpdateUserEmailPageState extends State<UpdateUserEmailPage> {
|
|||||||
padding: EdgeInsetsDirectional.fromSTEB(
|
padding: EdgeInsetsDirectional.fromSTEB(
|
||||||
60.rpx, 0, 35.rpx, 0),
|
60.rpx, 0, 35.rpx, 0),
|
||||||
child: Text(
|
child: Text(
|
||||||
"原邮箱号" + ":" + "${getHideEmail()}",
|
"原邮箱号".tr + ":" + "${getHideEmail()}",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: themeController.currentColor.sc3,
|
color: themeController.currentColor.sc3,
|
||||||
fontSize: AppConstants().normal_text_fontSize,
|
fontSize: AppConstants().normal_text_fontSize,
|
||||||
@@ -199,7 +201,7 @@ class _UpdateUserEmailPageState extends State<UpdateUserEmailPage> {
|
|||||||
alignment: AlignmentDirectional(-1, 0),
|
alignment: AlignmentDirectional(-1, 0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsetsDirectional.fromSTEB(
|
padding: EdgeInsetsDirectional.fromSTEB(
|
||||||
0, 0.rpx, 0, 20.rpx),
|
0, 20.rpx, 0, 20.rpx),
|
||||||
child: Container(
|
child: Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: bodySize.maxHeight * 0.056,
|
height: bodySize.maxHeight * 0.056,
|
||||||
@@ -354,7 +356,7 @@ class _UpdateUserEmailPageState extends State<UpdateUserEmailPage> {
|
|||||||
alignment: AlignmentDirectional(-1, 0),
|
alignment: AlignmentDirectional(-1, 0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsetsDirectional.fromSTEB(
|
padding: EdgeInsetsDirectional.fromSTEB(
|
||||||
0, 0.rpx, 0, 0),
|
0, 0.rpx, 0, 20.rpx),
|
||||||
child: Container(
|
child: Container(
|
||||||
height: bodySize.maxHeight * 0.056,
|
height: bodySize.maxHeight * 0.056,
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
|
|||||||
@@ -418,7 +418,9 @@ class _UpdateUserPageState extends State<UpdateUserPage> {
|
|||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
].divide(SizedBox(width: 22.rpx)),
|
SizedBox(width: 22.rpx),
|
||||||
|
getNowInfoByType('phone'),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
@@ -427,9 +429,8 @@ class _UpdateUserPageState extends State<UpdateUserPage> {
|
|||||||
getTextByUserInfo('phone'),
|
getTextByUserInfo('phone'),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily: 'Inter',
|
fontFamily: 'Inter',
|
||||||
// color: Color(0xFFD9E3EB),
|
color: getColorByUserInfo(
|
||||||
color: themeController
|
'phone'),
|
||||||
.currentColor.sc2,
|
|
||||||
fontSize: 26.rpx,
|
fontSize: 26.rpx,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
),
|
),
|
||||||
@@ -485,7 +486,9 @@ class _UpdateUserPageState extends State<UpdateUserPage> {
|
|||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
].divide(SizedBox(width: 22.rpx)),
|
SizedBox(width: 22.rpx),
|
||||||
|
getNowInfoByType('email'),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
@@ -495,8 +498,8 @@ class _UpdateUserPageState extends State<UpdateUserPage> {
|
|||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily: 'Inter',
|
fontFamily: 'Inter',
|
||||||
// color: Color(0xFFD9E3EB),
|
// color: Color(0xFFD9E3EB),
|
||||||
color: themeController
|
color: getColorByUserInfo(
|
||||||
.currentColor.sc2,
|
'email'),
|
||||||
fontSize: 26.rpx,
|
fontSize: 26.rpx,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
),
|
),
|
||||||
@@ -589,13 +592,8 @@ class _UpdateUserPageState extends State<UpdateUserPage> {
|
|||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily: 'Inter',
|
fontFamily: 'Inter',
|
||||||
// color: Color(0xFFD9E3EB),
|
// color: Color(0xFFD9E3EB),
|
||||||
color: getTextByUserInfo(
|
color: getColorByUserInfo(
|
||||||
'wechat') ==
|
'wechat'),
|
||||||
"解绑".tr
|
|
||||||
? themeController
|
|
||||||
.currentColor.sc4
|
|
||||||
: themeController
|
|
||||||
.currentColor.sc2,
|
|
||||||
fontSize: 26.rpx,
|
fontSize: 26.rpx,
|
||||||
letterSpacing: 0.0,
|
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 (type == "phone") {
|
||||||
if (userInfo.phone == null || userInfo.phone!.isEmpty) {
|
if (userInfo.phone == null || userInfo.phone!.isEmpty) {
|
||||||
return "更换".tr;
|
return "去绑定".tr;
|
||||||
} else {
|
} else {
|
||||||
return "换绑".tr;
|
return "换绑".tr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (type == "email") {
|
if (type == "email") {
|
||||||
if (userInfo.email == null || userInfo.email!.isEmpty) {
|
if (userInfo.email == null || userInfo.email!.isEmpty) {
|
||||||
return "绑定".tr;
|
return "去绑定".tr;
|
||||||
} else {
|
} else {
|
||||||
return "换绑".tr;
|
return "换绑".tr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (type == "wechat") {
|
if (type == "wechat") {
|
||||||
if (userInfo.bindWx == null || userInfo.bindWx == false) {
|
if (userInfo.bindWx == null || userInfo.bindWx == false) {
|
||||||
return "绑定".tr;
|
return "去绑定".tr;
|
||||||
} else {
|
} else {
|
||||||
return "解绑".tr;
|
return "解绑".tr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return "";
|
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