|
|
|
@ -102,7 +102,8 @@ class _SystemMessagePage extends State<SystemMessagePage> {
|
|
|
|
|
token: value.getString("token"), |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
BaseData<List<MsgStats>> baseData = await apiService.stats().catchError((onError) {}); |
|
|
|
|
BaseData<List<MsgStats>> baseData = |
|
|
|
|
await apiService.stats().catchError((onError) {}); |
|
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
|
setState(() { |
|
|
|
|
msgNumber.forEach((key, value) { |
|
|
|
@ -125,34 +126,34 @@ class _SystemMessagePage extends State<SystemMessagePage> {
|
|
|
|
|
@override |
|
|
|
|
Widget build(BuildContext context) { |
|
|
|
|
return Scaffold( |
|
|
|
|
appBar: MyAppBar( |
|
|
|
|
background: Colors.white, |
|
|
|
|
leadingColor: Colors.black, |
|
|
|
|
title: S.of(context).xiaoxi, |
|
|
|
|
titleSize: 18.sp, |
|
|
|
|
titleColor: Colors.black, |
|
|
|
|
actions: [ |
|
|
|
|
Container( |
|
|
|
|
margin: EdgeInsets.only(right: 16.w), |
|
|
|
|
alignment: Alignment.centerRight, |
|
|
|
|
child: GestureDetector( |
|
|
|
|
onTap: () { |
|
|
|
|
setState(() { |
|
|
|
|
queryMsgStats(); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
child: Text( |
|
|
|
|
S.of(context).biaoweiyidu, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
fontWeight:MyFontWeight.semi_bold, |
|
|
|
|
color: Color(0xFF353535), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
// appBar: MyAppBar( |
|
|
|
|
// background: Colors.white, |
|
|
|
|
// leadingColor: Colors.black, |
|
|
|
|
// title: S.of(context).xiaoxi, |
|
|
|
|
// titleSize: 18.sp, |
|
|
|
|
// titleColor: Colors.black, |
|
|
|
|
// actions: [ |
|
|
|
|
// Container( |
|
|
|
|
// margin: EdgeInsets.only(right: 16.w), |
|
|
|
|
// alignment: Alignment.centerRight, |
|
|
|
|
// child: GestureDetector( |
|
|
|
|
// onTap: () { |
|
|
|
|
// setState(() { |
|
|
|
|
// queryMsgStats(); |
|
|
|
|
// }); |
|
|
|
|
// }, |
|
|
|
|
// child: Text( |
|
|
|
|
// S.of(context).biaoweiyidu, |
|
|
|
|
// style: TextStyle( |
|
|
|
|
// fontSize: 16.sp, |
|
|
|
|
// fontWeight:MyFontWeight.semi_bold, |
|
|
|
|
// color: Color(0xFF353535), |
|
|
|
|
// ), |
|
|
|
|
// ), |
|
|
|
|
// ), |
|
|
|
|
// ), |
|
|
|
|
// ], |
|
|
|
|
// ), |
|
|
|
|
body: SmartRefresher( |
|
|
|
|
enablePullDown: true, |
|
|
|
|
enablePullUp: true, |
|
|
|
@ -177,15 +178,73 @@ class _SystemMessagePage extends State<SystemMessagePage> {
|
|
|
|
|
child: Container( |
|
|
|
|
child: Column( |
|
|
|
|
children: [ |
|
|
|
|
Container( |
|
|
|
|
color: Colors.white, |
|
|
|
|
padding: EdgeInsets.only( |
|
|
|
|
top: MediaQuery.of(context).padding.top + 10.h, |
|
|
|
|
bottom: 15.h,right: 16.w), |
|
|
|
|
child: Row( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
|
|
children: [ |
|
|
|
|
GestureDetector( |
|
|
|
|
behavior: HitTestBehavior.opaque, |
|
|
|
|
onTap: () { |
|
|
|
|
Navigator.of(context).pop(); |
|
|
|
|
}, |
|
|
|
|
child: Container( |
|
|
|
|
alignment: Alignment.centerRight, |
|
|
|
|
margin: EdgeInsets.only(left: 12,), |
|
|
|
|
padding: EdgeInsets.all(6), |
|
|
|
|
child: Icon( |
|
|
|
|
Icons.arrow_back_ios, |
|
|
|
|
color: Colors.black, |
|
|
|
|
size: 24, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Spacer(), |
|
|
|
|
Expanded( |
|
|
|
|
child: Text( |
|
|
|
|
S.of(context).xiaoxi, |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Colors.black, |
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
), |
|
|
|
|
)), |
|
|
|
|
GestureDetector( |
|
|
|
|
behavior: HitTestBehavior.opaque, |
|
|
|
|
onTap: () { |
|
|
|
|
setState(() { |
|
|
|
|
queryMsgStats(); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
child: Container( |
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 10.w), |
|
|
|
|
child: Text( |
|
|
|
|
S.of(context).biaoweiyidu, |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Colors.black, |
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
newsSurvey(), |
|
|
|
|
SizedBox(height: 16.h,), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 16.h, |
|
|
|
|
), |
|
|
|
|
buildMessage(), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
|
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
@ -196,10 +255,11 @@ class _SystemMessagePage extends State<SystemMessagePage> {
|
|
|
|
|
padding: EdgeInsets.only(top: 16.h, bottom: 16.h), |
|
|
|
|
child: Row( |
|
|
|
|
children: [ |
|
|
|
|
Expanded(child: GestureDetector( |
|
|
|
|
Expanded( |
|
|
|
|
child: GestureDetector( |
|
|
|
|
onTap: () { |
|
|
|
|
Navigator.of(context) |
|
|
|
|
.pushNamed('/router/system_details',arguments: {"msgType":5}).then((value) { |
|
|
|
|
Navigator.of(context).pushNamed('/router/system_details', |
|
|
|
|
arguments: {"msgType": 5}).then((value) { |
|
|
|
|
setState(() { |
|
|
|
|
msgNumber["5"] = 0; |
|
|
|
|
}); |
|
|
|
@ -237,8 +297,7 @@ class _SystemMessagePage extends State<SystemMessagePage> {
|
|
|
|
|
backgroup: Color(0xFFFF441A), |
|
|
|
|
fontSize: 8.sp, |
|
|
|
|
radius: 100, |
|
|
|
|
) |
|
|
|
|
), |
|
|
|
|
)), |
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
@ -252,14 +311,12 @@ class _SystemMessagePage extends State<SystemMessagePage> {
|
|
|
|
|
), |
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
) |
|
|
|
|
) |
|
|
|
|
), |
|
|
|
|
Expanded(child: |
|
|
|
|
GestureDetector( |
|
|
|
|
))), |
|
|
|
|
Expanded( |
|
|
|
|
child: GestureDetector( |
|
|
|
|
onTap: () { |
|
|
|
|
Navigator.of(context) |
|
|
|
|
.pushNamed('/router/system_details',arguments: {"msgType":6}).then((value) { |
|
|
|
|
Navigator.of(context).pushNamed('/router/system_details', |
|
|
|
|
arguments: {"msgType": 6}).then((value) { |
|
|
|
|
setState(() { |
|
|
|
|
msgNumber["6"] = 0; |
|
|
|
|
}); |
|
|
|
@ -297,8 +354,7 @@ class _SystemMessagePage extends State<SystemMessagePage> {
|
|
|
|
|
backgroup: Color(0xFFFF441A), |
|
|
|
|
fontSize: 8.sp, |
|
|
|
|
radius: 100, |
|
|
|
|
) |
|
|
|
|
), |
|
|
|
|
)), |
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
@ -312,13 +368,12 @@ class _SystemMessagePage extends State<SystemMessagePage> {
|
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
) |
|
|
|
|
)), |
|
|
|
|
Expanded(child: |
|
|
|
|
GestureDetector( |
|
|
|
|
))), |
|
|
|
|
Expanded( |
|
|
|
|
child: GestureDetector( |
|
|
|
|
onTap: () { |
|
|
|
|
Navigator.of(context) |
|
|
|
|
.pushNamed('/router/system_details',arguments: {"msgType":4}).then((value) { |
|
|
|
|
Navigator.of(context).pushNamed('/router/system_details', |
|
|
|
|
arguments: {"msgType": 4}).then((value) { |
|
|
|
|
setState(() { |
|
|
|
|
msgNumber["4"] = 0; |
|
|
|
|
}); |
|
|
|
@ -356,8 +411,7 @@ class _SystemMessagePage extends State<SystemMessagePage> {
|
|
|
|
|
backgroup: Color(0xFFFF441A), |
|
|
|
|
fontSize: 8.sp, |
|
|
|
|
radius: 100, |
|
|
|
|
) |
|
|
|
|
), |
|
|
|
|
)), |
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
@ -371,9 +425,7 @@ class _SystemMessagePage extends State<SystemMessagePage> {
|
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
) |
|
|
|
|
) |
|
|
|
|
), |
|
|
|
|
))), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
@ -413,15 +465,17 @@ class _SystemMessagePage extends State<SystemMessagePage> {
|
|
|
|
|
return GestureDetector( |
|
|
|
|
onTap: () { |
|
|
|
|
if (messages[position].typed == 2) |
|
|
|
|
Navigator.of(context) |
|
|
|
|
.pushNamed('/router/system_details',arguments: {"msgType":2}).then((value) { |
|
|
|
|
Navigator.of(context).pushNamed( |
|
|
|
|
'/router/system_details', |
|
|
|
|
arguments: {"msgType": 2}).then((value) { |
|
|
|
|
setState(() { |
|
|
|
|
msgNumber["2"] = 0; |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
else if (messages[position].typed == 3) |
|
|
|
|
Navigator.of(context) |
|
|
|
|
.pushNamed('/router/system_details',arguments: {"msgType":3}).then((value) { |
|
|
|
|
Navigator.of(context).pushNamed( |
|
|
|
|
'/router/system_details', |
|
|
|
|
arguments: {"msgType": 3}).then((value) { |
|
|
|
|
setState(() { |
|
|
|
|
msgNumber["3"] = 0; |
|
|
|
|
}); |
|
|
|
@ -431,8 +485,7 @@ class _SystemMessagePage extends State<SystemMessagePage> {
|
|
|
|
|
); |
|
|
|
|
}), |
|
|
|
|
], |
|
|
|
|
) |
|
|
|
|
); |
|
|
|
|
)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Widget buildMessageItem(Message message) { |
|
|
|
@ -472,13 +525,15 @@ class _SystemMessagePage extends State<SystemMessagePage> {
|
|
|
|
|
SizedBox( |
|
|
|
|
width: 12.w, |
|
|
|
|
), |
|
|
|
|
Expanded(child:Column( |
|
|
|
|
Expanded( |
|
|
|
|
child: Column( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
Row( |
|
|
|
|
children: [ |
|
|
|
|
Expanded(child:Text( |
|
|
|
|
Expanded( |
|
|
|
|
child: Text( |
|
|
|
|
(message.typed == 1) |
|
|
|
|
? S.of(context).xitongtongzhi |
|
|
|
|
: (message.typed == 2) |
|
|
|
@ -499,20 +554,23 @@ class _SystemMessagePage extends State<SystemMessagePage> {
|
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
SizedBox(height:4.h,), |
|
|
|
|
(message.typed != 3) ? |
|
|
|
|
Row( |
|
|
|
|
SizedBox( |
|
|
|
|
height: 4.h, |
|
|
|
|
), |
|
|
|
|
(message.typed != 3) |
|
|
|
|
? Row( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center, |
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
Expanded(child: |
|
|
|
|
Text( |
|
|
|
|
Expanded( |
|
|
|
|
child: Text( |
|
|
|
|
S.of(context).ninyouyigexindedingdan, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 10.sp, |
|
|
|
|
color: Color(0xFF353535), |
|
|
|
|
), |
|
|
|
|
),), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
if (msgNumber["2"].toString() != "0") |
|
|
|
|
RoundButton( |
|
|
|
|
width: 16, |
|
|
|
@ -525,13 +583,13 @@ class _SystemMessagePage extends State<SystemMessagePage> {
|
|
|
|
|
radius: 100, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
): |
|
|
|
|
Row( |
|
|
|
|
) |
|
|
|
|
: Row( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center, |
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
Expanded(child: |
|
|
|
|
Text( |
|
|
|
|
Expanded( |
|
|
|
|
child: Text( |
|
|
|
|
message.content, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 10.sp, |
|
|
|
|