对接消息列表

hmxc
小赖 4 years ago
parent d47e9a97e7
commit c0e8ae635a

@ -0,0 +1,21 @@
class CommentMessageItemModel {
int id;
int type;
int relationId;
CommentMessageItemModel({this.id, this.type, this.relationId});
CommentMessageItemModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
type = json['type'];
relationId = json['relationId'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['type'] = this.type;
data['relationId'] = this.relationId;
return data;
}
}

@ -0,0 +1,21 @@
class SystemMessageItemModel {
int id;
int type;
int relationId;
SystemMessageItemModel({this.id, this.type, this.relationId});
SystemMessageItemModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
type = json['type'];
relationId = json['relationId'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['type'] = this.type;
data['relationId'] = this.relationId;
return data;
}
}

@ -1,8 +1,12 @@
// Flutter imports: // Flutter imports:
import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/models/message/comment_message_item_model.dart';
import 'package:aku_community_manager/ui/widgets/common/bee_list_view.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
// Package imports: // Package imports:
import 'package:aku_ui/common_widgets/aku_common_widgets.dart'; import 'package:aku_ui/common_widgets/aku_common_widgets.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
// Project imports: // Project imports:
@ -18,6 +22,7 @@ class CommentMessage extends StatefulWidget {
} }
class _CommentMessageState extends State<CommentMessage> { class _CommentMessageState extends State<CommentMessage> {
EasyRefreshController _refreshController = EasyRefreshController();
Widget _messageList( Widget _messageList(
String date, String date,
String name, String name,
@ -112,9 +117,7 @@ class _CommentMessageState extends State<CommentMessage> {
], ],
), ),
SizedBox(height: 16.w), SizedBox(height: 16.w),
Divider( Divider(height: 1.w),
height: 1.w,
),
AkuButton( AkuButton(
onPressed: () {}, onPressed: () {},
child: Container( child: Container(
@ -145,12 +148,18 @@ class _CommentMessageState extends State<CommentMessage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AkuScaffold( return AkuScaffold(
title: '评论消息', title: '评论消息',
body: ListView( body: BeeListView(
padding: EdgeInsets.only(left: 32.w, right: 32.w, bottom: 40.w), controller: _refreshController,
children: [ path: API.message.commentList,
_messageList('2020-10-23 10:00', '杨建', '四星'), convert: (model) => model.tableList
_messageList('2020-10-24 11:00', '刘能', '四星'), .map((e) => CommentMessageItemModel.fromJson(e))
], .toList(),
builder: (items) {
return ListView(
padding: EdgeInsets.only(left: 32.w, right: 32.w, bottom: 40.w),
children: [],
);
},
), ),
); );
} }

@ -1,8 +1,12 @@
// Flutter imports: // Flutter imports:
import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/models/message/system_message_item_model.dart';
import 'package:aku_community_manager/ui/widgets/common/bee_list_view.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
// Package imports: // Package imports:
import 'package:aku_ui/aku_ui.dart'; import 'package:aku_ui/aku_ui.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
// Project imports: // Project imports:
@ -19,6 +23,8 @@ class SystemMessage extends StatefulWidget {
} }
class _SystemMessageState extends State<SystemMessage> { class _SystemMessageState extends State<SystemMessage> {
EasyRefreshController _refreshController = EasyRefreshController();
Widget _messageList(String date, String name, String phone, String area) { Widget _messageList(String date, String name, String phone, String area) {
return Column( return Column(
children: [ children: [
@ -163,12 +169,18 @@ class _SystemMessageState extends State<SystemMessage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AkuScaffold( return AkuScaffold(
title: '系统消息', title: '系统消息',
body: ListView( body: BeeListView(
padding: EdgeInsets.only(left: 32.w, right: 32.w, bottom: 40.w), controller: _refreshController,
children: [ builder: (items) {
_messageList('2020-10-23 10:00', '杨建', '17867665666', '共区'), return ListView(
_messageList('2020-10-22 10:00', '刘能', '17855823545', '共区'), padding: EdgeInsets.only(left: 32.w, right: 32.w, bottom: 40.w),
], children: [],
);
},
path: API.message.systemList,
convert: (model) => model.tableList
.map((e) => SystemMessageItemModel.fromJson(e))
.toList(),
), ),
); );
} }

@ -1,4 +1,5 @@
// Flutter imports: // Flutter imports:
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/utils/network/base_list_model.dart'; import 'package:aku_community_manager/utils/network/base_list_model.dart';
import 'package:aku_community_manager/utils/network/net_util.dart'; import 'package:aku_community_manager/utils/network/net_util.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -6,7 +7,6 @@ import 'package:flutter/material.dart';
// Package imports: // Package imports:
import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart';
/// ## BeeListView /// ## BeeListView
///```dart ///```dart
///BeeListView( ///BeeListView(
@ -90,7 +90,9 @@ class _BeeListViewState<T> extends State<BeeListView> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return EasyRefresh( return EasyRefresh(
controller: widget.controller, controller: widget.controller,
header: MaterialHeader(), header: MaterialHeader(
valueColor: AlwaysStoppedAnimation(AppStyle.primaryColor),
),
footer: MaterialFooter(), footer: MaterialFooter(),
onRefresh: () async { onRefresh: () async {
_pageNum = 1; _pageNum = 1;

Loading…
Cancel
Save