更新
This commit is contained in:
@@ -4,10 +4,12 @@ import 'package:ef/ef.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.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/mh_controller/people_info_controller.dart';
|
||||
|
||||
@@ -58,7 +60,7 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
|
||||
children: [
|
||||
// 中间居中的标题
|
||||
Text(
|
||||
'人员资料',
|
||||
'人员资料'.tr,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
@@ -89,7 +91,9 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
|
||||
d['height'].toString().isNotEmpty &&
|
||||
int.tryParse(d['height'].toString()) ==
|
||||
null) {
|
||||
showToast("$prefix身高请输入数字");
|
||||
TopSlideNotification.show(context,
|
||||
text: "请选择身高".tr,
|
||||
textColor: Color(0xFFFF7159));
|
||||
isValid = false;
|
||||
break;
|
||||
}
|
||||
@@ -98,16 +102,9 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
|
||||
d['weight'].toString().isNotEmpty &&
|
||||
int.tryParse(d['weight'].toString()) ==
|
||||
null) {
|
||||
showToast("$prefix体重请输入数字");
|
||||
isValid = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (d['tel'] != null &&
|
||||
d['tel'].toString().isNotEmpty &&
|
||||
!MyUtils.isValidPhoneNumber(
|
||||
d['tel'].toString())) {
|
||||
showToast("$prefix请输入正确的电话");
|
||||
TopSlideNotification.show(context,
|
||||
text: "请选择体重".tr,
|
||||
textColor: Color(0xFFFF7159));
|
||||
isValid = false;
|
||||
break;
|
||||
}
|
||||
@@ -116,7 +113,9 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
|
||||
d['contact'].toString().isNotEmpty &&
|
||||
!MyUtils.isValidPhoneNumber(
|
||||
d['contact'].toString())) {
|
||||
showToast("$prefix请输入正确的紧急联系人电话");
|
||||
TopSlideNotification.show(context,
|
||||
text: "请输入正确的联系人电话".tr,
|
||||
textColor: Color(0xFFFF7159));
|
||||
isValid = false;
|
||||
break;
|
||||
}
|
||||
@@ -126,13 +125,15 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
|
||||
if (isValid) {
|
||||
for (var data in controller.model.peopleList) {
|
||||
try {
|
||||
await controller.savePeoples(
|
||||
data); // 注意:你这个方法名是 savePeoples,建议改成 savePerson
|
||||
showToast("保存成功(${data['mac']})",
|
||||
color: color_success);
|
||||
await controller.savePeoples(data);
|
||||
TopSlideNotification.show(context,
|
||||
text: "更新成功".tr,
|
||||
textColor: Color(0XFF00C1AA));
|
||||
} catch (e) {
|
||||
print("保存失败:$e");
|
||||
showToast("保存失败(${data['mac']})");
|
||||
TopSlideNotification.show(context,
|
||||
text: "更新失败".tr,
|
||||
textColor: Color(0xFFFF7159));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -153,7 +154,7 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
|
||||
// color: stringToColor("#182B7C"),
|
||||
// ),
|
||||
child: Text(
|
||||
"保存",
|
||||
"保存".tr,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Color(0XFF011D33),
|
||||
@@ -391,12 +392,16 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
|
||||
SizedBox(
|
||||
width: 16.rpx,
|
||||
),
|
||||
Icon(
|
||||
Icons.expand_more,
|
||||
color:
|
||||
Colors.white,
|
||||
size: 48.rpx,
|
||||
),
|
||||
Container(
|
||||
height: 30.rpx,
|
||||
width: 30.rpx,
|
||||
child:
|
||||
SvgPicture
|
||||
.asset(
|
||||
'assets/img/icon/expand_more.svg',
|
||||
color: Colors
|
||||
.white,
|
||||
))
|
||||
],
|
||||
),
|
||||
],
|
||||
@@ -560,11 +565,15 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
|
||||
),
|
||||
SizedBox(
|
||||
width: 16.rpx),
|
||||
Icon(
|
||||
Icons.expand_more,
|
||||
color:
|
||||
Colors.white,
|
||||
size: 48.rpx),
|
||||
Container(
|
||||
height: 30.rpx,
|
||||
width: 30.rpx,
|
||||
child: SvgPicture
|
||||
.asset(
|
||||
'assets/img/icon/expand_more.svg',
|
||||
color: Colors
|
||||
.white,
|
||||
))
|
||||
],
|
||||
),
|
||||
],
|
||||
@@ -649,12 +658,16 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
|
||||
),
|
||||
SizedBox(
|
||||
width: 16.rpx),
|
||||
Icon(
|
||||
Icons
|
||||
.expand_more,
|
||||
color: Colors
|
||||
.white,
|
||||
size: 48.rpx),
|
||||
Container(
|
||||
height: 30.rpx,
|
||||
width: 30.rpx,
|
||||
child:
|
||||
SvgPicture
|
||||
.asset(
|
||||
'assets/img/icon/expand_more.svg',
|
||||
color: Colors
|
||||
.white,
|
||||
))
|
||||
],
|
||||
),
|
||||
],
|
||||
@@ -769,12 +782,16 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
|
||||
SizedBox(
|
||||
width: 16.rpx,
|
||||
),
|
||||
Icon(
|
||||
Icons.expand_more,
|
||||
color:
|
||||
Colors.white,
|
||||
size: 48.rpx,
|
||||
),
|
||||
Container(
|
||||
height: 30.rpx,
|
||||
width: 30.rpx,
|
||||
child:
|
||||
SvgPicture
|
||||
.asset(
|
||||
'assets/img/icon/expand_more.svg',
|
||||
color: Colors
|
||||
.white,
|
||||
))
|
||||
],
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user