Browse Source

更新

master
w-R 3 years ago
parent
commit
333c486d70
  1. 6
      lib/retrofit/min_api.dart
  2. 4
      lib/store/store_order.dart
  3. 53
      lib/store/store_view/settlement.dart

6
lib/retrofit/min_api.dart

@ -13,6 +13,7 @@ import 'package:retrofit/retrofit.dart';
import 'data/findMiNiGroupList.dart'; import 'data/findMiNiGroupList.dart';
import 'data/miNiDetail.dart'; import 'data/miNiDetail.dart';
import 'data/settleOrderInfo.dart';
import 'data/shoppingCart.dart'; import 'data/shoppingCart.dart';
part 'min_api.g.dart'; part 'min_api.g.dart';
@ -131,6 +132,11 @@ abstract class MinApiService {
Future<BaseData<ShoppingCart>> shoppingCart( Future<BaseData<ShoppingCart>> shoppingCart(
@Body() Map<String, dynamic> param,Map<String, dynamic> header); @Body() Map<String, dynamic> param,Map<String, dynamic> header);
///
@POST("order/getOrderInfo")
Future<BaseData<SettleOrderInfo>> getOrderInfo(
@Body() Map<String, dynamic> param);
} }

4
lib/store/store_order.dart

@ -360,9 +360,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
'/router/settlement', '/router/settlement',
arguments: { arguments: {
"storeName": storeInfo.storeName, "storeInfo": storeInfo,
"address": storeInfo.address,
"headMobile": storeInfo.headMobile,
}, },
); );
}, },

53
lib/store/store_view/settlement.dart

@ -20,9 +20,8 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
class Settlement extends StatefulWidget { class Settlement extends StatefulWidget {
final arguments; final arguments;
final OrderInfo orderInfo;
Settlement({this.arguments,this.orderInfo}); Settlement({this.arguments});
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -31,9 +30,9 @@ class Settlement extends StatefulWidget {
} }
class _Settlement extends State<Settlement> { class _Settlement extends State<Settlement> {
ApiService apiService;
MinApiService minService; MinApiService minService;
int selectedBtn = 0; int selectedBtn = 0;
OrderInfo orderInfo;
@override @override
void initState() { void initState() {
@ -45,11 +44,11 @@ class _Settlement extends State<Settlement> {
context: context, context: context,
token: value.getString("token"), token: value.getString("token"),
); );
queryOrderInfo(); // queryOrderInfo();
}); });
storeInfo = widget.arguments["storeInfo"];
} }
OrderInfo orderInfo;
StoreInfo storeInfo; StoreInfo storeInfo;
int payStatus = 0; int payStatus = 0;
int orderStatus = 0; int orderStatus = 0;
@ -58,27 +57,27 @@ class _Settlement extends State<Settlement> {
int refundStatus = 0; int refundStatus = 0;
// String storeType = "NORMALSTORE"; //NORMALSTORE FASTSTORE RETAILSTORE // String storeType = "NORMALSTORE"; //NORMALSTORE FASTSTORE RETAILSTORE
queryDetails() async { // queryDetails() async {
BaseData<OrderInfo> baseData = await apiService.orderDetail(widget.arguments["id"]); // BaseData<OrderInfo> baseData = await minService.orderDetail(widget.arguments["id"]);
if (baseData != null && baseData.isSuccess) { // if (baseData != null && baseData.isSuccess) {
orderInfo = baseData.data; // orderInfo = baseData.data;
payStatus = orderInfo.payStatus; // payStatus = orderInfo.payStatus;
orderStatus = orderInfo.orderStatus; // orderStatus = orderInfo.orderStatus;
sendStatus = orderInfo.sendStatus; // sendStatus = orderInfo.sendStatus;
isTakeOut = orderInfo.isTakeOut; // isTakeOut = orderInfo.isTakeOut;
refundStatus = orderInfo.refundStatus; // refundStatus = orderInfo.refundStatus;
// storeType = orderInfo.storeVO.posType.code; // // storeType = orderInfo.storeVO.posType.code;
print("order refund_status: $refundStatus"); // print("order refund_status: $refundStatus");
print("order payStatus: $payStatus"); // print("order payStatus: $payStatus");
print("order orderStatus: $orderStatus"); // print("order orderStatus: $orderStatus");
print("order sendStatus: $sendStatus"); // print("order sendStatus: $sendStatus");
print("order isTakeOut: $isTakeOut"); // print("order isTakeOut: $isTakeOut");
if (mounted) // if (mounted)
setState(() { // setState(() {
statusTitle(); // statusTitle();
}); // });
} // }
} // }
/// ///
queryOrderInfo() async { queryOrderInfo() async {
@ -841,7 +840,7 @@ class _Settlement extends State<Settlement> {
} }
String payChannel() { String payChannel() {
switch (widget.orderInfo.payChannel) { switch (orderInfo.payChannel) {
case 0: case 0:
return "现金支付"; return "现金支付";
case 1: case 1:

Loading…
Cancel
Save