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/miNiDetail.dart';
import 'data/settleOrderInfo.dart';
import 'data/shoppingCart.dart';
part 'min_api.g.dart';
@ -131,6 +132,11 @@ abstract class MinApiService {
Future<BaseData<ShoppingCart>> shoppingCart(
@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(
'/router/settlement',
arguments: {
"storeName": storeInfo.storeName,
"address": storeInfo.address,
"headMobile": storeInfo.headMobile,
"storeInfo": storeInfo,
},
);
},

53
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<StatefulWidget> createState() {
@ -31,9 +30,9 @@ class Settlement extends StatefulWidget {
}
class _Settlement extends State<Settlement> {
ApiService apiService;
MinApiService minService;
int selectedBtn = 0;
OrderInfo orderInfo;
@override
void initState() {
@ -45,11 +44,11 @@ class _Settlement extends State<Settlement> {
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<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 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<Settlement> {
}
String payChannel() {
switch (widget.orderInfo.payChannel) {
switch (orderInfo.payChannel) {
case 0:
return "现金支付";
case 1:

Loading…
Cancel
Save