|
@@ -1,63 +1,62 @@
|
1
|
|
-
|
2
|
|
-
|
3
|
1
|
import 'package:dio/dio.dart';
|
4
|
2
|
import 'package:farmer_client/utils/Request.dart';
|
5
|
3
|
import 'package:fluttertoast/fluttertoast.dart';
|
6
|
4
|
|
7
|
|
-
|
8
|
|
-
|
9
|
5
|
/**
|
10
|
6
|
* banner轮播图
|
11
|
7
|
* @param {*} data
|
12
|
8
|
* @returns
|
13
|
9
|
*/
|
14
|
|
-Future getHomeBanner(String position)async{
|
15
|
|
- return request('/banner',options: Options(method: 'GET'),data: { 'position': position}).catchError((error) =>
|
16
|
|
- { Fluttertoast.showToast(
|
17
|
|
- msg: error.error['message']
|
18
|
|
- ),});
|
19
|
|
-
|
|
10
|
+Future getHomeBanner(String position) async {
|
|
11
|
+ return request('/banner',
|
|
12
|
+ options: Options(method: 'GET'), data: {'position': position})
|
|
13
|
+ .catchError((error) => {
|
|
14
|
+ Fluttertoast.showToast(msg: error.error['message']),
|
|
15
|
+ });
|
20
|
16
|
}
|
21
|
17
|
|
22
|
|
-
|
23
|
|
-
|
24
|
18
|
/**
|
25
|
19
|
* 农机列表
|
26
|
20
|
* @param {*} data
|
27
|
21
|
* @returns
|
28
|
22
|
*/
|
29
|
|
-Future getMachinery(String location)async{
|
30
|
|
- return request('/machinery',options: Options(method: 'GET'),queryParameters: { 'location': location}).catchError((error) =>
|
31
|
|
- { Fluttertoast.showToast(
|
32
|
|
- msg: error.error['message']
|
33
|
|
- ),});
|
34
|
|
-
|
|
23
|
+Future getMachinery(String location) async {
|
|
24
|
+ return request('/machinery', options: Options(method: 'GET'), queryParameters: {
|
|
25
|
+ 'location': location
|
|
26
|
+ }).catchError((error) => {
|
|
27
|
+ Fluttertoast.showToast(msg: error.error['message']),
|
|
28
|
+ });
|
35
|
29
|
}
|
36
|
30
|
|
37
|
|
-
|
38
|
|
-
|
39
|
31
|
/**
|
40
|
32
|
* 农机详情
|
41
|
33
|
* @param {*} data
|
42
|
34
|
* @returns
|
43
|
35
|
*/
|
|
36
|
+<<<<<<< HEAD
|
44
|
37
|
Future getMachineryInfo(String id,String location ,bool attached)async{
|
45
|
38
|
return request('/machinery-summary/$id',options: Options(method: 'GET'),queryParameters: { 'location': location,'attached': attached}).catchError((error) =>
|
46
|
39
|
{ Fluttertoast.showToast(
|
47
|
40
|
msg: error.error['message']
|
48
|
41
|
),});
|
49
|
42
|
|
|
43
|
+=======
|
|
44
|
+Future getMachineryInfo(String id, String location, bool attached) async {
|
|
45
|
+ return request('/machinery-summary',
|
|
46
|
+ options: Options(method: 'GET'),
|
|
47
|
+ queryParameters: {'id': id},
|
|
48
|
+ data: {'location': location, 'attached': attached})
|
|
49
|
+ .catchError((error) => {
|
|
50
|
+ Fluttertoast.showToast(msg: error.error['message']),
|
|
51
|
+ });
|
|
52
|
+>>>>>>> 40e1cb063352fdbd66774cfedb970a9d87bd4315
|
50
|
53
|
}
|
51
|
54
|
|
52
|
|
-
|
53
|
55
|
/**
|
54
|
56
|
* 农机分类Tab列查询
|
55
|
57
|
* @param {*} data
|
56
|
58
|
* @returns
|
57
|
59
|
*/
|
58
|
|
-Future getMachineryType()async{
|
59
|
|
- return request('/machinery-type',options: Options(method: 'GET'));
|
|
60
|
+Future getMachineryType() async {
|
|
61
|
+ return request('/machinery-type', options: Options(method: 'GET'));
|
60
|
62
|
}
|
61
|
|
-
|
62
|
|
-
|
63
|
|
-
|