123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
-
-
- 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']
- ),});
-
- }
-
-
- /**
- * 生成订单
- * @param {*} data
- * @returns
- */
-
- Future generateOrder(item)async{
- return request('/order',options: Options(method: 'POST'),data: item).catchError((error) =>
- { Fluttertoast.showToast(
- msg: error.error['message']
- ),});
-
- }
-
-
-
- /**
- * 删除订单
- * @param {*} data
- * @returns
- */
- Future orderDelete(String id)async{
- return request('/order/$id',options: Options(method: 'DELETE')).catchError((error) =>
- { Fluttertoast.showToast(
- msg: error.error['message']
- ),});
-
- }
|