From 8b937fae5ac944e7a9a3ffa14aaa098f86c294b5 Mon Sep 17 00:00:00 2001 From: datang Date: Thu, 9 Jun 2022 15:41:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=8C=85=E5=86=B2=E7=AA=81=EF=BC=9B?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E5=85=AC=E5=91=8A=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/app/build.gradle | 2 +- lib/models/message/message_list_model.dart | 2 +- lib/models/message/message_list_model.g.dart | 2 +- .../announce/announce_card.dart | 29 ++++++++----------- .../announce/announce_view.dart | 17 ++++++----- 5 files changed, 25 insertions(+), 27 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 4baf7070..81a68f19 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -96,7 +96,7 @@ flutter { dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'com.amap.api:3dmap:latest.integration' - implementation 'com.amap.api:location:5.2.0' +// implementation 'com.amap.api:location:5.2.0' implementation 'com.android.support:multidex:2.0.1' } diff --git a/lib/models/message/message_list_model.dart b/lib/models/message/message_list_model.dart index 5aba654d..b452775a 100644 --- a/lib/models/message/message_list_model.dart +++ b/lib/models/message/message_list_model.dart @@ -13,7 +13,7 @@ class MessageListModel extends Equatable { final String content; final String sendDate; final int jumpId; - final int onlyId; + final int? onlyId; DateTime? get sendDt => DateUtil.getDateTime(sendDate); diff --git a/lib/models/message/message_list_model.g.dart b/lib/models/message/message_list_model.g.dart index d229ca46..74b2773b 100644 --- a/lib/models/message/message_list_model.g.dart +++ b/lib/models/message/message_list_model.g.dart @@ -15,5 +15,5 @@ MessageListModel _$MessageListModelFromJson(Map json) => content: json['content'] as String, sendDate: json['sendDate'] as String, jumpId: json['jumpId'] as int, - onlyId: json['onlyId'] as int, + onlyId: json['onlyId'] as int?, ); diff --git a/lib/pages/message_center_page/announce/announce_card.dart b/lib/pages/message_center_page/announce/announce_card.dart index d01b62e0..1ebb35b9 100644 --- a/lib/pages/message_center_page/announce/announce_card.dart +++ b/lib/pages/message_center_page/announce/announce_card.dart @@ -1,17 +1,12 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; - import 'package:common_utils/common_utils.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; - import 'package:aku_new_community/base/base_style.dart'; -import 'package:aku_new_community/models/home/home_announce_model.dart'; import 'package:aku_new_community/pages/message_center_page/announce/announce_view.dart'; import 'package:aku_new_community/ui/community/notice/notice_detail_page.dart'; -import 'package:aku_new_community/widget/bee_image_network.dart'; - import '../../../models/message/message_list_model.dart'; class AnnounceCard extends StatelessWidget { @@ -52,7 +47,7 @@ class AnnounceCard extends StatelessWidget { ); } - Widget _card(HomeAnnounceModel model) { + Widget _card(MessageListModel model) { return InkWell( onTap: () { Get.to(() => NoticeDetailPage(id: model.id)); @@ -70,22 +65,22 @@ class AnnounceCard extends StatelessWidget { children: [ - '${DateUtil.formatDateStr(model.createDate, format: 'dd日 HH:mm')}' + '${DateUtil.formatDateStr(model.sendDate, 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, - ), - ), - 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, + // ), + // ), + // 32.w.heightBox, '${model.title}'.text.size(36.sp).black.bold.make(), 32.w.heightBox, diff --git a/lib/pages/message_center_page/announce/announce_view.dart b/lib/pages/message_center_page/announce/announce_view.dart index dc75d444..f6c067e2 100644 --- a/lib/pages/message_center_page/announce/announce_view.dart +++ b/lib/pages/message_center_page/announce/announce_view.dart @@ -1,5 +1,6 @@ import 'package:aku_new_community/models/home/home_announce_model.dart'; +import 'package:aku_new_community/models/message/message_list_model.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -15,7 +16,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 +35,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,12 +116,13 @@ class _AnnounceViewState extends State { _page = 1; _modelLists.clear(); _innerModelList.clear(); - var base = await NetUtil().getList(SAASAPI.announce.list, params: { + var base = await NetUtil().getList(SAASAPI.message.list, params: { 'pageNum': _page, 'size': _size, + 'type':5, }); _innerModelList = - base.rows.map((e) => HomeAnnounceModel.fromJson(e)).toList(); + base.rows.map((e) => MessageListModel.fromJson(e)).toList(); monthListDepart(_innerModelList); if (_modelLists.isNotEmpty) { _headMonth = _modelLists[0].month; @@ -130,13 +132,14 @@ class _AnnounceViewState extends State { }, onLoad: () async { _page++; - var base = await NetUtil().getList(SAASAPI.announce.list, params: { + var base = await NetUtil().getList(SAASAPI.message.list, params: { 'pageNum': _page, 'size': _size, + 'type':5, }); if (base.total > _modelLists.length) { _innerModelList = - base.rows.map((e) => HomeAnnounceModel.fromJson(e)).toList(); + base.rows.map((e) => MessageListModel.fromJson(e)).toList(); monthListDepart(_innerModelList); setState(() {}); } else {