master
张萌 3 years ago
parent 5d67f12c3e
commit dd0abc7e05

@ -26,11 +26,20 @@ class SAASAPI {
static _Message message = _Message();
static _WorkOrder workOrder = _WorkOrder();
static _HouseHoldAudit householdAudit = _HouseHoldAudit();
static _Home home = _Home();
///
static _OtherApi other = _OtherApi();
}
class _Home {
///
String get todoList => '/butlerApp/user/frontPage/pendingList';
///
String get statusNum => '/butlerApp/user/frontPage/statusNumBar';
}
class _HouseHoldAudit {
///
String get list => '/butlerApp/user/review/list';

@ -3,128 +3,257 @@
/// FlutterGen
/// *****************************************************
// ignore_for_file: directives_ordering,unnecessary_import
import 'package:flutter/widgets.dart';
class $AssetsHomeGen {
const $AssetsHomeGen();
/// File path: assets/home/app_alarm.png
AssetGenImage get appAlarm =>
const AssetGenImage('assets/home/app_alarm.png');
/// File path: assets/home/bee_task.png
AssetGenImage get beeTask => const AssetGenImage('assets/home/bee_task.png');
/// File path: assets/home/clock_in_out.png
AssetGenImage get clockInOut =>
const AssetGenImage('assets/home/clock_in_out.png');
/// File path: assets/home/device_alarm.png
AssetGenImage get deviceAlarm =>
const AssetGenImage('assets/home/device_alarm.png');
/// File path: assets/home/facilities.png
AssetGenImage get facilities =>
const AssetGenImage('assets/home/facilities.png');
/// File path: assets/home/fire_alarm.png
AssetGenImage get fireAlarm =>
const AssetGenImage('assets/home/fire_alarm.png');
/// File path: assets/home/home_back.png
AssetGenImage get homeBack =>
const AssetGenImage('assets/home/home_back.png');
/// File path: assets/home/home_head.png
AssetGenImage get homeHead =>
const AssetGenImage('assets/home/home_head.png');
/// File path: assets/home/house_keeping.png
AssetGenImage get houseKeeping =>
const AssetGenImage('assets/home/house_keeping.png');
/// File path: assets/home/hygienice.png
AssetGenImage get hygienice =>
const AssetGenImage('assets/home/hygienice.png');
/// File path: assets/home/ic_Patrol.png
AssetGenImage get icPatrol =>
const AssetGenImage('assets/home/ic_Patrol.png');
/// File path: assets/home/ic_activity.png
AssetGenImage get icActivity =>
const AssetGenImage('assets/home/ic_activity.png');
/// File path: assets/home/ic_all.png
AssetGenImage get icAll => const AssetGenImage('assets/home/ic_all.png');
/// File path: assets/home/ic_article.png
AssetGenImage get icArticle =>
const AssetGenImage('assets/home/ic_article.png');
/// File path: assets/home/ic_borrow.png
AssetGenImage get icBorrow =>
const AssetGenImage('assets/home/ic_borrow.png');
/// File path: assets/home/ic_decoration.png
AssetGenImage get icDecoration =>
const AssetGenImage('assets/home/ic_decoration.png');
/// File path: assets/home/ic_facilities.png
AssetGenImage get icFacilities =>
const AssetGenImage('assets/home/ic_facilities.png');
/// File path: assets/home/ic_greening.png
AssetGenImage get icGreening =>
const AssetGenImage('assets/home/ic_greening.png');
/// File path: assets/home/ic_news.png
AssetGenImage get icNews => const AssetGenImage('assets/home/ic_news.png');
/// File path: assets/home/ic_police.png
AssetGenImage get icPolice =>
const AssetGenImage('assets/home/ic_police.png');
/// File path: assets/home/ic_scan.png
AssetGenImage get icScan => const AssetGenImage('assets/home/ic_scan.png');
/// File path: assets/home/ic_search.png
AssetGenImage get icSearch =>
const AssetGenImage('assets/home/ic_search.png');
/// File path: assets/home/ic_service.png
AssetGenImage get icService =>
const AssetGenImage('assets/home/ic_service.png');
/// File path: assets/home/ic_visitors.png
AssetGenImage get icVisitors =>
const AssetGenImage('assets/home/ic_visitors.png');
/// File path: assets/home/interview.png
AssetGenImage get interview =>
const AssetGenImage('assets/home/interview.png');
/// File path: assets/home/key.png
AssetGenImage get key => const AssetGenImage('assets/home/key.png');
/// File path: assets/home/message.png
AssetGenImage get message => const AssetGenImage('assets/home/message.png');
/// File path: assets/home/nearby_pet.png
AssetGenImage get nearbyPet =>
const AssetGenImage('assets/home/nearby_pet.png');
/// File path: assets/home/nearby_service.png
AssetGenImage get nearbyService =>
const AssetGenImage('assets/home/nearby_service.png');
/// File path: assets/home/package.png
AssetGenImage get package => const AssetGenImage('assets/home/package.png');
/// File path: assets/home/provide_aged.png
AssetGenImage get provideAged =>
const AssetGenImage('assets/home/provide_aged.png');
/// File path: assets/home/rules.png
AssetGenImage get rules => const AssetGenImage('assets/home/rules.png');
/// File path: assets/home/second_hand_market.png
AssetGenImage get secondHandMarket =>
const AssetGenImage('assets/home/second_hand_market.png');
/// File path: assets/home/share_park.png
AssetGenImage get sharePark =>
const AssetGenImage('assets/home/share_park.png');
/// File path: assets/home/shopping_mall.png
AssetGenImage get shoppingMall =>
const AssetGenImage('assets/home/shopping_mall.png');
/// File path: assets/home/sos.png
AssetGenImage get sos => const AssetGenImage('assets/home/sos.png');
}
class $AssetsIconsGen {
const $AssetsIconsGen();
/// File path: assets/icons/alarm_clock.png
AssetGenImage get alarmClock =>
const AssetGenImage('assets/icons/alarm_clock.png');
/// File path: assets/icons/camera.png
AssetGenImage get camera => const AssetGenImage('assets/icons/camera.png');
/// File path: assets/icons/cancel_task.png
AssetGenImage get cancelTask =>
const AssetGenImage('assets/icons/cancel_task.png');
/// File path: assets/icons/clock_circle.png
AssetGenImage get clockCircle =>
const AssetGenImage('assets/icons/clock_circle.png');
/// File path: assets/icons/connect.png
AssetGenImage get connect => const AssetGenImage('assets/icons/connect.png');
/// File path: assets/icons/copy.png
AssetGenImage get copy => const AssetGenImage('assets/icons/copy.png');
/// File path: assets/icons/dissatisfied.png
AssetGenImage get dissatisfied =>
const AssetGenImage('assets/icons/dissatisfied.png');
/// File path: assets/icons/edit.png
AssetGenImage get edit => const AssetGenImage('assets/icons/edit.png');
/// File path: assets/icons/environment.png
AssetGenImage get environment =>
const AssetGenImage('assets/icons/environment.png');
/// File path: assets/icons/examining.png
AssetGenImage get examining =>
const AssetGenImage('assets/icons/examining.png');
/// File path: assets/icons/finish_order.png
AssetGenImage get finishOrder =>
const AssetGenImage('assets/icons/finish_order.png');
/// File path: assets/icons/normal.png
AssetGenImage get normal => const AssetGenImage('assets/icons/normal.png');
/// File path: assets/icons/pass.png
AssetGenImage get pass => const AssetGenImage('assets/icons/pass.png');
/// File path: assets/icons/phone.png
AssetGenImage get phone => const AssetGenImage('assets/icons/phone.png');
/// File path: assets/icons/phone_circle.png
AssetGenImage get phoneCircle =>
const AssetGenImage('assets/icons/phone_circle.png');
/// File path: assets/icons/record.png
AssetGenImage get record => const AssetGenImage('assets/icons/record.png');
/// File path: assets/icons/reject.png
AssetGenImage get reject => const AssetGenImage('assets/icons/reject.png');
/// File path: assets/icons/reward.png
AssetGenImage get reward => const AssetGenImage('assets/icons/reward.png');
/// File path: assets/icons/satisfied.png
AssetGenImage get satisfied =>
const AssetGenImage('assets/icons/satisfied.png');
/// File path: assets/icons/tag.png
AssetGenImage get tag => const AssetGenImage('assets/icons/tag.png');
/// File path: assets/icons/task_location.png
AssetGenImage get taskLocation =>
const AssetGenImage('assets/icons/task_location.png');
/// File path: assets/icons/watch.png
AssetGenImage get watch => const AssetGenImage('assets/icons/watch.png');
}
class $AssetsInspectionGen {
const $AssetsInspectionGen();
/// File path: assets/inspection/ic_date.png
AssetGenImage get icDate =>
const AssetGenImage('assets/inspection/ic_date.png');
/// File path: assets/inspection/ic_inspection_name.png
AssetGenImage get icInspectionName =>
const AssetGenImage('assets/inspection/ic_inspection_name.png');
/// File path: assets/inspection/ic_pattern.png
AssetGenImage get icPattern =>
const AssetGenImage('assets/inspection/ic_pattern.png');
/// File path: assets/inspection/ic_station.png
AssetGenImage get icStation =>
const AssetGenImage('assets/inspection/ic_station.png');
/// File path: assets/inspection/ic_way.png
AssetGenImage get icWay =>
const AssetGenImage('assets/inspection/ic_way.png');
/// File path: assets/inspection/ic_xunjian.png
AssetGenImage get icXunjian =>
const AssetGenImage('assets/inspection/ic_xunjian.png');
/// File path: assets/inspection/inspection_station.png
AssetGenImage get inspectionStation =>
const AssetGenImage('assets/inspection/inspection_station.png');
}
@ -132,72 +261,156 @@ class $AssetsInspectionGen {
class $AssetsManageGen {
const $AssetsManageGen();
/// File path: assets/manage/add.png
AssetGenImage get add => const AssetGenImage('assets/manage/add.png');
/// File path: assets/manage/address.png
AssetGenImage get address => const AssetGenImage('assets/manage/address.png');
/// File path: assets/manage/article.png
AssetGenImage get article => const AssetGenImage('assets/manage/article.png');
/// File path: assets/manage/borrow.png
AssetGenImage get borrow => const AssetGenImage('assets/manage/borrow.png');
/// File path: assets/manage/check.png
AssetGenImage get check => const AssetGenImage('assets/manage/check.png');
/// File path: assets/manage/circuit.png
AssetGenImage get circuit => const AssetGenImage('assets/manage/circuit.png');
/// File path: assets/manage/clock.png
AssetGenImage get clock => const AssetGenImage('assets/manage/clock.png');
/// File path: assets/manage/decoration.png
AssetGenImage get decoration =>
const AssetGenImage('assets/manage/decoration.png');
/// File path: assets/manage/dingwei.png
AssetGenImage get dingwei => const AssetGenImage('assets/manage/dingwei.png');
/// File path: assets/manage/estate.png
AssetGenImage get estate => const AssetGenImage('assets/manage/estate.png');
/// File path: assets/manage/home.png
AssetGenImage get home => const AssetGenImage('assets/manage/home.png');
/// File path: assets/manage/ic_announce.png
AssetGenImage get icAnnounce =>
const AssetGenImage('assets/manage/ic_announce.png');
/// File path: assets/manage/ic_car.png
AssetGenImage get icCar => const AssetGenImage('assets/manage/ic_car.png');
/// File path: assets/manage/ic_daofang.png
AssetGenImage get icDaofang =>
const AssetGenImage('assets/manage/ic_daofang.png');
/// File path: assets/manage/ic_guoqi.png
AssetGenImage get icGuoqi =>
const AssetGenImage('assets/manage/ic_guoqi.png');
/// File path: assets/manage/ic_image.png
AssetGenImage get icImage =>
const AssetGenImage('assets/manage/ic_image.png');
/// File path: assets/manage/ic_renwu.png
AssetGenImage get icRenwu =>
const AssetGenImage('assets/manage/ic_renwu.png');
/// File path: assets/manage/ic_time.png
AssetGenImage get icTime => const AssetGenImage('assets/manage/ic_time.png');
/// File path: assets/manage/ic_wancheng.png
AssetGenImage get icWancheng =>
const AssetGenImage('assets/manage/ic_wancheng.png');
/// File path: assets/manage/ic_weidao.png
AssetGenImage get icWeidao =>
const AssetGenImage('assets/manage/ic_weidao.png');
/// File path: assets/manage/ic_zhuangxiu.png
AssetGenImage get icZhuangxiu =>
const AssetGenImage('assets/manage/ic_zhuangxiu.png');
/// File path: assets/manage/ic_zuofei.png
AssetGenImage get icZuofei =>
const AssetGenImage('assets/manage/ic_zuofei.png');
/// File path: assets/manage/info.png
AssetGenImage get info => const AssetGenImage('assets/manage/info.png');
/// File path: assets/manage/key.png
AssetGenImage get key => const AssetGenImage('assets/manage/key.png');
/// File path: assets/manage/location.png
AssetGenImage get location =>
const AssetGenImage('assets/manage/location.png');
/// File path: assets/manage/lock.png
AssetGenImage get lock => const AssetGenImage('assets/manage/lock.png');
/// File path: assets/manage/passed.png
AssetGenImage get passed => const AssetGenImage('assets/manage/passed.png');
/// File path: assets/manage/police.png
AssetGenImage get police => const AssetGenImage('assets/manage/police.png');
/// File path: assets/manage/rejected.png
AssetGenImage get rejected =>
const AssetGenImage('assets/manage/rejected.png');
/// File path: assets/manage/remaining.png
AssetGenImage get remaining =>
const AssetGenImage('assets/manage/remaining.png');
/// File path: assets/manage/security.png
AssetGenImage get security =>
const AssetGenImage('assets/manage/security.png');
/// File path: assets/manage/status.png
AssetGenImage get status => const AssetGenImage('assets/manage/status.png');
/// File path: assets/manage/submit_success.png
AssetGenImage get submitSuccess =>
const AssetGenImage('assets/manage/submit_success.png');
/// File path: assets/manage/wall.png
AssetGenImage get wall => const AssetGenImage('assets/manage/wall.png');
/// File path: assets/manage/warning.png
AssetGenImage get warning => const AssetGenImage('assets/manage/warning.png');
/// File path: assets/manage/waterway.png
AssetGenImage get waterway =>
const AssetGenImage('assets/manage/waterway.png');
/// File path: assets/manage/window.png
AssetGenImage get window => const AssetGenImage('assets/manage/window.png');
}
class $AssetsMessageGen {
const $AssetsMessageGen();
/// File path: assets/message/ic_area.png
AssetGenImage get icArea => const AssetGenImage('assets/message/ic_area.png');
/// File path: assets/message/ic_people.png
AssetGenImage get icPeople =>
const AssetGenImage('assets/message/ic_people.png');
/// File path: assets/message/ic_phone.png
AssetGenImage get icPhone =>
const AssetGenImage('assets/message/ic_phone.png');
/// File path: assets/message/ic_pinglun.png
AssetGenImage get icPinglun =>
const AssetGenImage('assets/message/ic_pinglun.png');
/// File path: assets/message/ic_star.png
AssetGenImage get icStar => const AssetGenImage('assets/message/ic_star.png');
/// File path: assets/message/ic_tongzhi.png
AssetGenImage get icTongzhi =>
const AssetGenImage('assets/message/ic_tongzhi.png');
}
@ -205,48 +418,89 @@ class $AssetsMessageGen {
class $AssetsNewIconGen {
const $AssetsNewIconGen();
/// File path: assets/newIcon/avatar_placeholder.png
AssetGenImage get avatarPlaceholder =>
const AssetGenImage('assets/newIcon/avatar_placeholder.png');
/// File path: assets/newIcon/splash.png
AssetGenImage get splash => const AssetGenImage('assets/newIcon/splash.png');
}
class $AssetsOutdoorGen {
const $AssetsOutdoorGen();
/// File path: assets/outdoor/ic_address.png
AssetGenImage get icAddress =>
const AssetGenImage('assets/outdoor/ic_address.png');
/// File path: assets/outdoor/ic_chuhu.png
AssetGenImage get icChuhu =>
const AssetGenImage('assets/outdoor/ic_chuhu.png');
/// File path: assets/outdoor/ic_goout.png
AssetGenImage get icGoout =>
const AssetGenImage('assets/outdoor/ic_goout.png');
/// File path: assets/outdoor/ic_home.png
AssetGenImage get icHome => const AssetGenImage('assets/outdoor/ic_home.png');
/// File path: assets/outdoor/ic_image.png
AssetGenImage get icImage =>
const AssetGenImage('assets/outdoor/ic_image.png');
/// File path: assets/outdoor/ic_people.png
AssetGenImage get icPeople =>
const AssetGenImage('assets/outdoor/ic_people.png');
/// File path: assets/outdoor/ic_phoneblue.png
AssetGenImage get icPhoneblue =>
const AssetGenImage('assets/outdoor/ic_phoneblue.png');
/// File path: assets/outdoor/ic_time.png
AssetGenImage get icTime => const AssetGenImage('assets/outdoor/ic_time.png');
/// File path: assets/outdoor/ic_transport.png
AssetGenImage get icTransport =>
const AssetGenImage('assets/outdoor/ic_transport.png');
/// File path: assets/outdoor/ic_weight.png
AssetGenImage get icWeight =>
const AssetGenImage('assets/outdoor/ic_weight.png');
/// File path: assets/outdoor/item2.png
AssetGenImage get item2 => const AssetGenImage('assets/outdoor/item2.png');
/// File path: assets/outdoor/item3.png
AssetGenImage get item3 => const AssetGenImage('assets/outdoor/item3.png');
/// File path: assets/outdoor/itme1.png
AssetGenImage get itme1 => const AssetGenImage('assets/outdoor/itme1.png');
}
class $AssetsStaticFixGen {
const $AssetsStaticFixGen();
/// File path: assets/static_fix/air1.png
AssetGenImage get air1 => const AssetGenImage('assets/static_fix/air1.png');
/// File path: assets/static_fix/air2.png
AssetGenImage get air2 => const AssetGenImage('assets/static_fix/air2.png');
/// File path: assets/static_fix/food.png
AssetGenImage get food => const AssetGenImage('assets/static_fix/food.png');
/// File path: assets/static_fix/food2.png
AssetGenImage get food2 => const AssetGenImage('assets/static_fix/food2.png');
/// File path: assets/static_fix/light1.png
AssetGenImage get light1 =>
const AssetGenImage('assets/static_fix/light1.png');
/// File path: assets/static_fix/light2.png
AssetGenImage get light2 =>
const AssetGenImage('assets/static_fix/light2.png');
/// File path: assets/static_fix/light3.png
AssetGenImage get light3 =>
const AssetGenImage('assets/static_fix/light3.png');
}
@ -254,15 +508,30 @@ class $AssetsStaticFixGen {
class $AssetsStaticTempGen {
const $AssetsStaticTempGen();
/// File path: assets/static_temp/drill.png
AssetGenImage get drill =>
const AssetGenImage('assets/static_temp/drill.png');
/// File path: assets/static_temp/f1.webp
AssetGenImage get f1 => const AssetGenImage('assets/static_temp/f1.webp');
/// File path: assets/static_temp/f2.webp
AssetGenImage get f2 => const AssetGenImage('assets/static_temp/f2.webp');
/// File path: assets/static_temp/f3.webp
AssetGenImage get f3 => const AssetGenImage('assets/static_temp/f3.webp');
/// File path: assets/static_temp/f4.webp
AssetGenImage get f4 => const AssetGenImage('assets/static_temp/f4.webp');
/// File path: assets/static_temp/f5.webp
AssetGenImage get f5 => const AssetGenImage('assets/static_temp/f5.webp');
/// File path: assets/static_temp/hammer.png
AssetGenImage get hammer =>
const AssetGenImage('assets/static_temp/hammer.png');
/// File path: assets/static_temp/ladder.png
AssetGenImage get ladder =>
const AssetGenImage('assets/static_temp/ladder.png');
}
@ -270,9 +539,14 @@ class $AssetsStaticTempGen {
class $AssetsUserGen {
const $AssetsUserGen();
/// File path: assets/user/ic_kefu.png
AssetGenImage get icKefu => const AssetGenImage('assets/user/ic_kefu.png');
/// File path: assets/user/ic_person.png
AssetGenImage get icPerson =>
const AssetGenImage('assets/user/ic_person.png');
/// File path: assets/user/ic_setup.png
AssetGenImage get icSetup => const AssetGenImage('assets/user/ic_setup.png');
}

@ -3,8 +3,11 @@
/// FlutterGen
/// *****************************************************
// ignore_for_file: directives_ordering,unnecessary_import
class FontFamily {
FontFamily._();
/// Font family: Bebas
static const String bebas = 'Bebas';
}

@ -0,0 +1,6 @@
class HomeMap {
static Map<int, String> todoType = {
1: '巡检',
2: '工单',
};
}

@ -1,16 +1,22 @@
import 'package:aku_new_community_manager/const/saas_api.dart';
import 'package:aku_new_community_manager/gen/assets.gen.dart';
import 'package:aku_new_community_manager/new_ui/new_home/home_map.dart';
import 'package:aku_new_community_manager/new_ui/work_order/distributor/distributor_detail_page.dart';
import 'package:aku_new_community_manager/new_ui/work_order/receiver/receiver_detail_page.dart';
import 'package:aku_new_community_manager/saas_models/home/home_message_list_model.dart';
import 'package:aku_new_community_manager/saas_models/home/home_status_number_model.dart';
import 'package:aku_new_community_manager/saas_models/home/home_todo_list_model.dart';
import 'package:aku_new_community_manager/tools/user_tool.dart';
import 'package:aku_new_community_manager/ui/home/personal_draw.dart';
import 'package:aku_new_community_manager/ui/manage_pages/inspection_manage/inspection_manage_details_page.dart';
import 'package:aku_new_community_manager/ui/widgets/app_widgets/bee_avatar_widget.dart';
import 'package:aku_new_community_manager/utils/bee_date_util.dart';
import 'package:aku_new_community_manager/utils/extension/list_extension.dart';
import 'package:aku_new_community_manager/utils/network/net_util.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart';
import 'application_util.dart';
@ -25,6 +31,8 @@ class NewHomePage extends StatefulWidget {
class _NewHomePageState extends State<NewHomePage> {
List<HomeMessageListModel> _announceModels = [];
List<HomeTodoListModel> _todoModels = [];
HomeStatusNumberModel? _homeNums;
Future _getAnnounces() async {
//type
@ -34,6 +42,19 @@ class _NewHomePageState extends State<NewHomePage> {
re.rows.map((e) => HomeMessageListModel.fromJson(e)).toList();
}
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);
}
@override
Widget build(BuildContext context) {
return Scaffold(
@ -89,6 +110,8 @@ class _NewHomePageState extends State<NewHomePage> {
child: EasyRefresh(
onRefresh: () async {
await _getAnnounces();
await _getStatusNum();
await _getToDoList();
setState(() {});
},
header: MaterialHeader(),
@ -160,7 +183,11 @@ class _NewHomePageState extends State<NewHomePage> {
.color(Colors.black.withOpacity(0.85))
.make(),
Spacer(),
'12'.text.size(24.sp).color(Color(0xFFF01C26)).make(),
'${_homeNums?.noProcessedNum ?? 0}'
.text
.size(24.sp)
.color(Color(0xFFF01C26))
.make(),
],
),
Spacer(),
@ -172,7 +199,11 @@ class _NewHomePageState extends State<NewHomePage> {
.color(Colors.black.withOpacity(0.85))
.make(),
Spacer(),
'12'.text.size(24.sp).color(Color(0xFF1C92FF)).make(),
'${_homeNums?.processingNum ?? 0}'
.text
.size(24.sp)
.color(Color(0xFF1C92FF))
.make(),
],
),
Spacer(),
@ -184,7 +215,11 @@ class _NewHomePageState extends State<NewHomePage> {
.color(Colors.black.withOpacity(0.85))
.make(),
Spacer(),
'12'.text.size(24.sp).color(Color(0xFF52C41A)).make(),
'${_homeNums?.processedNum ?? 0}'
.text
.size(24.sp)
.color(Color(0xFF52C41A))
.make(),
],
),
Spacer(),
@ -196,7 +231,7 @@ class _NewHomePageState extends State<NewHomePage> {
.color(Colors.black.withOpacity(0.85))
.make(),
Spacer(),
'124'
'${_homeNums?.allProcessNum ?? 0}'
.text
.size(24.sp)
.color(Color(0xFFFFC40C))
@ -276,22 +311,22 @@ class _NewHomePageState extends State<NewHomePage> {
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
'查看全部待办'.text.size(28.sp).color(Color(0xFFFFC40C)).make(),
// '查看全部待办'.text.size(28.sp).color(Color(0xFFFFC40C)).make(),
8.w.widthBox,
Container(
width: 28.w,
height: 28.w,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFFC40C),
borderRadius: BorderRadius.circular(4.w),
),
child: Icon(
CupertinoIcons.chevron_right,
color: Color(0xFFFFC40C),
size: 24.w,
),
)
// Container(
// width: 28.w,
// height: 28.w,
// alignment: Alignment.center,
// decoration: BoxDecoration(
// color: Color(0xFFC40C),
// borderRadius: BorderRadius.circular(4.w),
// ),
// child: Icon(
// CupertinoIcons.chevron_right,
// color: Color(0xFFFFC40C),
// size: 24.w,
// ),
// )
],
),
),
@ -309,7 +344,10 @@ class _NewHomePageState extends State<NewHomePage> {
child: ListView(
shrinkWrap: true,
scrollDirection: Axis.horizontal,
children: [_todoListCard()],
children: _todoModels
.mapIndexed((currentValue, index) =>
_todoListCard(currentValue, index))
.toList(),
),
),
],
@ -400,10 +438,31 @@ class _NewHomePageState extends State<NewHomePage> {
);
}
Widget _todoListCard() {
Widget _todoListCard(HomeTodoListModel model, int index) {
return Stack(
children: [
Container(
GestureDetector(
onTap: () {
switch (model.type) {
case 1:
Get.to(InspectionManageDetailsPage(
executeId: model.id,
));
break;
case 2:
if (UserTool
.userProvider.userInfoModel!.workOrderJurisdiction ==
1) {
Get.to(() => DistributorDetailPage(id: model.id));
} else {
Get.to(() => ReceiverDetailPage(id: model.id));
}
break;
}
},
child: Material(
color: Colors.transparent,
child: Container(
width: 390.w,
padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w),
decoration: BoxDecoration(
@ -414,25 +473,36 @@ class _NewHomePageState extends State<NewHomePage> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'电梯巡检'.text.size(28.sp).color(Color(0xFF333333)).bold.make(),
'${HomeMap.todoType[model.type]}'
.text
.size(28.sp)
.color(Color(0xFF333333))
.bold
.make(),
12.w.heightBox,
'时间2021-12-23 1233'
'时间:${model.pendingDate}'
.text
.size(24.sp)
.color(Color(0xFF333333))
.make(),
8.w.heightBox,
'地点1栋1单元B2排风机房'.text.size(24.sp).color(Color(0xFF333333)).make(),
Spacer(),
BeeDateUtil(DateTime.now())
.timeAgo
'编号:${model.code}'
.text
.size(20.sp)
.color(Color(0xFF999999))
.size(24.sp)
.color(Color(0xFF333333))
.make(),
Spacer(),
// BeeDateUtil(DateTime.now())
// .timeAgo
// .text
// .size(20.sp)
// .color(Color(0xFF999999))
// .make(),
],
),
),
),
),
Positioned(
bottom: 0,
right: 0,

@ -0,0 +1,30 @@
import 'package:equatable/equatable.dart';
import 'package:json_annotation/json_annotation.dart';
part 'home_status_number_model.g.dart';
@JsonSerializable()
class HomeStatusNumberModel extends Equatable {
final int noProcessedNum;
final int processingNum;
final int processedNum;
final int allProcessNum;
factory HomeStatusNumberModel.fromJson(Map<String, dynamic> json) =>
_$HomeStatusNumberModelFromJson(json);
const HomeStatusNumberModel({
required this.noProcessedNum,
required this.processingNum,
required this.processedNum,
required this.allProcessNum,
});
@override
List<Object?> get props => [
noProcessedNum,
processingNum,
processedNum,
allProcessNum,
];
}

@ -0,0 +1,16 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'home_status_number_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
HomeStatusNumberModel _$HomeStatusNumberModelFromJson(
Map<String, dynamic> json) =>
HomeStatusNumberModel(
noProcessedNum: json['noProcessedNum'] as int,
processingNum: json['processingNum'] as int,
processedNum: json['processedNum'] as int,
allProcessNum: json['allProcessNum'] as int,
);

@ -0,0 +1,33 @@
import 'package:equatable/equatable.dart';
import 'package:json_annotation/json_annotation.dart';
part 'home_todo_list_model.g.dart';
@JsonSerializable()
class HomeTodoListModel extends Equatable {
final int id;
final int type;
final String code;
final int status;
final String pendingDate;
factory HomeTodoListModel.fromJson(Map<String, dynamic> json) =>
_$HomeTodoListModelFromJson(json);
const HomeTodoListModel({
required this.id,
required this.type,
required this.code,
required this.status,
required this.pendingDate,
});
@override
List<Object?> get props => [
id,
type,
code,
status,
pendingDate,
];
}

@ -0,0 +1,16 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'home_todo_list_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
HomeTodoListModel _$HomeTodoListModelFromJson(Map<String, dynamic> json) =>
HomeTodoListModel(
id: json['id'] as int,
type: json['type'] as int,
code: json['code'] as String,
status: json['status'] as int,
pendingDate: json['pendingDate'] as String,
);
Loading…
Cancel
Save