张萌 4 years ago
commit acf4994f47

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

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

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

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

@ -1,10 +1,13 @@
// 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_location_option.dart';
import 'package:flutter/material.dart';
// Project imports:
import 'package:aku_community_manager/ui/home/application/applications_page.dart';
import 'package:dio/dio.dart';
class AppProvider extends ChangeNotifier {
List<AppApplication> _recentUsedApp = [];
@ -50,4 +53,18 @@ class AppProvider extends ChangeNotifier {
_flutterLocation.stopLocation();
_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';
// Flutter imports:
import 'package:aku_community_manager/provider/app_provider.dart';
import 'package:aku_community_manager/utils/network/base_file_model.dart';
import 'package:bot_toast/bot_toast.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'
as USER_INFO;
import 'package:get/get.dart';
import 'package:jpush_flutter/jpush_flutter.dart';
import 'package:provider/provider.dart';
//
class UserProvider extends ChangeNotifier {
@ -44,6 +48,8 @@ class UserProvider extends ChangeNotifier {
///profile
Future<UserProfileModel> updateProfile() async {
final appProvider = Provider.of<AppProvider>(Get.context, listen: false);
appProvider.updateMessage();
BaseModel model = await NetUtil().get(API.user.profile);
if (model == null)
return null;
@ -53,10 +59,14 @@ class UserProvider extends ChangeNotifier {
Future<USER_INFO.UserInfoModel> updateUserInfo() async {
BaseModel model = await NetUtil().get(API.user.info);
if (model == null)
return null;
else
return USER_INFO.UserInfoModel.fromJson(model.data);
else {
var userModel = USER_INFO.UserInfoModel.fromJson(model.data);
JPush().setAlias(userModel.id.toString());
return userModel;
}
}
///

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

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

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

@ -1,6 +1,5 @@
// Flutter imports:
import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/utils/network/net_util.dart';
import 'package:aku_community_manager/provider/app_provider.dart';
import 'package:dio/dio.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/system_message.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:provider/provider.dart';
class Message extends StatefulWidget {
Message({Key key}) : super(key: key);
@ -26,8 +26,6 @@ class Message extends StatefulWidget {
}
class _MessageState extends State<Message> {
int _messageCount = 0;
int _commentCount = 0;
EasyRefreshController _refreshController = EasyRefreshController();
Widget _messageTypeImage(String type) {
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
Widget build(BuildContext context) {
final appProvider = Provider.of<AppProvider>(context);
return AkuScaffold(
title: '消息',
titleStyle: AppStyle().barTitleStyle,
@ -148,8 +140,7 @@ class _MessageState extends State<Message> {
controller: _refreshController,
firstRefresh: true,
onRefresh: () async {
await _updateMessageCenter();
setState(() {});
await appProvider.updateMessage();
},
header: MaterialHeader(),
child: ListView(
@ -160,7 +151,7 @@ class _MessageState extends State<Message> {
_messageTypeImage('系统消息'),
'系统消息',
'你有一条新的报事报修待处理',
_messageCount,
appProvider.sysMessage,
onpressed: () {
Get.to(() => SystemMessage());
},
@ -173,7 +164,7 @@ class _MessageState extends State<Message> {
_messageTypeImage('评论消息'),
'评论消息',
'你有一条新的评论回复',
_commentCount,
appProvider.commentMessage,
onpressed: () {
Get.to(() => CommentMessage());
},

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

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

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

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

Loading…
Cancel
Save