对接:查询待办事项数量

hmxc
张萌 4 years ago
parent f8226a7040
commit 5dfeaa4c5f

@ -164,6 +164,9 @@ class _Manage {
///
String get inspectionPointCheckDetail =>
'/user/inspection/findCheckDetailById';
///
String get findItemNum => '/user/backlog/findItemNum';
}
class _Upload {

@ -0,0 +1,28 @@
class ItemNumModel {
int unProcessedNum;
int processedNum;
int processingNum;
int allNum;
ItemNumModel(
{this.unProcessedNum,
this.processedNum,
this.processingNum,
this.allNum});
ItemNumModel.fromJson(Map<String, dynamic> json) {
unProcessedNum = json['unProcessedNum'];
processedNum = json['processedNum'];
processingNum = json['processingNum'];
allNum = json['allNum'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['unProcessedNum'] = this.unProcessedNum;
data['processedNum'] = this.processedNum;
data['processingNum'] = this.processingNum;
data['allNum'] = this.allNum;
return data;
}
}

@ -1,6 +1,7 @@
// Flutter imports:
import 'package:aku_community_manager/models/manager/bussiness_and_fix/bussiness_and_fix_model.dart';
import 'package:aku_community_manager/models/manager/decoration/decoration_list_model.dart';
import 'package:aku_community_manager/models/manager/item_num_model.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
@ -39,7 +40,8 @@ import 'package:aku_community_manager/ui/tool_pages/warning/warning_page.dart';
import 'package:aku_community_manager/ui/widgets/app_widgets/aku_avatar.dart';
class HomePage extends StatefulWidget {
HomePage({Key key}) : super(key: key);
final ItemNumModel itemNumModel;
HomePage({Key key, @required this.itemNumModel}) : super(key: key);
@override
_HomePageState createState() => _HomePageState();
@ -530,11 +532,11 @@ class _HomePageState extends State<HomePage> {
children: [
Row(
children: [
_card(AllModel(context).waitThings?.length, '未处理事项',
_card(widget.itemNumModel.unProcessedNum??0, '未处理事项',
Color(0xFFFF4E0D), 0),
GridientDiveder().verticalDivider(166.5.w),
_card(AllModel(context).processingThings?.length,
'处理中事项', Color(0xFFFFC40C), 1),
_card(widget.itemNumModel.processingNum??0, '处理中事项',
Color(0xFFFFC40C), 1),
],
),
Row(children: [
@ -544,12 +546,12 @@ class _HomePageState extends State<HomePage> {
]),
Row(
children: [
_card(AllModel(context).doneThings?.length, '已处理事项',
_card(widget.itemNumModel.processedNum??0, '已处理事项',
Color(0xFF3F8FFE), 2),
GridientDiveder(isReverse: true).verticalDivider(
166.5.w,
),
_card(AllModel(context).allThings?.length, '全部事项',
_card(widget.itemNumModel.allNum??0, '全部事项',
Color(0xFF333333), 3),
],
),

@ -1,12 +1,16 @@
// Flutter imports:
import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/models/manager/item_num_model.dart';
import 'package:aku_community_manager/provider/user_provider.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/utils/dev_util.dart';
import 'package:aku_community_manager/utils/network/net_util.dart';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:amap_map_fluttify/amap_map_fluttify.dart';
import 'package:get/get.dart';
import 'package:get/get.dart' hide Response;
import 'package:hive/hive.dart';
import 'package:hive_flutter/hive_flutter.dart';
import 'package:power_logger/power_logger.dart';
@ -45,10 +49,18 @@ class _SplashPageState extends State<SplashPage> {
});
Future.delayed(Duration(milliseconds: 2000), () async {
await _originOp();
Get.off(HomePage());
ItemNumModel itemNumModel = await _getItemNum();
Get.off(HomePage(
itemNumModel: itemNumModel,
));
});
}
Future _getItemNum() async {
Response response = await NetUtil().dio.get(API.manage.findItemNum);
return ItemNumModel.fromJson(response.data);
}
@override
Widget build(BuildContext context) {
return Scaffold(

Loading…
Cancel
Save