|
|
|
@ -20,8 +20,12 @@ import 'package:huixiang/view_widget/round_button.dart';
|
|
|
|
|
import 'package:pull_to_refresh/pull_to_refresh.dart'; |
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
|
|
import 'package:shared_preferences/shared_preferences.dart'; |
|
|
|
|
import 'package:shared_preferences/shared_preferences.dart'; |
|
|
|
|
|
|
|
|
|
class BargainGroupOrder extends StatefulWidget { |
|
|
|
|
final Map<String, dynamic> arguments; |
|
|
|
|
|
|
|
|
|
BargainGroupOrder({this.arguments}); |
|
|
|
|
@override |
|
|
|
|
State<StatefulWidget> createState() { |
|
|
|
|
return _BargainGroupOrder(); |
|
|
|
@ -33,10 +37,12 @@ class _BargainGroupOrder extends State<BargainGroupOrder>
|
|
|
|
|
List<Widget> tabs; |
|
|
|
|
List<Widget> _pages; |
|
|
|
|
TabController tabcontroller; |
|
|
|
|
int type = 0; |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
void initState() { |
|
|
|
|
super.initState(); |
|
|
|
|
type = widget.arguments["type"]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
///查看我的拼团、砍价、列表 |
|
|
|
@ -62,10 +68,10 @@ class _BargainGroupOrder extends State<BargainGroupOrder>
|
|
|
|
|
) |
|
|
|
|
]; |
|
|
|
|
_pages = [ |
|
|
|
|
ExchangeHistoryList(0), |
|
|
|
|
ExchangeHistoryList(1), |
|
|
|
|
ExchangeHistoryList(2), |
|
|
|
|
ExchangeHistoryList(3) |
|
|
|
|
ExchangeHistoryList(0,type), |
|
|
|
|
ExchangeHistoryList(2,type), |
|
|
|
|
ExchangeHistoryList(3,type), |
|
|
|
|
ExchangeHistoryList(4,type) |
|
|
|
|
]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -75,7 +81,7 @@ class _BargainGroupOrder extends State<BargainGroupOrder>
|
|
|
|
|
length: 4, |
|
|
|
|
child: Scaffold( |
|
|
|
|
appBar: MyAppBar( |
|
|
|
|
title: S.of(context).wodekanjia, |
|
|
|
|
title:type == 1 ? S.of(context).wodepintuan :S.of(context).wodekanjia, |
|
|
|
|
titleColor: Colors.black, |
|
|
|
|
titleSize: 18.sp, |
|
|
|
|
background: Color(0xFFFFFFFF), |
|
|
|
@ -113,8 +119,9 @@ class _BargainGroupOrder extends State<BargainGroupOrder>
|
|
|
|
|
|
|
|
|
|
class ExchangeHistoryList extends StatefulWidget { |
|
|
|
|
final int orderStatus; |
|
|
|
|
final int type; |
|
|
|
|
|
|
|
|
|
ExchangeHistoryList(this.orderStatus); |
|
|
|
|
ExchangeHistoryList(this.orderStatus,this.type); |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
State<StatefulWidget> createState() { |
|
|
|
@ -150,7 +157,7 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> {
|
|
|
|
|
BaseData<List<ActivityOrderList>> baseData = |
|
|
|
|
await minService.showMyActList({ |
|
|
|
|
"state":0, |
|
|
|
|
"type" :1, |
|
|
|
|
"type" :widget.type, |
|
|
|
|
}).catchError((error) { |
|
|
|
|
_refreshController.loadFailed(); |
|
|
|
|
_refreshController.refreshFailed(); |
|
|
|
@ -164,19 +171,18 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> {
|
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
_refreshController.refreshFailed(); |
|
|
|
|
_refreshController.loadFailed(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// int pageNum = 1; |
|
|
|
|
|
|
|
|
|
_refresh() { |
|
|
|
|
// pageNum = 1; |
|
|
|
|
queryShowMyActList(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
Widget build(BuildContext context) { |
|
|
|
|
return SmartRefresher( |
|
|
|
|
return Container( |
|
|
|
|
child: SmartRefresher( |
|
|
|
|
enablePullDown: true, |
|
|
|
|
enablePullUp: true, |
|
|
|
|
header: MyHeader(), |
|
|
|
@ -187,9 +193,7 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> {
|
|
|
|
|
), |
|
|
|
|
controller: _refreshController, |
|
|
|
|
onRefresh: _refresh, |
|
|
|
|
onLoading: queryShowMyActList, |
|
|
|
|
child: |
|
|
|
|
(activityOrderList?.length ?? 0) < 0 |
|
|
|
|
child: (activityOrderList?.length ?? 0) < 0 |
|
|
|
|
? NoDataView( |
|
|
|
|
isShowBtn: false, |
|
|
|
|
text: "还没有订单,快去下一单吧~", |
|
|
|
@ -199,10 +203,13 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> {
|
|
|
|
|
: |
|
|
|
|
ListView.builder( |
|
|
|
|
itemCount: activityOrderList?.length ?? 0, |
|
|
|
|
shrinkWrap: true, |
|
|
|
|
physics: NeverScrollableScrollPhysics(), |
|
|
|
|
itemBuilder: (context, position) { |
|
|
|
|
return bargainOrder(activityOrderList[position]); |
|
|
|
|
}, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|