

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


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

}


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

}


