张萌 4 years ago
commit acf4994f47

@ -81,12 +81,16 @@ android {
minifyEnabled true minifyEnabled true
useProguard true useProguard true
multiDexEnabled true multiDexEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release signingConfig signingConfigs.release
} }
profile{ profile{
minifyEnabled true minifyEnabled true
useProguard true useProguard true
multiDexEnabled true multiDexEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release signingConfig signingConfigs.release
} }
} }

@ -36,6 +36,8 @@ void main() async {
print("flutter onReceiveNotification: $message"); print("flutter onReceiveNotification: $message");
LoggerData.addData(message); LoggerData.addData(message);
await JpushMessageParse(message).shot(); await JpushMessageParse(message).shot();
final appProvider = Provider.of<AppProvider>(Get.context, listen: false);
appProvider.updateMessage();
}, },
// //
onOpenNotification: (Map<String, dynamic> message) async { onOpenNotification: (Map<String, dynamic> message) async {
@ -88,6 +90,7 @@ class MyApp extends StatelessWidget {
designSize: Size(750, 1334), designSize: Size(750, 1334),
builder: () { builder: () {
return GetMaterialApp( return GetMaterialApp(
debugShowCheckedModeBanner: false,
title: '小蜜蜂管家', title: '小蜜蜂管家',
theme: AppTheme.themeData, theme: AppTheme.themeData,
home: SplashPage(), home: SplashPage(),

@ -30,7 +30,7 @@ class ExecuteCheckList {
final Map<String, dynamic> data = { final Map<String, dynamic> data = {
"id": this.id, "id": this.id,
"status": this.status, "status": this.status,
"remarks": this.remarkes, "remakes": this.remarkes,
}; };
return data; return data;
} }

@ -16,6 +16,9 @@ class UserInfoModel {
/// ///
bool get canOperation => jurisdiction.contains(57); bool get canOperation => jurisdiction.contains(57);
///
bool get manager => canSendTicket && canPickUpTicket;
UserInfoModel({this.id, this.roleId, this.nickName, this.jurisdiction}); UserInfoModel({this.id, this.roleId, this.nickName, this.jurisdiction});
UserInfoModel.fromJson(Map<String, dynamic> json) { UserInfoModel.fromJson(Map<String, dynamic> json) {

@ -1,10 +1,13 @@
// Flutter imports: // Flutter imports:
import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/utils/network/net_util.dart';
import 'package:amap_flutter_location/amap_flutter_location.dart'; import 'package:amap_flutter_location/amap_flutter_location.dart';
import 'package:amap_flutter_location/amap_location_option.dart'; import 'package:amap_flutter_location/amap_location_option.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
// Project imports: // Project imports:
import 'package:aku_community_manager/ui/home/application/applications_page.dart'; import 'package:aku_community_manager/ui/home/application/applications_page.dart';
import 'package:dio/dio.dart';
class AppProvider extends ChangeNotifier { class AppProvider extends ChangeNotifier {
List<AppApplication> _recentUsedApp = []; List<AppApplication> _recentUsedApp = [];
@ -50,4 +53,18 @@ class AppProvider extends ChangeNotifier {
_flutterLocation.stopLocation(); _flutterLocation.stopLocation();
_flutterLocation.destroy(); _flutterLocation.destroy();
} }
int _sysMessage = 0;
int _commentMessage = 0;
bool get hasMessage => _sysMessage != 0 || _commentMessage != 0;
int get sysMessage => _sysMessage;
int get commentMessage => _commentMessage;
updateMessage() async {
Response response = await NetUtil().dio.get(API.message.messageCenter);
if (response == null || response.data == null) return;
_sysMessage = response.data['sysCount'] ?? 0;
_commentMessage = response.data['commentCount'] ?? 0;
notifyListeners();
}
} }

@ -2,6 +2,7 @@
import 'dart:io'; import 'dart:io';
// Flutter imports: // Flutter imports:
import 'package:aku_community_manager/provider/app_provider.dart';
import 'package:aku_community_manager/utils/network/base_file_model.dart'; import 'package:aku_community_manager/utils/network/base_file_model.dart';
import 'package:bot_toast/bot_toast.dart'; import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -16,6 +17,9 @@ import 'package:aku_community_manager/utils/network/net_util.dart';
import 'package:aku_community_manager/models/user/user_info_model.dart' import 'package:aku_community_manager/models/user/user_info_model.dart'
as USER_INFO; as USER_INFO;
import 'package:get/get.dart';
import 'package:jpush_flutter/jpush_flutter.dart';
import 'package:provider/provider.dart';
// //
class UserProvider extends ChangeNotifier { class UserProvider extends ChangeNotifier {
@ -44,6 +48,8 @@ class UserProvider extends ChangeNotifier {
///profile ///profile
Future<UserProfileModel> updateProfile() async { Future<UserProfileModel> updateProfile() async {
final appProvider = Provider.of<AppProvider>(Get.context, listen: false);
appProvider.updateMessage();
BaseModel model = await NetUtil().get(API.user.profile); BaseModel model = await NetUtil().get(API.user.profile);
if (model == null) if (model == null)
return null; return null;
@ -53,10 +59,14 @@ class UserProvider extends ChangeNotifier {
Future<USER_INFO.UserInfoModel> updateUserInfo() async { Future<USER_INFO.UserInfoModel> updateUserInfo() async {
BaseModel model = await NetUtil().get(API.user.info); BaseModel model = await NetUtil().get(API.user.info);
if (model == null) if (model == null)
return null; return null;
else else {
return USER_INFO.UserInfoModel.fromJson(model.data); var userModel = USER_INFO.UserInfoModel.fromJson(model.data);
JPush().setAlias(userModel.id.toString());
return userModel;
}
} }
/// ///

@ -216,9 +216,7 @@ class AgreementPage extends StatelessWidget {
20201021 20201021
''', ''',
style: TextStyle( style: Theme.of(context).textTheme.subtitle1,
fontSize: 30.w,
),
), ),
), ),
); );

@ -18,10 +18,6 @@ class PrivacyPage extends StatelessWidget {
padding: EdgeInsets.all(16.sp), padding: EdgeInsets.all(16.sp),
child: Column( child: Column(
children: [ children: [
Text(
'小蜜蜂智慧社区管家端隐私政策',
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 35.w),
),
Text( Text(
''' '''
APPAPP便使使 APPAPP便使使
@ -124,9 +120,7 @@ class PrivacyPage extends StatelessWidget {
20201020 20201020
''', ''',
style: TextStyle( style: Theme.of(context).textTheme.subtitle1,
fontSize: 30.w,
),
), ),
], ],
), ),

@ -5,10 +5,12 @@ import 'package:aku_community_manager/models/manager/bussiness_and_fix/bussiness
import 'package:aku_community_manager/models/manager/item_num_model.dart'; import 'package:aku_community_manager/models/manager/item_num_model.dart';
import 'package:aku_community_manager/models/todo_bussiness/todo_model.dart'; import 'package:aku_community_manager/models/todo_bussiness/todo_model.dart';
import 'package:aku_community_manager/models/todo_bussiness/todo_outdoor_model.dart'; import 'package:aku_community_manager/models/todo_bussiness/todo_outdoor_model.dart';
import 'package:aku_community_manager/tools/user_tool.dart';
import 'package:aku_community_manager/ui/home/business/bussiness_func.dart'; import 'package:aku_community_manager/ui/home/business/bussiness_func.dart';
import 'package:aku_community_manager/ui/home/business/todo_outdoor_card.dart'; import 'package:aku_community_manager/ui/home/business/todo_outdoor_card.dart';
import 'package:aku_community_manager/utils/network/base_list_model.dart'; import 'package:aku_community_manager/utils/network/base_list_model.dart';
import 'package:aku_community_manager/utils/network/net_util.dart'; import 'package:aku_community_manager/utils/network/net_util.dart';
import 'package:badges/badges.dart';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:firebase_crashlytics/firebase_crashlytics.dart'; import 'package:firebase_crashlytics/firebase_crashlytics.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -151,12 +153,15 @@ class _HomePageState extends State<HomePage> {
statusBarColor: Colors.transparent, statusBarColor: Colors.transparent,
)); ));
Future.delayed(Duration(milliseconds: 300), () async { Future.delayed(Duration(milliseconds: 300), () async {
final userProvider = Provider.of<UserProvider>(context, listen: false);
if (userProvider.isLogin) {
_itemNumModel = await _getItemNum(); _itemNumModel = await _getItemNum();
var dataList = await BussinessFunc.getBussinessModelList(1); var dataList = await BussinessFunc.getBussinessModelList(1);
_todoModelList = dataList.map((e) => ToDoModel.fromJson(e)).toList(); _todoModelList = dataList.map((e) => ToDoModel.fromJson(e)).toList();
_anounceMentList = await _getAnouncement(); _anounceMentList = await _getAnouncement();
_onload = false; _onload = false;
setState(() {}); setState(() {});
}
}); });
} }
@ -182,6 +187,10 @@ class _HomePageState extends State<HomePage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final userProvider = Provider.of<UserProvider>(context); final userProvider = Provider.of<UserProvider>(context);
final appProvider = Provider.of<AppProvider>(context);
var loadingWidget = Center(
child: CircularProgressIndicator(),
);
return AnnotatedRegion<SystemUiOverlayStyle>( return AnnotatedRegion<SystemUiOverlayStyle>(
child: Scaffold( child: Scaffold(
drawer: PersonalDraw(), drawer: PersonalDraw(),
@ -261,7 +270,7 @@ class _HomePageState extends State<HomePage> {
), ),
SizedBox(width: 19.w), SizedBox(width: 19.w),
Text( Text(
'搜索工单订单号、手机', '搜索应用',
style: TextStyle( style: TextStyle(
color: AppStyle.minorTextColor, color: AppStyle.minorTextColor,
fontSize: 28.sp, fontSize: 28.sp,
@ -300,7 +309,14 @@ class _HomePageState extends State<HomePage> {
// ]), // ]),
// ), // ),
// ), // ),
Container( Badge(
elevation: 0,
position: BadgePosition.topEnd(
top: 4,
end: 4,
),
showBadge: appProvider.hasMessage,
child: Container(
margin: EdgeInsets.only(top: 5.w, bottom: 5.w), margin: EdgeInsets.only(top: 5.w, bottom: 5.w),
child: AkuMaterialButton( child: AkuMaterialButton(
minWidth: 78.w, minWidth: 78.w,
@ -328,6 +344,7 @@ class _HomePageState extends State<HomePage> {
]), ]),
), ),
), ),
),
SizedBox(width: 17.w), SizedBox(width: 17.w),
]), ]),
), ),
@ -389,13 +406,11 @@ class _HomePageState extends State<HomePage> {
), ),
), ),
), ),
body: _onload //
? Center( body: (!UserTool.userProvider.isLogin)
child: Shimmer.fromColors( ? SizedBox()
child: 'LOADING······'.text.black.size(50.sp).make(), : _onload
baseColor: Colors.white, ? loadingWidget
highlightColor: kPrimaryColor),
)
: ListView( : ListView(
padding: EdgeInsets.all(32.w), padding: EdgeInsets.all(32.w),
children: [ children: [
@ -476,7 +491,8 @@ class _HomePageState extends State<HomePage> {
return Container( return Container(
width: 12.w, width: 12.w,
height: 12.w, height: 12.w,
margin: EdgeInsets.symmetric(horizontal: 12.w), margin:
EdgeInsets.symmetric(horizontal: 12.w),
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle,
color: _currentIndicator == index color: _currentIndicator == index
@ -556,8 +572,8 @@ class _HomePageState extends State<HomePage> {
.runtimeType == .runtimeType ==
ToDoOutDoorModel) { ToDoOutDoorModel) {
return ToDoOutDoorCard( return ToDoOutDoorCard(
model: model: _todoModelList[index]
_todoModelList[index].dynamicModel, .dynamicModel,
); );
} else } else
return SizedBox(); return SizedBox();
@ -584,7 +600,8 @@ class _HomePageState extends State<HomePage> {
children: [ children: [
_card(_itemNumModel.unProcessedNum ?? 0, _card(_itemNumModel.unProcessedNum ?? 0,
'未处理事项', Color(0xFFFF4E0D), 0), '未处理事项', Color(0xFFFF4E0D), 0),
GridientDiveder().verticalDivider(166.5.w), GridientDiveder()
.verticalDivider(166.5.w),
_card(_itemNumModel.processingNum ?? 0, _card(_itemNumModel.processingNum ?? 0,
'处理中事项', Color(0xFFFFC40C), 1), '处理中事项', Color(0xFFFFC40C), 1),
], ],

@ -1,6 +1,5 @@
// Flutter imports: // Flutter imports:
import 'package:aku_community_manager/const/api.dart'; import 'package:aku_community_manager/provider/app_provider.dart';
import 'package:aku_community_manager/utils/network/net_util.dart';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -17,6 +16,7 @@ import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/ui/home/messages/comment_message.dart'; import 'package:aku_community_manager/ui/home/messages/comment_message.dart';
import 'package:aku_community_manager/ui/home/messages/system_message.dart'; import 'package:aku_community_manager/ui/home/messages/system_message.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:provider/provider.dart';
class Message extends StatefulWidget { class Message extends StatefulWidget {
Message({Key key}) : super(key: key); Message({Key key}) : super(key: key);
@ -26,8 +26,6 @@ class Message extends StatefulWidget {
} }
class _MessageState extends State<Message> { class _MessageState extends State<Message> {
int _messageCount = 0;
int _commentCount = 0;
EasyRefreshController _refreshController = EasyRefreshController(); EasyRefreshController _refreshController = EasyRefreshController();
Widget _messageTypeImage(String type) { Widget _messageTypeImage(String type) {
String path; String path;
@ -132,15 +130,9 @@ class _MessageState extends State<Message> {
); );
} }
Future _updateMessageCenter() async {
Response response = await NetUtil().dio.get(API.message.messageCenter);
if (response == null || response.data == null) return;
_messageCount = response.data['sysCount'] ?? 0;
_commentCount = response.data['commentCount'] ?? 0;
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final appProvider = Provider.of<AppProvider>(context);
return AkuScaffold( return AkuScaffold(
title: '消息', title: '消息',
titleStyle: AppStyle().barTitleStyle, titleStyle: AppStyle().barTitleStyle,
@ -148,8 +140,7 @@ class _MessageState extends State<Message> {
controller: _refreshController, controller: _refreshController,
firstRefresh: true, firstRefresh: true,
onRefresh: () async { onRefresh: () async {
await _updateMessageCenter(); await appProvider.updateMessage();
setState(() {});
}, },
header: MaterialHeader(), header: MaterialHeader(),
child: ListView( child: ListView(
@ -160,7 +151,7 @@ class _MessageState extends State<Message> {
_messageTypeImage('系统消息'), _messageTypeImage('系统消息'),
'系统消息', '系统消息',
'你有一条新的报事报修待处理', '你有一条新的报事报修待处理',
_messageCount, appProvider.sysMessage,
onpressed: () { onpressed: () {
Get.to(() => SystemMessage()); Get.to(() => SystemMessage());
}, },
@ -173,7 +164,7 @@ class _MessageState extends State<Message> {
_messageTypeImage('评论消息'), _messageTypeImage('评论消息'),
'评论消息', '评论消息',
'你有一条新的评论回复', '你有一条新的评论回复',
_commentCount, appProvider.commentMessage,
onpressed: () { onpressed: () {
Get.to(() => CommentMessage()); Get.to(() => CommentMessage());
}, },

@ -91,7 +91,7 @@ class _SearchWorkOrderpageState extends State<SearchWorkOrderPage> {
child: TextField( child: TextField(
controller: _textController, controller: _textController,
decoration: InputDecoration( decoration: InputDecoration(
hintText: '搜索工单、手机号', hintText: '搜索应用',
hintStyle: TextStyle( hintStyle: TextStyle(
color: AppStyle.minorTextColor, color: AppStyle.minorTextColor,
fontSize: 28.sp, fontSize: 28.sp,

@ -19,8 +19,7 @@ class ManageFunc {
/// ///
static Future dispatchListDetailType() async { static Future dispatchListDetailType() async {
Response response = await NetUtil().dio.get( Response response = await NetUtil().dio.get(
'http://test.akuhotel.com:8804/IntelligentCommunity' + '${API.host}/IntelligentCommunity' + API.manage.dispatchListDetailType);
API.manage.dispatchListDetailType);
return response.data as List; return response.data as List;
} }

@ -23,23 +23,21 @@ packages:
name: amap_flutter_base name: amap_flutter_base
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.0.2" version: "2.0.0"
amap_flutter_location: amap_flutter_location:
dependency: "direct main" dependency: "direct main"
description: description:
name: amap_flutter_location name: amap_flutter_location
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.0.1" version: "2.0.0"
amap_flutter_map: amap_flutter_map:
dependency: "direct main" dependency: "direct main"
description: description:
path: "." name: amap_flutter_map
ref: nullsafety url: "https://pub.flutter-io.cn"
resolved-ref: "5c50cf60d2157cc2779a171ca65c327d571389a7" source: hosted
url: "http://159.75.73.143:8080/third_packages/amap_flutter_map" version: "2.0.1"
source: git
version: "2.0.2-nullsafety"
analyzer: analyzer:
dependency: transitive dependency: transitive
description: description:
@ -82,6 +80,13 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "3.0.0" version: "3.0.0"
badges:
dependency: "direct main"
description:
name: badges
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.0"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:

@ -42,12 +42,9 @@ dependencies:
expandable: ^5.0.1 expandable: ^5.0.1
url_launcher: ^6.0.3 url_launcher: ^6.0.3
amap_flutter_map: amap_flutter_map: ^2.0.1
git: amap_flutter_location: ^2.0.0
url: http://159.75.73.143:8080/third_packages/amap_flutter_map amap_flutter_base: ^2.0.0
ref: nullsafety
amap_flutter_location: ^1.0.1
amap_flutter_base: ^1.0.2
permission_handler: ^6.1.1 permission_handler: ^6.1.1
velocity_x: ^2.6.0 velocity_x: ^2.6.0
@ -72,6 +69,7 @@ dependencies:
url: http://159.75.73.143:8080/third_packages/jpush_flutter url: http://159.75.73.143:8080/third_packages/jpush_flutter
shimmer: ^2.0.0-nullsafety.0 shimmer: ^2.0.0-nullsafety.0
badges: ^1.2.0
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:

Loading…
Cancel
Save