|
|
@ -1,8 +1,10 @@ |
|
|
|
import 'package:dio/dio.dart'; |
|
|
|
import 'package:dio/dio.dart'; |
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
|
|
|
|
import 'package:flutter_easyloading/flutter_easyloading.dart'; |
|
|
|
import 'package:huixiang/generated/l10n.dart'; |
|
|
|
import 'package:huixiang/generated/l10n.dart'; |
|
|
|
import 'package:huixiang/retrofit/data/base_data.dart'; |
|
|
|
import 'package:huixiang/retrofit/data/base_data.dart'; |
|
|
|
import 'package:huixiang/retrofit/data/message.dart'; |
|
|
|
import 'package:huixiang/retrofit/data/message.dart'; |
|
|
|
|
|
|
|
import 'package:huixiang/retrofit/data/msg_stats.dart'; |
|
|
|
import 'package:huixiang/retrofit/data/page.dart'; |
|
|
|
import 'package:huixiang/retrofit/data/page.dart'; |
|
|
|
import 'package:huixiang/retrofit/retrofit_api.dart'; |
|
|
|
import 'package:huixiang/retrofit/retrofit_api.dart'; |
|
|
|
import 'package:huixiang/utils/font_weight.dart'; |
|
|
|
import 'package:huixiang/utils/font_weight.dart'; |
|
|
@ -10,6 +12,7 @@ import 'package:huixiang/view_widget/classic_header.dart'; |
|
|
|
import 'package:huixiang/view_widget/my_appbar.dart'; |
|
|
|
import 'package:huixiang/view_widget/my_appbar.dart'; |
|
|
|
import 'package:huixiang/view_widget/my_footer.dart'; |
|
|
|
import 'package:huixiang/view_widget/my_footer.dart'; |
|
|
|
import 'package:huixiang/view_widget/no_data_view.dart'; |
|
|
|
import 'package:huixiang/view_widget/no_data_view.dart'; |
|
|
|
|
|
|
|
import 'package:huixiang/view_widget/round_button.dart'; |
|
|
|
import 'package:pull_to_refresh/pull_to_refresh.dart'; |
|
|
|
import 'package:pull_to_refresh/pull_to_refresh.dart'; |
|
|
|
import 'package:shared_preferences/shared_preferences.dart'; |
|
|
|
import 'package:shared_preferences/shared_preferences.dart'; |
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
@ -23,6 +26,18 @@ class SystemMessagePage extends StatefulWidget { |
|
|
|
|
|
|
|
|
|
|
|
class _SystemMessagePage extends State<SystemMessagePage> { |
|
|
|
class _SystemMessagePage extends State<SystemMessagePage> { |
|
|
|
ApiService apiService; |
|
|
|
ApiService apiService; |
|
|
|
|
|
|
|
int pageNum = 1; |
|
|
|
|
|
|
|
List<Message> messages = []; |
|
|
|
|
|
|
|
List<MsgStats> msgStats = []; |
|
|
|
|
|
|
|
Map <String,int> msgNumber = { |
|
|
|
|
|
|
|
"1":0, |
|
|
|
|
|
|
|
"2":0, |
|
|
|
|
|
|
|
"3":0, |
|
|
|
|
|
|
|
"4":0, |
|
|
|
|
|
|
|
"5":0, |
|
|
|
|
|
|
|
"6":0, |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
int state = 0; |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
void initState() { |
|
|
|
void initState() { |
|
|
@ -32,15 +47,14 @@ class _SystemMessagePage extends State<SystemMessagePage> { |
|
|
|
apiService = |
|
|
|
apiService = |
|
|
|
ApiService(Dio(), token: value.getString("token"), context: context); |
|
|
|
ApiService(Dio(), token: value.getString("token"), context: context); |
|
|
|
queryMessage(); |
|
|
|
queryMessage(); |
|
|
|
|
|
|
|
queryMsgStats(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int pageNum = 1; |
|
|
|
|
|
|
|
List<Message> messages = []; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_refresh() { |
|
|
|
_refresh() { |
|
|
|
pageNum = 1; |
|
|
|
pageNum = 1; |
|
|
|
queryMessage(); |
|
|
|
queryMessage(); |
|
|
|
|
|
|
|
queryMsgStats(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
queryMessage() async { |
|
|
|
queryMessage() async { |
|
|
@ -59,7 +73,13 @@ class _SystemMessagePage extends State<SystemMessagePage> { |
|
|
|
if (pageNum == 1) { |
|
|
|
if (pageNum == 1) { |
|
|
|
messages.clear(); |
|
|
|
messages.clear(); |
|
|
|
} |
|
|
|
} |
|
|
|
messages.addAll(baseData.data.list); |
|
|
|
List<Message> message = []; |
|
|
|
|
|
|
|
message.addAll(baseData.data.list); |
|
|
|
|
|
|
|
message.forEach((element) { |
|
|
|
|
|
|
|
if(element.typed==2 || element.typed==3){ |
|
|
|
|
|
|
|
messages.add(element); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
_refreshController.loadComplete(); |
|
|
|
_refreshController.loadComplete(); |
|
|
|
_refreshController.refreshCompleted(); |
|
|
|
_refreshController.refreshCompleted(); |
|
|
|
if (mounted) setState(() {}); |
|
|
|
if (mounted) setState(() {}); |
|
|
@ -74,17 +94,64 @@ class _SystemMessagePage extends State<SystemMessagePage> { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
queryMsgStats() async { |
|
|
|
|
|
|
|
if (apiService == null) { |
|
|
|
|
|
|
|
SharedPreferences value = await SharedPreferences.getInstance(); |
|
|
|
|
|
|
|
apiService = ApiService( |
|
|
|
|
|
|
|
Dio(), |
|
|
|
|
|
|
|
context: context, |
|
|
|
|
|
|
|
token: value.getString("token"), |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
BaseData<List<MsgStats>> baseData = await apiService.stats().catchError((onError) {}); |
|
|
|
|
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
|
|
|
|
setState(() { |
|
|
|
|
|
|
|
msgStats.clear(); |
|
|
|
|
|
|
|
msgStats = baseData.data; |
|
|
|
|
|
|
|
msgStats.forEach((element) { |
|
|
|
|
|
|
|
if(msgNumber.containsKey(element.name)){ |
|
|
|
|
|
|
|
msgNumber[element.name] = element.number; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
_refreshController.loadComplete(); |
|
|
|
|
|
|
|
_refreshController.refreshCompleted(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
EasyLoading.dismiss(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
RefreshController _refreshController = RefreshController(); |
|
|
|
RefreshController _refreshController = RefreshController(); |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
Widget build(BuildContext context) { |
|
|
|
Widget build(BuildContext context) { |
|
|
|
return Scaffold( |
|
|
|
return Scaffold( |
|
|
|
appBar: MyAppBar( |
|
|
|
appBar: MyAppBar( |
|
|
|
background: Color(0xFFF7F7F7), |
|
|
|
background: Colors.white, |
|
|
|
leadingColor: Colors.black, |
|
|
|
leadingColor: Colors.black, |
|
|
|
title: S.of(context).xitongxiaoxi, |
|
|
|
title: S.of(context).xiaoxi, |
|
|
|
titleSize: 18.sp, |
|
|
|
titleSize: 18.sp, |
|
|
|
titleColor: Colors.black, |
|
|
|
titleColor: Colors.black, |
|
|
|
|
|
|
|
actions: [ |
|
|
|
|
|
|
|
Container( |
|
|
|
|
|
|
|
margin: EdgeInsets.only(right: 16.w), |
|
|
|
|
|
|
|
alignment: Alignment.centerRight, |
|
|
|
|
|
|
|
child: GestureDetector( |
|
|
|
|
|
|
|
onTap: () { |
|
|
|
|
|
|
|
setState(() { |
|
|
|
|
|
|
|
queryMsgStats(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
child: Text( |
|
|
|
|
|
|
|
"标为已读", |
|
|
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
|
|
|
fontWeight:MyFontWeight.semi_bold, |
|
|
|
|
|
|
|
color: Color(0xFF353535), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
body: SmartRefresher( |
|
|
|
body: SmartRefresher( |
|
|
|
enablePullDown: true, |
|
|
|
enablePullDown: true, |
|
|
@ -94,79 +161,303 @@ class _SystemMessagePage extends State<SystemMessagePage> { |
|
|
|
footer: CustomFooter( |
|
|
|
footer: CustomFooter( |
|
|
|
loadStyle: LoadStyle.ShowWhenLoading, |
|
|
|
loadStyle: LoadStyle.ShowWhenLoading, |
|
|
|
builder: (BuildContext context, LoadStatus mode) { |
|
|
|
builder: (BuildContext context, LoadStatus mode) { |
|
|
|
return MyFooter(mode); |
|
|
|
return (messages.length == 0)?Container():MyFooter(mode); |
|
|
|
}, |
|
|
|
}, |
|
|
|
), |
|
|
|
), |
|
|
|
controller: _refreshController, |
|
|
|
controller: _refreshController, |
|
|
|
onRefresh: _refresh, |
|
|
|
onRefresh: _refresh, |
|
|
|
onLoading: () { |
|
|
|
onLoading: () { |
|
|
|
queryMessage(); |
|
|
|
setState(() { |
|
|
|
|
|
|
|
_refresh(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
child: Container( |
|
|
|
|
|
|
|
child: SingleChildScrollView( |
|
|
|
|
|
|
|
physics: BouncingScrollPhysics(), |
|
|
|
|
|
|
|
child: Container( |
|
|
|
|
|
|
|
child: Column( |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
newsSurvey(), |
|
|
|
|
|
|
|
SizedBox(height: 16.h,), |
|
|
|
|
|
|
|
buildMessage(), |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Widget newsSurvey(){ |
|
|
|
|
|
|
|
return Container( |
|
|
|
|
|
|
|
color: Colors.white, |
|
|
|
|
|
|
|
padding: EdgeInsets.only(top: 16.h,bottom: 16.h), |
|
|
|
|
|
|
|
child: Row( |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
Expanded(child: GestureDetector( |
|
|
|
|
|
|
|
onTap: (){ |
|
|
|
|
|
|
|
Navigator.of(context) |
|
|
|
|
|
|
|
.pushNamed('/router/system_details',arguments: {"msgType":5}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
child: (messages == null || messages.length == 0) |
|
|
|
child:Column( |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
Stack( |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
Image.asset( |
|
|
|
|
|
|
|
"assets/image/icon_z.png", |
|
|
|
|
|
|
|
width: 40, |
|
|
|
|
|
|
|
height: 40, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
if(msgNumber["5"].toString() != "0") |
|
|
|
|
|
|
|
Container( |
|
|
|
|
|
|
|
width:48, |
|
|
|
|
|
|
|
alignment: Alignment.topRight, |
|
|
|
|
|
|
|
child:Container( |
|
|
|
|
|
|
|
width:20, |
|
|
|
|
|
|
|
height:17, |
|
|
|
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(100), |
|
|
|
|
|
|
|
border: Border.all( |
|
|
|
|
|
|
|
width: 1, |
|
|
|
|
|
|
|
color: Colors.white, |
|
|
|
|
|
|
|
style: BorderStyle.solid, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
color:Color(0xFFFF441A), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
child:RoundButton( |
|
|
|
|
|
|
|
text:msgNumber["5"].toString(), |
|
|
|
|
|
|
|
textColor: Colors.white, |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
|
|
|
backgroup: Color(0xFFFF441A), |
|
|
|
|
|
|
|
fontSize:8.sp, |
|
|
|
|
|
|
|
radius: 100, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
SizedBox(height: 6.h), |
|
|
|
|
|
|
|
Text( |
|
|
|
|
|
|
|
"点赞", |
|
|
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
|
|
|
fontWeight:MyFontWeight.medium, |
|
|
|
|
|
|
|
color: Color(0xFF060606), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
Expanded(child: |
|
|
|
|
|
|
|
GestureDetector( |
|
|
|
|
|
|
|
onTap: (){ |
|
|
|
|
|
|
|
Navigator.of(context) |
|
|
|
|
|
|
|
.pushNamed('/router/system_details',arguments: {"msgType":6}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
child: Column( |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
Stack( |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
Image.asset( |
|
|
|
|
|
|
|
"assets/image/icon_pl.png", |
|
|
|
|
|
|
|
width: 40, |
|
|
|
|
|
|
|
height: 40, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
if(msgNumber["6"].toString() != "0") |
|
|
|
|
|
|
|
Container( |
|
|
|
|
|
|
|
width:48, |
|
|
|
|
|
|
|
alignment: Alignment.topRight, |
|
|
|
|
|
|
|
child:Container( |
|
|
|
|
|
|
|
width:16, |
|
|
|
|
|
|
|
height:16, |
|
|
|
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(100), |
|
|
|
|
|
|
|
border: Border.all( |
|
|
|
|
|
|
|
width: 1, |
|
|
|
|
|
|
|
color: Colors.white, |
|
|
|
|
|
|
|
style: BorderStyle.solid, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
color:Color(0xFFFF441A), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
child:RoundButton( |
|
|
|
|
|
|
|
text: msgNumber["6"].toString(), |
|
|
|
|
|
|
|
textColor: Colors.white, |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
|
|
|
backgroup: Color(0xFFFF441A), |
|
|
|
|
|
|
|
fontSize:8.sp, |
|
|
|
|
|
|
|
radius: 100, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
SizedBox(height: 6.h), |
|
|
|
|
|
|
|
Text( |
|
|
|
|
|
|
|
S.of(context).pinglun, |
|
|
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
|
|
|
fontWeight:MyFontWeight.medium, |
|
|
|
|
|
|
|
color: Color(0xFF060606), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
)), |
|
|
|
|
|
|
|
Expanded(child: |
|
|
|
|
|
|
|
GestureDetector( |
|
|
|
|
|
|
|
onTap: (){ |
|
|
|
|
|
|
|
Navigator.of(context) |
|
|
|
|
|
|
|
.pushNamed('/router/system_details',arguments: {"msgType":4}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
child:Column( |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
Stack( |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
Image.asset( |
|
|
|
|
|
|
|
"assets/image/icon_gz.png", |
|
|
|
|
|
|
|
width: 40, |
|
|
|
|
|
|
|
height: 40, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
if(msgNumber["4"].toString() != "0") |
|
|
|
|
|
|
|
Container( |
|
|
|
|
|
|
|
width:48, |
|
|
|
|
|
|
|
alignment: Alignment.topRight, |
|
|
|
|
|
|
|
child:Container( |
|
|
|
|
|
|
|
width:16, |
|
|
|
|
|
|
|
height:16, |
|
|
|
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(100), |
|
|
|
|
|
|
|
border: Border.all( |
|
|
|
|
|
|
|
width: 1, |
|
|
|
|
|
|
|
color: Colors.white, |
|
|
|
|
|
|
|
style: BorderStyle.solid, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
color:Color(0xFFFF441A), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
child:RoundButton( |
|
|
|
|
|
|
|
text: msgNumber["4"].toString(), |
|
|
|
|
|
|
|
textColor: Colors.white, |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
|
|
|
backgroup: Color(0xFFFF441A), |
|
|
|
|
|
|
|
fontSize:8.sp, |
|
|
|
|
|
|
|
radius: 100, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
SizedBox(height: 6.h), |
|
|
|
|
|
|
|
Text( |
|
|
|
|
|
|
|
S.of(context).guanzhu, |
|
|
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
|
|
|
fontWeight:MyFontWeight.medium, |
|
|
|
|
|
|
|
color: Color(0xFF060606), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Widget buildMessage(){ |
|
|
|
|
|
|
|
return Container( |
|
|
|
|
|
|
|
color: Colors.white, |
|
|
|
|
|
|
|
width: double.infinity, |
|
|
|
|
|
|
|
padding: EdgeInsets.all(20.w), |
|
|
|
|
|
|
|
child:Column( |
|
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceAround, |
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
Text( |
|
|
|
|
|
|
|
S.of(context).xitongxiaoxi, |
|
|
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
|
|
|
fontWeight:MyFontWeight.semi_bold, |
|
|
|
|
|
|
|
color: Colors.black, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
(messages == null || messages.length == 0) |
|
|
|
? NoDataView( |
|
|
|
? NoDataView( |
|
|
|
isShowBtn: false, |
|
|
|
isShowBtn: false, |
|
|
|
text: S.of(context).haimeiyouxiaoxi, |
|
|
|
text: S.of(context).haimeiyouxiaoxi, |
|
|
|
fontSize: 16.sp, |
|
|
|
fontSize: 16.sp, |
|
|
|
margin: EdgeInsets.only(top: 120.h), |
|
|
|
margin: EdgeInsets.only(top: 120.h), |
|
|
|
) |
|
|
|
) |
|
|
|
: ListView.builder( |
|
|
|
:ListView.builder( |
|
|
|
padding: EdgeInsets.only(top: 16), |
|
|
|
padding: EdgeInsets.only(top: 16), |
|
|
|
itemCount: messages.length, |
|
|
|
itemCount: messages.length, |
|
|
|
|
|
|
|
shrinkWrap: true, |
|
|
|
physics: NeverScrollableScrollPhysics(), |
|
|
|
physics: NeverScrollableScrollPhysics(), |
|
|
|
itemBuilder: (context, position) { |
|
|
|
itemBuilder: (context, position) { |
|
|
|
return GestureDetector( |
|
|
|
return GestureDetector( |
|
|
|
onTap: () { |
|
|
|
onTap: () { |
|
|
|
if (messages[position].typed == 2) { |
|
|
|
if(messages[position].typed == 2) |
|
|
|
Navigator.of(context) |
|
|
|
Navigator.of(context) |
|
|
|
.pushNamed('/router/exchange_order_details'); |
|
|
|
.pushNamed('/router/system_details',arguments: {"msgType":2}); |
|
|
|
} |
|
|
|
else if(messages[position].typed == 3) |
|
|
|
|
|
|
|
Navigator.of(context) |
|
|
|
|
|
|
|
.pushNamed('/router/system_details',arguments: {"msgType":3}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
child: buildMessageItem(messages[position]), |
|
|
|
child: buildMessageItem(messages[position]), |
|
|
|
); |
|
|
|
); |
|
|
|
}), |
|
|
|
}), |
|
|
|
), |
|
|
|
], |
|
|
|
|
|
|
|
) |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Widget buildMessageItem(Message message) { |
|
|
|
Widget buildMessageItem(Message message) { |
|
|
|
return Container( |
|
|
|
return Container( |
|
|
|
margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 8.h, bottom: 8.h), |
|
|
|
margin: EdgeInsets.only(top: 8.h, bottom: 8.h), |
|
|
|
padding: EdgeInsets.all(20.w), |
|
|
|
// margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 8.h, bottom: 8.h), |
|
|
|
decoration: BoxDecoration( |
|
|
|
// padding: EdgeInsets.all(20.w), |
|
|
|
color: Colors.white, |
|
|
|
// decoration: BoxDecoration( |
|
|
|
boxShadow: [ |
|
|
|
// color: Colors.white, |
|
|
|
BoxShadow( |
|
|
|
// boxShadow: [ |
|
|
|
color: Colors.black.withAlpha(12), |
|
|
|
// BoxShadow( |
|
|
|
offset: Offset(0, 3), |
|
|
|
// color: Colors.black.withAlpha(12), |
|
|
|
blurRadius: 14, |
|
|
|
// offset: Offset(0, 3), |
|
|
|
spreadRadius: 0, |
|
|
|
// blurRadius: 14, |
|
|
|
) |
|
|
|
// spreadRadius: 0, |
|
|
|
], |
|
|
|
// ) |
|
|
|
borderRadius: BorderRadius.circular(8), |
|
|
|
// ], |
|
|
|
), |
|
|
|
// borderRadius: BorderRadius.circular(8), |
|
|
|
|
|
|
|
// ), |
|
|
|
child: Column( |
|
|
|
child: Column( |
|
|
|
mainAxisAlignment: MainAxisAlignment.center, |
|
|
|
mainAxisAlignment: MainAxisAlignment.center, |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
children: [ |
|
|
|
children: [ |
|
|
|
Row( |
|
|
|
Row( |
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
children: [ |
|
|
|
|
|
|
|
Row( |
|
|
|
|
|
|
|
children: [ |
|
|
|
children: [ |
|
|
|
Image.asset( |
|
|
|
Image.asset( |
|
|
|
(message.typed == 1) |
|
|
|
(message.typed == 1) |
|
|
|
? "assets/image/icon_system_notices.png" |
|
|
|
? "assets/image/icon_system_message.png" |
|
|
|
: (message.typed == 2) |
|
|
|
: (message.typed == 2) |
|
|
|
? "assets/image/icon_system_order.png" |
|
|
|
? "assets/image/icon_system_message.png" |
|
|
|
: "assets/image/icon_system_recharge.png", |
|
|
|
: "assets/image/c_z.png", |
|
|
|
width: 24.w, |
|
|
|
width: 40.w, |
|
|
|
height: 24.h, |
|
|
|
height: 40.h, |
|
|
|
), |
|
|
|
), |
|
|
|
SizedBox( |
|
|
|
SizedBox( |
|
|
|
width: 4.w, |
|
|
|
width:12.w, |
|
|
|
), |
|
|
|
), |
|
|
|
Text( |
|
|
|
Expanded(child:Column( |
|
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
Row( |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
Expanded(child:Text( |
|
|
|
(message.typed == 1) |
|
|
|
(message.typed == 1) |
|
|
|
? S.of(context).xitongtongzhi |
|
|
|
? S.of(context).xitongtongzhi |
|
|
|
: (message.typed == 2) |
|
|
|
: (message.typed == 2) |
|
|
@ -174,12 +465,10 @@ class _SystemMessagePage extends State<SystemMessagePage> { |
|
|
|
: S.of(context).chongzhixiaoxi, |
|
|
|
: S.of(context).chongzhixiaoxi, |
|
|
|
style: TextStyle( |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 14.sp, |
|
|
|
fontSize: 14.sp, |
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
color: Color(0xFF060606), |
|
|
|
color: Color(0xFF060606), |
|
|
|
), |
|
|
|
), |
|
|
|
) |
|
|
|
)), |
|
|
|
], |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
Text( |
|
|
|
Text( |
|
|
|
message.updateTime, |
|
|
|
message.updateTime, |
|
|
|
style: TextStyle( |
|
|
|
style: TextStyle( |
|
|
@ -189,64 +478,173 @@ class _SystemMessagePage extends State<SystemMessagePage> { |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
if (message.typed != 3) |
|
|
|
SizedBox(height:4.h,), |
|
|
|
Container( |
|
|
|
(message.typed != 3) ? |
|
|
|
margin: EdgeInsets.only(left: 28.w, top: 12.h), |
|
|
|
Row( |
|
|
|
child: Text( |
|
|
|
mainAxisAlignment: MainAxisAlignment.center, |
|
|
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
Expanded(child: |
|
|
|
|
|
|
|
Text( |
|
|
|
S.of(context).ninyouyigexindedingdan, |
|
|
|
S.of(context).ninyouyigexindedingdan, |
|
|
|
style: TextStyle( |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 10.sp, |
|
|
|
fontSize: 10.sp, |
|
|
|
color: Color(0xFF353535), |
|
|
|
color: Color(0xFF353535), |
|
|
|
), |
|
|
|
), |
|
|
|
|
|
|
|
),), |
|
|
|
|
|
|
|
if(msgNumber["2"].toString() != "0") |
|
|
|
|
|
|
|
RoundButton( |
|
|
|
|
|
|
|
width: 16, |
|
|
|
|
|
|
|
height: 16, |
|
|
|
|
|
|
|
text:msgNumber["2"].toString(), |
|
|
|
|
|
|
|
textColor: Colors.white, |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
|
|
|
backgroup: Color(0xFFFF441A), |
|
|
|
|
|
|
|
fontSize:10.sp, |
|
|
|
|
|
|
|
radius: 100, |
|
|
|
), |
|
|
|
), |
|
|
|
) |
|
|
|
], |
|
|
|
else |
|
|
|
): |
|
|
|
Container( |
|
|
|
Row( |
|
|
|
margin: EdgeInsets.only(left: 28.w, top: 18.h), |
|
|
|
mainAxisAlignment: MainAxisAlignment.center, |
|
|
|
child: Text( |
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
message.title, |
|
|
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
|
|
fontSize: 20.sp, |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
|
|
|
|
color: Color(0xFF353535), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
if (message.typed != 3) |
|
|
|
|
|
|
|
Container( |
|
|
|
|
|
|
|
margin: EdgeInsets.only(left: 28.w, top: 22.h), |
|
|
|
|
|
|
|
child: Row( |
|
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
|
|
|
|
|
children: [ |
|
|
|
children: [ |
|
|
|
|
|
|
|
Expanded(child: |
|
|
|
Text( |
|
|
|
Text( |
|
|
|
S.of(context).chakangengduo, |
|
|
|
message.content, |
|
|
|
style: TextStyle( |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 12.sp, |
|
|
|
fontSize: 10.sp, |
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
|
|
|
|
color: Color(0xFF353535), |
|
|
|
color: Color(0xFF353535), |
|
|
|
), |
|
|
|
), |
|
|
|
|
|
|
|
)), |
|
|
|
|
|
|
|
if(msgNumber["3"].toString() != "0") |
|
|
|
|
|
|
|
RoundButton( |
|
|
|
|
|
|
|
width: 16, |
|
|
|
|
|
|
|
height: 16, |
|
|
|
|
|
|
|
text:msgNumber["3"].toString(), |
|
|
|
|
|
|
|
textColor: Colors.white, |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
|
|
|
backgroup: Color(0xFFFF441A), |
|
|
|
|
|
|
|
fontSize:10.sp, |
|
|
|
|
|
|
|
radius: 100, |
|
|
|
), |
|
|
|
), |
|
|
|
Icon( |
|
|
|
|
|
|
|
Icons.keyboard_arrow_right, |
|
|
|
|
|
|
|
color: Colors.black, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
) |
|
|
|
], |
|
|
|
else |
|
|
|
)), |
|
|
|
Container( |
|
|
|
], |
|
|
|
margin: EdgeInsets.only(left: 28.w, top: 22.h), |
|
|
|
|
|
|
|
child: Text( |
|
|
|
|
|
|
|
message.content, |
|
|
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
|
|
fontSize: 10.sp, |
|
|
|
|
|
|
|
color: Color(0xFF353535), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
), |
|
|
|
|
|
|
|
Container( |
|
|
|
|
|
|
|
margin: EdgeInsets.only(top: 16.h,bottom:8.h), |
|
|
|
|
|
|
|
height: 1.h, |
|
|
|
|
|
|
|
width: double.infinity, |
|
|
|
|
|
|
|
color: Color(0xFFF7F7F7), |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
|
|
|
|
// Column( |
|
|
|
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.center, |
|
|
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
|
|
|
// children: [ |
|
|
|
|
|
|
|
// Row( |
|
|
|
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.center, |
|
|
|
|
|
|
|
// children: [ |
|
|
|
|
|
|
|
// Row( |
|
|
|
|
|
|
|
// children: [ |
|
|
|
|
|
|
|
// Image.asset( |
|
|
|
|
|
|
|
// (message.typed == 1) |
|
|
|
|
|
|
|
// ? "assets/image/icon_system_notices.png" |
|
|
|
|
|
|
|
// : (message.typed == 2) |
|
|
|
|
|
|
|
// ? "assets/image/icon_system_order.png" |
|
|
|
|
|
|
|
// : "assets/image/icon_system_recharge.png", |
|
|
|
|
|
|
|
// width: 24.w, |
|
|
|
|
|
|
|
// height: 24.h, |
|
|
|
|
|
|
|
// ), |
|
|
|
|
|
|
|
// SizedBox( |
|
|
|
|
|
|
|
// width: 4.w, |
|
|
|
|
|
|
|
// ), |
|
|
|
|
|
|
|
// Text( |
|
|
|
|
|
|
|
// (message.typed == 1) |
|
|
|
|
|
|
|
// ? S.of(context).xitongtongzhi |
|
|
|
|
|
|
|
// : (message.typed == 2) |
|
|
|
|
|
|
|
// ? S.of(context).dingdanxiaoxi |
|
|
|
|
|
|
|
// : S.of(context).chongzhixiaoxi, |
|
|
|
|
|
|
|
// style: TextStyle( |
|
|
|
|
|
|
|
// fontSize: 14.sp, |
|
|
|
|
|
|
|
// fontWeight: FontWeight.bold, |
|
|
|
|
|
|
|
// color: Color(0xFF060606), |
|
|
|
|
|
|
|
// ), |
|
|
|
|
|
|
|
// ) |
|
|
|
|
|
|
|
// ], |
|
|
|
|
|
|
|
// ), |
|
|
|
|
|
|
|
// Text( |
|
|
|
|
|
|
|
// message.updateTime, |
|
|
|
|
|
|
|
// style: TextStyle( |
|
|
|
|
|
|
|
// fontSize: 10.sp, |
|
|
|
|
|
|
|
// color: Color(0xFFA29E9E), |
|
|
|
|
|
|
|
// ), |
|
|
|
|
|
|
|
// ), |
|
|
|
|
|
|
|
// ], |
|
|
|
|
|
|
|
// ), |
|
|
|
|
|
|
|
// if (message.typed != 3) |
|
|
|
|
|
|
|
// Container( |
|
|
|
|
|
|
|
// margin: EdgeInsets.only(left: 28.w, top: 12.h), |
|
|
|
|
|
|
|
// child: Text( |
|
|
|
|
|
|
|
// S.of(context).ninyouyigexindedingdan, |
|
|
|
|
|
|
|
// style: TextStyle( |
|
|
|
|
|
|
|
// fontSize: 10.sp, |
|
|
|
|
|
|
|
// color: Color(0xFF353535), |
|
|
|
|
|
|
|
// ), |
|
|
|
|
|
|
|
// ), |
|
|
|
|
|
|
|
// ) |
|
|
|
|
|
|
|
// else |
|
|
|
|
|
|
|
// Container( |
|
|
|
|
|
|
|
// margin: EdgeInsets.only(left: 28.w, top: 18.h), |
|
|
|
|
|
|
|
// child: Text( |
|
|
|
|
|
|
|
// message.title, |
|
|
|
|
|
|
|
// style: TextStyle( |
|
|
|
|
|
|
|
// fontSize: 20.sp, |
|
|
|
|
|
|
|
// fontWeight: MyFontWeight.semi_bold, |
|
|
|
|
|
|
|
// color: Color(0xFF353535), |
|
|
|
|
|
|
|
// ), |
|
|
|
|
|
|
|
// ), |
|
|
|
|
|
|
|
// ), |
|
|
|
|
|
|
|
// if (message.typed != 3) |
|
|
|
|
|
|
|
// Container( |
|
|
|
|
|
|
|
// margin: EdgeInsets.only(left: 28.w, top: 22.h), |
|
|
|
|
|
|
|
// child: Row( |
|
|
|
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.center, |
|
|
|
|
|
|
|
// children: [ |
|
|
|
|
|
|
|
// Text( |
|
|
|
|
|
|
|
// S.of(context).chakangengduo, |
|
|
|
|
|
|
|
// style: TextStyle( |
|
|
|
|
|
|
|
// fontSize: 12.sp, |
|
|
|
|
|
|
|
// fontWeight: FontWeight.bold, |
|
|
|
|
|
|
|
// color: Color(0xFF353535), |
|
|
|
|
|
|
|
// ), |
|
|
|
|
|
|
|
// ), |
|
|
|
|
|
|
|
// Icon( |
|
|
|
|
|
|
|
// Icons.keyboard_arrow_right, |
|
|
|
|
|
|
|
// color: Colors.black, |
|
|
|
|
|
|
|
// ) |
|
|
|
|
|
|
|
// ], |
|
|
|
|
|
|
|
// ), |
|
|
|
|
|
|
|
// ) |
|
|
|
|
|
|
|
// else |
|
|
|
|
|
|
|
// Container( |
|
|
|
|
|
|
|
// margin: EdgeInsets.only(left: 28.w, top: 22.h), |
|
|
|
|
|
|
|
// child: Text( |
|
|
|
|
|
|
|
// message.content, |
|
|
|
|
|
|
|
// style: TextStyle( |
|
|
|
|
|
|
|
// fontSize: 10.sp, |
|
|
|
|
|
|
|
// color: Color(0xFF353535), |
|
|
|
|
|
|
|
// ), |
|
|
|
|
|
|
|
// ), |
|
|
|
|
|
|
|
// ), |
|
|
|
|
|
|
|
// ], |
|
|
|
|
|
|
|
// ), |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|