12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- import 'package:dio/dio.dart';
- import 'package:farmer_client/utils/Request.dart';
-
- import 'showError.dart';
- /**
- * banner轮播图
- * @param {*} data
- * @returns
- */
-
- Future getHomeBanner(String position) async {
- return request('/banner',
- options: Options(method: 'GET'), data: {'position': position})
- .catchError(showError);
- }
-
- /**
- * 农机列表
- * @param {*} data
- * @returns
- */
- Future getMachinery(params) async {
- return request('/machinery',
- options: Options(method: 'GET'), queryParameters: params)
- .catchError(showError);
- }
-
- /**
- * 农机列表搜索
- * @param {*} data
- * @returns
- */
- Future searchMachinery(params) async {
- return request('/machinery',
- options: Options(method: 'GET'),
- queryParameters: params,
- data: params)
- .catchError(showError);
- }
-
- /**
- * 农机分类
- * @param {*} data
- * @returns
- */
- Future typeMachinery(
- String location,
- String typeId,
- ) async {
- return request('/machinery',
- options: Options(method: 'GET'),
- queryParameters: {
- 'location': location,
- 'typeId': typeId,
- },
- data: {
- 'typeId': typeId,
- 'location': location
- }).catchError(showError);
- }
-
- /**
- * 农机详情
- * @param {*} data
- * @returns
- */
-
- Future getMachineryInfo(String id, String location, bool attached) async {
- return request('/machinery-summary/$id',
- options: Options(method: 'GET'),
- queryParameters: {'location': location, 'attached': attached});
- }
-
- /**
- * 农机分类Tab列查询
- * @param {*} data
- * @returns
- */
- Future getMachineryType(params) async {
- return request('/machinery-type',
- options: Options(method: 'GET'), queryParameters: params);
- }
|