更新
This commit is contained in:
@@ -34,6 +34,17 @@ class _EPageState extends State<PersonPage> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
personController.getDiseaseData().then((apiResponse) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: apiResponse.msg!,
|
||||
textColor: apiResponse.code != HttpStatusCodes.ok
|
||||
? themeController.currentColor.sc9
|
||||
: themeController.currentColor.sc2,
|
||||
);
|
||||
});
|
||||
});
|
||||
personController.selectedDiseaseIds.value = [];
|
||||
personController.name.value = '';
|
||||
personController.gender.value = 1;
|
||||
|
||||
@@ -3,7 +3,6 @@ import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:vbvs_app/common/color/appConstants.dart';
|
||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
|
||||
|
||||
Future showDateSelectionDialog(BuildContext context,
|
||||
|
||||
@@ -15,11 +15,13 @@ import 'package:vbvs_app/controller/main_bottom/global_controller.dart';
|
||||
import 'package:vbvs_app/controller/person/person_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/BindType.dart';
|
||||
import 'package:vbvs_app/model/api_response.dart';
|
||||
import 'package:vbvs_app/pages/person/select_time.dart';
|
||||
|
||||
class UpdatePersonPage extends StatefulWidget {
|
||||
const UpdatePersonPage({super.key});
|
||||
var status;
|
||||
UpdatePersonPage({super.key, required this.status});
|
||||
|
||||
@override
|
||||
State<UpdatePersonPage> createState() => _UpdatePageState();
|
||||
@@ -38,7 +40,7 @@ class _UpdatePageState extends State<UpdatePersonPage> {
|
||||
super.initState();
|
||||
personController.getDiseaseData().then((apiResponse) {
|
||||
TopSlideNotification.show(
|
||||
Get.context!,
|
||||
context,
|
||||
text: apiResponse.msg!,
|
||||
textColor: apiResponse.code != HttpStatusCodes.ok
|
||||
? themeController.currentColor.sc9
|
||||
@@ -49,6 +51,8 @@ class _UpdatePageState extends State<UpdatePersonPage> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
print(widget.status);
|
||||
print(widget.status);
|
||||
return LayoutBuilder(
|
||||
builder: (context, bodySize) => GestureDetector(
|
||||
onTap: () => FocusScope.of(context).unfocus(),
|
||||
@@ -85,7 +89,6 @@ class _UpdatePageState extends State<UpdatePersonPage> {
|
||||
fontSize: 30.rpx,
|
||||
),
|
||||
),
|
||||
|
||||
/// 左边返回按钮
|
||||
Positioned(
|
||||
left: 0,
|
||||
@@ -94,41 +97,44 @@ class _UpdatePageState extends State<UpdatePersonPage> {
|
||||
bodyDeviceController.updateAll();
|
||||
}),
|
||||
),
|
||||
Positioned(
|
||||
right: 20.rpx,
|
||||
child: CustomCard(
|
||||
borderRadius: 20.rpx,
|
||||
onTap: () async {
|
||||
ApiResponse apiRespons =
|
||||
await personController.savePersonData();
|
||||
if (apiRespons.code == HttpStatusCodes.ok) {
|
||||
TopSlideNotification.show(context,
|
||||
text: apiRespons.msg!);
|
||||
} else {
|
||||
TopSlideNotification.show(context,
|
||||
text: apiRespons.msg!,
|
||||
textColor: themeController.currentColor.sc9);
|
||||
}
|
||||
},
|
||||
colors: [
|
||||
themeController.currentColor.sc1,
|
||||
themeController.currentColor.sc2,
|
||||
],
|
||||
child: Container(
|
||||
width: 100.rpx,
|
||||
height: 60.rpx,
|
||||
alignment: Alignment.center,
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
16.rpx, 0, 16.rpx, 0),
|
||||
child: Text(
|
||||
'人员资料.保存'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.titleSmall
|
||||
.override(
|
||||
fontFamily: 'Inter Tight',
|
||||
color: themeController.currentColor.sc3,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
Visibility(
|
||||
visible: widget.status == BindType.active.code,
|
||||
child: Positioned(
|
||||
right: 20.rpx,
|
||||
child: CustomCard(
|
||||
borderRadius: 20.rpx,
|
||||
onTap: () async {
|
||||
ApiResponse apiRespons =
|
||||
await personController.savePersonData();
|
||||
if (apiRespons.code == HttpStatusCodes.ok) {
|
||||
TopSlideNotification.show(context,
|
||||
text: apiRespons.msg!);
|
||||
} else {
|
||||
TopSlideNotification.show(context,
|
||||
text: apiRespons.msg!,
|
||||
textColor: themeController.currentColor.sc9);
|
||||
}
|
||||
},
|
||||
colors: [
|
||||
themeController.currentColor.sc1,
|
||||
themeController.currentColor.sc2,
|
||||
],
|
||||
child: Container(
|
||||
width: 100.rpx,
|
||||
height: 60.rpx,
|
||||
alignment: Alignment.center,
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
16.rpx, 0, 16.rpx, 0),
|
||||
child: Text(
|
||||
'人员资料.保存'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.titleSmall
|
||||
.override(
|
||||
fontFamily: 'Inter Tight',
|
||||
color: themeController.currentColor.sc3,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -670,6 +676,7 @@ class _UpdatePageState extends State<UpdatePersonPage> {
|
||||
),
|
||||
);
|
||||
}),
|
||||
|
||||
Padding(
|
||||
padding:
|
||||
EdgeInsetsDirectional.fromSTEB(0, 152.rpx, 0, 0),
|
||||
|
||||
Reference in New Issue
Block a user