diff --git a/lib/store/store_view/settlement.dart b/lib/store/store_view/settlement.dart index bf912a1b..224eaea0 100644 --- a/lib/store/store_view/settlement.dart +++ b/lib/store/store_view/settlement.dart @@ -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 { - ApiService apiService; + MinApiService minService; int selectedBtn = 0; @@ -34,10 +37,11 @@ class _Settlement extends State { 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 { 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 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 baseData = await minService.getOrderInfo({ - "addressId":0, - "isTake": 0, - "memberCouponId": 0, - "orderId": widget.arguments["orderId"], - "promotionId": 0 - }); - if (baseData != null && baseData.isSuccess) { - setState(() {}); - } + // BaseData baseData = await minService.getOrderInfo({ + // "addressId":0, + // "isTake": 0, + // "memberCouponId": 0, + // "orderId": widget.arguments["orderId"], + // "promotionId": 0 + // }); + // if (baseData != null && baseData.isSuccess) { + // setState(() {}); + // } } @override