|
|
|
@ -1,10 +1,13 @@
|
|
|
|
|
import 'package:dio/dio.dart'; |
|
|
|
|
import 'package:flutter/cupertino.dart'; |
|
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; |
|
|
|
|
import 'package:huixiang/generated/l10n.dart'; |
|
|
|
|
import 'package:huixiang/order/order_view/order_commodity.dart'; |
|
|
|
|
import 'package:huixiang/retrofit/data/base_data.dart'; |
|
|
|
|
import 'package:huixiang/retrofit/data/order_info.dart'; |
|
|
|
|
import 'package:huixiang/retrofit/data/settleOrderInfo.dart'; |
|
|
|
|
import 'package:huixiang/retrofit/min_api.dart'; |
|
|
|
|
import 'package:huixiang/retrofit/retrofit_api.dart'; |
|
|
|
|
import 'package:huixiang/utils/font_weight.dart'; |
|
|
|
|
import 'package:huixiang/view_widget/my_appbar.dart'; |
|
|
|
@ -25,7 +28,7 @@ class Settlement extends StatefulWidget {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
class _Settlement extends State<Settlement> { |
|
|
|
|
ApiService apiService; |
|
|
|
|
|
|
|
|
|
MinApiService minService; |
|
|
|
|
int selectedBtn = 0; |
|
|
|
|
|
|
|
|
@ -34,10 +37,11 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
super.initState(); |
|
|
|
|
|
|
|
|
|
SharedPreferences.getInstance().then((value) { |
|
|
|
|
apiService = ApiService( |
|
|
|
|
minService = MinApiService( |
|
|
|
|
Dio(), |
|
|
|
|
context: context, |
|
|
|
|
token: value.getString("token"), |
|
|
|
|
token: value.getString("minToken"), |
|
|
|
|
tenant: value.getString("tenant"), |
|
|
|
|
); |
|
|
|
|
queryOrderInfo(); |
|
|
|
|
}); |
|
|
|
@ -51,41 +55,41 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
int refundStatus = 0; |
|
|
|
|
|
|
|
|
|
// String storeType = "NORMALSTORE"; //NORMALSTORE FASTSTORE RETAILSTORE |
|
|
|
|
queryDetails() async { |
|
|
|
|
BaseData<OrderInfo> baseData = |
|
|
|
|
await apiService.orderDetail(widget.arguments["id"]); |
|
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
|
orderInfo = baseData.data; |
|
|
|
|
payStatus = orderInfo.payStatus; |
|
|
|
|
orderStatus = orderInfo.orderStatus; |
|
|
|
|
sendStatus = orderInfo.sendStatus; |
|
|
|
|
isTakeOut = orderInfo.isTakeOut; |
|
|
|
|
refundStatus = orderInfo.refundStatus; |
|
|
|
|
// storeType = orderInfo.storeVO.posType.code; |
|
|
|
|
print("order refund_status: $refundStatus"); |
|
|
|
|
print("order payStatus: $payStatus"); |
|
|
|
|
print("order orderStatus: $orderStatus"); |
|
|
|
|
print("order sendStatus: $sendStatus"); |
|
|
|
|
print("order isTakeOut: $isTakeOut"); |
|
|
|
|
if (mounted) |
|
|
|
|
setState(() { |
|
|
|
|
statusTitle(); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// queryDetails() async { |
|
|
|
|
// BaseData<OrderInfo> baseData = |
|
|
|
|
// await apiService.orderDetail(widget.arguments["id"]); |
|
|
|
|
// if (baseData != null && baseData.isSuccess) { |
|
|
|
|
// orderInfo = baseData.data; |
|
|
|
|
// payStatus = orderInfo.payStatus; |
|
|
|
|
// orderStatus = orderInfo.orderStatus; |
|
|
|
|
// sendStatus = orderInfo.sendStatus; |
|
|
|
|
// isTakeOut = orderInfo.isTakeOut; |
|
|
|
|
// refundStatus = orderInfo.refundStatus; |
|
|
|
|
// // storeType = orderInfo.storeVO.posType.code; |
|
|
|
|
// print("order refund_status: $refundStatus"); |
|
|
|
|
// print("order payStatus: $payStatus"); |
|
|
|
|
// print("order orderStatus: $orderStatus"); |
|
|
|
|
// print("order sendStatus: $sendStatus"); |
|
|
|
|
// print("order isTakeOut: $isTakeOut"); |
|
|
|
|
// if (mounted) |
|
|
|
|
// setState(() { |
|
|
|
|
// statusTitle(); |
|
|
|
|
// }); |
|
|
|
|
// } |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
///订单结算信息 |
|
|
|
|
queryOrderInfo() async { |
|
|
|
|
BaseData<SettleOrderInfo> baseData = await minService.getOrderInfo({ |
|
|
|
|
"addressId":0, |
|
|
|
|
"isTake": 0, |
|
|
|
|
"memberCouponId": 0, |
|
|
|
|
"orderId": widget.arguments["orderId"], |
|
|
|
|
"promotionId": 0 |
|
|
|
|
}); |
|
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
|
setState(() {}); |
|
|
|
|
} |
|
|
|
|
// BaseData<SettleOrderInfo> baseData = await minService.getOrderInfo({ |
|
|
|
|
// "addressId":0, |
|
|
|
|
// "isTake": 0, |
|
|
|
|
// "memberCouponId": 0, |
|
|
|
|
// "orderId": widget.arguments["orderId"], |
|
|
|
|
// "promotionId": 0 |
|
|
|
|
// }); |
|
|
|
|
// if (baseData != null && baseData.isSuccess) { |
|
|
|
|
// setState(() {}); |
|
|
|
|
// } |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|