From 16934b5f8e14103a265362e4523f91a563b65c22 Mon Sep 17 00:00:00 2001 From: zhangmeng <494089941@qq.com> Date: Thu, 17 Jun 2021 16:19:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E6=81=AF=E4=B8=AD=E5=BF=83=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=20=E7=BB=BF=E5=8C=96=20=E5=8D=AB=E7=94=9F=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E7=9A=84=E6=B6=88=E6=81=AF=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/const/api.dart | 7 + .../system_message_green_model.dart | 24 ++ .../system_message_green_model.g.dart | 26 ++ .../system_message_hygience_model.dart | 22 ++ .../system_message_hygience_model.g.dart | 26 ++ .../message/system_message_detail_model.dart | 14 +- lib/ui/home/messages/message_map.dart | 16 + lib/ui/home/messages/system_message.dart | 38 +- ...age_card.dart => system_message_card.dart} | 47 +-- .../messages/system_message_green_card.dart | 345 ++++++++++++++++++ .../system_message_hygience_card.dart | 337 +++++++++++++++++ 11 files changed, 860 insertions(+), 42 deletions(-) create mode 100644 lib/json_models/system_message_green_model.dart create mode 100644 lib/json_models/system_message_green_model.g.dart create mode 100644 lib/json_models/system_message_hygience_model.dart create mode 100644 lib/json_models/system_message_hygience_model.g.dart create mode 100644 lib/ui/home/messages/message_map.dart rename lib/ui/home/messages/{systen_message_card.dart => system_message_card.dart} (91%) create mode 100644 lib/ui/home/messages/system_message_green_card.dart create mode 100644 lib/ui/home/messages/system_message_hygience_card.dart diff --git a/lib/const/api.dart b/lib/const/api.dart index 86d285e..49e48c4 100644 --- a/lib/const/api.dart +++ b/lib/const/api.dart @@ -349,4 +349,11 @@ class _Message { ///消息中心:系统消息全部已读(进入系统消息列表后调用) String get allReadSysMes => '/user/message/allReadSys'; + + ///消息中心:根据绿化任务主键id 同步查询绿化任务消息信息(同步) + String get getSysGreenMessageById => '/user/message/findGreenTaskByGreenId'; + + ///消息中心:根据卫生任务主键id 同步查询卫生任务消息信息(同步) + String get getSysHygienceMessageById => + '/user/message/findHygieneTaskByGreenId'; } diff --git a/lib/json_models/system_message_green_model.dart b/lib/json_models/system_message_green_model.dart new file mode 100644 index 0000000..eced8e4 --- /dev/null +++ b/lib/json_models/system_message_green_model.dart @@ -0,0 +1,24 @@ +import 'package:equatable/equatable.dart'; +import 'package:json_annotation/json_annotation.dart'; +part 'system_message_green_model.g.dart'; + +@JsonSerializable() +class SystemMessageGreenModel extends Equatable { + final int id; + final String name; + final String tel; + final String areaName; + SystemMessageGreenModel({ + required this.id, + required this.name, + required this.tel, + required this.areaName, + }); + factory SystemMessageGreenModel.fromJson(Map json) => + _$SystemMessageGreenModelFromJson(json); + @override + List get props => [id, name, tel, areaName]; + + factory SystemMessageGreenModel.fail() => + SystemMessageGreenModel(id: -1, name: '', tel: '', areaName: ''); +} diff --git a/lib/json_models/system_message_green_model.g.dart b/lib/json_models/system_message_green_model.g.dart new file mode 100644 index 0000000..76f4716 --- /dev/null +++ b/lib/json_models/system_message_green_model.g.dart @@ -0,0 +1,26 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'system_message_green_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SystemMessageGreenModel _$SystemMessageGreenModelFromJson( + Map json) { + return SystemMessageGreenModel( + id: json['id'] as int, + name: json['name'] as String, + tel: json['tel'] as String, + areaName: json['areaName'] as String, + ); +} + +Map _$SystemMessageGreenModelToJson( + SystemMessageGreenModel instance) => + { + 'id': instance.id, + 'name': instance.name, + 'tel': instance.tel, + 'areaName': instance.areaName, + }; diff --git a/lib/json_models/system_message_hygience_model.dart b/lib/json_models/system_message_hygience_model.dart new file mode 100644 index 0000000..0f0ca66 --- /dev/null +++ b/lib/json_models/system_message_hygience_model.dart @@ -0,0 +1,22 @@ +import 'package:equatable/equatable.dart'; +import 'package:json_annotation/json_annotation.dart'; +part 'system_message_hygience_model.g.dart'; +@JsonSerializable() +class SystemMessageHygineceModel extends Equatable { + final int id; + final String name; + final String tel; + final String areaName; + SystemMessageHygineceModel({ + required this.id, + required this.name, + required this.tel, + required this.areaName, + }); + + factory SystemMessageHygineceModel.fromJson(Map json) => + _$SystemMessageHygineceModelFromJson(json); + + @override + List get props => [id, name, tel, areaName]; +} diff --git a/lib/json_models/system_message_hygience_model.g.dart b/lib/json_models/system_message_hygience_model.g.dart new file mode 100644 index 0000000..3d013c8 --- /dev/null +++ b/lib/json_models/system_message_hygience_model.g.dart @@ -0,0 +1,26 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'system_message_hygience_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SystemMessageHygineceModel _$SystemMessageHygineceModelFromJson( + Map json) { + return SystemMessageHygineceModel( + id: json['id'] as int, + name: json['name'] as String, + tel: json['tel'] as String, + areaName: json['areaName'] as String, + ); +} + +Map _$SystemMessageHygineceModelToJson( + SystemMessageHygineceModel instance) => + { + 'id': instance.id, + 'name': instance.name, + 'tel': instance.tel, + 'areaName': instance.areaName, + }; diff --git a/lib/models/message/system_message_detail_model.dart b/lib/models/message/system_message_detail_model.dart index 078fda3..80b9e8d 100644 --- a/lib/models/message/system_message_detail_model.dart +++ b/lib/models/message/system_message_detail_model.dart @@ -21,19 +21,15 @@ class SystemMessageDetailModel { data['type'] = this.type; return data; } - String get sysMesTypeString { + + String get typeString { switch (this.type) { case 1: - return '报事报修'; + return '无偿服务'; case 2: - return '装修'; - case 3: - return '绿化任务'; - case 4: - return '卫生任务'; + return '有偿服务'; default: - return '未知'; + return ''; } } } - diff --git a/lib/ui/home/messages/message_map.dart b/lib/ui/home/messages/message_map.dart new file mode 100644 index 0000000..8a22778 --- /dev/null +++ b/lib/ui/home/messages/message_map.dart @@ -0,0 +1,16 @@ +class MessageMap { + static sysType(int type){ + switch (type) { + case 1: + return '报事报修'; + case 2: + return '装修'; + case 3: + return '绿化任务'; + case 4: + return '卫生任务'; + default: + return '未知'; + } + } +} \ No newline at end of file diff --git a/lib/ui/home/messages/system_message.dart b/lib/ui/home/messages/system_message.dart index df730cf..9a32c43 100644 --- a/lib/ui/home/messages/system_message.dart +++ b/lib/ui/home/messages/system_message.dart @@ -1,4 +1,6 @@ // Flutter imports: +import 'package:aku_community_manager/ui/home/messages/system_message_green_card.dart'; +import 'package:aku_community_manager/ui/home/messages/system_message_hygience_card.dart'; import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; @@ -11,7 +13,7 @@ import 'package:velocity_x/velocity_x.dart'; import 'package:aku_community_manager/const/api.dart'; import 'package:aku_community_manager/models/message/system_message_item_model.dart'; import 'package:aku_community_manager/style/app_style.dart'; -import 'package:aku_community_manager/ui/home/messages/systen_message_card.dart'; +import 'package:aku_community_manager/ui/home/messages/system_message_card.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_community_manager/ui/widgets/common/bee_list_view.dart'; @@ -36,7 +38,7 @@ class _SystemMessageState extends State { return ListView.separated( padding: EdgeInsets.symmetric(horizontal: 32.w), itemBuilder: (context, index) { - return _buildCard(items[index]); + return _buildCard(items[index], index); }, separatorBuilder: (context, index) { return 10.w.heightBox; @@ -51,17 +53,31 @@ class _SystemMessageState extends State { ); } - Widget _buildCard(SystemMessageItemModel model) { - String _date = + Widget _buildCard(SystemMessageItemModel model, int index) { + String? _date = DateUtil.formatDateStr(model.sendDate!, format: 'yyyy-MM-dd'); - if (_sendDate == null || _sendDate != _date) { - _sendDate = _date; - return SystemMessageCard( - relationId: model.relationId!, - date: _date, - ); + if (_sendDate != null && _sendDate == _date && index != 0) { + _date = null; } else { - return SystemMessageCard(relationId: model.relationId!, date: null); + _sendDate = _date; + } + switch (model.type) { + case 1: + return SystemMessageCard( + relationId: model.relationId!, + date: _date, + type: 1, + ); + case 2: + return Container(); + case 3: + return SystemMessageGreenCard( + relationId: model.relationId!, date: _date, type: 3); + case 4: + return SystemMessageHygienceCard( + relationId: model.relationId!, date: _date, type: 4); + default: + return Container(); } } } diff --git a/lib/ui/home/messages/systen_message_card.dart b/lib/ui/home/messages/system_message_card.dart similarity index 91% rename from lib/ui/home/messages/systen_message_card.dart rename to lib/ui/home/messages/system_message_card.dart index 405c64a..19b8035 100644 --- a/lib/ui/home/messages/systen_message_card.dart +++ b/lib/ui/home/messages/system_message_card.dart @@ -1,6 +1,7 @@ // Flutter imports: import 'dart:async'; +import 'package:aku_community_manager/ui/home/messages/message_map.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_button.dart'; import 'package:flutter/material.dart'; @@ -21,10 +22,11 @@ import 'package:aku_community_manager/utils/network/net_util.dart'; class SystemMessageCard extends StatefulWidget { final int relationId; final String? date; + final int type; SystemMessageCard({ Key? key, required this.relationId, - required this.date, + required this.date, required this.type, }) : super(key: key); @override @@ -46,7 +48,9 @@ class _SystemMessageCardState extends State { @override Widget build(BuildContext context) { - return _messageList(_systemModel); + return (_systemModel == null || _onLoad) + ? _loadingWidget() + : _messageList(_systemModel); } Future getSystemMessage(int repairId) async { @@ -184,10 +188,10 @@ class _SystemMessageCardState extends State { } Widget _messageList(SystemMessageDetailModel? model) { - return (_systemModel == null || _onLoad) - ? _loadingWidget() - : Column( + return Column( children: [ + + widget.date==null?16.w.heightBox:SizedBox(), widget.date == null ? SizedBox() : Container( @@ -201,22 +205,22 @@ class _SystemMessageCardState extends State { ), ), Container( - padding: EdgeInsets.only(top: 24.w, left: 24.w, right: 24.w), + padding: EdgeInsets.only(top:24.w,left: 24.w, right: 24.w), color: Color(0xFFFFFFFF), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row(children: [ - Container( - width: 16.w, - height: 16.w, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8.w), - color: Color(0xFFFF4501)), - ), - SizedBox( - width: 16.w, - ), + // Container( + // width: 16.w, + // height: 16.w, + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(8.w), + // color: Color(0xFFFF4501)), + // ), + // SizedBox( + // width: 16.w, + // ), Text( '系统通知', style: TextStyle( @@ -227,7 +231,7 @@ class _SystemMessageCardState extends State { SizedBox(height: 8.w), ]), Text( - '你有一条新的${model!.sysMesTypeString},请立即处理', + '你有一条新的${MessageMap.sysType(widget.type)},请立即处理', style: TextStyle( color: AppStyle.primaryTextColor, fontSize: 28.sp, @@ -245,13 +249,13 @@ class _SystemMessageCardState extends State { width: 4.w, ), Text( - '保修人', + '报修人员', style: TextStyle( color: AppStyle.minorTextColor, fontSize: 28.sp), ), Spacer(), Text( - model.name!, + model!.name!, style: TextStyle( color: AppStyle.primaryTextColor, fontSize: 28.sp), @@ -291,12 +295,12 @@ class _SystemMessageCardState extends State { SizedBox( width: 4.w, ), - Text('报修区域', + Text('服务类型', style: TextStyle( color: AppStyle.minorTextColor, fontSize: 28.sp)), Spacer(), - Text('area', + Text('${model.typeString}', style: TextStyle( color: AppStyle.primaryTextColor, fontSize: 28.sp)), @@ -330,7 +334,6 @@ class _SystemMessageCardState extends State { ], ), ), - 16.w.heightBox, ], ); } diff --git a/lib/ui/home/messages/system_message_green_card.dart b/lib/ui/home/messages/system_message_green_card.dart new file mode 100644 index 0000000..ed77ea5 --- /dev/null +++ b/lib/ui/home/messages/system_message_green_card.dart @@ -0,0 +1,345 @@ +// Flutter imports: +import 'dart:async'; + +import 'package:aku_community_manager/json_models/system_message_green_model.dart'; +import 'package:aku_community_manager/ui/home/messages/message_map.dart'; +import 'package:aku_community_manager/ui/manage_pages/green_manage/green_manage_page.dart'; +import 'package:aku_community_manager/ui/widgets/common/aku_button.dart'; +import 'package:flutter/material.dart'; + +// Package imports: +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:shimmer/shimmer.dart'; +import 'package:velocity_x/velocity_x.dart'; + +// Project imports: +import 'package:aku_community_manager/const/api.dart'; +import 'package:aku_community_manager/style/app_style.dart'; +import 'package:aku_community_manager/utils/network/base_model.dart'; +import 'package:aku_community_manager/utils/network/net_util.dart'; + +class SystemMessageGreenCard extends StatefulWidget { + final int relationId; + final String? date; + final int type; + SystemMessageGreenCard({ + Key? key, + required this.relationId, + required this.date, + required this.type, + }) : super(key: key); + + @override + _SystemMessageGreenCardState createState() => _SystemMessageGreenCardState(); +} + +class _SystemMessageGreenCardState extends State { + SystemMessageGreenModel? _systemModel; + bool _onLoad = true; + @override + void initState() { + super.initState(); + Future.delayed(Duration(milliseconds: 300), () async { + _systemModel = await getSystemMessage(widget.relationId); + _onLoad = false; + setState(() {}); + }); + } + + @override + Widget build(BuildContext context) { + return (_systemModel == null || _onLoad) + ? _loadingWidget() + :_messageList(_systemModel!); + } + + Future getSystemMessage(int repairId) async { + BaseModel baseModel = + await NetUtil().get(API.message.getSysGreenMessageById, params: { + "greenTaskId": repairId, + }); + if (baseModel.status ?? false) { + return SystemMessageGreenModel.fromJson(baseModel.data); + } else { + return SystemMessageGreenModel.fail(); + } + } + + Widget _loadingWidget() { + return Column( + children: [ + Container( + margin: EdgeInsets.only(top: 24.w, bottom: 24.w), + alignment: Alignment.center, + width: double.infinity, + child: Shimmer.fromColors( + baseColor: kPrimaryColor.withOpacity(0.3), + highlightColor: kPrimaryColor.withOpacity(0.1), + child: Text( + '', + style: TextStyle(color: AppStyle.minorTextColor, fontSize: 24.sp), + ), + ), + ), + Container( + padding: EdgeInsets.only(top: 24.w, left: 24.w, right: 24.w), + color: Color(0xFFFFFFFF), + child: Shimmer.fromColors( + baseColor: kPrimaryColor.withOpacity(0.3), + highlightColor: kPrimaryColor.withOpacity(0.1), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row(children: [ + Container( + width: 16.w, + height: 16.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8.w), + color: Color(0xFFFF4501)), + ), + SizedBox( + width: 16.w, + ), + Text( + '', + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 32.sp, + fontWeight: FontWeight.w600), + ), + SizedBox(height: 8.w), + ]), + Text( + '', + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 28.sp, + fontWeight: FontWeight.bold), + ), + SizedBox(height: 24.w), + Row( + children: [ + Image.asset( + R.ASSETS_MESSAGE_IC_PEOPLE_PNG, + width: 40.w, + height: 40.w, + ), + SizedBox( + width: 4.w, + ), + Text( + '', + style: TextStyle( + color: AppStyle.minorTextColor, fontSize: 28.sp), + ), + Spacer(), + Text( + '', + style: TextStyle( + color: AppStyle.primaryTextColor, fontSize: 28.sp), + ), + ], + ), + SizedBox(height: 16.w), + Row( + children: [ + Image.asset( + R.ASSETS_MESSAGE_IC_STAR_PNG, + width: 40.w, + height: 40.w, + ), + SizedBox( + width: 4.w, + ), + Text('', + style: TextStyle( + color: AppStyle.minorTextColor, fontSize: 28.sp)), + Spacer(), + Text('', + style: TextStyle( + color: AppStyle.primaryTextColor, fontSize: 28.sp)), + ], + ), + SizedBox(height: 16.w), + Divider(height: 1.w), + AkuButton( + onPressed: () {}, + child: Container( + height: 88.w, + alignment: Alignment.center, + padding: EdgeInsets.only(left: 24.w), + child: Row( + children: [ + Text( + '', + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 28.sp), + ), + Spacer(), + Icon(Icons.arrow_forward_ios, size: 22.w), + ], + ), + ), + ), + ], + ), + ), + ), + ], + ); + } + + Widget _messageList(SystemMessageGreenModel model) { + return Column( + children: [ + + widget.date==null?16.w.heightBox:SizedBox(), + widget.date == null + ? SizedBox() + : Container( + margin: EdgeInsets.only(top: 24.w, bottom: 24.w), + alignment: Alignment.center, + width: double.infinity, + child: Text( + widget.date!, + style: TextStyle( + color: AppStyle.minorTextColor, fontSize: 24.sp), + ), + ), + Container( + padding: EdgeInsets.only(top:24.w,left: 24.w, right: 24.w), + color: Color(0xFFFFFFFF), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row(children: [ + // Container( + // width: 16.w, + // height: 16.w, + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(8.w), + // color: Color(0xFFFF4501)), + // ), + // SizedBox( + // width: 16.w, + // ), + Text( + '系统通知', + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 32.sp, + fontWeight: FontWeight.w600), + ), + SizedBox(height: 8.w), + ]), + Text( + '你有一条新的${MessageMap.sysType(widget.type)},请立即处理', + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 28.sp, + fontWeight: FontWeight.bold), + ), + SizedBox(height: 24.w), + Row( + children: [ + Image.asset( + R.ASSETS_MESSAGE_IC_PEOPLE_PNG, + width: 40.w, + height: 40.w, + ), + SizedBox( + width: 4.w, + ), + Text( + '保修人', + style: TextStyle( + color: AppStyle.minorTextColor, fontSize: 28.sp), + ), + Spacer(), + Text( + model.name, + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 28.sp), + ), + ], + ), + SizedBox(height: 16.w), + Row( + children: [ + Image.asset( + R.ASSETS_MESSAGE_IC_PHONE_PNG, + width: 40.w, + height: 40.w, + ), + SizedBox( + width: 4.w, + ), + Text('联系电话', + style: TextStyle( + color: AppStyle.minorTextColor, + fontSize: 28.sp)), + Spacer(), + Text(model.tel, + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 28.sp)), + ], + ), + SizedBox(height: 16.w), + Row( + children: [ + Image.asset( + R.ASSETS_MESSAGE_IC_AREA_PNG, + width: 40.w, + height: 40.w, + ), + SizedBox( + width: 4.w, + ), + Text('报修区域', + style: TextStyle( + color: AppStyle.minorTextColor, + fontSize: 28.sp)), + Spacer(), + Text('area', + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 28.sp)), + ], + ), + SizedBox(height: 16.w), + Divider( + height: 1.w, + ), + AkuButton( + onPressed: () { + Get.to(() => GreenManagePage()); + }, + child: Container( + height: 88.w, + alignment: Alignment.center, + child: Row( + children: [ + Text( + '查看详情', + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 28.sp), + ), + Spacer(), + Icon(Icons.arrow_forward_ios, size: 22.w), + ], + ), + ), + ), + ], + ), + ), + ], + ); + } +} diff --git a/lib/ui/home/messages/system_message_hygience_card.dart b/lib/ui/home/messages/system_message_hygience_card.dart new file mode 100644 index 0000000..9fc3464 --- /dev/null +++ b/lib/ui/home/messages/system_message_hygience_card.dart @@ -0,0 +1,337 @@ +// Flutter imports: +import 'dart:async'; + +import 'package:aku_community_manager/json_models/system_message_hygience_model.dart'; +import 'package:aku_community_manager/ui/home/messages/message_map.dart'; +import 'package:aku_community_manager/ui/manage_pages/hygience_manage/hygience_manage_page.dart'; +import 'package:aku_community_manager/ui/widgets/common/aku_button.dart'; +import 'package:flutter/material.dart'; + +// Package imports: +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:shimmer/shimmer.dart'; +import 'package:velocity_x/velocity_x.dart'; + +// Project imports: +import 'package:aku_community_manager/const/api.dart'; +import 'package:aku_community_manager/style/app_style.dart'; +import 'package:aku_community_manager/utils/network/base_model.dart'; +import 'package:aku_community_manager/utils/network/net_util.dart'; + +class SystemMessageHygienceCard extends StatefulWidget { + final int relationId; + final String? date; + final int type; + SystemMessageHygienceCard({ + Key? key, + required this.relationId, + required this.date, + required this.type, + }) : super(key: key); + + @override + _SystemMessageHygienceCardState createState() => + _SystemMessageHygienceCardState(); +} + +class _SystemMessageHygienceCardState extends State { + SystemMessageHygineceModel? _systemModel; + bool _onLoad = true; + @override + void initState() { + super.initState(); + Future.delayed(Duration(milliseconds: 300), () async { + _systemModel = await getSystemMessage(widget.relationId); + _onLoad = false; + setState(() {}); + }); + } + + @override + Widget build(BuildContext context) { + return (_systemModel == null || _onLoad) + ? _loadingWidget() + : _messageList(_systemModel!); + } + + Future getSystemMessage(int repairId) async { + BaseModel baseModel = + await NetUtil().get(API.message.getSysHygienceMessageById, params: { + "hygieneTaskId": repairId, + }); + if (baseModel.status ?? false) { + return SystemMessageHygineceModel.fromJson(baseModel.data); + } + } + + Widget _loadingWidget() { + return Column( + children: [ + Container( + margin: EdgeInsets.only(top: 24.w, bottom: 24.w), + alignment: Alignment.center, + width: double.infinity, + child: Shimmer.fromColors( + baseColor: kPrimaryColor.withOpacity(0.3), + highlightColor: kPrimaryColor.withOpacity(0.1), + child: Text( + '', + style: TextStyle(color: AppStyle.minorTextColor, fontSize: 24.sp), + ), + ), + ), + Container( + padding: EdgeInsets.only(top: 24.w, left: 24.w, right: 24.w), + color: Color(0xFFFFFFFF), + child: Shimmer.fromColors( + baseColor: kPrimaryColor.withOpacity(0.3), + highlightColor: kPrimaryColor.withOpacity(0.1), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row(children: [ + Container( + width: 16.w, + height: 16.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8.w), + color: Color(0xFFFF4501)), + ), + SizedBox( + width: 16.w, + ), + Text( + '', + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 32.sp, + fontWeight: FontWeight.w600), + ), + SizedBox(height: 8.w), + ]), + Text( + '', + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 28.sp, + fontWeight: FontWeight.bold), + ), + SizedBox(height: 24.w), + Row( + children: [ + Image.asset( + R.ASSETS_MESSAGE_IC_PEOPLE_PNG, + width: 40.w, + height: 40.w, + ), + SizedBox( + width: 4.w, + ), + Text( + '', + style: TextStyle( + color: AppStyle.minorTextColor, fontSize: 28.sp), + ), + Spacer(), + Text( + '', + style: TextStyle( + color: AppStyle.primaryTextColor, fontSize: 28.sp), + ), + ], + ), + SizedBox(height: 16.w), + Row( + children: [ + Image.asset( + R.ASSETS_MESSAGE_IC_STAR_PNG, + width: 40.w, + height: 40.w, + ), + SizedBox( + width: 4.w, + ), + Text('', + style: TextStyle( + color: AppStyle.minorTextColor, fontSize: 28.sp)), + Spacer(), + Text('', + style: TextStyle( + color: AppStyle.primaryTextColor, fontSize: 28.sp)), + ], + ), + SizedBox(height: 16.w), + Divider(height: 1.w), + AkuButton( + onPressed: () {}, + child: Container( + height: 88.w, + alignment: Alignment.center, + padding: EdgeInsets.only(left: 24.w), + child: Row( + children: [ + Text( + '', + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 28.sp), + ), + Spacer(), + Icon(Icons.arrow_forward_ios, size: 22.w), + ], + ), + ), + ), + ], + ), + ), + ), + ], + ); + } + + Widget _messageList(SystemMessageHygineceModel model) { + return Column( + children: [ + widget.date == null ? 16.w.heightBox : SizedBox(), + widget.date == null + ? SizedBox() + : Container( + margin: EdgeInsets.only(top: 24.w, bottom: 24.w), + alignment: Alignment.center, + width: double.infinity, + child: Text( + widget.date!, + style: TextStyle( + color: AppStyle.minorTextColor, fontSize: 24.sp), + ), + ), + Container( + padding: EdgeInsets.only(top: 24.w, left: 24.w, right: 24.w), + color: Color(0xFFFFFFFF), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row(children: [ + // Container( + // width: 16.w, + // height: 16.w, + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(8.w), + // color: Color(0xFFFF4501)), + // ), + // SizedBox( + // width: 16.w, + // ), + Text( + '系统通知', + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 32.sp, + fontWeight: FontWeight.w600), + ), + SizedBox(height: 8.w), + ]), + Text( + '你有一条新的${MessageMap.sysType(widget.type)},请立即处理', + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 28.sp, + fontWeight: FontWeight.bold), + ), + SizedBox(height: 24.w), + Row( + children: [ + Image.asset( + R.ASSETS_MESSAGE_IC_PEOPLE_PNG, + width: 40.w, + height: 40.w, + ), + SizedBox( + width: 4.w, + ), + Text( + '绿化人员', + style: TextStyle( + color: AppStyle.minorTextColor, fontSize: 28.sp), + ), + Spacer(), + Text( + model.name, + style: TextStyle( + color: AppStyle.primaryTextColor, fontSize: 28.sp), + ), + ], + ), + SizedBox(height: 16.w), + Row( + children: [ + Image.asset( + R.ASSETS_MESSAGE_IC_PHONE_PNG, + width: 40.w, + height: 40.w, + ), + SizedBox( + width: 4.w, + ), + Text('联系电话', + style: TextStyle( + color: AppStyle.minorTextColor, fontSize: 28.sp)), + Spacer(), + Text(model.tel, + style: TextStyle( + color: AppStyle.primaryTextColor, fontSize: 28.sp)), + ], + ), + SizedBox(height: 16.w), + Row( + children: [ + Image.asset( + R.ASSETS_MESSAGE_IC_AREA_PNG, + width: 40.w, + height: 40.w, + ), + SizedBox( + width: 4.w, + ), + Text('报修区域', + style: TextStyle( + color: AppStyle.minorTextColor, fontSize: 28.sp)), + Spacer(), + Text('area', + style: TextStyle( + color: AppStyle.primaryTextColor, fontSize: 28.sp)), + ], + ), + SizedBox(height: 16.w), + Divider( + height: 1.w, + ), + AkuButton( + onPressed: () { + Get.to(() => HygienceManagePage()); + }, + child: Container( + height: 88.w, + alignment: Alignment.center, + child: Row( + children: [ + Text( + '查看详情', + style: TextStyle( + color: AppStyle.primaryTextColor, fontSize: 28.sp), + ), + Spacer(), + Icon(Icons.arrow_forward_ios, size: 22.w), + ], + ), + ), + ), + ], + ), + ), + ], + ); + } +}