diff --git a/lib/mock_models/users/user_info_model.dart b/lib/mock_models/users/user_info_model.dart index 2226d3e..ab7fb96 100644 --- a/lib/mock_models/users/user_info_model.dart +++ b/lib/mock_models/users/user_info_model.dart @@ -18,16 +18,26 @@ class UserInfoModel { String nickName; File avatar; USER_ROLE role; + String phone; + String get securePhone { + if (phone.length < 8) + return phone; + else + return '${phone.substring(0, 3)}****${phone.substring(7)}'; + } + UserInfoModel({ this.nickName, this.avatar, this.role, + this.phone, }); UserInfoModel.empty({ this.nickName = '', this.avatar, this.role = USER_ROLE.EMPTY, + this.phone = '', }); ///管家角色生成 @@ -36,6 +46,7 @@ class UserInfoModel { this.nickName = '李管家', this.avatar, this.role = USER_ROLE.MANAGER, + this.phone = '18819289976', }); ///师傅角色生成 @@ -44,6 +55,7 @@ class UserInfoModel { this.nickName = '王师傅', this.avatar, this.role = USER_ROLE.FIXER, + this.phone = '18927139123', }); ///师傅角色生成 @@ -52,5 +64,6 @@ class UserInfoModel { this.nickName = '林保安', this.avatar, this.role = USER_ROLE.SECURITY, + this.phone = '13918237877', }); } diff --git a/lib/provider/user_provider.dart b/lib/provider/user_provider.dart index 8ab535d..09d0cb4 100644 --- a/lib/provider/user_provider.dart +++ b/lib/provider/user_provider.dart @@ -1,6 +1,5 @@ import 'dart:io'; -import 'package:aku_community_manager/const/resource.dart'; import 'package:aku_community_manager/mock_models/users/user_info_model.dart'; import 'package:flutter/material.dart'; diff --git a/lib/ui/home/application/applications_page.dart b/lib/ui/home/application/applications_page.dart index d651a54..4a3593d 100644 --- a/lib/ui/home/application/applications_page.dart +++ b/lib/ui/home/application/applications_page.dart @@ -1,5 +1,6 @@ import 'package:aku_community_manager/ui/manage_pages/green_manage_page.dart'; import 'package:aku_community_manager/ui/sub_pages/activity_manager/activity_manager_page.dart'; +import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_manager_page.dart'; import 'package:aku_community_manager/ui/sub_pages/visitor_manager/visitor_manager_page.dart'; import 'package:aku_ui/common_widgets/aku_material_button.dart'; import 'package:flutter/material.dart'; @@ -49,9 +50,11 @@ class _ApplicationPageState extends State AppApplication('一键报警', R.ASSETS_HOME_IC_POLICE_PNG, Scaffold()), AppApplication('问卷调查', '', Scaffold()), ]; -List _wisdomApplications=[ - AppApplication('绿化管理', R.ASSETS_HOME_IC_GREENING_PNG, GreenManagePage()), -]; + List _wisdomApplications = [ + AppApplication('绿化管理', R.ASSETS_HOME_IC_GREENING_PNG, GreenManagePage()), + AppApplication( + '装修管理', R.ASSETS_HOME_IC_DECORATION_PNG, DecorationManagerPage()), + ]; @override Widget build(BuildContext context) { final appProvider = Provider.of(context); @@ -202,7 +205,7 @@ List _wisdomApplications=[ }, itemCount: _recommandApplications.length, ), - GridView.builder( + GridView.builder( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: 3, ), diff --git a/lib/ui/home/home_page.dart b/lib/ui/home/home_page.dart index b14f99b..a2b4bfc 100644 --- a/lib/ui/home/home_page.dart +++ b/lib/ui/home/home_page.dart @@ -275,17 +275,25 @@ class _HomePageState extends State { ]), ), SizedBox(height: 24.w), - Container( - margin: EdgeInsets.only( - left: 32.w, - ), - height: 67.w, - child: Text( - 'HI,李大海', - style: TextStyle( + GestureDetector( + onTap: () { + if (!userProvider.isSigned) Get.to(LoginPage()); + }, + child: Container( + margin: EdgeInsets.only( + left: 32.w, + ), + height: 67.w, + child: Text( + userProvider.isSigned + ? 'HI,${userProvider.userInfoModel.nickName}' + : '登录/注册', + style: TextStyle( color: AppStyle.primaryTextColor, fontWeight: FontWeight.bold, - fontSize: 48.sp), + fontSize: 48.sp, + ), + ), ), ), SizedBox(height: 16.w), diff --git a/lib/ui/settings/user_info_page.dart b/lib/ui/settings/user_info_page.dart index abe6b22..9df3337 100644 --- a/lib/ui/settings/user_info_page.dart +++ b/lib/ui/settings/user_info_page.dart @@ -50,6 +50,7 @@ class _UserInfoPageState extends State { AkuTile( onTap: () {}, title: Text('手机'), + suffix: Text(userProvider.userInfoModel.securePhone), ), ], ), diff --git a/lib/ui/sub_pages/decoration_manager/decoration_manager_page.dart b/lib/ui/sub_pages/decoration_manager/decoration_manager_page.dart new file mode 100644 index 0000000..36136d7 --- /dev/null +++ b/lib/ui/sub_pages/decoration_manager/decoration_manager_page.dart @@ -0,0 +1,18 @@ +import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; +import 'package:flutter/material.dart'; + +class DecorationManagerPage extends StatefulWidget { + DecorationManagerPage({Key key}) : super(key: key); + + @override + _DecorationManagerPageState createState() => _DecorationManagerPageState(); +} + +class _DecorationManagerPageState extends State { + @override + Widget build(BuildContext context) { + return AkuScaffold( + title: '装修管理', + ); + } +}