From 259bc1844dcd5edf8b5b1c3862696f0fcdbaeda8 Mon Sep 17 00:00:00 2001 From: datang Date: Wed, 8 Jun 2022 14:39:18 +0800 Subject: [PATCH] update --- .../announce/announce_card.dart | 22 +++++++++---------- .../announce/announce_view.dart | 18 +++++++-------- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/lib/pages/message_center_page/announce/announce_card.dart b/lib/pages/message_center_page/announce/announce_card.dart index 29e4d98a..d01b62e0 100644 --- a/lib/pages/message_center_page/announce/announce_card.dart +++ b/lib/pages/message_center_page/announce/announce_card.dart @@ -52,7 +52,7 @@ class AnnounceCard extends StatelessWidget { ); } - Widget _card(MessageListModel model) { + Widget _card(HomeAnnounceModel model) { return InkWell( onTap: () { Get.to(() => NoticeDetailPage(id: model.id)); @@ -70,21 +70,21 @@ class AnnounceCard extends StatelessWidget { children: [ - '${DateUtil.formatDateStr(model.sendDate, format: 'dd日 HH:mm')}' + '${DateUtil.formatDateStr(model.createDate, format: 'dd日 HH:mm')}' .text .size(28.sp) .color(ktextSubColor) .make(), 32.w.heightBox, - // Container( - // width: double.infinity, - // height: 258.w, - // clipBehavior: Clip.antiAliasWithSaveLayer, - // decoration: BoxDecoration(borderRadius: BorderRadius.circular(16.w)), - // child: BeeImageNetwork( - // imgs: model.imgList, - // ), - // ), + Container( + width: double.infinity, + height: 258.w, + clipBehavior: Clip.antiAliasWithSaveLayer, + decoration: BoxDecoration(borderRadius: BorderRadius.circular(16.w)), + child: BeeImageNetwork( + imgs: model.imgList, + ), + ), 32.w.heightBox, '${model.title}'.text.size(36.sp).black.bold.make(), diff --git a/lib/pages/message_center_page/announce/announce_view.dart b/lib/pages/message_center_page/announce/announce_view.dart index f1fef61e..dc75d444 100644 --- a/lib/pages/message_center_page/announce/announce_view.dart +++ b/lib/pages/message_center_page/announce/announce_view.dart @@ -1,5 +1,5 @@ -import 'package:aku_new_community/models/message/message_list_model.dart'; +import 'package:aku_new_community/models/home/home_announce_model.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -15,7 +15,7 @@ class ListDateModel { final String month; final int index; final String year; - final List models; + final List models; ListDateModel(this.month, this.models, this.index, this.year); } @@ -34,10 +34,10 @@ class _AnnounceViewState extends State { late AutoScrollController _autoScrollController; List _modelLists = []; - List _innerModelList = []; + List _innerModelList = []; String _headMonth = ''; - void monthListDepart(List models) { + void monthListDepart(List models) { for (var item in models) { var index = _modelLists.indexWhere((element) => element.month == item.month); @@ -115,13 +115,12 @@ class _AnnounceViewState extends State { _page = 1; _modelLists.clear(); _innerModelList.clear(); - var base = await NetUtil().getList(SAASAPI.message.list, params: { + var base = await NetUtil().getList(SAASAPI.announce.list, params: { 'pageNum': _page, 'size': _size, - 'type': null, }); _innerModelList = - base.rows.map((e) => MessageListModel.fromJson(e)).toList(); + base.rows.map((e) => HomeAnnounceModel.fromJson(e)).toList(); monthListDepart(_innerModelList); if (_modelLists.isNotEmpty) { _headMonth = _modelLists[0].month; @@ -131,14 +130,13 @@ class _AnnounceViewState extends State { }, onLoad: () async { _page++; - var base = await NetUtil().getList(SAASAPI.message.list, params: { + var base = await NetUtil().getList(SAASAPI.announce.list, params: { 'pageNum': _page, 'size': _size, - 'type': null, }); if (base.total > _modelLists.length) { _innerModelList = - base.rows.map((e) => MessageListModel.fromJson(e)).toList(); + base.rows.map((e) => HomeAnnounceModel.fromJson(e)).toList(); monthListDepart(_innerModelList); setState(() {}); } else {