import 'package:dio/dio.dart';
import '../utils/Request.dart';
import 'package:fluttertoast/fluttertoast.dart';

/// 订单列表
/// @param {*} data
/// @returns
Future getOrderList(params) async {
  return request('/order',
      options: Options(method: 'GET'), queryParameters: params)
      .catchError((error) => {
    Fluttertoast.showToast(msg: error.error.toString()),
    print(error)
  });
}

/// 订单详情
/// @param {*} data
/// @returns
Future getOrderDetail(String id) async {
  return request('/order/$id',
      options: Options(method: 'GET'))
      .catchError((error) => {
    Fluttertoast.showToast(msg: error.error['message']),
  });
}
