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(
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(),

@ -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<MessageListModel> models;
final List<HomeAnnounceModel> models;
ListDateModel(this.month, this.models, this.index, this.year);
}
@ -34,10 +34,10 @@ class _AnnounceViewState extends State<AnnounceView> {
late AutoScrollController _autoScrollController;
List<ListDateModel> _modelLists = [];
List<MessageListModel> _innerModelList = [];
List<HomeAnnounceModel> _innerModelList = [];
String _headMonth = '';
void monthListDepart(List<MessageListModel> models) {
void monthListDepart(List<HomeAnnounceModel> models) {
for (var item in models) {
var index =
_modelLists.indexWhere((element) => element.month == item.month);
@ -115,13 +115,12 @@ class _AnnounceViewState extends State<AnnounceView> {
_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<AnnounceView> {
},
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 {

Loading…
Cancel
Save