12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- import 'package:dio/dio.dart';
- import 'package:farmer_client/utils/Request.dart';
-
- import 'showError.dart';
- /**
- * 订单列表
- * @param {*} data
- * @returns
- */
- Future getOrderList(params) async {
- return request('/order',
- options: Options(method: 'GET'), queryParameters: params)
- .catchError(showError);
- }
-
- /**
- * 订单详情
- * @param {*} data
- * @returns
- */
- Future orderInfo(String id) async {
- return request(
- '/order/$id',
- options: Options(method: 'GET'),
- ).catchError(showError);
- }
-
- /**
- * 生成订单
- * @param {*} data
- * @returns
- */
-
- Future generateOrder(item) async {
- return request('/order', options: Options(method: 'POST'), data: item)
- .catchError(showError);
- }
-
- /**
- * 删除订单
- * @param {*} data
- * @returns
- */
- Future orderDelete(String id) async {
- return request('/order/$id', options: Options(method: 'DELETE'))
- .catchError(showError);
- }
-
- /**
- * --------------订单退款-----------------
- * @param {*} data
- * @returns
- */
- Future orderRefund(String id) async {
- return request('/order/$id/refund', options: Options(method: 'PUT'))
- .catchError(showError);
- }
-
- /**
- * 评价订单
- * @param {*} data
- * @returns
- */
-
- Future orderEvaluation(String orderId, num score, String content) async {
- return request('/evaluation',
- options: Options(method: 'POST'),
- data: {'orderId': orderId, 'score': score, 'content': content})
- .catchError(showError);
- }
|