首页自动刷新

master
张萌 3 years ago
parent 21b431685f
commit bb82dda8b8

@ -1,6 +1,13 @@
import 'dart:ui';
import 'package:aku_new_community_manager/gen/assets.gen.dart';
import 'package:aku_new_community_manager/new_ui/household_audit/household_audit_page.dart';
import 'package:aku_new_community_manager/new_ui/work_order/distributor/work_order_distributor_page.dart';
import 'package:aku_new_community_manager/new_ui/work_order/receiver/work_order_receiver_page.dart';
import 'package:aku_new_community_manager/tools/user_tool.dart';
import 'package:aku_new_community_manager/ui/manage_pages/inspection_manage/inspection_manage_page.dart';
import 'package:equatable/equatable.dart';
import 'package:get/get.dart';
class ApplicationUtil {
ApplicationUtil(this.titles);
@ -26,7 +33,31 @@ class ApplicationUtil {
}
}
List<AppElement> get allApplications => [];
List<AppElement> get allApplications => [
AppElement(
title: '巡检管理',
imgPath: Assets.home.icPatrol.path,
onTap: () async {
await Get.to(() => InspectionManagePage());
}),
AppElement(
title: '工单管理',
imgPath: Assets.home.icArticle.path,
onTap: () async {
if (UserTool.userProvider.userInfoModel!.workOrderJurisdiction ==
1) {
Get.to(() => WorkOrderDistributorPage());
} else {
Get.to(() => WorkOrderReceiverPage());
}
}),
AppElement(
title: '住户审核',
imgPath: Assets.home.icVisitors.path,
onTap: () async {
Get.to(() => HouseholdAuditPage());
})
];
}
class AppElement extends Equatable {
@ -34,11 +65,11 @@ class AppElement extends Equatable {
final String imgPath;
final VoidCallback onTap;
const AppElement(
this.title,
this.imgPath,
this.onTap,
);
const AppElement({
required this.title,
required this.imgPath,
required this.onTap,
});
@override
List<Object?> get props => [

@ -43,14 +43,12 @@ class _NewHomePageState extends State<NewHomePage> {
}
Future _getToDoList() async {
//type
var base = await NetUtil().get(SAASAPI.home.todoList);
_todoModels =
(base.data as List).map((e) => HomeTodoListModel.fromJson(e)).toList();
}
Future _getStatusNum() async {
//type
var base = await NetUtil().get(SAASAPI.home.statusNum);
_homeNums = HomeStatusNumberModel.fromJson(base.data);
}
@ -108,6 +106,7 @@ class _NewHomePageState extends State<NewHomePage> {
),
SafeArea(
child: EasyRefresh(
firstRefresh: true,
onRefresh: () async {
await _getAnnounces();
await _getStatusNum();
@ -347,7 +346,7 @@ class _NewHomePageState extends State<NewHomePage> {
children: _todoModels
.mapIndexed((currentValue, index) =>
_todoListCard(currentValue, index))
.toList(),
.toList().sepWidget(separate: 20.w.widthBox),
),
),
],

Loading…
Cancel
Save