|
|
|
@ -19,6 +19,7 @@ import 'package:pull_to_refresh/pull_to_refresh.dart';
|
|
|
|
|
import 'package:shared_preferences/shared_preferences.dart'; |
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
|
|
|
|
|
|
|
import '../retrofit/data/user_info.dart'; |
|
|
|
|
import '../utils/flutter_utils.dart'; |
|
|
|
|
import '../view_widget/classic_header.dart'; |
|
|
|
|
import '../view_widget/my_footer.dart'; |
|
|
|
@ -40,15 +41,18 @@ class _OrderDetailPage extends State<OrderDetailPage> {
|
|
|
|
|
MinApiService minService; |
|
|
|
|
int jumpState; |
|
|
|
|
final RefreshController refreshController = RefreshController(); |
|
|
|
|
UserInfo userInfo; |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
void initState() { |
|
|
|
|
super.initState(); |
|
|
|
|
jumpState = widget.arguments["jumpState"]; |
|
|
|
|
SharedPreferences.getInstance().then((value) { |
|
|
|
|
EasyLoading.show(status: S.of(context).zhengzaijiazai); |
|
|
|
|
apiService = ApiService(Dio(), |
|
|
|
|
context: context, token: value.getString("token"), showLoading: jumpState == 2? true:false); |
|
|
|
|
context: context, token: value.getString("token"),); |
|
|
|
|
queryDetails(); |
|
|
|
|
queryUserBalance(); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -81,6 +85,18 @@ class _OrderDetailPage extends State<OrderDetailPage> {
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
///查询用户信息 |
|
|
|
|
queryUserBalance() async { |
|
|
|
|
BaseData<UserInfo> baseData = |
|
|
|
|
await apiService.queryInfo().catchError((onError) {}); |
|
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
|
userInfo = baseData.data; |
|
|
|
|
if (mounted) setState(() {}); |
|
|
|
|
}else { |
|
|
|
|
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
OrderInfo orderInfo; |
|
|
|
|
int payStatus = 0; |
|
|
|
|
int orderStatus = 0; |
|
|
|
@ -123,9 +139,11 @@ class _OrderDetailPage extends State<OrderDetailPage> {
|
|
|
|
|
setState(() { |
|
|
|
|
statusTitle(); |
|
|
|
|
}); |
|
|
|
|
EasyLoading.dismiss(); |
|
|
|
|
refreshController.refreshCompleted(); |
|
|
|
|
refreshController.loadComplete(); |
|
|
|
|
} else { |
|
|
|
|
EasyLoading.dismiss(); |
|
|
|
|
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); |
|
|
|
|
refreshController.refreshFailed(); |
|
|
|
|
refreshController.loadFailed(); |
|
|
|
@ -196,6 +214,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
|
|
|
|
|
orderInfo, |
|
|
|
|
), |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
///订单取货地址,或, 收货地址 |
|
|
|
|
if(orderInfo != null && orderInfo.addressExt != null) |
|
|
|
|
OrderAddress( |
|
|
|
@ -241,7 +260,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
|
|
|
|
|
context: context, |
|
|
|
|
backgroundColor: Colors.transparent, |
|
|
|
|
builder: (context) { |
|
|
|
|
return OrderPaySelected(); |
|
|
|
|
return OrderPaySelected(userInfo); |
|
|
|
|
}, |
|
|
|
|
); |
|
|
|
|
if (payChannel != null && payChannel > 0) { |
|
|
|
|