|
|
|
@ -39,14 +39,17 @@ class _OrderDetailPage extends State<OrderDetailPage> {
|
|
|
|
|
ApiService apiService; |
|
|
|
|
MinApiService minService; |
|
|
|
|
int jumpState; |
|
|
|
|
final RefreshController refreshController = RefreshController(); |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
void initState() { |
|
|
|
|
super.initState(); |
|
|
|
|
SharedPreferences.getInstance().then((value) { |
|
|
|
|
apiService = ApiService(Dio(), |
|
|
|
|
context: context, token: value.getString("token"), showLoading: true); |
|
|
|
|
apiService = ApiService( |
|
|
|
|
Dio(), |
|
|
|
|
context: context, |
|
|
|
|
token: value.getString("token"), |
|
|
|
|
showLoading: true |
|
|
|
|
); |
|
|
|
|
queryDetails(); |
|
|
|
|
}); |
|
|
|
|
jumpState = widget.arguments["jumpState"]; |
|
|
|
@ -91,19 +94,16 @@ class _OrderDetailPage extends State<OrderDetailPage> {
|
|
|
|
|
queryDetails() async { |
|
|
|
|
if (apiService == null) { |
|
|
|
|
SharedPreferences value = await SharedPreferences.getInstance(); |
|
|
|
|
apiService = ApiService(Dio(), |
|
|
|
|
apiService = ApiService( |
|
|
|
|
Dio(), |
|
|
|
|
context: context, |
|
|
|
|
token: value.getString("token"), |
|
|
|
|
showLoading: false); |
|
|
|
|
showLoading: false |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
BaseData<OrderInfo> baseData = await apiService |
|
|
|
|
.orderDetail(widget.arguments["id"]) |
|
|
|
|
.catchError((error) { |
|
|
|
|
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type), |
|
|
|
|
alignment: Alignment.center); |
|
|
|
|
refreshController.refreshFailed(); |
|
|
|
|
refreshController.loadFailed(); |
|
|
|
|
}); |
|
|
|
|
.catchError((error) {}); |
|
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
|
orderInfo = baseData.data; |
|
|
|
|
payStatus = orderInfo.payStatus; |
|
|
|
@ -123,12 +123,8 @@ class _OrderDetailPage extends State<OrderDetailPage> {
|
|
|
|
|
setState(() { |
|
|
|
|
statusTitle(); |
|
|
|
|
}); |
|
|
|
|
refreshController.refreshCompleted(); |
|
|
|
|
refreshController.loadComplete(); |
|
|
|
|
} else { |
|
|
|
|
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); |
|
|
|
|
refreshController.refreshFailed(); |
|
|
|
|
refreshController.loadFailed(); |
|
|
|
|
}else{ |
|
|
|
|
SmartDialog.showToast(baseData.msg,alignment: Alignment.center); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -163,24 +159,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
|
|
|
|
|
leadingColor: Colors.white, |
|
|
|
|
brightness: Brightness.dark, |
|
|
|
|
), |
|
|
|
|
body: SmartRefresher( |
|
|
|
|
controller: refreshController, |
|
|
|
|
enablePullDown: true, |
|
|
|
|
enablePullUp: false, |
|
|
|
|
header: MyHeader(), |
|
|
|
|
footer: CustomFooter( |
|
|
|
|
builder: (context, mode) { |
|
|
|
|
return MyFooter(mode); |
|
|
|
|
}, |
|
|
|
|
), |
|
|
|
|
onRefresh:(){ |
|
|
|
|
setState(() { |
|
|
|
|
queryDetails(); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
physics: BouncingScrollPhysics(), |
|
|
|
|
scrollController: ScrollController(), |
|
|
|
|
child: Container( |
|
|
|
|
body: Container( |
|
|
|
|
child: SingleChildScrollView( |
|
|
|
|
physics: BouncingScrollPhysics(), |
|
|
|
|
child: Container( |
|
|
|
@ -230,7 +209,6 @@ class _OrderDetailPage extends State<OrderDetailPage> {
|
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|