多语言
This commit is contained in:
@@ -1,13 +1,9 @@
|
||||
import 'package:ef/ef.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
||||
import 'package:vbvs_app/common/color/ServiceConstant.dart';
|
||||
|
||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/common/util/requestWithLog.dart';
|
||||
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||
import 'package:vbvs_app/controller/main_bottom/global_controller.dart';
|
||||
import 'package:vbvs_app/controller/mh_controller/people_info_controller.dart';
|
||||
|
||||
class DevicePeopleInfo extends GetView<PeopleInfoController> {
|
||||
@@ -15,28 +11,59 @@ class DevicePeopleInfo extends GetView<PeopleInfoController> {
|
||||
DevicePeopleInfo({required this.data});
|
||||
|
||||
PeopleInfoController controller = Get.put(PeopleInfoController());
|
||||
getInfoRow(context, String str) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
height: 60.rpx,
|
||||
decoration: BoxDecoration(),
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
'$str',
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Colors.white,
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0,
|
||||
getInfoRow(context, String k, String str) {
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Container(
|
||||
constraints: BoxConstraints(
|
||||
minWidth: 30.rpx,
|
||||
maxWidth: 140.rpx,
|
||||
minHeight: 62.rpx,
|
||||
),
|
||||
child: Align(
|
||||
alignment: AlignmentDirectional(-1, 0),
|
||||
child: Text(
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 2,
|
||||
k,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: Color(0xFF929699),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
constraints: BoxConstraints(
|
||||
minWidth: 30.rpx,
|
||||
minHeight: 62.rpx,
|
||||
),
|
||||
child: Align(
|
||||
alignment: AlignmentDirectional(-1, 0),
|
||||
child: Text(
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 1,
|
||||
str,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
].divide(SizedBox(width: 0.rpx)),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
controller.getPeoples(data['mac']);
|
||||
controller.getPeoples(data['mac'.tr]);
|
||||
});
|
||||
return LayoutBuilder(
|
||||
builder: (context, boxConstraints) => GestureDetector(
|
||||
@@ -68,7 +95,7 @@ class DevicePeopleInfo extends GetView<PeopleInfoController> {
|
||||
children: [
|
||||
// 中间居中的标题
|
||||
Text(
|
||||
'详情',
|
||||
'详情'.tr,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
@@ -123,7 +150,7 @@ class DevicePeopleInfo extends GetView<PeopleInfoController> {
|
||||
Container(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
'设备信息',
|
||||
'设备信息'.tr,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Colors.white,
|
||||
@@ -131,16 +158,17 @@ class DevicePeopleInfo extends GetView<PeopleInfoController> {
|
||||
),
|
||||
),
|
||||
),
|
||||
getInfoRow(
|
||||
context, "名称:${data["name"] ?? "-"}"),
|
||||
getInfoRow(
|
||||
context, "房间:${data["roomName"] ?? "-"}"),
|
||||
getInfoRow(context, "设备名称".tr,
|
||||
"${data["name"] ?? "-"}"),
|
||||
getInfoRow(context, "房间".tr,
|
||||
"${data["roomName"] ?? "-"}"),
|
||||
getInfoRow(
|
||||
context,
|
||||
"设备状态:${data["status"]?["status"] == 1 ? "已绑定" : data["status"]?["status"] == 0 ? "已绑定" : "-"}",
|
||||
"设备状态".tr,
|
||||
"${data["status"]?["status"] == 1 ? "已绑定" : data["status"]?["status"] == 0 ? "已绑定" : "-"}",
|
||||
),
|
||||
getInfoRow(
|
||||
context, "MAC:${data["mac"] ?? "-"}"),
|
||||
context, "MAC", "${data["mac"] ?? "-"}"),
|
||||
],
|
||||
),
|
||||
)),
|
||||
@@ -169,7 +197,9 @@ class DevicePeopleInfo extends GetView<PeopleInfoController> {
|
||||
width: double.infinity,
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
'人员资料${index == 0 ? "A" : "B"}',
|
||||
index == 0
|
||||
? 'person_info_A'.tr
|
||||
: 'person_info_B'.tr,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Colors.white,
|
||||
@@ -178,18 +208,18 @@ class DevicePeopleInfo extends GetView<PeopleInfoController> {
|
||||
),
|
||||
),
|
||||
),
|
||||
getInfoRow(
|
||||
context, "姓名:${person["name"] ?? "-"}"),
|
||||
getInfoRow(context,
|
||||
"性别:${person["gender"] == null ? "-" : (person["gender"] == 1 ? "男" : "女")}"),
|
||||
getInfoRow(context,
|
||||
"身高:${person["height"] == null ? "-" : "${person["height"]}cm"}"),
|
||||
getInfoRow(context,
|
||||
"体重:${person["weight"] == null ? "-" : "${person["weight"]}kg"}"),
|
||||
getInfoRow(context,
|
||||
"生日:${person["birthday"] == null ? "-" : time_08_Formatter_pattern(person["birthday"], "yyyy年MM月dd日")}"),
|
||||
getInfoRow(context,
|
||||
"联系方式:${person["contact"] ?? "-"}"),
|
||||
getInfoRow(context, "姓名".tr,
|
||||
"${person["name"] ?? "-"}"),
|
||||
getInfoRow(context, "性别".tr,
|
||||
"${person["gender"] == null ? "-" : (person["gender"] == 1 ? "男" : "女")}"),
|
||||
getInfoRow(context, "身高".tr,
|
||||
"${person["height"] == null ? "-" : "${person["height"]}cm"}"),
|
||||
getInfoRow(context, "体重".tr,
|
||||
"${person["weight"] == null ? "-" : "${person["weight"]}kg"}"),
|
||||
getInfoRow(context, "生日".tr,
|
||||
"${person["birthday"] == null ? "-" : time_08_Formatter_pattern(person["birthday"], "yyyy年MM月dd日")}"),
|
||||
getInfoRow(context, "联系方式".tr,
|
||||
"${person["contact"] ?? "-"}"),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user