|
|
|
@ -9,6 +9,7 @@ import 'package:huixiang/utils/font_weight.dart';
|
|
|
|
|
import 'package:huixiang/view_widget/classic_header.dart'; |
|
|
|
|
import 'package:huixiang/view_widget/my_appbar.dart'; |
|
|
|
|
import 'package:huixiang/view_widget/my_footer.dart'; |
|
|
|
|
import 'package:huixiang/view_widget/no_data_view.dart'; |
|
|
|
|
import 'package:pull_to_refresh/pull_to_refresh.dart'; |
|
|
|
|
import 'package:shared_preferences/shared_preferences.dart'; |
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
|
@ -62,8 +63,7 @@ class _SystemMessagePage extends State<SystemMessagePage> {
|
|
|
|
|
messages.addAll(pageInfo.list.map((e) => Message.fromJson(e)).toList()); |
|
|
|
|
_refreshController.loadComplete(); |
|
|
|
|
_refreshController.refreshCompleted(); |
|
|
|
|
if (mounted) |
|
|
|
|
setState(() {}); |
|
|
|
|
if (mounted) setState(() {}); |
|
|
|
|
if (pageNum * 10 > int.tryParse(pageInfo.total)) { |
|
|
|
|
_refreshController.loadNoData(); |
|
|
|
|
} else { |
|
|
|
@ -77,7 +77,6 @@ class _SystemMessagePage extends State<SystemMessagePage> {
|
|
|
|
|
|
|
|
|
|
RefreshController _refreshController = RefreshController(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
Widget build(BuildContext context) { |
|
|
|
|
return Scaffold( |
|
|
|
@ -104,21 +103,28 @@ class _SystemMessagePage extends State<SystemMessagePage> {
|
|
|
|
|
onLoading: () { |
|
|
|
|
queryMessage(); |
|
|
|
|
}, |
|
|
|
|
child: ListView.builder( |
|
|
|
|
padding: EdgeInsets.only(top: 16), |
|
|
|
|
itemCount: messages.length, |
|
|
|
|
physics: NeverScrollableScrollPhysics(), |
|
|
|
|
itemBuilder: (context, position) { |
|
|
|
|
return GestureDetector( |
|
|
|
|
onTap: () { |
|
|
|
|
if (messages[position].typed == 2) { |
|
|
|
|
Navigator.of(context) |
|
|
|
|
.pushNamed('/router/exchange_order_details'); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
child: buildMessageItem(messages[position]), |
|
|
|
|
); |
|
|
|
|
}), |
|
|
|
|
child: (messages == null || messages.length == 0) |
|
|
|
|
? NoDataView( |
|
|
|
|
isShowBtn: false, |
|
|
|
|
text: S.of(context).haimeiyouxiaoxi, |
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
margin: EdgeInsets.only(top: 120.h), |
|
|
|
|
) |
|
|
|
|
: ListView.builder( |
|
|
|
|
padding: EdgeInsets.only(top: 16), |
|
|
|
|
itemCount: messages.length, |
|
|
|
|
physics: NeverScrollableScrollPhysics(), |
|
|
|
|
itemBuilder: (context, position) { |
|
|
|
|
return GestureDetector( |
|
|
|
|
onTap: () { |
|
|
|
|
if (messages[position].typed == 2) { |
|
|
|
|
Navigator.of(context) |
|
|
|
|
.pushNamed('/router/exchange_order_details'); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
child: buildMessageItem(messages[position]), |
|
|
|
|
); |
|
|
|
|
}), |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
@ -153,8 +159,8 @@ class _SystemMessagePage extends State<SystemMessagePage> {
|
|
|
|
|
(message.typed == 1) |
|
|
|
|
? "assets/image/icon_system_notices.png" |
|
|
|
|
: (message.typed == 2) |
|
|
|
|
? "assets/image/icon_system_order.png" |
|
|
|
|
: "assets/image/icon_system_recharge.png", |
|
|
|
|
? "assets/image/icon_system_order.png" |
|
|
|
|
: "assets/image/icon_system_recharge.png", |
|
|
|
|
width: 24.w, |
|
|
|
|
height: 24.h, |
|
|
|
|
), |
|
|
|
|