张萌 4 years ago
commit acf4994f47

@ -78,15 +78,19 @@ android {
signingConfig signingConfigs.release
}
debug {
minifyEnabled true
useProguard true
multiDexEnabled true
minifyEnabled true
useProguard true
multiDexEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
profile{
minifyEnabled true
useProguard true
multiDexEnabled true
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 {
_itemNumModel = await _getItemNum();
var dataList = await BussinessFunc.getBussinessModelList(1);
_todoModelList = dataList.map((e) => ToDoModel.fromJson(e)).toList();
_anounceMentList = await _getAnouncement();
_onload = false;
setState(() {});
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,32 +309,40 @@ class _HomePageState extends State<HomePage> {
// ]),
// ),
// ),
Container(
margin: EdgeInsets.only(top: 5.w, bottom: 5.w),
child: AkuMaterialButton(
minWidth: 78.w,
//
height: double.infinity,
onPressed: () {
if (userProvider.isLogin)
Get.to(() => Message());
else
Get.to(() => LoginPage());
},
child: Column(children: [
Image.asset(
R.ASSETS_HOME_IC_NEWS_PNG,
height: 48.w,
width: 48.w,
),
Text(
'消息',
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 20.sp,
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,
//
height: double.infinity,
onPressed: () {
if (userProvider.isLogin)
Get.to(() => Message());
else
Get.to(() => LoginPage());
},
child: Column(children: [
Image.asset(
R.ASSETS_HOME_IC_NEWS_PNG,
height: 48.w,
width: 48.w,
),
),
]),
Text(
'消息',
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 20.sp,
),
),
]),
),
),
),
SizedBox(width: 17.w),
@ -389,114 +406,23 @@ class _HomePageState extends State<HomePage> {
),
),
),
body: _onload
? Center(
child: Shimmer.fromColors(
child: 'LOADING······'.text.black.size(50.sp).make(),
baseColor: Colors.white,
highlightColor: kPrimaryColor),
)
: ListView(
padding: EdgeInsets.all(32.w),
children: [
Container(
//
width: double.infinity,
height: 45.w,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'今日公告',
style: TextStyle(
color: Color(0xFF4A4B51),
fontSize: 32.sp,
fontWeight: FontWeight.bold,
),
),
Spacer(),
AkuButton(
//
onPressed: () {
Get.to(() => AllAnouncement());
},
child: Row(
children: [
Text(
'全部公告',
style: TextStyle(
color: AppStyle.minorTextColor,
fontSize: 24.sp,
fontWeight: FontWeight.bold,
),
),
Icon(
Icons.arrow_forward_ios,
size: 22.w,
color: AppStyle.minorTextColor,
)
],
),
),
],
),
),
SizedBox(height: 16.w),
//
Container(
color: Color(0xFFFFFFFF),
width: double.infinity,
height: 172.w,
child: Stack(children: [
CarouselSlider(
items: _anounceMentList
.map((e) => AllAnouncementState.anounceCard(e))
.toList(),
options: CarouselOptions(
viewportFraction: 1.0,
aspectRatio: 686 / 172,
autoPlay: true,
onPageChanged: (index, _) {
setState(() {
_currentIndicator = index;
});
},
),
),
Positioned(
top: 144.w,
left: 0,
bottom: 16.w,
right: 0,
//
body: (!UserTool.userProvider.isLogin)
? SizedBox()
: _onload
? loadingWidget
: ListView(
padding: EdgeInsets.all(32.w),
children: [
Container(
//
width: double.infinity,
height: 45.w,
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: _anounceMentList.map((e) {
int index = _anounceMentList.indexOf(e);
return Container(
width: 12.w,
height: 12.w,
margin: EdgeInsets.symmetric(horizontal: 12.w),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: _currentIndicator == index
? Color(0xFFFFC40C)
: Color(0xFFE8E8E8),
),
);
}).toList(),
),
),
]),
),
SizedBox(height: 16.w),
//
!userProvider.isLogin
? SizedBox()
: Row(
children: [
Text(
'待办事项',
'今日公告',
style: TextStyle(
color: Color(0xFF4A4B51),
fontSize: 32.sp,
@ -505,112 +431,203 @@ class _HomePageState extends State<HomePage> {
),
Spacer(),
AkuButton(
padding: EdgeInsets.symmetric(vertical: 16.w),
//
onPressed: () {
Get.to(BusinessPage(initIndex: 3));
Get.to(() => AllAnouncement());
},
child: Row(
children: [
Text(
'全部事项',
'全部公告',
style: TextStyle(
color: AppStyle.minorTextColor,
fontSize: 24.sp,
fontWeight: FontWeight.bold),
color: AppStyle.minorTextColor,
fontSize: 24.sp,
fontWeight: FontWeight.bold,
),
),
Icon(
Icons.arrow_forward_ios,
size: 22.w,
color: AppStyle.minorTextColor,
),
)
],
),
),
],
),
SizedBox(height: 16.w),
//
!userProvider.isLogin
? SizedBox()
: Container(
height: 480.w,
child: ListView.separated(
separatorBuilder: (context, index) {
return AkuBox.w(16);
},
scrollDirection: Axis.horizontal,
itemBuilder: (context, index) {
return Container(
width: 526.w,
child: Builder(
builder: (context) {
if (_todoModelList[index]
.dynamicModel
.runtimeType ==
BussinessAndFixModel) {
return BusinessFixCard(
model: _todoModelList[index]
.dynamicModel);
} else if (_todoModelList[index]
.dynamicModel
.runtimeType ==
ToDoOutDoorModel) {
return ToDoOutDoorCard(
model:
_todoModelList[index].dynamicModel,
);
} else
return SizedBox();
},
),
);
},
itemCount: _todoModelList.length,
),
SizedBox(height: 16.w),
//
Container(
color: Color(0xFFFFFFFF),
width: double.infinity,
height: 172.w,
child: Stack(children: [
CarouselSlider(
items: _anounceMentList
.map((e) => AllAnouncementState.anounceCard(e))
.toList(),
options: CarouselOptions(
viewportFraction: 1.0,
aspectRatio: 686 / 172,
autoPlay: true,
onPageChanged: (index, _) {
setState(() {
_currentIndicator = index;
});
},
),
),
),
SizedBox(height: 24.w),
//
!userProvider.isLogin
? SizedBox()
: Container(
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.w),
color: Colors.white,
Positioned(
top: 144.w,
left: 0,
bottom: 16.w,
right: 0,
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: _anounceMentList.map((e) {
int index = _anounceMentList.indexOf(e);
return Container(
width: 12.w,
height: 12.w,
margin:
EdgeInsets.symmetric(horizontal: 12.w),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: _currentIndicator == index
? Color(0xFFFFC40C)
: Color(0xFFE8E8E8),
),
);
}).toList(),
),
),
child: Column(
children: [
Row(
children: [
_card(_itemNumModel.unProcessedNum ?? 0,
'未处理事项', Color(0xFFFF4E0D), 0),
GridientDiveder().verticalDivider(166.5.w),
_card(_itemNumModel.processingNum ?? 0,
'处理中事项', Color(0xFFFFC40C), 1),
],
]),
),
SizedBox(height: 16.w),
//
!userProvider.isLogin
? SizedBox()
: Row(
children: [
Text(
'待办事项',
style: TextStyle(
color: Color(0xFF4A4B51),
fontSize: 32.sp,
fontWeight: FontWeight.bold,
),
),
Spacer(),
AkuButton(
padding: EdgeInsets.symmetric(vertical: 16.w),
onPressed: () {
Get.to(BusinessPage(initIndex: 3));
},
child: Row(
children: [
Text(
'全部事项',
style: TextStyle(
color: AppStyle.minorTextColor,
fontSize: 24.sp,
fontWeight: FontWeight.bold),
),
Icon(
Icons.arrow_forward_ios,
size: 22.w,
color: AppStyle.minorTextColor,
),
],
),
),
],
),
SizedBox(height: 16.w),
//
!userProvider.isLogin
? SizedBox()
: Container(
height: 480.w,
child: ListView.separated(
separatorBuilder: (context, index) {
return AkuBox.w(16);
},
scrollDirection: Axis.horizontal,
itemBuilder: (context, index) {
return Container(
width: 526.w,
child: Builder(
builder: (context) {
if (_todoModelList[index]
.dynamicModel
.runtimeType ==
BussinessAndFixModel) {
return BusinessFixCard(
model: _todoModelList[index]
.dynamicModel);
} else if (_todoModelList[index]
.dynamicModel
.runtimeType ==
ToDoOutDoorModel) {
return ToDoOutDoorCard(
model: _todoModelList[index]
.dynamicModel,
);
} else
return SizedBox();
},
),
);
},
itemCount: _todoModelList.length,
),
),
SizedBox(height: 24.w),
//
!userProvider.isLogin
? SizedBox()
: Container(
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.w),
color: Colors.white,
),
Row(children: [
GridientDiveder().horizontalDivider(343.w),
GridientDiveder(isReverse: true)
.horizontalDivider(343.w)
]),
Row(
child: Column(
children: [
_card(_itemNumModel.processedNum ?? 0,
'已处理事项', Color(0xFF3F8FFE), 2),
GridientDiveder(isReverse: true)
.verticalDivider(
166.5.w,
Row(
children: [
_card(_itemNumModel.unProcessedNum ?? 0,
'未处理事项', Color(0xFFFF4E0D), 0),
GridientDiveder()
.verticalDivider(166.5.w),
_card(_itemNumModel.processingNum ?? 0,
'处理中事项', Color(0xFFFFC40C), 1),
],
),
Row(children: [
GridientDiveder().horizontalDivider(343.w),
GridientDiveder(isReverse: true)
.horizontalDivider(343.w)
]),
Row(
children: [
_card(_itemNumModel.processedNum ?? 0,
'已处理事项', Color(0xFF3F8FFE), 2),
GridientDiveder(isReverse: true)
.verticalDivider(
166.5.w,
),
_card(_itemNumModel.allNum ?? 0, '全部事项',
Color(0xFF333333), 3),
],
),
_card(_itemNumModel.allNum ?? 0, '全部事项',
Color(0xFF333333), 3),
],
),
],
),
),
],
),
),
],
),
),
value: SystemUiOverlayStyle.dark,
);

@ -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,14 +42,11 @@ 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
dotted_border: ^2.0.0-nullsafety.0
dio: ^4.0.0
@ -58,7 +55,7 @@ dependencies:
firebase_crashlytics: ^2.0.0
#json序列化
json_serializable: ^4.1.1
power_logger: ^1.0.1-nullsafety.1
logger: ^1.0.0
aku_ui:
@ -67,11 +64,12 @@ dependencies:
hive: ^1.4.4+1
hive_flutter: ^0.3.1
jpush_flutter:
git:
jpush_flutter:
git:
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