diff --git a/lib/models/message/system_message_item_model.dart b/lib/models/message/system_message_item_model.dart index ea8a53e..261911f 100644 --- a/lib/models/message/system_message_item_model.dart +++ b/lib/models/message/system_message_item_model.dart @@ -1,14 +1,18 @@ +import 'package:common_utils/common_utils.dart'; + class SystemMessageItemModel { int id; int type; int relationId; + String sendDate; - SystemMessageItemModel({this.id, this.type, this.relationId}); + SystemMessageItemModel({this.id, this.type, this.relationId, this.sendDate}); SystemMessageItemModel.fromJson(Map json) { id = json['id']; type = json['type']; relationId = json['relationId']; + sendDate = json['sendDate']; } Map toJson() { @@ -16,6 +20,10 @@ class SystemMessageItemModel { data['id'] = this.id; data['type'] = this.type; data['relationId'] = this.relationId; + data['sendDate'] = this.sendDate; return data; } + + String get sendDateString => + DateUtil.formatDateStr(this.sendDate, format: 'yyyy-MM-dd HH:mm'); } diff --git a/lib/ui/home/messages/system_message.dart b/lib/ui/home/messages/system_message.dart index 5a783c2..2653b98 100644 --- a/lib/ui/home/messages/system_message.dart +++ b/lib/ui/home/messages/system_message.dart @@ -35,7 +35,7 @@ class _SystemMessageState extends State { return ListView.separated( padding: EdgeInsets.symmetric(horizontal: 32.w), itemBuilder: (context, index) { - return SystemMessageCard(model: items[index]); + return SystemMessageCard(model: items[index],); }, separatorBuilder: (context, index) { return 10.w.heightBox; diff --git a/lib/ui/home/messages/systen_message_card.dart b/lib/ui/home/messages/systen_message_card.dart index 513eabe..778d014 100644 --- a/lib/ui/home/messages/systen_message_card.dart +++ b/lib/ui/home/messages/systen_message_card.dart @@ -2,17 +2,22 @@ import 'package:aku_community_manager/const/api.dart'; import 'package:aku_community_manager/models/message/system_message_detail_model.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/sub_pages/business_and_fix/business_and_fix_page.dart'; import 'package:aku_community_manager/utils/network/base_model.dart'; import 'package:aku_community_manager/utils/network/net_util.dart'; import 'package:aku_ui/aku_ui.dart'; import 'package:flutter/material.dart'; +import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:shimmer/shimmer.dart'; class SystemMessageCard extends StatefulWidget { final SystemMessageItemModel model; - SystemMessageCard({Key key, this.model}) : super(key: key); + SystemMessageCard({ + Key key, + this.model, + }) : super(key: key); @override _SystemMessageCardState createState() => _SystemMessageCardState(); @@ -180,7 +185,7 @@ class _SystemMessageCardState extends State { alignment: Alignment.center, width: double.infinity, child: Text( - 'date', + widget.model.sendDate, style: TextStyle( color: AppStyle.minorTextColor, fontSize: 24.sp), ), @@ -292,11 +297,12 @@ class _SystemMessageCardState extends State { height: 1.w, ), AkuButton( - onPressed: () {}, + onPressed: () { + Get.to(() => BusinessAndFixPage()); + }, child: Container( height: 88.w, alignment: Alignment.center, - padding: EdgeInsets.only(left: 24.w), child: Row( children: [ Text(