|
|
@@ -1,10 +1,14 @@ |
|
|
|
import 'package:flutter/cupertino.dart'; |
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
import 'package:flutter_bloc/flutter_bloc.dart'; |
|
|
|
import 'package:pull_to_refresh/pull_to_refresh.dart'; |
|
|
|
import 'package:zhiying_base_widget/pages/message_notice_page/bloc/message_notice_bloc.dart'; |
|
|
|
import 'package:zhiying_base_widget/pages/message_notice_page/bloc/message_notice_repository.dart'; |
|
|
|
import 'package:zhiying_base_widget/widgets/empty/empty_widget.dart'; |
|
|
|
import 'package:zhiying_comm/zhiying_comm.dart'; |
|
|
|
|
|
|
|
import 'model/message_notice_style_model.dart'; |
|
|
|
|
|
|
|
/// |
|
|
|
/// 消息通知页 |
|
|
|
/// |
|
|
@@ -16,7 +20,7 @@ class MessageNoticePage extends StatelessWidget { |
|
|
|
@override |
|
|
|
Widget build(BuildContext context) { |
|
|
|
return BlocProvider<MessageNoticeBloc>( |
|
|
|
create: (_) => MessageNoticeBloc(MessageNoticeRepository())..add(MessageNoticeInitEvent()), |
|
|
|
create: (_) => MessageNoticeBloc(MessageNoticeRepository()), |
|
|
|
child: _MessageNoticePageContainer(), |
|
|
|
); |
|
|
|
} |
|
|
@@ -28,33 +32,129 @@ class _MessageNoticePageContainer extends StatefulWidget { |
|
|
|
} |
|
|
|
|
|
|
|
class __MessageNoticePageContainerState extends State<_MessageNoticePageContainer> { |
|
|
|
RefreshController _refreshController; |
|
|
|
|
|
|
|
/// 刷新 |
|
|
|
void _onRefresh() async {} |
|
|
|
|
|
|
|
/// 下拉更多 |
|
|
|
void _onLoad() async {} |
|
|
|
|
|
|
|
@override |
|
|
|
void initState() { |
|
|
|
_refreshController = RefreshController(); |
|
|
|
|
|
|
|
/// 初始化 |
|
|
|
BlocProvider.of<MessageNoticeBloc>(context).add(MessageNoticeInitEvent()); |
|
|
|
super.initState(); |
|
|
|
} |
|
|
|
|
|
|
|
@override |
|
|
|
Widget build(BuildContext context) { |
|
|
|
return _buildMainWidget(); |
|
|
|
return BlocConsumer<MessageNoticeBloc, MessageNoticeState>( |
|
|
|
listener: (context, state) {}, |
|
|
|
buildWhen: (prev, current) { |
|
|
|
/// 上拉更多成功 |
|
|
|
if (current is MessageNoticeOnLoadSuccessState) { |
|
|
|
_refreshController.loadComplete(); |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
/// 下拉刷新成功 |
|
|
|
if (current is MessageNoticeOnRefreshSuccessState) { |
|
|
|
_refreshController.refreshCompleted(resetFooterState: true); |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
/// 上拉更多失败 |
|
|
|
if (current is MessageNoticeOnLoadErrorState) { |
|
|
|
_refreshController.loadNoData(); |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
/// 下拉刷新失败 |
|
|
|
if (current is MessageNoticeOnRefreshErrorState) { |
|
|
|
_refreshController.refreshFailed(); |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
/// 数据加载失败 |
|
|
|
if (current is MessageNoticeErrorState) { |
|
|
|
return false; |
|
|
|
} |
|
|
|
return true; |
|
|
|
}, |
|
|
|
builder: (context, state) { |
|
|
|
/// 数据加载成功 |
|
|
|
if (state is MessageNoticeLoadedState) { |
|
|
|
return _buildDataListWidget(state?.styleModel); |
|
|
|
} |
|
|
|
|
|
|
|
/// 数据初始化失败 |
|
|
|
if (state is MessageNoticeInitErrorState) { |
|
|
|
return _buildEmptyWidget(); |
|
|
|
} |
|
|
|
|
|
|
|
/// 骨架图 |
|
|
|
return _buildSkeletonWidget(); |
|
|
|
}, |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
/// 主视图 |
|
|
|
Widget _buildMainWidget() { |
|
|
|
/// 有数据 |
|
|
|
Widget _buildDataListWidget(MessageNoticeStyleModel styleModel) { |
|
|
|
return Scaffold( |
|
|
|
appBar: _buildAppBarWidget(), |
|
|
|
backgroundColor: HexColor.fromHex('#F9F9F9'), |
|
|
|
body: ListView.builder( |
|
|
|
appBar: _buildAppBarWidget(), |
|
|
|
body: SmartRefresher( |
|
|
|
controller: _refreshController, |
|
|
|
onRefresh: _onRefresh, |
|
|
|
onLoading: _onLoad, |
|
|
|
enablePullDown: true, |
|
|
|
enablePullUp: true, |
|
|
|
child: ListView.builder( |
|
|
|
padding: const EdgeInsets.only(left: 12.5, right: 12.5, top: 8), |
|
|
|
// shrinkWrap: true, |
|
|
|
itemCount: 5, |
|
|
|
itemCount: styleModel?.main_notification?.length ?? 0, |
|
|
|
itemBuilder: (context, index) { |
|
|
|
return _buildOfficialActivitiesStyleWidget(); |
|
|
|
})); |
|
|
|
return _buildMessageCenterStyleWidget(styleModel?.main_notification[index], index, styleModel?.main_notification?.length); |
|
|
|
}), |
|
|
|
), |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
/// 没有数据 |
|
|
|
Widget _buildEmptyWidget() { |
|
|
|
return Scaffold( |
|
|
|
appBar: _buildAppBarWidget(), |
|
|
|
body: SmartRefresher( |
|
|
|
controller: _refreshController, |
|
|
|
onRefresh: _onRefresh, |
|
|
|
enablePullDown: true, |
|
|
|
enablePullUp: false, |
|
|
|
child: ListView( |
|
|
|
children: <Widget>[ |
|
|
|
EmptyWidget(), |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
/// 骨架图 |
|
|
|
Widget _buildSkeletonWidget() { |
|
|
|
return Scaffold( |
|
|
|
appBar: _buildAppBarWidget(), |
|
|
|
body: Container(), |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
/// 消息中心样式 |
|
|
|
Widget _buildMessageCenterStyleWidget(int index, int length) { |
|
|
|
Widget _buildMessageCenterStyleWidget(MainNotificationStyle styleModel, int index, int length) { |
|
|
|
var borderRadius = index == 0 |
|
|
|
? BorderRadius.only(topLeft: Radius.circular(7.5), topRight: Radius.circular(7.5)) |
|
|
|
: index == length - 1 ? BorderRadius.only(bottomRight: Radius.circular(7.5), bottomLeft: Radius.circular(7.5)) : BorderRadius.only(); |
|
|
|
|
|
|
|
return Container( |
|
|
|
decoration: BoxDecoration(color: HexColor.fromHex('#FFFFFF'), borderRadius: borderRadius), |
|
|
|
decoration: BoxDecoration(color: HexColor.fromHex(styleModel?.bg_color ?? '#FFFFFF'), borderRadius: borderRadius), |
|
|
|
padding: const EdgeInsets.only(left: 15, right: 15, top: 16), |
|
|
|
child: Column( |
|
|
|
children: <Widget>[ |
|
|
@@ -63,7 +163,7 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine |
|
|
|
width: double.infinity, |
|
|
|
child: Row( |
|
|
|
children: <Widget>[ |
|
|
|
_buildCustomerAvatarWidget(), |
|
|
|
_buildCustomerAvatarWidget(icon: styleModel?.icon), |
|
|
|
const SizedBox(width: 10), |
|
|
|
Expanded( |
|
|
|
child: Column( |
|
|
@@ -73,8 +173,11 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine |
|
|
|
Row( |
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
children: <Widget>[ |
|
|
|
Text('官方活动', style: TextStyle(color: HexColor.fromHex('#333333'), fontWeight: FontWeight.bold, fontSize: 13)), |
|
|
|
Text('04-20 16:00', style: TextStyle(color: HexColor.fromHex('#D8D8D8'), fontSize: 12)), |
|
|
|
Text( |
|
|
|
styleModel?.name ?? '官方活动', |
|
|
|
style: TextStyle(color: HexColor.fromHex(styleModel?.name_color ?? '#333333'), fontWeight: FontWeight.bold, fontSize: 13), |
|
|
|
), |
|
|
|
Text('04-20 16:00', style: TextStyle(color: HexColor.fromHex(styleModel?.time_color ?? '#D8D8D8'), fontSize: 12)), |
|
|
|
], |
|
|
|
), |
|
|
|
Padding( |
|
|
@@ -83,7 +186,7 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine |
|
|
|
'2020年6月23日4:00至6月30日4:00关闭提现aaa', |
|
|
|
maxLines: 1, |
|
|
|
overflow: TextOverflow.ellipsis, |
|
|
|
style: TextStyle(color: HexColor.fromHex('#999999'), fontSize: 12), |
|
|
|
style: TextStyle(color: HexColor.fromHex(styleModel?.value_color ?? '#999999'), fontSize: 12), |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
@@ -99,12 +202,12 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine |
|
|
|
} |
|
|
|
|
|
|
|
/// 官方通知样式 |
|
|
|
Widget _buildOfficialNoticeStyleWidget() { |
|
|
|
Widget _buildOfficialNoticeStyleWidget(OfficialNotificationStyle styleModel) { |
|
|
|
return Container( |
|
|
|
padding: const EdgeInsets.only(left: 15, right: 15, top: 12.5, bottom: 10), |
|
|
|
margin: const EdgeInsets.only(bottom: 7.5), |
|
|
|
decoration: BoxDecoration( |
|
|
|
color: HexColor.fromHex('#FFFFFF'), |
|
|
|
color: HexColor.fromHex(styleModel?.bg_color ?? '#FFFFFF'), |
|
|
|
borderRadius: BorderRadius.circular(7.5), |
|
|
|
), |
|
|
|
child: Column( |
|
|
@@ -113,19 +216,26 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine |
|
|
|
Row( |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
children: <Widget>[ |
|
|
|
_buildCustomerAvatarWidget(), |
|
|
|
_buildCustomerAvatarWidget(icon: styleModel?.icon), |
|
|
|
const SizedBox(width: 10), |
|
|
|
Expanded( |
|
|
|
child: Column( |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
children: <Widget>[ |
|
|
|
/// 标题 |
|
|
|
Text('关于关闭提现功能通知', style: TextStyle(color: HexColor.fromHex('#333333'), fontSize: 14, fontWeight: FontWeight.bold)), |
|
|
|
Text( |
|
|
|
'关于关闭提现功能通知', |
|
|
|
style: TextStyle(color: HexColor.fromHex(styleModel?.title_value_color ?? '#333333'), fontSize: 14, fontWeight: FontWeight.bold), |
|
|
|
), |
|
|
|
const SizedBox(height: 5), |
|
|
|
|
|
|
|
/// 内容 |
|
|
|
Text('由于微信官方的限制,我们暂时将嗨如意小程序内的提现功能进行关闭并进行维护,关闭功能时间为2020年6月23日4:00至6月30日4:00,请谅解', |
|
|
|
maxLines: 3, overflow: TextOverflow.ellipsis, style: TextStyle(color: HexColor.fromHex('#999999'), fontSize: 11)) |
|
|
|
Text( |
|
|
|
'由于微信官方的限制,我们暂时将嗨如意小程序内的提现功能进行关闭并进行维护,关闭功能时间为2020年6月23日4:00至6月30日4:00,请谅解', |
|
|
|
maxLines: 3, |
|
|
|
overflow: TextOverflow.ellipsis, |
|
|
|
style: TextStyle(color: HexColor.fromHex(styleModel?.message_value_color ?? '#999999'), fontSize: 11), |
|
|
|
) |
|
|
|
], |
|
|
|
), |
|
|
|
) |
|
|
@@ -133,25 +243,30 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine |
|
|
|
), |
|
|
|
|
|
|
|
/// 时间 |
|
|
|
Padding(padding: const EdgeInsets.only(top: 16), child: Text('2020-06-23 01:00:06', style: TextStyle(color: HexColor.fromHex('#D8D8D8'), fontSize: 11))) |
|
|
|
Padding( |
|
|
|
padding: const EdgeInsets.only(top: 16), |
|
|
|
child: Text( |
|
|
|
'2020-06-23 01:00:06', |
|
|
|
style: TextStyle(color: HexColor.fromHex(styleModel?.time_color ?? '#D8D8D8'), fontSize: 11), |
|
|
|
)) |
|
|
|
], |
|
|
|
), |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
/// 官方活动样式 |
|
|
|
Widget _buildOfficialActivitiesStyleWidget() { |
|
|
|
Widget _buildOfficialActivitiesStyleWidget(OfficialActivityStyle styleModel) { |
|
|
|
return Container( |
|
|
|
padding: const EdgeInsets.only(left: 15, right: 15, top: 12.5, bottom: 10), |
|
|
|
margin: const EdgeInsets.only(bottom: 7.5), |
|
|
|
decoration: BoxDecoration(borderRadius: BorderRadius.circular(7.5), color: HexColor.fromHex('#FFFFFF')), |
|
|
|
decoration: BoxDecoration(borderRadius: BorderRadius.circular(7.5), color: HexColor.fromHex(styleModel?.bg_color ?? '#FFFFFF')), |
|
|
|
child: Column( |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
children: <Widget>[ |
|
|
|
/// 标题 |
|
|
|
Text( |
|
|
|
'8.8淘宝会员节大促', |
|
|
|
style: TextStyle(color: HexColor.fromHex('#333333'), fontWeight: FontWeight.bold, fontSize: 14), |
|
|
|
style: TextStyle(color: HexColor.fromHex(styleModel?.title_value_color ?? '#333333'), fontWeight: FontWeight.bold, fontSize: 14), |
|
|
|
maxLines: 1, |
|
|
|
overflow: TextOverflow.ellipsis, |
|
|
|
), |
|
|
@@ -159,8 +274,11 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine |
|
|
|
|
|
|
|
/// 图片海报 |
|
|
|
ClipRRect( |
|
|
|
borderRadius: BorderRadius.circular(7.5), |
|
|
|
child: CachedNetworkImage(imageUrl: 'http://ossq.izhyin.cn/index_carousel_1.png', width: double.infinity, )), |
|
|
|
borderRadius: BorderRadius.circular(7.5), |
|
|
|
child: CachedNetworkImage( |
|
|
|
imageUrl: 'http://ossq.izhyin.cn/index_carousel_1.png', |
|
|
|
width: double.infinity, |
|
|
|
)), |
|
|
|
const SizedBox(height: 6.5), |
|
|
|
|
|
|
|
/// 活动内容 |
|
|
@@ -168,24 +286,24 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine |
|
|
|
'京东家电815周年庆,全场家电最低五折起,买一送一等超多优惠活动,点击查看活动详情', |
|
|
|
maxLines: 2, |
|
|
|
overflow: TextOverflow.ellipsis, |
|
|
|
style: TextStyle(fontSize: 11, color: HexColor.fromHex('#999999')), |
|
|
|
style: TextStyle(fontSize: 11, color: HexColor.fromHex(styleModel?.message_value_color ?? '#999999')), |
|
|
|
), |
|
|
|
|
|
|
|
/// 时间 |
|
|
|
const SizedBox(height: 7), |
|
|
|
Text('2020-06-23 01:00:06', style: TextStyle(color: HexColor.fromHex('#D8D8D8'), fontSize: 11)) |
|
|
|
Text('2020-06-23 01:00:06', style: TextStyle(color: HexColor.fromHex(styleModel?.time_color ?? '#D8D8D8'), fontSize: 11)) |
|
|
|
], |
|
|
|
), |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
/// 交易通知样式 |
|
|
|
Widget _buildTradeNoticeStyleWidget() { |
|
|
|
Widget _buildTradeNoticeStyleWidget(TransactionNotificationStyle styleModel) { |
|
|
|
return Container( |
|
|
|
padding: const EdgeInsets.only(left: 15, right: 15, top: 12.5, bottom: 10), |
|
|
|
margin: const EdgeInsets.only(bottom: 7.5), |
|
|
|
decoration: BoxDecoration( |
|
|
|
color: HexColor.fromHex('#FFFFFF'), |
|
|
|
color: HexColor.fromHex(styleModel?.bg_color ?? '#FFFFFF'), |
|
|
|
borderRadius: BorderRadius.circular(7.5), |
|
|
|
), |
|
|
|
child: Column( |
|
|
@@ -194,18 +312,18 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine |
|
|
|
Row( |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
children: <Widget>[ |
|
|
|
_buildCustomerAvatarWidget(), |
|
|
|
_buildCustomerAvatarWidget(icon: styleModel?.icon), |
|
|
|
const SizedBox(width: 10), |
|
|
|
Expanded( |
|
|
|
child: Column( |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
children: <Widget>[ |
|
|
|
/// 标题 |
|
|
|
Text('自购订单收益', style: TextStyle(color: HexColor.fromHex('#333333'), fontSize: 14, fontWeight: FontWeight.bold)), |
|
|
|
Text('自购订单收益', style: TextStyle(color: HexColor.fromHex(styleModel?.title_value_color ?? '#333333'), fontSize: 14, fontWeight: FontWeight.bold)), |
|
|
|
const SizedBox(height: 5), |
|
|
|
|
|
|
|
/// 内容 |
|
|
|
_buildCustomerTradeContentWidget(), |
|
|
|
_buildCustomerTradeContentWidget(styleModel), |
|
|
|
], |
|
|
|
), |
|
|
|
) |
|
|
@@ -213,19 +331,21 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine |
|
|
|
), |
|
|
|
|
|
|
|
/// 时间 |
|
|
|
Padding(padding: const EdgeInsets.only(top: 16), child: Text('2020-06-23 01:00:06', style: TextStyle(color: HexColor.fromHex('#D8D8D8'), fontSize: 11))) |
|
|
|
Padding( |
|
|
|
padding: const EdgeInsets.only(top: 16), |
|
|
|
child: Text('2020-06-23 01:00:06', style: TextStyle(color: HexColor.fromHex(styleModel?.time_color ?? '#D8D8D8'), fontSize: 11))) |
|
|
|
], |
|
|
|
), |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
/// 推广通知样式 |
|
|
|
Widget _buildPromoteNoticeStyleWidget() { |
|
|
|
Widget _buildPromoteNoticeStyleWidget(PromotionNotificationStyle styleModel) { |
|
|
|
return Container( |
|
|
|
padding: const EdgeInsets.only(left: 15, right: 15, top: 12.5, bottom: 10), |
|
|
|
margin: const EdgeInsets.only(bottom: 7.5), |
|
|
|
decoration: BoxDecoration( |
|
|
|
color: HexColor.fromHex('#FFFFFF'), |
|
|
|
color: HexColor.fromHex(styleModel?.bg_color ?? '#FFFFFF'), |
|
|
|
borderRadius: BorderRadius.circular(7.5), |
|
|
|
), |
|
|
|
child: Column( |
|
|
@@ -234,19 +354,26 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine |
|
|
|
Row( |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
children: <Widget>[ |
|
|
|
_buildCustomerAvatarWidget(), |
|
|
|
_buildCustomerAvatarWidget(icon: styleModel?.icon), |
|
|
|
const SizedBox(width: 10), |
|
|
|
Expanded( |
|
|
|
child: Column( |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
children: <Widget>[ |
|
|
|
/// 标题 |
|
|
|
Text('新增直推粉丝', style: TextStyle(color: HexColor.fromHex('#333333'), fontSize: 14, fontWeight: FontWeight.bold)), |
|
|
|
Text( |
|
|
|
'新增直推粉丝', |
|
|
|
style: TextStyle(color: HexColor.fromHex(styleModel?.title_value_color ?? '#333333'), fontSize: 14, fontWeight: FontWeight.bold), |
|
|
|
), |
|
|
|
const SizedBox(height: 5), |
|
|
|
|
|
|
|
/// 内容 |
|
|
|
Text('恭喜您成功邀请152****5887加入您的团队,快带领小伙伴走向致富之路吧!', |
|
|
|
maxLines: 3, overflow: TextOverflow.ellipsis, style: TextStyle(color: HexColor.fromHex('#999999'), fontSize: 11)) |
|
|
|
Text( |
|
|
|
'恭喜您成功邀请152****5887加入您的团队,快带领小伙伴走向致富之路吧!', |
|
|
|
maxLines: 3, |
|
|
|
overflow: TextOverflow.ellipsis, |
|
|
|
style: TextStyle(color: HexColor.fromHex(styleModel?.message_value_color ?? '#999999'), fontSize: 11), |
|
|
|
) |
|
|
|
], |
|
|
|
), |
|
|
|
) |
|
|
@@ -254,19 +381,21 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine |
|
|
|
), |
|
|
|
|
|
|
|
/// 时间 |
|
|
|
Padding(padding: const EdgeInsets.only(top: 16), child: Text('2020-06-23 01:00:06', style: TextStyle(color: HexColor.fromHex('#D8D8D8'), fontSize: 11))) |
|
|
|
Padding( |
|
|
|
padding: const EdgeInsets.only(top: 16), |
|
|
|
child: Text('2020-06-23 01:00:06', style: TextStyle(color: HexColor.fromHex(styleModel?.time_color ?? '#D8D8D8'), fontSize: 11))) |
|
|
|
], |
|
|
|
), |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
/// 反馈通知样式 |
|
|
|
Widget _buildFeedbackNoticeStyleWidget() { |
|
|
|
Widget _buildFeedbackNoticeStyleWidget(FeedbackNotificationStyle styleModel) { |
|
|
|
return Container( |
|
|
|
padding: const EdgeInsets.only(left: 15, right: 15, top: 14, bottom: 10), |
|
|
|
margin: const EdgeInsets.only(bottom: 7.5), |
|
|
|
decoration: BoxDecoration( |
|
|
|
color: HexColor.fromHex('#FFFFFF'), |
|
|
|
color: HexColor.fromHex(styleModel?.bg_color ?? '#FFFFFF'), |
|
|
|
borderRadius: BorderRadius.circular(7.5), |
|
|
|
), |
|
|
|
child: Column( |
|
|
@@ -275,18 +404,18 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine |
|
|
|
Row( |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
children: <Widget>[ |
|
|
|
_buildCustomerAvatarWidget(), |
|
|
|
_buildCustomerAvatarWidget(icon: styleModel?.icon), |
|
|
|
const SizedBox(width: 10), |
|
|
|
Expanded( |
|
|
|
child: Column( |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
children: <Widget>[ |
|
|
|
/// 标题 |
|
|
|
Text('您的反馈有回复啦', style: TextStyle(color: HexColor.fromHex('#333333'), fontSize: 14, fontWeight: FontWeight.bold)), |
|
|
|
Text('您的反馈有回复啦', style: TextStyle(color: HexColor.fromHex(styleModel?.title_value_color ?? '#333333'), fontSize: 14, fontWeight: FontWeight.bold)), |
|
|
|
const SizedBox(height: 3), |
|
|
|
|
|
|
|
/// 内容 |
|
|
|
Text('点击查看回复详情', |
|
|
|
maxLines: 1, overflow: TextOverflow.ellipsis, style: TextStyle(color: HexColor.fromHex('#999999'), fontSize: 11)) |
|
|
|
Text('点击查看回复详情', maxLines: 1, overflow: TextOverflow.ellipsis, style: TextStyle(color: HexColor.fromHex(styleModel?.message_value_color ?? '#999999'), fontSize: 11)) |
|
|
|
], |
|
|
|
), |
|
|
|
) |
|
|
@@ -294,7 +423,7 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine |
|
|
|
), |
|
|
|
|
|
|
|
/// 时间 |
|
|
|
Padding(padding: const EdgeInsets.only(top: 16), child: Text('2020-06-23 01:00:06', style: TextStyle(color: HexColor.fromHex('#D8D8D8'), fontSize: 11))) |
|
|
|
Padding(padding: const EdgeInsets.only(top: 16), child: Text(styleModel?.time_color ?? '2020-06-23 01:00:06', style: TextStyle(color: HexColor.fromHex('#D8D8D8'), fontSize: 11))) |
|
|
|
], |
|
|
|
), |
|
|
|
); |
|
|
@@ -322,7 +451,7 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine |
|
|
|
} |
|
|
|
|
|
|
|
/// ================================= 自定义View ================================= /// |
|
|
|
Widget _buildCustomerAvatarWidget() { |
|
|
|
Widget _buildCustomerAvatarWidget({@required String icon, String value}) { |
|
|
|
return Container( |
|
|
|
// width: 30, |
|
|
|
// height: 30, |
|
|
@@ -334,21 +463,26 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine |
|
|
|
Container( |
|
|
|
height: 30, |
|
|
|
width: 30, |
|
|
|
color: Colors.deepPurpleAccent, |
|
|
|
child: CachedNetworkImage( |
|
|
|
imageUrl: icon ?? '', |
|
|
|
), |
|
|
|
), |
|
|
|
Transform.translate( |
|
|
|
offset: Offset(5, -4.5), |
|
|
|
child: Container( |
|
|
|
// width: 17, |
|
|
|
height: 12, |
|
|
|
padding: const EdgeInsets.only(left: 3, right: 3, top: 1, bottom: 1), |
|
|
|
alignment: Alignment.center, |
|
|
|
decoration: |
|
|
|
BoxDecoration(color: HexColor.fromHex('#FF4242'), borderRadius: BorderRadius.circular(6), border: Border.all(color: HexColor.fromHex('#FFFFFF'), width: 0.5)), |
|
|
|
child: Text( |
|
|
|
'18', |
|
|
|
textAlign: TextAlign.center, |
|
|
|
style: TextStyle(fontSize: 9, color: HexColor.fromHex('#FFFFFF')), |
|
|
|
Visibility( |
|
|
|
visible: !EmptyUtil.isEmpty(value), |
|
|
|
child: Transform.translate( |
|
|
|
offset: Offset(5, -4.5), |
|
|
|
child: Container( |
|
|
|
// width: 17, |
|
|
|
height: 12, |
|
|
|
padding: const EdgeInsets.only(left: 3, right: 3, top: 1, bottom: 1), |
|
|
|
alignment: Alignment.center, |
|
|
|
decoration: |
|
|
|
BoxDecoration(color: HexColor.fromHex('#FF4242'), borderRadius: BorderRadius.circular(6), border: Border.all(color: HexColor.fromHex('#FFFFFF'), width: 0.5)), |
|
|
|
child: Text( |
|
|
|
'18', |
|
|
|
textAlign: TextAlign.center, |
|
|
|
style: TextStyle(fontSize: 9, color: HexColor.fromHex('#FFFFFF')), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
) |
|
|
@@ -357,26 +491,24 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
Widget _buildCustomerTradeContentWidget(){ |
|
|
|
Map<String, String> datas= { |
|
|
|
'订单编号:':'154547896541651464788', |
|
|
|
'订单类型:':'京东', |
|
|
|
Widget _buildCustomerTradeContentWidget(TransactionNotificationStyle styleModel) { |
|
|
|
Map<String, String> datas = { |
|
|
|
'订单编号:': '154547896541651464788', |
|
|
|
'订单类型:': '京东', |
|
|
|
'预估收益:': '8.00', |
|
|
|
'下单时间:':'2020-08-14 11:35:39', |
|
|
|
'预估结算:':'次月25日结算', |
|
|
|
'下单时间:': '2020-08-14 11:35:39', |
|
|
|
'预估结算:': '次月25日结算', |
|
|
|
}; |
|
|
|
List<Widget> lists = []; |
|
|
|
datas.forEach((key, value) { |
|
|
|
datas.forEach((key, value) { |
|
|
|
lists.add(Padding( |
|
|
|
padding: const EdgeInsets.only(bottom: 5), |
|
|
|
child: RichText( |
|
|
|
textAlign: TextAlign.start, |
|
|
|
text: TextSpan( |
|
|
|
children: [ |
|
|
|
TextSpan(text: key, style: TextStyle(fontSize: 11, color: HexColor.fromHex('#999999'))), |
|
|
|
TextSpan(text: value, style: TextStyle(fontSize: 11, color: HexColor.fromHex('#999999'))), |
|
|
|
] |
|
|
|
), |
|
|
|
text: TextSpan(children: [ |
|
|
|
TextSpan(text: key, style: TextStyle(fontSize: 11, color: HexColor.fromHex('#999999'))), |
|
|
|
TextSpan(text: value, style: TextStyle(fontSize: 11, color: HexColor.fromHex('#999999'))), |
|
|
|
]), |
|
|
|
), |
|
|
|
)); |
|
|
|
}); |
|
|
|