首页自动刷新

master
张萌 3 years ago
parent 21b431685f
commit bb82dda8b8

@ -1,6 +1,13 @@
import 'dart:ui'; 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:equatable/equatable.dart';
import 'package:get/get.dart';
class ApplicationUtil { class ApplicationUtil {
ApplicationUtil(this.titles); 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 { class AppElement extends Equatable {
@ -34,11 +65,11 @@ class AppElement extends Equatable {
final String imgPath; final String imgPath;
final VoidCallback onTap; final VoidCallback onTap;
const AppElement( const AppElement({
this.title, required this.title,
this.imgPath, required this.imgPath,
this.onTap, required this.onTap,
); });
@override @override
List<Object?> get props => [ List<Object?> get props => [

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

Loading…
Cancel
Save