|
|
@ -126,7 +126,8 @@ class ExchangeHistoryList extends StatefulWidget { |
|
|
|
class _ExchangeHistoryList extends State<ExchangeHistoryList> |
|
|
|
class _ExchangeHistoryList extends State<ExchangeHistoryList> |
|
|
|
with AutomaticKeepAliveClientMixin { |
|
|
|
with AutomaticKeepAliveClientMixin { |
|
|
|
ApiService apiService; |
|
|
|
ApiService apiService; |
|
|
|
RefreshController _refreshController = RefreshController(initialRefresh: false); |
|
|
|
RefreshController _refreshController = |
|
|
|
|
|
|
|
RefreshController(initialRefresh: false); |
|
|
|
int pageNum = 1; |
|
|
|
int pageNum = 1; |
|
|
|
List<ExchangeOrder> orders = []; |
|
|
|
List<ExchangeOrder> orders = []; |
|
|
|
|
|
|
|
|
|
|
@ -136,15 +137,18 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> |
|
|
|
SharedPreferences.getInstance().then((value) => { |
|
|
|
SharedPreferences.getInstance().then((value) => { |
|
|
|
apiService = ApiService(Dio(), |
|
|
|
apiService = ApiService(Dio(), |
|
|
|
showLoading: false, |
|
|
|
showLoading: false, |
|
|
|
context: context, token: value.getString('token')), |
|
|
|
context: context, |
|
|
|
|
|
|
|
token: value.getString('token')), |
|
|
|
queryHistory(), |
|
|
|
queryHistory(), |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
queryHistory({isLoading = true}) async { |
|
|
|
queryHistory({bool isLoading = true}) async { |
|
|
|
try { |
|
|
|
try { |
|
|
|
if (isLoading) |
|
|
|
if (isLoading) |
|
|
|
EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black); |
|
|
|
EasyLoading.show( |
|
|
|
|
|
|
|
status: S.current.zhengzaijiazai, |
|
|
|
|
|
|
|
maskType: EasyLoadingMaskType.black); |
|
|
|
var map = { |
|
|
|
var map = { |
|
|
|
"pageNum": pageNum, |
|
|
|
"pageNum": pageNum, |
|
|
|
"pageSize": 10, |
|
|
|
"pageSize": 10, |
|
|
@ -173,7 +177,8 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
_refreshController.refreshFailed(); |
|
|
|
_refreshController.refreshFailed(); |
|
|
|
_refreshController.loadFailed(); |
|
|
|
_refreshController.loadFailed(); |
|
|
|
}}finally{ |
|
|
|
} |
|
|
|
|
|
|
|
} finally { |
|
|
|
EasyLoading.dismiss(); |
|
|
|
EasyLoading.dismiss(); |
|
|
|
setState(() {}); |
|
|
|
setState(() {}); |
|
|
|
} |
|
|
|
} |
|
|
@ -197,7 +202,9 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> |
|
|
|
), |
|
|
|
), |
|
|
|
controller: _refreshController, |
|
|
|
controller: _refreshController, |
|
|
|
onRefresh: _refresh, |
|
|
|
onRefresh: _refresh, |
|
|
|
onLoading: queryHistory, |
|
|
|
onLoading: () { |
|
|
|
|
|
|
|
queryHistory(isLoading: false); |
|
|
|
|
|
|
|
}, |
|
|
|
child: orders == null || orders.length == 0 |
|
|
|
child: orders == null || orders.length == 0 |
|
|
|
? NoDataView( |
|
|
|
? NoDataView( |
|
|
|
src: "assets/image/ding_dan.webp", |
|
|
|
src: "assets/image/ding_dan.webp", |
|
|
@ -261,10 +268,15 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
Text( |
|
|
|
Text( |
|
|
|
exchangeOrder.payStatus != 1 ? "未支付": |
|
|
|
exchangeOrder.payStatus != 1 |
|
|
|
((exchangeOrder.useTyped ==1)?((exchangeOrder.sendStatus==3 || exchangeOrder.sendStatus == 9)?"已自提":"待提货") |
|
|
|
? "未支付" |
|
|
|
:(exchangeOrder.useTyped == 2 ?((exchangeOrder.sendStatus==1)?"待发货" |
|
|
|
: ((exchangeOrder.useTyped == 1) |
|
|
|
:"已发货") |
|
|
|
? ((exchangeOrder.sendStatus == 3 || |
|
|
|
|
|
|
|
exchangeOrder.sendStatus == 9) |
|
|
|
|
|
|
|
? "已自提" |
|
|
|
|
|
|
|
: "待提货") |
|
|
|
|
|
|
|
: (exchangeOrder.useTyped == 2 |
|
|
|
|
|
|
|
? ((exchangeOrder.sendStatus == 1) ? "待发货" : "已发货") |
|
|
|
: orderStatus(exchangeOrder.state))), |
|
|
|
: orderStatus(exchangeOrder.state))), |
|
|
|
style: TextStyle( |
|
|
|
style: TextStyle( |
|
|
|
color: Color(0xFFFE951E), |
|
|
|
color: Color(0xFFFE951E), |
|
|
@ -277,8 +289,8 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> |
|
|
|
SizedBox( |
|
|
|
SizedBox( |
|
|
|
height: 16.h, |
|
|
|
height: 16.h, |
|
|
|
), |
|
|
|
), |
|
|
|
exchangeOrder.useTyped == 1 ? |
|
|
|
exchangeOrder.useTyped == 1 |
|
|
|
Container( |
|
|
|
? Container( |
|
|
|
child: Column( |
|
|
|
child: Column( |
|
|
|
children: [ |
|
|
|
children: [ |
|
|
|
Row( |
|
|
|
Row( |
|
|
@ -368,8 +380,8 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
): |
|
|
|
) |
|
|
|
Row( |
|
|
|
: Row( |
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
children: [ |
|
|
|
children: [ |
|
|
@ -480,9 +492,13 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> |
|
|
|
Text( |
|
|
|
Text( |
|
|
|
exchangeOrder?.amount == null || exchangeOrder.amount == "0" |
|
|
|
exchangeOrder?.amount == null || exchangeOrder.amount == "0" |
|
|
|
? "" |
|
|
|
? "" |
|
|
|
: exchangeOrder.payType == 2 ? "实付印章 ${exchangeOrder.amount}印章":(S.of(context).shifujifen(exchangeOrder.amount) + |
|
|
|
: exchangeOrder.payType == 2 |
|
|
|
( exchangeOrder?.creditOrderDetailList[0]?.money == null || |
|
|
|
? "实付印章 ${exchangeOrder.amount}印章" |
|
|
|
exchangeOrder?.creditOrderDetailList[0]?.money == |
|
|
|
: (S.of(context).shifujifen(exchangeOrder.amount) + |
|
|
|
|
|
|
|
(exchangeOrder?.creditOrderDetailList[0]?.money == |
|
|
|
|
|
|
|
null || |
|
|
|
|
|
|
|
exchangeOrder |
|
|
|
|
|
|
|
?.creditOrderDetailList[0]?.money == |
|
|
|
"0.00" |
|
|
|
"0.00" |
|
|
|
? "" |
|
|
|
? "" |
|
|
|
: " + ${double.parse(exchangeOrder?.creditOrderDetailList[0]?.money.toString()) * exchangeOrder?.creditOrderDetailList[0].goodsNumber}元")), |
|
|
|
: " + ${double.parse(exchangeOrder?.creditOrderDetailList[0]?.money.toString()) * exchangeOrder?.creditOrderDetailList[0].goodsNumber}元")), |
|
|
@ -512,8 +528,8 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
if (exchangeOrder.useTyped != 3) |
|
|
|
if (exchangeOrder.useTyped != 3) |
|
|
|
(exchangeOrder.useTyped == 1 ? |
|
|
|
(exchangeOrder.useTyped == 1 |
|
|
|
GestureDetector( |
|
|
|
? GestureDetector( |
|
|
|
behavior: HitTestBehavior.opaque, |
|
|
|
behavior: HitTestBehavior.opaque, |
|
|
|
onTap: () { |
|
|
|
onTap: () { |
|
|
|
// if (exchangeOrder.state == 1) { |
|
|
|
// if (exchangeOrder.state == 1) { |
|
|
@ -529,18 +545,21 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
child: buildBtnStatus(exchangeOrder.state), |
|
|
|
child: buildBtnStatus(exchangeOrder.state), |
|
|
|
): |
|
|
|
) |
|
|
|
GestureDetector( |
|
|
|
: GestureDetector( |
|
|
|
behavior: HitTestBehavior.opaque, |
|
|
|
behavior: HitTestBehavior.opaque, |
|
|
|
onTap: () { |
|
|
|
onTap: () { |
|
|
|
Navigator.of(context).pushNamed( |
|
|
|
Navigator.of(context).pushNamed( |
|
|
|
'/router/logistics_information_page', |
|
|
|
'/router/logistics_information_page', |
|
|
|
arguments: { |
|
|
|
arguments: { |
|
|
|
"orderId": exchangeOrder.creditOrderDetailList[0].orderId, |
|
|
|
"orderId": exchangeOrder |
|
|
|
|
|
|
|
.creditOrderDetailList[0].orderId, |
|
|
|
"logisticsNum": "", |
|
|
|
"logisticsNum": "", |
|
|
|
"logisticsName": "", |
|
|
|
"logisticsName": "", |
|
|
|
"productNum": exchangeOrder.creditOrderDetailList[0].goodsNumber, |
|
|
|
"productNum": exchangeOrder |
|
|
|
"skuImg":exchangeOrder.creditOrderDetailList[0].goodsMainImg |
|
|
|
.creditOrderDetailList[0].goodsNumber, |
|
|
|
|
|
|
|
"skuImg": exchangeOrder |
|
|
|
|
|
|
|
.creditOrderDetailList[0].goodsMainImg |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
child: buildBtnStatusTow(exchangeOrder.sendStatus), |
|
|
|
child: buildBtnStatusTow(exchangeOrder.sendStatus), |
|
|
|