修改活动公告

hmxc
张萌 4 years ago
parent d43be5986c
commit 84da67f033

@ -1,28 +0,0 @@
// Flutter imports:
class AnouncementCardModel {
String title;
String date;
String body;
AnouncementCardModel(this.title, this.date, {this.body});
static List<AnouncementCardModel> initList() {
return [
AnouncementCardModel(
'关于国庆放假的通知和安排',
'2020-10-22 10:00',
body: '''
201610177108
''',
),
AnouncementCardModel(
'关于国庆放假的通知和安排',
'2020-10-22 10:00',
),
AnouncementCardModel('关于中秋放假通知与工作安排', '2020-10-22 10:00'),
AnouncementCardModel('疫情期间对大家的表扬和鼓励', '2020-10-22 11:00'),
];
}
}

@ -37,4 +37,14 @@ class AnnouncementDetailModel {
data['imgUrls'] = this.imgUrls; data['imgUrls'] = this.imgUrls;
return data; return data;
} }
AnnouncementDetailModel.zero() {
this.content = '';
this.fileDocName = '';
this.fileDocUrl = '';
this.id = -1;
this.imgUrls = [];
this.releaseTime = '';
this.title = '';
}
} }

@ -1,14 +1,15 @@
// Flutter imports: // Flutter imports:
import 'package:aku_community_manager/models/announce/announcement_detail_model.dart';
import 'package:aku_community_manager/models/announce/announcement_list_model.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
// Project imports: // Project imports:
import 'package:aku_community_manager/mock_models/anouncement/anouncement_model.dart';
class AnouncementProvider extends ChangeNotifier { class AnouncementProvider extends ChangeNotifier {
List<AnouncementCardModel> _anouncementCardModel = List<AnnouncementListModel> _anouncementCardModel = [];
AnouncementCardModel.initList(); List<AnnouncementListModel> get anouncementCardModels =>
List<AnouncementCardModel> get anouncementCardModels => _anouncementCardModel; _anouncementCardModel;
addAnouncementCardModel(AnouncementCardModel model) { addAnouncementCardModel(AnnouncementListModel model) {
_anouncementCardModel.insert(0, model); _anouncementCardModel.insert(0, model);
notifyListeners(); notifyListeners();
} }

@ -19,7 +19,6 @@ import 'package:get/get.dart';
// Project imports: // Project imports:
import 'package:aku_community_manager/const/resource.dart'; import 'package:aku_community_manager/const/resource.dart';
import 'package:aku_community_manager/mock_models/anouncement/anouncement_model.dart';
import 'package:aku_community_manager/style/app_style.dart'; import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/ui/home/announcement/anouncement_details.dart'; import 'package:aku_community_manager/ui/home/announcement/anouncement_details.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
@ -44,9 +43,11 @@ class AllAnouncementState extends State<AllAnouncement> {
params: {'announcementId': model.id}); params: {'announcementId': model.id});
AnnouncementDetailModel detailModel = AnnouncementDetailModel detailModel =
AnnouncementDetailModel.fromJson(baseModel.data); AnnouncementDetailModel.fromJson(baseModel.data);
Get.to(AnouncementDetails( Get.to(
model: detailModel, AnouncementDetails(
)); model: detailModel,
),
);
}, },
child: Container( child: Container(
color: Color(0xFFFFFFFF), color: Color(0xFFFFFFFF),
@ -116,7 +117,7 @@ class AllAnouncementState extends State<AllAnouncement> {
Widget _anouncementList( Widget _anouncementList(
String date, String date,
List<AnouncementCardModel> cards, List<AnnouncementListModel> cards,
) { ) {
return Column( return Column(
children: [ children: [

@ -431,10 +431,9 @@ class _HomePageState extends State<HomePage> {
height: 172.w, height: 172.w,
child: Stack(children: [ child: Stack(children: [
CarouselSlider( CarouselSlider(
// items: _anouncementProvider.anouncementCardModels items: _anouncementProvider.anouncementCardModels
// .map((e) => AllAnouncementState.anounceCard(e)) .map((e) => AllAnouncementState.anounceCard(e))
// .toList(), .toList(),
items: [],
options: CarouselOptions( options: CarouselOptions(
viewportFraction: 1.0, viewportFraction: 1.0,
aspectRatio: 686 / 172, aspectRatio: 686 / 172,

Loading…
Cancel
Save