pull/1/head
戴余标 2 years ago
parent 59f3ccc21c
commit 259bc1844d

@ -52,7 +52,7 @@ class AnnounceCard extends StatelessWidget {
); );
} }
Widget _card(MessageListModel model) { Widget _card(HomeAnnounceModel model) {
return InkWell( return InkWell(
onTap: () { onTap: () {
Get.to(() => NoticeDetailPage(id: model.id)); Get.to(() => NoticeDetailPage(id: model.id));
@ -70,21 +70,21 @@ class AnnounceCard extends StatelessWidget {
children: [ children: [
'${DateUtil.formatDateStr(model.sendDate, format: 'dd日 HH:mm')}' '${DateUtil.formatDateStr(model.createDate, format: 'dd日 HH:mm')}'
.text .text
.size(28.sp) .size(28.sp)
.color(ktextSubColor) .color(ktextSubColor)
.make(), .make(),
32.w.heightBox, 32.w.heightBox,
// Container( Container(
// width: double.infinity, width: double.infinity,
// height: 258.w, height: 258.w,
// clipBehavior: Clip.antiAliasWithSaveLayer, clipBehavior: Clip.antiAliasWithSaveLayer,
// decoration: BoxDecoration(borderRadius: BorderRadius.circular(16.w)), decoration: BoxDecoration(borderRadius: BorderRadius.circular(16.w)),
// child: BeeImageNetwork( child: BeeImageNetwork(
// imgs: model.imgList, imgs: model.imgList,
// ), ),
// ), ),
32.w.heightBox, 32.w.heightBox,
'${model.title}'.text.size(36.sp).black.bold.make(), '${model.title}'.text.size(36.sp).black.bold.make(),

@ -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/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -15,7 +15,7 @@ class ListDateModel {
final String month; final String month;
final int index; final int index;
final String year; final String year;
final List<MessageListModel> models; final List<HomeAnnounceModel> models;
ListDateModel(this.month, this.models, this.index, this.year); ListDateModel(this.month, this.models, this.index, this.year);
} }
@ -34,10 +34,10 @@ class _AnnounceViewState extends State<AnnounceView> {
late AutoScrollController _autoScrollController; late AutoScrollController _autoScrollController;
List<ListDateModel> _modelLists = []; List<ListDateModel> _modelLists = [];
List<MessageListModel> _innerModelList = []; List<HomeAnnounceModel> _innerModelList = [];
String _headMonth = ''; String _headMonth = '';
void monthListDepart(List<MessageListModel> models) { void monthListDepart(List<HomeAnnounceModel> models) {
for (var item in models) { for (var item in models) {
var index = var index =
_modelLists.indexWhere((element) => element.month == item.month); _modelLists.indexWhere((element) => element.month == item.month);
@ -115,13 +115,12 @@ class _AnnounceViewState extends State<AnnounceView> {
_page = 1; _page = 1;
_modelLists.clear(); _modelLists.clear();
_innerModelList.clear(); _innerModelList.clear();
var base = await NetUtil().getList(SAASAPI.message.list, params: { var base = await NetUtil().getList(SAASAPI.announce.list, params: {
'pageNum': _page, 'pageNum': _page,
'size': _size, 'size': _size,
'type': null,
}); });
_innerModelList = _innerModelList =
base.rows.map((e) => MessageListModel.fromJson(e)).toList(); base.rows.map((e) => HomeAnnounceModel.fromJson(e)).toList();
monthListDepart(_innerModelList); monthListDepart(_innerModelList);
if (_modelLists.isNotEmpty) { if (_modelLists.isNotEmpty) {
_headMonth = _modelLists[0].month; _headMonth = _modelLists[0].month;
@ -131,14 +130,13 @@ class _AnnounceViewState extends State<AnnounceView> {
}, },
onLoad: () async { onLoad: () async {
_page++; _page++;
var base = await NetUtil().getList(SAASAPI.message.list, params: { var base = await NetUtil().getList(SAASAPI.announce.list, params: {
'pageNum': _page, 'pageNum': _page,
'size': _size, 'size': _size,
'type': null,
}); });
if (base.total > _modelLists.length) { if (base.total > _modelLists.length) {
_innerModelList = _innerModelList =
base.rows.map((e) => MessageListModel.fromJson(e)).toList(); base.rows.map((e) => HomeAnnounceModel.fromJson(e)).toList();
monthListDepart(_innerModelList); monthListDepart(_innerModelList);
setState(() {}); setState(() {});
} else { } else {

Loading…
Cancel
Save