diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index 8f3ce159..e97d7c93 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -13,6 +13,7 @@ import 'package:retrofit/retrofit.dart'; import 'data/findMiNiGroupList.dart'; import 'data/miNiDetail.dart'; +import 'data/settleOrderInfo.dart'; import 'data/shoppingCart.dart'; part 'min_api.g.dart'; @@ -131,6 +132,11 @@ abstract class MinApiService { Future> shoppingCart( @Body() Map param,Map header); + ///订单结算信息 + @POST("order/getOrderInfo") + Future> getOrderInfo( + @Body() Map param); + } \ No newline at end of file diff --git a/lib/store/store_order.dart b/lib/store/store_order.dart index 49dfe413..b121be6c 100644 --- a/lib/store/store_order.dart +++ b/lib/store/store_order.dart @@ -360,9 +360,7 @@ class _StoreOrderPage extends State Navigator.of(context).pushNamed( '/router/settlement', arguments: { - "storeName": storeInfo.storeName, - "address": storeInfo.address, - "headMobile": storeInfo.headMobile, + "storeInfo": storeInfo, }, ); }, diff --git a/lib/store/store_view/settlement.dart b/lib/store/store_view/settlement.dart index 81bc48af..f2d65b58 100644 --- a/lib/store/store_view/settlement.dart +++ b/lib/store/store_view/settlement.dart @@ -20,9 +20,8 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; class Settlement extends StatefulWidget { final arguments; - final OrderInfo orderInfo; - Settlement({this.arguments,this.orderInfo}); + Settlement({this.arguments}); @override State createState() { @@ -31,9 +30,9 @@ class Settlement extends StatefulWidget { } class _Settlement extends State { - ApiService apiService; MinApiService minService; int selectedBtn = 0; + OrderInfo orderInfo; @override void initState() { @@ -45,11 +44,11 @@ class _Settlement extends State { context: context, token: value.getString("token"), ); - queryOrderInfo(); + // queryOrderInfo(); }); + storeInfo = widget.arguments["storeInfo"]; } - OrderInfo orderInfo; StoreInfo storeInfo; int payStatus = 0; int orderStatus = 0; @@ -58,27 +57,27 @@ class _Settlement extends State { int refundStatus = 0; // String storeType = "NORMALSTORE"; //NORMALSTORE FASTSTORE RETAILSTORE - queryDetails() async { - BaseData 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 baseData = await minService.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 { @@ -841,7 +840,7 @@ class _Settlement extends State { } String payChannel() { - switch (widget.orderInfo.payChannel) { + switch (orderInfo.payChannel) { case 0: return "现金支付"; case 1: