添加保湿保修页面

更新角色ROLE
hmxc
小赖 4 years ago
parent 3537388d43
commit bec9d4403f

@ -1,10 +1,56 @@
import 'dart:io'; import 'dart:io';
enum USER_ROLE {
///
MANAGER,
///
FIXER,
///
SECURITY,
///
EMPTY,
}
class UserInfoModel { class UserInfoModel {
String nickName; String nickName;
File avatar; File avatar;
USER_ROLE role;
UserInfoModel({ UserInfoModel({
this.nickName, this.nickName,
this.avatar, this.avatar,
this.role,
});
UserInfoModel.empty({
this.nickName = '',
this.avatar,
this.role = USER_ROLE.EMPTY,
});
///
///password 000000
UserInfoModel.manager({
this.nickName = '李管家',
this.avatar,
this.role = USER_ROLE.MANAGER,
});
///
///password 000001
UserInfoModel.fixer({
this.nickName = '王师傅',
this.avatar,
this.role = USER_ROLE.FIXER,
});
///
///password 000002
UserInfoModel.security({
this.nickName = '林保安',
this.avatar,
this.role = USER_ROLE.SECURITY,
}); });
} }

@ -17,13 +17,16 @@ class UserProvider extends ChangeNotifier {
notifyListeners(); notifyListeners();
} }
UserInfoModel _userInfoModel = UserInfoModel( UserInfoModel _userInfoModel = UserInfoModel.empty();
nickName: '李大海',
avatar: null,
);
UserInfoModel get userInfoModel => _userInfoModel; UserInfoModel get userInfoModel => _userInfoModel;
setUserInfo(UserInfoModel model) {
_userInfoModel = model;
_isSigned = true;
notifyListeners();
}
setNickName(String name) { setNickName(String name) {
_userInfoModel.nickName = name; _userInfoModel.nickName = name;
notifyListeners(); notifyListeners();

@ -84,7 +84,7 @@ class _PersonalDrawState extends State<PersonalDraw> {
onTap: () {}, onTap: () {},
child: userProvider.isSigned child: userProvider.isSigned
? Text( ? Text(
'李大海', userProvider.userInfoModel.nickName,
style: TextStyle( style: TextStyle(
color: AppStyle.primaryTextColor, color: AppStyle.primaryTextColor,
fontSize: 28.sp, fontSize: 28.sp,

@ -1,5 +1,6 @@
import 'dart:async'; import 'dart:async';
import 'package:aku_community_manager/mock_models/users/user_info_model.dart';
import 'package:aku_community_manager/provider/user_provider.dart'; import 'package:aku_community_manager/provider/user_provider.dart';
import 'package:aku_community_manager/style/app_style.dart'; import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/widget_tool.dart'; import 'package:aku_community_manager/tools/widget_tool.dart';
@ -7,6 +8,7 @@ import 'package:aku_community_manager/ui/home/home_page.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_back_button.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_back_button.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_ui/common_widgets/aku_material_button.dart'; import 'package:aku_ui/common_widgets/aku_material_button.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:aku_community_manager/tools/screen_tool.dart'; import 'package:aku_community_manager/tools/screen_tool.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
@ -97,8 +99,16 @@ class _LoginSMSPageState extends State<LoginSMSPage> {
final userProvider = final userProvider =
Provider.of<UserProvider>(context, listen: false); Provider.of<UserProvider>(context, listen: false);
if (text == '000000') { if (text == '000000') {
userProvider.setisSigned(true); userProvider.setUserInfo(UserInfoModel.manager());
Get.offAll(HomePage()); Get.offAll(HomePage());
} else if (text == '000001') {
userProvider.setUserInfo(UserInfoModel.fixer());
Get.offAll(HomePage());
} else if (text == '000002') {
userProvider.setUserInfo(UserInfoModel.security());
Get.offAll(HomePage());
} else {
if (text.length == 6) BotToast.showText(text: '验证码错误');
} }
}, },
), ),

@ -0,0 +1,16 @@
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:flutter/material.dart';
class BusinessAndFixPage extends StatefulWidget {
BusinessAndFixPage({Key key}) : super(key: key);
@override
_BusinessAndFixPageState createState() => _BusinessAndFixPageState();
}
class _BusinessAndFixPageState extends State<BusinessAndFixPage> {
@override
Widget build(BuildContext context) {
return AkuScaffold();
}
}
Loading…
Cancel
Save