Browse Source

safety

master
fmk 3 years ago
parent
commit
8e5d98ca5e
  1. 74
      lib/store/store_view/settlement.dart

74
lib/store/store_view/settlement.dart

@ -1,10 +1,13 @@
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/order/order_view/order_commodity.dart'; import 'package:huixiang/order/order_view/order_commodity.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/order_info.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/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_appbar.dart';
@ -25,7 +28,7 @@ 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;
@ -34,10 +37,11 @@ class _Settlement extends State<Settlement> {
super.initState(); super.initState();
SharedPreferences.getInstance().then((value) { SharedPreferences.getInstance().then((value) {
apiService = ApiService( minService = MinApiService(
Dio(), Dio(),
context: context, context: context,
token: value.getString("token"), token: value.getString("minToken"),
tenant: value.getString("tenant"),
); );
queryOrderInfo(); queryOrderInfo();
}); });
@ -51,41 +55,41 @@ 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 = // BaseData<OrderInfo> baseData =
await apiService.orderDetail(widget.arguments["id"]); // await apiService.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 {
BaseData<SettleOrderInfo> baseData = await minService.getOrderInfo({ // BaseData<SettleOrderInfo> baseData = await minService.getOrderInfo({
"addressId":0, // "addressId":0,
"isTake": 0, // "isTake": 0,
"memberCouponId": 0, // "memberCouponId": 0,
"orderId": widget.arguments["orderId"], // "orderId": widget.arguments["orderId"],
"promotionId": 0 // "promotionId": 0
}); // });
if (baseData != null && baseData.isSuccess) { // if (baseData != null && baseData.isSuccess) {
setState(() {}); // setState(() {});
} // }
} }
@override @override

Loading…
Cancel
Save