Pārlūkot izejas kodu

Merge branch 'master' of http://git.ycjcjy.com/nanyang/farmer_client

Yansen 2 gadus atpakaļ
vecāks
revīzija
4dc6e57f3d

Binārs
images/userMoren.png Parādīt failu


+ 1
- 2
ios/Runner.xcodeproj/project.pbxproj Parādīt failu

3
 	archiveVersion = 1;
3
 	archiveVersion = 1;
4
 	classes = {
4
 	classes = {
5
 	};
5
 	};
6
-	objectVersion = 50;
6
+	objectVersion = 51;
7
 	objects = {
7
 	objects = {
8
 
8
 
9
 /* Begin PBXBuildFile section */
9
 /* Begin PBXBuildFile section */
76
 				805A6DB5EC13EB9FC8C0F263 /* Pods-Runner.release.xcconfig */,
76
 				805A6DB5EC13EB9FC8C0F263 /* Pods-Runner.release.xcconfig */,
77
 				E4D5DB9E3D4475D04602FE2B /* Pods-Runner.profile.xcconfig */,
77
 				E4D5DB9E3D4475D04602FE2B /* Pods-Runner.profile.xcconfig */,
78
 			);
78
 			);
79
-			name = Pods;
80
 			path = Pods;
79
 			path = Pods;
81
 			sourceTree = "<group>";
80
 			sourceTree = "<group>";
82
 		};
81
 		};

+ 10
- 0
ios/Runner/Info.plist Parādīt failu

28
 	<string>LaunchScreen</string>
28
 	<string>LaunchScreen</string>
29
 	<key>UIMainStoryboardFile</key>
29
 	<key>UIMainStoryboardFile</key>
30
 	<string>Main</string>
30
 	<string>Main</string>
31
+	<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
32
+	<string>需要您提供定位信息,才能使用获取您附近的农机</string>
31
 	<key>UISupportedInterfaceOrientations</key>
33
 	<key>UISupportedInterfaceOrientations</key>
32
 	<array>
34
 	<array>
33
 		<string>UIInterfaceOrientationPortrait</string>
35
 		<string>UIInterfaceOrientationPortrait</string>
45
 	<false/>
47
 	<false/>
46
 	<key>CADisableMinimumFrameDurationOnPhone</key>
48
 	<key>CADisableMinimumFrameDurationOnPhone</key>
47
 	<true/>
49
 	<true/>
50
+	<key>io.flutter.embedded_views_preview</key>
51
+	<string>YES</string>	
52
+	<key>NSLocationAlwaysUsageDescription</key>
53
+	<string>需要您提供后台定位信息,才能使用获取您附近的农机</string>
54
+	<key>NSLocationUsageDescription</key>
55
+	<string>需要您提供定位信息,才能使用获取您附近的农机</string>
56
+	<key>NSLocationWhenInUseUsageDescription</key>
57
+	<string>需要您提供定位信息,才能使用获取您附近的农机</string>
48
 </dict>
58
 </dict>
49
 </plist>
59
 </plist>

+ 0
- 1
lib/main.dart Parādīt failu

1
 import 'package:farmer_client/theme.dart';
1
 import 'package:farmer_client/theme.dart';
2
-import 'package:farmer_client/utils/location.dart';
3
 import 'package:flutter/material.dart';
2
 import 'package:flutter/material.dart';
4
 import 'package:flutter_easyloading/flutter_easyloading.dart';
3
 import 'package:flutter_easyloading/flutter_easyloading.dart';
5
 import 'package:fluwx/fluwx.dart';
4
 import 'package:fluwx/fluwx.dart';

+ 16
- 16
lib/pages/OrderConfirmation/index.dart Parādīt failu

3
 import 'package:farmer_client/models/entities/CardInfo.dart';
3
 import 'package:farmer_client/models/entities/CardInfo.dart';
4
 import 'package:farmer_client/widgets/layout/BasicPage.dart';
4
 import 'package:farmer_client/widgets/layout/BasicPage.dart';
5
 import 'package:flutter/material.dart';
5
 import 'package:flutter/material.dart';
6
-import 'package:flutter/services.dart';
7
 import 'package:flutter_easyloading/flutter_easyloading.dart';
6
 import 'package:flutter_easyloading/flutter_easyloading.dart';
8
 import 'package:flutter_screenutil/flutter_screenutil.dart';
7
 import 'package:flutter_screenutil/flutter_screenutil.dart';
9
 import 'package:fluttertoast/fluttertoast.dart';
8
 import 'package:fluttertoast/fluttertoast.dart';
10
 import 'package:get/get.dart';
9
 import 'package:get/get.dart';
11
 import 'package:intl/intl.dart';
10
 import 'package:intl/intl.dart';
12
 
11
 
13
-import '../../models/entities/CardListModel.dart';
14
 import '../../models/entities/OrderInfoModel.dart';
12
 import '../../models/entities/OrderInfoModel.dart';
15
 import '../../services/homeAPI.dart';
13
 import '../../services/homeAPI.dart';
16
 import '../../services/orderAPI.dart';
14
 import '../../services/orderAPI.dart';
32
     super.beforeShow();
30
     super.beforeShow();
33
     if (Get.arguments['item'] != null) {
31
     if (Get.arguments['item'] != null) {
34
       item(Get.arguments['item']);
32
       item(Get.arguments['item']);
35
-    } else {
33
+    } else if (Get.arguments['id'] != null) {
36
       markId = Get.arguments['id'];
34
       markId = Get.arguments['id'];
37
       EasyLoading.show(status: '数据加载中...');
35
       EasyLoading.show(status: '数据加载中...');
38
-
39
-      getMachineryInfo(markId, appController.locationStr, true)
36
+      //苹果模拟器看不到定位所以加一个默认定位是邓州市中心位置
37
+      getMachineryInfo(Get.arguments['id'],
38
+              appController.locationStr ?? '112.091892,32.690712', true)
40
           .then((value) {
39
           .then((value) {
41
         item(CardInfo.fromJson(value));
40
         item(CardInfo.fromJson(value));
42
         EasyLoading.dismiss();
41
         EasyLoading.dismiss();
42
+      }).catchError((error) {
43
+        EasyLoading.dismiss();
44
+        Fluttertoast.showToast(msg: error.error['message']);
43
       });
45
       });
44
-
45
-      // item(CardInfo.fromJson(Get.arguments['item']));
46
-
47
-      return;
48
     }
46
     }
49
   }
47
   }
50
 
48
 
69
         orderInfo(OrderInfoModel.fromJson(value));
67
         orderInfo(OrderInfoModel.fromJson(value));
70
         Fluttertoast.showToast(msg: '预约成功');
68
         Fluttertoast.showToast(msg: '预约成功');
71
         Get.offNamed('/orderPageInfo', arguments: {
69
         Get.offNamed('/orderPageInfo', arguments: {
72
-          'id': orderInfo().orderId,
70
+          'orderId': value['orderId'],
73
           'title': '待付款',
71
           'title': '待付款',
74
           'styleColor': Color(0xFF51D4FF)
72
           'styleColor': Color(0xFF51D4FF)
75
         });
73
         });
81
   @override
79
   @override
82
   Widget builder(BuildContext context) {
80
   Widget builder(BuildContext context) {
83
     naviTitle = '预约';
81
     naviTitle = '预约';
84
-    return Container(
82
+    return SizedBox(
85
       height: 700.h,
83
       height: 700.h,
86
       child: Form(
84
       child: Form(
87
         key: _formKey, //设置globalKey,用于后面获取FormState
85
         key: _formKey, //设置globalKey,用于后面获取FormState
174
                           child: Obx(
172
                           child: Obx(
175
                             () => Text(selectDate == null
173
                             () => Text(selectDate == null
176
                                 ? '请选择日期'
174
                                 ? '请选择日期'
177
-                                : DateFormat("yyyy-MM-dd").format(selectDate())),
175
+                                : DateFormat("yyyy-MM-dd")
176
+                                    .format(selectDate())),
178
                           )),
177
                           )),
179
                     )
178
                     )
180
                   ],
179
                   ],
212
                       padding: const EdgeInsets.fromLTRB(10, 0, 0, 0),
211
                       padding: const EdgeInsets.fromLTRB(10, 0, 0, 0),
213
                       child: GestureDetector(
212
                       child: GestureDetector(
214
                         onTap: () {
213
                         onTap: () {
215
-                          Get.toNamed('/addressList',
216
-                              arguments: {'isBack': true});
214
+                          Get.toNamed('/addressList', arguments: {
215
+                            'isBack': true,
216
+                          });
217
                         },
217
                         },
218
                         child: SizedBox(
218
                         child: SizedBox(
219
                           width: 290.w,
219
                           width: 290.w,
277
                         fontWeight: FontWeight.bold),
277
                         fontWeight: FontWeight.bold),
278
                   ),
278
                   ),
279
                   style: ButtonStyle(
279
                   style: ButtonStyle(
280
-                    side: MaterialStateProperty.all(
281
-                        const BorderSide(width: 1, color: Color(0xFFFF703B))), //边框
280
+                    side: MaterialStateProperty.all(const BorderSide(
281
+                        width: 1, color: Color(0xFFFF703B))), //边框
282
                     elevation: MaterialStateProperty.all(0),
282
                     elevation: MaterialStateProperty.all(0),
283
                     backgroundColor: MaterialStateProperty.all(Colors.white),
283
                     backgroundColor: MaterialStateProperty.all(Colors.white),
284
                     shape: MaterialStateProperty.all(
284
                     shape: MaterialStateProperty.all(

+ 10
- 8
lib/pages/addressList/index.dart Parādīt failu

58
         ),
58
         ),
59
         onCancel: () => true,
59
         onCancel: () => true,
60
         onConfirm: () {
60
         onConfirm: () {
61
-              addressDelete(id).then((value) {
62
-                List<Address> list = addressController.addressList.value.toList();
63
-                list.removeWhere((element) => element.addressId == id);
64
-                addressController.addressList(list);
65
-                Fluttertoast.showToast(msg: '删除成功!');
66
-              });
67
-            });
61
+          addressDelete(id).then((value) {
62
+            List<Address> list = addressController.addressList.value.toList();
63
+            list.removeWhere((element) => element.addressId == id);
64
+            addressController.addressList(list);
65
+            Fluttertoast.showToast(msg: '删除成功!');
66
+          });
67
+        });
68
   }
68
   }
69
 
69
 
70
   Widget buildList() {
70
   Widget buildList() {
97
         );
97
         );
98
       }).toList();
98
       }).toList();
99
 
99
 
100
-      return Column(children: children,);
100
+      return Column(
101
+        children: children,
102
+      );
101
     });
103
     });
102
   }
104
   }
103
 
105
 

+ 164
- 157
lib/pages/login/login.dart Parādīt failu

1
 import 'dart:async';
1
 import 'dart:async';
2
-import 'dart:ffi';
3
 import 'package:farmer_client/models/app.dart';
2
 import 'package:farmer_client/models/app.dart';
4
 import 'package:farmer_client/pages/home/index.dart';
3
 import 'package:farmer_client/pages/home/index.dart';
5
 import 'package:fluttertoast/fluttertoast.dart';
4
 import 'package:fluttertoast/fluttertoast.dart';
6
-import 'package:flutter/gestures.dart';
7
 import 'package:flutter/material.dart';
5
 import 'package:flutter/material.dart';
8
 import 'package:flutter_screenutil/flutter_screenutil.dart';
6
 import 'package:flutter_screenutil/flutter_screenutil.dart';
9
 import 'package:get/get.dart';
7
 import 'package:get/get.dart';
109
     });
107
     });
110
   }
108
   }
111
 
109
 
112
-  //登按钮
110
+  //登按钮
113
   void _handelSubmit() {
111
   void _handelSubmit() {
114
     if (handleCodes == '' || handlePhones == '') {
112
     if (handleCodes == '' || handlePhones == '') {
115
       Fluttertoast.showToast(msg: '请输入验证码或手机号!');
113
       Fluttertoast.showToast(msg: '请输入验证码或手机号!');
147
               fit: BoxFit.cover,
145
               fit: BoxFit.cover,
148
             ),
146
             ),
149
           ),
147
           ),
150
-          child: Container(
151
-            child: ListView(
152
-              // mainAxisAlignment: MainAxisAlignment.end,
153
-              // crossAxisAlignment: CrossAxisAlignment.start,
154
-              children: [
155
-                Padding(
156
-                  padding: EdgeInsets.fromLTRB(15, 0, 0, 5),
157
-                  child: const Text(
158
-                    '您好!',
148
+          child: ListView(
149
+            children: [
150
+              SizedBox(
151
+                height: 44.w,
152
+                child: Center(
153
+                  child: Text(
154
+                    '登录',
159
                     style: TextStyle(
155
                     style: TextStyle(
156
+                      letterSpacing: 3,
160
                       fontWeight: FontWeight.bold,
157
                       fontWeight: FontWeight.bold,
161
-                      fontSize: 33,
158
+                      color: const Color(0xFF333333),
159
+                      fontSize: 17.sp,
162
                     ),
160
                     ),
163
                   ),
161
                   ),
164
                 ),
162
                 ),
165
-                Padding(
166
-                  padding: EdgeInsets.fromLTRB(15, 0, 0, 0),
167
-                  child: const Text(
168
-                    '欢迎进入农户端应用!',
169
-                    style: TextStyle(
170
-                      fontWeight: FontWeight.bold,
171
-                      fontSize: 27,
172
-                    ),
163
+              ),
164
+              Padding(
165
+                padding: EdgeInsets.fromLTRB(15, 0, 0, 5),
166
+                child: const Text(
167
+                  '您好!',
168
+                  style: TextStyle(
169
+                    fontWeight: FontWeight.bold,
170
+                    fontSize: 33,
173
                   ),
171
                   ),
174
                 ),
172
                 ),
175
-                Cell(
176
-                    // margin: EdgeInsets.symmetric(horizontal: 13.w),
177
-                    margin: const EdgeInsets.fromLTRB(13, 43, 10, 0),
178
-                    header: Text(
179
-                      "+86",
180
-                      style: TextStyle(
181
-                        fontSize: 19.sp,
182
-                      ),
183
-                    ),
184
-                    child: TextField(
185
-                      maxLength: 11,
186
-                      keyboardType: TextInputType.number,
187
-                      style: TextStyle(
188
-                        fontSize: 17.sp,
189
-                      ),
190
-                      decoration: const InputDecoration(
191
-                        isCollapsed: true,
192
-                        contentPadding:
193
-                            EdgeInsets.symmetric(vertical: 8, horizontal: 16),
194
-                        labelText: "请输入手机号码",
195
-                        counterText: '', //去掉计数
196
-                        border: InputBorder.none,
197
-                        floatingLabelBehavior: FloatingLabelBehavior.never,
198
-                      ),
199
-                      onChanged: (e) {
200
-                        _handlePhone(e);
201
-                      },
202
-                    ),
203
-                    footer: SizedBox(
204
-                      child: ElevatedButton(
205
-                        onPressed: () => {
206
-                          setState(() {
207
-                            _buttonClickListen();
208
-                          })
209
-                        },
210
-                        child: Text(
211
-                          '$buttonText',
212
-                          style: TextStyle(
213
-                            fontSize: 15.sp,
214
-                          ),
215
-                        ),
216
-                        style: ButtonStyle(
217
-                          backgroundColor: isButtonEnable
218
-                              ? MaterialStateProperty.all(
219
-                                  const Color(0xFFFF703B))
220
-                              : MaterialStateProperty.all(
221
-                                  const Color(0xFFCBCBCB)),
222
-                          shape: MaterialStateProperty.all(
223
-                              const RoundedRectangleBorder(
224
-                                  borderRadius:
225
-                                      BorderRadius.all(Radius.circular(10)))),
226
-                        ),
227
-                      ),
228
-                    )),
229
-                Cell(
173
+              ),
174
+              Padding(
175
+                padding: EdgeInsets.fromLTRB(15, 0, 0, 0),
176
+                child: const Text(
177
+                  '欢迎进入农户端应用!',
178
+                  style: TextStyle(
179
+                    fontWeight: FontWeight.bold,
180
+                    fontSize: 27,
181
+                  ),
182
+                ),
183
+              ),
184
+              Cell(
230
                   // margin: EdgeInsets.symmetric(horizontal: 13.w),
185
                   // margin: EdgeInsets.symmetric(horizontal: 13.w),
231
-                  margin: const EdgeInsets.fromLTRB(13, 16, 10, 0),
232
-
233
-                  header: Align(
234
-                    alignment: FractionalOffset(0.1, 0.5),
235
-                    child: Image.asset(
236
-                      'images/phoneCode.png',
237
-                      width: 20,
238
-                      height: 20,
186
+                  margin: const EdgeInsets.fromLTRB(13, 43, 10, 0),
187
+                  header: Text(
188
+                    "+86",
189
+                    style: TextStyle(
190
+                      fontSize: 19.sp,
239
                     ),
191
                     ),
240
                   ),
192
                   ),
241
-
242
                   child: TextField(
193
                   child: TextField(
194
+                    maxLength: 11,
243
                     keyboardType: TextInputType.number,
195
                     keyboardType: TextInputType.number,
244
                     style: TextStyle(
196
                     style: TextStyle(
245
                       fontSize: 17.sp,
197
                       fontSize: 17.sp,
248
                       isCollapsed: true,
200
                       isCollapsed: true,
249
                       contentPadding:
201
                       contentPadding:
250
                           EdgeInsets.symmetric(vertical: 8, horizontal: 16),
202
                           EdgeInsets.symmetric(vertical: 8, horizontal: 16),
251
-                      labelText: "请输入验证码",
203
+                      labelText: "请输入手机号码",
204
+                      counterText: '', //去掉计数
252
                       border: InputBorder.none,
205
                       border: InputBorder.none,
253
                       floatingLabelBehavior: FloatingLabelBehavior.never,
206
                       floatingLabelBehavior: FloatingLabelBehavior.never,
254
                     ),
207
                     ),
255
                     onChanged: (e) {
208
                     onChanged: (e) {
256
-                      _handleCode(e);
209
+                      _handlePhone(e);
257
                     },
210
                     },
258
                   ),
211
                   ),
259
-                ),
260
-                Container(
261
-                  height: 350.h,
262
-                  alignment: Alignment.bottomCenter,
263
-                  child: SizedBox(
264
-                    width: 315.w,
265
-                    height: 49.h,
212
+                  footer: SizedBox(
266
                     child: ElevatedButton(
213
                     child: ElevatedButton(
267
-                      onPressed: () {
268
-                        _handelSubmit();
214
+                      onPressed: () => {
215
+                        setState(() {
216
+                          _buttonClickListen();
217
+                        })
269
                       },
218
                       },
270
-                      child: const Text(
271
-                        "登陆",
219
+                      child: Text(
220
+                        '$buttonText',
272
                         style: TextStyle(
221
                         style: TextStyle(
273
-                            fontSize: 18,
274
-                            color: Colors.white,
275
-                            fontWeight: FontWeight.bold),
222
+                          fontSize: 15.sp,
223
+                        ),
276
                       ),
224
                       ),
277
                       style: ButtonStyle(
225
                       style: ButtonStyle(
278
-                        elevation: MaterialStateProperty.all(0),
279
-                        backgroundColor:
280
-                            MaterialStateProperty.all(const Color(0xFFFF703B)),
226
+                        backgroundColor: isButtonEnable
227
+                            ? MaterialStateProperty.all(const Color(0xFFFF703B))
228
+                            : MaterialStateProperty.all(
229
+                                const Color(0xFFCBCBCB)),
281
                         shape: MaterialStateProperty.all(
230
                         shape: MaterialStateProperty.all(
282
                             const RoundedRectangleBorder(
231
                             const RoundedRectangleBorder(
283
                                 borderRadius:
232
                                 borderRadius:
284
-                                    BorderRadius.all(Radius.circular(24.4)))),
233
+                                    BorderRadius.all(Radius.circular(10)))),
285
                       ),
234
                       ),
286
                     ),
235
                     ),
236
+                  )),
237
+              Cell(
238
+                // margin: EdgeInsets.symmetric(horizontal: 13.w),
239
+                margin: const EdgeInsets.fromLTRB(13, 16, 10, 0),
240
+
241
+                header: Align(
242
+                  alignment: FractionalOffset(0.1, 0.5),
243
+                  child: Image.asset(
244
+                    'images/phoneCode.png',
245
+                    width: 20,
246
+                    height: 20,
287
                   ),
247
                   ),
288
                 ),
248
                 ),
289
-                Container(
290
-                    padding: EdgeInsets.fromLTRB(10.0, 10, 0, 10),
291
-                    child: Row(
292
-                      children: <Widget>[
293
-                        Radio<bool>(
294
-                            value: true,
295
-                            activeColor: Color(0xFFFF703B),
296
-                            groupValue: _newValue,
297
-                            onChanged: (value) {
298
-                              setState(() {
299
-                                _newValue = value!;
300
-                              });
301
-                            }),
302
-                        // SizedBox(
303
-                        //   child:Text('文本协议/隐私政策',style: TextStyle(fontSize:15.sp,color: Color(0xffce3800))),
304
-                        // ),
305
-                        Text('请认真查看',
306
-                            style: TextStyle(
307
-                                fontSize: 14.sp, color: Color(0xff2a2a2a))),
308
-                        GestureDetector(
309
-                          onTap: () {
310
-                            Get.toNamed('/agreement');
311
-                          },
312
-                          child: Text('文本协议/隐私政策',
313
-                              style: TextStyle(
314
-                                  fontSize: 14.sp, color: Color(0xffce3800))),
315
-                        ),
316
-                        Text(',确认之后选择此项',
249
+
250
+                child: TextField(
251
+                  keyboardType: TextInputType.number,
252
+                  style: TextStyle(
253
+                    fontSize: 17.sp,
254
+                  ),
255
+                  decoration: const InputDecoration(
256
+                    isCollapsed: true,
257
+                    contentPadding:
258
+                        EdgeInsets.symmetric(vertical: 8, horizontal: 16),
259
+                    labelText: "请输入验证码",
260
+                    border: InputBorder.none,
261
+                    floatingLabelBehavior: FloatingLabelBehavior.never,
262
+                  ),
263
+                  onChanged: (e) {
264
+                    _handleCode(e);
265
+                  },
266
+                ),
267
+              ),
268
+              Container(
269
+                height: 350.h,
270
+                alignment: Alignment.bottomCenter,
271
+                child: SizedBox(
272
+                  width: 315.w,
273
+                  height: 49.h,
274
+                  child: ElevatedButton(
275
+                    onPressed: () {
276
+                      _handelSubmit();
277
+                    },
278
+                    child: const Text(
279
+                      "登录",
280
+                      style: TextStyle(
281
+                          fontSize: 18,
282
+                          color: Colors.white,
283
+                          fontWeight: FontWeight.bold),
284
+                    ),
285
+                    style: ButtonStyle(
286
+                      elevation: MaterialStateProperty.all(0),
287
+                      backgroundColor:
288
+                          MaterialStateProperty.all(const Color(0xFFFF703B)),
289
+                      shape: MaterialStateProperty.all(
290
+                          const RoundedRectangleBorder(
291
+                              borderRadius:
292
+                                  BorderRadius.all(Radius.circular(24.4)))),
293
+                    ),
294
+                  ),
295
+                ),
296
+              ),
297
+              Container(
298
+                  padding: EdgeInsets.fromLTRB(10.0, 10, 0, 10),
299
+                  child: Row(
300
+                    children: <Widget>[
301
+                      Radio<bool>(
302
+                          value: true,
303
+                          activeColor: Color(0xFFFF703B),
304
+                          groupValue: _newValue,
305
+                          onChanged: (value) {
306
+                            setState(() {
307
+                              _newValue = value!;
308
+                            });
309
+                          }),
310
+                      // SizedBox(
311
+                      //   child:Text('文本协议/隐私政策',style: TextStyle(fontSize:15.sp,color: Color(0xffce3800))),
312
+                      // ),
313
+                      Text('请认真查看',
314
+                          style: TextStyle(
315
+                              fontSize: 14.sp, color: Color(0xff2a2a2a))),
316
+                      GestureDetector(
317
+                        onTap: () {
318
+                          Get.toNamed('/agreement');
319
+                        },
320
+                        child: Text('文本协议/隐私政策',
317
                             style: TextStyle(
321
                             style: TextStyle(
318
-                                fontSize: 14.sp, color: Color(0xff2a2a2a))),
319
-                        // RichText(
320
-                        //   text: TextSpan(children: <InlineSpan>[
321
-                        //     const TextSpan(
322
-                        //         text: '请认真查看',
323
-                        //         style: TextStyle(color: Color(0xff2a2a2a))),
324
-                        //     TextSpan(
325
-                        //       text: '文本协议/隐私政策,',
326
-                        //       style: TextStyle(color: Color(0xffce3800)),
327
-                        //       recognizer:
328
-                        //           TapGestureRecognizer() //踩坑。。。recognizer 是手势交互 除了我现在些的是 点击交互,其他一般都是抽象类。
329
-                        //             ..onTap = () {
330
-                        //               Get.toNamed('/agreement');
331
-                        //             },
332
-                        //     ),
333
-                        //     const TextSpan(
334
-                        //         text: '确认之后选择此项',
335
-                        //         style: TextStyle(color: Color(0xff2a2a2a))),
336
-                        //   ]),
337
-                        // ),
338
-                      ],
339
-                    )),
340
-              ],
341
-            ),
322
+                                fontSize: 14.sp, color: Color(0xffce3800))),
323
+                      ),
324
+                      Text(',确认之后选择此项',
325
+                          style: TextStyle(
326
+                              fontSize: 14.sp, color: Color(0xff2a2a2a))),
327
+                      // RichText(
328
+                      //   text: TextSpan(children: <InlineSpan>[
329
+                      //     const TextSpan(
330
+                      //         text: '请认真查看',
331
+                      //         style: TextStyle(color: Color(0xff2a2a2a))),
332
+                      //     TextSpan(
333
+                      //       text: '文本协议/隐私政策,',
334
+                      //       style: TextStyle(color: Color(0xffce3800)),
335
+                      //       recognizer:
336
+                      //           TapGestureRecognizer() //踩坑。。。recognizer 是手势交互 除了我现在些的是 点击交互,其他一般都是抽象类。
337
+                      //             ..onTap = () {
338
+                      //               Get.toNamed('/agreement');
339
+                      //             },
340
+                      //     ),
341
+                      //     const TextSpan(
342
+                      //         text: '确认之后选择此项',
343
+                      //         style: TextStyle(color: Color(0xff2a2a2a))),
344
+                      //   ]),
345
+                      // ),
346
+                    ],
347
+                  )),
348
+            ],
342
           ),
349
           ),
343
         ),
350
         ),
344
       ),
351
       ),

+ 6
- 2
lib/pages/machinery/detail/index.dart Parādīt failu

3
 import 'package:farmer_client/widgets/layout/BasicPage.dart';
3
 import 'package:farmer_client/widgets/layout/BasicPage.dart';
4
 import 'package:flutter/material.dart';
4
 import 'package:flutter/material.dart';
5
 import 'package:flutter_easyloading/flutter_easyloading.dart';
5
 import 'package:flutter_easyloading/flutter_easyloading.dart';
6
+import 'package:fluttertoast/fluttertoast.dart';
6
 import 'package:get/get.dart';
7
 import 'package:get/get.dart';
7
 import '../../../services/homeAPI.dart';
8
 import '../../../services/homeAPI.dart';
8
 import 'widgets/detail.dart';
9
 import 'widgets/detail.dart';
31
       markId = Get.arguments['id'];
32
       markId = Get.arguments['id'];
32
       marKm = Get.arguments['km'];
33
       marKm = Get.arguments['km'];
33
       print(marKm);
34
       print(marKm);
34
-      getMachineryInfo(markId, appController.locationStr, true)
35
+      getMachineryInfo(
36
+              markId, appController.locationStr ?? '112.091892,32.690712', true)
35
           .then((value) {
37
           .then((value) {
36
         machineryInfoContent(CardInfo.fromJson(value));
38
         machineryInfoContent(CardInfo.fromJson(value));
37
         machineryListBanner(machineryInfoContent().imagesList!);
39
         machineryListBanner(machineryInfoContent().imagesList!);
38
         machineryListContent(machineryInfoContent().contentList!);
40
         machineryListContent(machineryInfoContent().contentList!);
39
         EasyLoading.dismiss();
41
         EasyLoading.dismiss();
40
-
42
+      }).catchError((error) {
43
+        EasyLoading.dismiss();
44
+        Fluttertoast.showToast(msg: error.error['message']);
41
       });
45
       });
42
     }
46
     }
43
     print("----show----detail page--------------");
47
     print("----show----detail page--------------");

+ 3
- 7
lib/pages/machinery/detail/widgets/detail.dart Parādīt failu

5
 import 'package:flutter/material.dart';
5
 import 'package:flutter/material.dart';
6
 import 'package:flutter_screenutil/flutter_screenutil.dart';
6
 import 'package:flutter_screenutil/flutter_screenutil.dart';
7
 import 'package:farmer_client/widgets/ExtendContentList.dart';
7
 import 'package:farmer_client/widgets/ExtendContentList.dart';
8
-import 'package:farmer_client/models/entities/ExtendContent.dart';
9
-import 'package:get/get.dart';
10
 import '../../../../models/entities/CardInfo.dart';
8
 import '../../../../models/entities/CardInfo.dart';
11
 import '../../widgets/summary.dart';
9
 import '../../widgets/summary.dart';
12
 
10
 
20
   return DefLayout(
18
   return DefLayout(
21
       head: CarouselSlider(
19
       head: CarouselSlider(
22
         items: bnnerItem
20
         items: bnnerItem
23
-            .map((item) => Container(
24
-                  child: Center(
25
-                      child: Image.network(item.url.toString(),
26
-                          fit: BoxFit.fitWidth, width: 370.w)),
27
-                ))
21
+            .map((item) => Center(
22
+                child: Image.network(item.url.toString(),
23
+                    fit: BoxFit.fitWidth, width: 370.w)))
28
             .toList(),
24
             .toList(),
29
         options: CarouselOptions(
25
         options: CarouselOptions(
30
           autoPlay: true,
26
           autoPlay: true,

+ 6
- 2
lib/pages/machinery/map/index.dart Parādīt failu

3
 import 'package:farmer_client/widgets/layout/BasicPage.dart';
3
 import 'package:farmer_client/widgets/layout/BasicPage.dart';
4
 import 'package:flutter/material.dart';
4
 import 'package:flutter/material.dart';
5
 import 'package:flutter_easyloading/flutter_easyloading.dart';
5
 import 'package:flutter_easyloading/flutter_easyloading.dart';
6
+import 'package:fluttertoast/fluttertoast.dart';
6
 import 'package:get/get.dart';
7
 import 'package:get/get.dart';
7
 
8
 
8
 import '../../../models/entities/CardInfo.dart';
9
 import '../../../models/entities/CardInfo.dart';
31
       markId = Get.arguments['id'];
32
       markId = Get.arguments['id'];
32
       marKm = Get.arguments['km'];
33
       marKm = Get.arguments['km'];
33
       print(marKm);
34
       print(marKm);
34
-      getMachineryInfo(markId, appController.locationStr, true)
35
+      getMachineryInfo(
36
+              markId, appController.locationStr ?? '112.091892,32.690712', true)
35
           .then((value) {
37
           .then((value) {
36
         machineryInfoContent(CardInfo.fromJson(value));
38
         machineryInfoContent(CardInfo.fromJson(value));
37
         EasyLoading.dismiss();
39
         EasyLoading.dismiss();
38
-
40
+      }).catchError((error) {
41
+        EasyLoading.dismiss();
42
+        Fluttertoast.showToast(msg: error.error['message']);
39
       });
43
       });
40
     }
44
     }
41
     print("----show----map page--------------");
45
     print("----show----map page--------------");

+ 1
- 0
lib/pages/machinery/map/widgets/detail.dart Parādīt failu

27
       height: DefLayout.headHeight,
27
       height: DefLayout.headHeight,
28
       child: Image.network(
28
       child: Image.network(
29
         item.thumb.toString(),
29
         item.thumb.toString(),
30
+        width:375.w,
30
         fit: BoxFit.cover,
31
         fit: BoxFit.cover,
31
         errorBuilder: (ctx, exception, stackTrace) {
32
         errorBuilder: (ctx, exception, stackTrace) {
32
           return Container(); //THE WIDGET YOU WANT TO SHOW IF URL NOT RETURN IMAGE
33
           return Container(); //THE WIDGET YOU WANT TO SHOW IF URL NOT RETURN IMAGE

+ 9
- 7
lib/pages/main/widgets/main/index.dart Parādīt failu

15
 
15
 
16
   GetStorage box = GetStorage();
16
   GetStorage box = GetStorage();
17
 
17
 
18
-
19
   void _userOut() {
18
   void _userOut() {
20
     modal.showDialog(
19
     modal.showDialog(
21
         title: '提示',
20
         title: '提示',
22
         content: Container(
21
         content: Container(
23
           alignment: Alignment.center,
22
           alignment: Alignment.center,
24
-          child: Text('确定要退出登吗?'),
23
+          child: Text('确定要退出登吗?'),
25
         ),
24
         ),
26
         onCancel: () => true,
25
         onCancel: () => true,
27
         onConfirm: () => {
26
         onConfirm: () => {
43
               OtherColumn(), //功能菜单栏
42
               OtherColumn(), //功能菜单栏
44
               Card(
43
               Card(
45
                 //设置圆角
44
                 //设置圆角
46
-                shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20.0)),
45
+                shape: RoundedRectangleBorder(
46
+                    borderRadius: BorderRadius.circular(20.0)),
47
                 // 普通的边
47
                 // 普通的边
48
-                elevation: 1,// 阴影大小
48
+                elevation: 1, // 阴影大小
49
                 // height: 70.h,
49
                 // height: 70.h,
50
                 margin: EdgeInsets.only(top: 10, bottom: 40.0),
50
                 margin: EdgeInsets.only(top: 10, bottom: 40.0),
51
                 child: SizedBox(
51
                 child: SizedBox(
56
                       _userOut();
56
                       _userOut();
57
                     },
57
                     },
58
                     child: const Text(
58
                     child: const Text(
59
-                      "退出登",
59
+                      "退出登",
60
                       style: TextStyle(
60
                       style: TextStyle(
61
                           fontSize: 18,
61
                           fontSize: 18,
62
                           color: Colors.black,
62
                           color: Colors.black,
76
               ),
76
               ),
77
               Container(
77
               Container(
78
                 margin: EdgeInsets.fromLTRB(0, 5, 0, 15),
78
                 margin: EdgeInsets.fromLTRB(0, 5, 0, 15),
79
-                child: Text('南京市云致科技有限公司 提供技术支持',style: TextStyle(fontSize: 15.sp,color: Color(
80
-                    0xff999999)),),
79
+                child: Text(
80
+                  '南京市云致科技有限公司 提供技术支持',
81
+                  style: TextStyle(fontSize: 15.sp, color: Color(0xff999999)),
82
+                ),
81
               )
83
               )
82
             ],
84
             ],
83
           ),
85
           ),

+ 1
- 1
lib/pages/main/widgets/main/widgets/UserInfo.dart Parādīt failu

108
                       ),
108
                       ),
109
                     ),
109
                     ),
110
                     // const Text(
110
                     // const Text(
111
-                    //      '点击登',
111
+                    //      '点击登',
112
                     //      style: TextStyle(
112
                     //      style: TextStyle(
113
                     //        color: Colors.white,
113
                     //        color: Colors.white,
114
                     //        fontSize: 17,
114
                     //        fontSize: 17,

+ 0
- 1
lib/pages/order/index.dart Parādīt failu

1
 import 'package:farmer_client/pages/order/widgets/index.dart';
1
 import 'package:farmer_client/pages/order/widgets/index.dart';
2
 import 'package:flutter/material.dart';
2
 import 'package:flutter/material.dart';
3
 import 'package:get/get.dart';
3
 import 'package:get/get.dart';
4
-import 'package:get/get_rx/src/rx_types/rx_types.dart';
5
 import 'package:farmer_client/models/entities/OrderInfoModel.dart';
4
 import 'package:farmer_client/models/entities/OrderInfoModel.dart';
6
 import 'package:farmer_client/services/orderAPI.dart';
5
 import 'package:farmer_client/services/orderAPI.dart';
7
 import 'package:farmer_client/widgets/OrderListCard.dart';
6
 import 'package:farmer_client/widgets/OrderListCard.dart';

+ 16
- 24
lib/pages/order/widgets/index.dart Parādīt failu

7
   @override
7
   @override
8
   Widget build(BuildContext context) {
8
   Widget build(BuildContext context) {
9
     return Container(
9
     return Container(
10
-      padding: EdgeInsets.fromLTRB(15, 0, 15, 0),
10
+      padding: const EdgeInsets.fromLTRB(15, 0, 15, 0),
11
       height: 55.w,
11
       height: 55.w,
12
-      decoration: BoxDecoration(color: Colors.white),
12
+      decoration: const BoxDecoration(color: Colors.white),
13
       child: Row(
13
       child: Row(
14
-        mainAxisAlignment: MainAxisAlignment.spaceBetween,
15
         children: [
14
         children: [
16
-          Row(
17
-            children: [
18
-              Padding(
19
-                padding: EdgeInsets.fromLTRB(0, 0, 8, 0),
20
-                child: Image(
21
-                  image: AssetImage('images/ordersListImga.png'),
22
-                  fit: BoxFit.cover,
23
-                  width: 18.w,
24
-                ),
25
-              ),
26
-              Text(
27
-                '订单列表',
28
-                style: TextStyle(
29
-                    color: Color(0xff222222),
30
-                    fontSize: 20.sp,
31
-                    fontWeight: FontWeight.bold),
32
-              )
33
-            ],
15
+          Padding(
16
+            padding: const EdgeInsets.fromLTRB(0, 0, 8, 0),
17
+            child: Image(
18
+              image: const AssetImage('images/ordersListImga.png'),
19
+              fit: BoxFit.cover,
20
+              width: 18.w,
21
+            ),
34
           ),
22
           ),
23
+          Text(
24
+            '订单列表',
25
+            style: TextStyle(
26
+                color: const Color(0xff222222),
27
+                fontSize: 20.sp,
28
+                fontWeight: FontWeight.bold),
29
+          )
35
         ],
30
         ],
36
       ),
31
       ),
37
     );
32
     );
38
-
39
   }
33
   }
40
 }
34
 }
41
-
42
-

+ 114
- 126
lib/pages/orderInfo/index.dart Parādīt failu

22
   final id = Rx<String>('');
22
   final id = Rx<String>('');
23
   final orderStateText = Rx<String>('待支付');
23
   final orderStateText = Rx<String>('待支付');
24
   final orderStateColor = Rx<Color>(Colors.black);
24
   final orderStateColor = Rx<Color>(Colors.black);
25
-  final orderInfoContent = Rx<OrderInfoModel>(OrderInfoModel());
25
+  final orderInfoContent = Rx<OrderInfoModel>(OrderInfoModel.fromJson(
26
+      {'status': 6, 'dispatchStatus': 6, 'workStatus': 6}));
27
+
26
   final evalText = Rx<String>('');
28
   final evalText = Rx<String>('');
27
   final evalStars = Rx<num>(-1);
29
   final evalStars = Rx<num>(-1);
28
-  var processStatus;
29
 
30
 
30
   // orderStates
31
   // orderStates
31
   @override
32
   @override
32
   void beforeShow() {
33
   void beforeShow() {
33
     // TODO: implement beforeShow
34
     // TODO: implement beforeShow
34
     super.beforeShow();
35
     super.beforeShow();
35
-    if (Get.arguments['id'] != null) {
36
-      id(Get.arguments['id']);
36
+    if (Get.arguments != null && Get.arguments['orderId'] != null) {
37
+      id(Get.arguments['orderId']);
37
 
38
 
38
-      orderInfo(id()).then((value) {
39
+      orderInfo(Get.arguments['orderId']).then((value) {
39
         EasyLoading.show(status: '数据加载中...');
40
         EasyLoading.show(status: '数据加载中...');
40
         OrderInfoModel orderInfo = OrderInfoModel.fromJson(value);
41
         OrderInfoModel orderInfo = OrderInfoModel.fromJson(value);
41
-        processStatus = getProcessStatus(orderInfo);
42
-        ProcessSign processSign = getProcessSign(processStatus);
42
+        ProcessSign processSign = getProcessSign(getProcessStatus(orderInfo));
43
         orderStateText(processSign.label);
43
         orderStateText(processSign.label);
44
         orderStateColor(processSign.color);
44
         orderStateColor(processSign.color);
45
         orderInfoContent(orderInfo);
45
         orderInfoContent(orderInfo);
48
     }
48
     }
49
   }
49
   }
50
 
50
 
51
+  Widget _action(BuildContext context, String orderId) {
52
+    bool mustAction = false;
53
+    var btnLabel;
54
+    var btnFunction;
55
+
56
+    switch (getProcessStatus(orderInfoContent.value)) {
57
+      case 1:
58
+      case 2:
59
+        mustAction = true;
60
+        btnLabel = '取消';
61
+        btnFunction = () {
62
+          _cancelOrder(orderId);
63
+        };
64
+        break;
65
+      case 4:
66
+        mustAction = true;
67
+        btnLabel = '支付';
68
+        btnFunction = () {
69
+          _bottomSheet(context);
70
+        };
71
+        break;
72
+      case 5:
73
+        mustAction = true;
74
+        btnLabel = '评价';
75
+        btnFunction = () {
76
+          _fnEvaluate(orderId);
77
+        };
78
+        break;
79
+      case 3:
80
+      case 6:
81
+      default:
82
+        break;
83
+    }
84
+
85
+    if (mustAction) {
86
+      return DefaultButton(
87
+        color: const Color(0xffffffff),
88
+        backColor: const Color(0xFFFF703B),
89
+        width: 300.w,
90
+        height: 49.h,
91
+        text: btnLabel,
92
+        margin: const EdgeInsets.all(0),
93
+        fontSize: 20.sp,
94
+        radius: 24.5.w,
95
+        onPressed: btnFunction,
96
+      );
97
+    } else {
98
+      return const Text('');
99
+    }
100
+  }
101
+
51
   @override
102
   @override
52
   Widget builder(BuildContext context) {
103
   Widget builder(BuildContext context) {
53
     naviTitle = '订单详情';
104
     naviTitle = '订单详情';
79
         ),
130
         ),
80
         onCancel: () => true,
131
         onCancel: () => true,
81
         onConfirm: () => {
132
         onConfirm: () => {
82
-          orderDelete(orderId).then((value) {
83
-            Fluttertoast.showToast(msg: '订单取消成功!');
84
-            Get.offAllNamed('/order');
85
-          })
86
-        });
133
+              orderDelete(orderId).then((value) {
134
+                Fluttertoast.showToast(msg: '订单取消成功!');
135
+                Get.offAllNamed('/order');
136
+              })
137
+            });
87
   }
138
   }
88
 
139
 
89
   // 满意度表单
140
   // 满意度表单
94
     return Container(
145
     return Container(
95
         alignment: Alignment.center,
146
         alignment: Alignment.center,
96
         child: Container(
147
         child: Container(
97
-          margin:
98
-          const EdgeInsets.fromLTRB(15, 20, 15, 20),
148
+          margin: const EdgeInsets.fromLTRB(15, 20, 15, 20),
99
           child: Column(
149
           child: Column(
100
             children: [
150
             children: [
101
               Container(
151
               Container(
102
-                padding: const EdgeInsets.fromLTRB(
103
-                    0, 0, 0, 10),
152
+                padding: const EdgeInsets.fromLTRB(0, 0, 0, 10),
104
                 decoration: const BoxDecoration(
153
                 decoration: const BoxDecoration(
105
                     border: Border(
154
                     border: Border(
106
-                        bottom: BorderSide(
107
-                            width: 0.8,
108
-                            color: Color(0x20000000)
109
-                          // 0x17000000
110
-                        ))),
155
+                        bottom: BorderSide(width: 0.8, color: Color(0x20000000)
156
+                            // 0x17000000
157
+                            ))),
111
                 child: Row(
158
                 child: Row(
112
                   children: [
159
                   children: [
113
                     Text(
160
                     Text(
114
                       '满意度:',
161
                       '满意度:',
115
                       style: TextStyle(
162
                       style: TextStyle(
116
-                          fontSize: 17.sp,
117
-                          fontWeight: FontWeight.bold),
163
+                          fontSize: 17.sp, fontWeight: FontWeight.bold),
118
                     ),
164
                     ),
119
                     FFStars(
165
                     FFStars(
120
                       //https://pub.dev/packages/ff_stars
166
                       //https://pub.dev/packages/ff_stars
121
-                      normalStar: Image.asset(
122
-                          'images/icons/starOff.png'),
123
-                      selectedStar: Image.asset(
124
-                          'images/icons/starOn.png'),
125
-                      starsChanged:
126
-                          (realStars, selectedStars) {
127
-                            star = realStars;
128
-                            onEvaluate(star, desc);
167
+                      normalStar: Image.asset('images/icons/starOff.png'),
168
+                      selectedStar: Image.asset('images/icons/starOn.png'),
169
+                      starsChanged: (realStars, selectedStars) {
170
+                        star = realStars;
171
+                        onEvaluate(star, desc);
129
                       },
172
                       },
130
                       step: 1,
173
                       step: 1,
131
                       defaultStars: 0,
174
                       defaultStars: 0,
134
                 ),
177
                 ),
135
               ),
178
               ),
136
               Container(
179
               Container(
137
-                margin: const EdgeInsets.fromLTRB(
138
-                    0, 20, 0, 0),
180
+                margin: const EdgeInsets.fromLTRB(0, 20, 0, 0),
139
                 width: 300.w,
181
                 width: 300.w,
140
                 height: 100.w,
182
                 height: 100.w,
141
                 decoration: BoxDecoration(
183
                 decoration: BoxDecoration(
147
                 child: TextField(
189
                 child: TextField(
148
                   minLines: 6,
190
                   minLines: 6,
149
                   maxLines: 6,
191
                   maxLines: 6,
150
-                  style: TextStyle(
151
-                      fontSize: 17.sp, height: 1.5),
192
+                  style: TextStyle(fontSize: 17.sp, height: 1.5),
152
                   decoration: const InputDecoration(
193
                   decoration: const InputDecoration(
153
                     isCollapsed: true,
194
                     isCollapsed: true,
154
                     border: InputBorder.none,
195
                     border: InputBorder.none,
155
                     counterText: '',
196
                     counterText: '',
156
                     hintText: '请输入评价内容',
197
                     hintText: '请输入评价内容',
157
-                    floatingLabelBehavior:
158
-                    FloatingLabelBehavior.never,
198
+                    floatingLabelBehavior: FloatingLabelBehavior.never,
159
                   ),
199
                   ),
160
                   onChanged: (e) {
200
                   onChanged: (e) {
161
                     desc = e;
201
                     desc = e;
170
 
210
 
171
   // 评价
211
   // 评价
172
   _fnEvaluate(String orderId) {
212
   _fnEvaluate(String orderId) {
173
-    int evalStars = -1;
213
+    double evalStars = -1;
174
     String evalText = '';
214
     String evalText = '';
175
 
215
 
176
-    onEvaluate(int val1, String val2) {
216
+    onEvaluate(double val1, String val2) {
177
       evalStars = val1;
217
       evalStars = val1;
178
       evalText = val2;
218
       evalText = val2;
179
     }
219
     }
184
       onCancel: () => true,
224
       onCancel: () => true,
185
       onConfirm: () {
225
       onConfirm: () {
186
         if (evalStars != -1 && evalText != '') {
226
         if (evalStars != -1 && evalText != '') {
187
-          orderEvaluation(
188
-              orderId, evalStars, evalText)
189
-              .then((value) {
227
+          orderEvaluation(orderId, evalStars, evalText).then((value) {
190
             Fluttertoast.showToast(msg: '评价成功!');
228
             Fluttertoast.showToast(msg: '评价成功!');
191
             Get.offAllNamed('/order');
229
             Get.offAllNamed('/order');
192
           });
230
           });
199
   }
237
   }
200
 
238
 
201
   // 调用支付接口
239
   // 调用支付接口
202
-  Future<void> payMoney (String payType) async {
203
-    if(payType=='wxPay'){
204
-      final isInstall=await fluwx.isWeChatInstalled;
205
-      if(!isInstall){
240
+  Future<void> payMoney(String payType) async {
241
+    if (payType == 'wxPay') {
242
+      final isInstall = await fluwx.isWeChatInstalled;
243
+      if (!isInstall) {
206
         EasyLoading.showError('请先安装微信');
244
         EasyLoading.showError('请先安装微信');
207
         return;
245
         return;
208
       }
246
       }
209
       createOrder(id.value, "wx").then((value) {
247
       createOrder(id.value, "wx").then((value) {
210
-        fluwx.payWithWeChat(
248
+        fluwx
249
+            .payWithWeChat(
211
           appId: value['appid'].toString(),
250
           appId: value['appid'].toString(),
212
           partnerId: value['partnerId'].toString(),
251
           partnerId: value['partnerId'].toString(),
213
           prepayId: value['prepayId'].toString(),
252
           prepayId: value['prepayId'].toString(),
215
           nonceStr: value['noncestr'].toString(),
254
           nonceStr: value['noncestr'].toString(),
216
           timeStamp: int.parse(value['timestamp'].toString()),
255
           timeStamp: int.parse(value['timestamp'].toString()),
217
           sign: value['sign'].toString(),
256
           sign: value['sign'].toString(),
218
-        ).then((res) {
257
+        )
258
+            .then((res) {
219
           print("payWithWeChat--------${res}");
259
           print("payWithWeChat--------${res}");
220
-        }).catchError((onError){
260
+        }).catchError((onError) {
221
           print("payWithWeChat错误--------${onError}");
261
           print("payWithWeChat错误--------${onError}");
222
         });
262
         });
223
       });
263
       });
230
           // EasyLoading.showSuccess('支付成功');
270
           // EasyLoading.showSuccess('支付成功');
231
           Get.snackbar('提示', "支付成功");
271
           Get.snackbar('提示', "支付成功");
232
           Get.offAllNamed('/order');
272
           Get.offAllNamed('/order');
233
-        }else{
234
-
273
+        } else {
235
           EasyLoading.showError('支付失败');
274
           EasyLoading.showError('支付失败');
236
         }
275
         }
237
         // 关闭弹窗
276
         // 关闭弹窗
238
       });
277
       });
239
       return;
278
       return;
240
-    } else if(payType=='aliPay'){
241
-      final isInstall=await tobias.isAliPayInstalled();
242
-      if(!isInstall){
279
+    } else if (payType == 'aliPay') {
280
+      final isInstall = await tobias.isAliPayInstalled();
281
+      if (!isInstall) {
243
         EasyLoading.showError('请先安装支付宝');
282
         EasyLoading.showError('请先安装支付宝');
244
         return;
283
         return;
245
       }
284
       }
273
             height: 200.w, //对话框高度就是此高度
312
             height: 200.w, //对话框高度就是此高度
274
             child: Center(
313
             child: Center(
275
                 child: Column(
314
                 child: Column(
276
-                  children: [
277
-                    Padding(
278
-                      padding: EdgeInsets.fromLTRB(0, 25.w, 0, 34.w),
279
-                      child: Bold(text: "支付方式", fontSize: 17.sp),
280
-                    ),
281
-                    PayItem(
282
-                      label: "支付宝",
283
-                      icon: const AssetImage('images/alipay.png'),
284
-                      onPress: () {
285
-                        payMoney('aliPay');
286
-                      },
287
-                    ),
288
-                    PayItem(
289
-                      label: "微信",
290
-                      icon: const AssetImage('images/weChatPay.png'),
291
-                      onPress: () {
292
-                        payMoney('wxPay');
293
-                      },
294
-                    ),
295
-                  ],
296
-                )),
315
+              children: [
316
+                Padding(
317
+                  padding: EdgeInsets.fromLTRB(0, 25.w, 0, 34.w),
318
+                  child: Bold(text: "支付方式", fontSize: 17.sp),
319
+                ),
320
+                PayItem(
321
+                  label: "支付宝",
322
+                  icon: const AssetImage('images/alipay.png'),
323
+                  onPress: () {
324
+                    payMoney('aliPay');
325
+                  },
326
+                ),
327
+                PayItem(
328
+                  label: "微信",
329
+                  icon: const AssetImage('images/weChatPay.png'),
330
+                  onPress: () {
331
+                    payMoney('wxPay');
332
+                  },
333
+                ),
334
+              ],
335
+            )),
297
           );
336
           );
298
         });
337
         });
299
   }
338
   }
300
-
301
-  Widget _action(BuildContext context, String orderId) {
302
-    bool mustAction = false;
303
-    var btnLabel;
304
-    var btnFunction;
305
-
306
-    switch (processStatus) {
307
-      case 1:
308
-      case 2:
309
-        mustAction = true;
310
-        btnLabel = '取消';
311
-        btnFunction = () {
312
-          _cancelOrder(orderId);
313
-        };
314
-        break;
315
-      case 4:
316
-        mustAction = true;
317
-        btnLabel = '支付';
318
-        btnFunction = () {
319
-          _bottomSheet(context);
320
-        };
321
-        break;
322
-      case 5:
323
-        mustAction = true;
324
-        btnLabel = '评价';
325
-        btnFunction = () {
326
-          _fnEvaluate(orderId);
327
-        };
328
-        break;
329
-      case 3:
330
-      case 6:
331
-      default:
332
-        break;
333
-    }
334
-
335
-    if (mustAction) {
336
-      return DefaultButton(
337
-        color: const Color(0xffffffff),
338
-        backColor: const Color(0xFFFF703B),
339
-        width: 300.w,
340
-        height: 49.h,
341
-        text: btnLabel,
342
-        margin: const EdgeInsets.all(0),
343
-        fontSize: 20.sp,
344
-        radius: 24.5.w,
345
-        onPressed: btnFunction,
346
-      );
347
-    } else {
348
-      return const Text('');
349
-    }
350
-  }
351
 }
339
 }

+ 8
- 5
lib/pages/userInfo/index.dart Parādīt failu

20
   @override
20
   @override
21
   void beforeShow() {
21
   void beforeShow() {
22
     super.beforeShow();
22
     super.beforeShow();
23
-    _cName = TextEditingController(text: userInfo.user().nickName.toString());
24
-    _cPhone = TextEditingController(text: userInfo.user().phone.toString());
25
-    name = userInfo.user().nickName.toString();
23
+    name = userInfo.user().nickName != null
24
+        ? userInfo.user().nickName.toString()
25
+        : '';
26
     phone = userInfo.user().phone.toString();
26
     phone = userInfo.user().phone.toString();
27
+    _cName = TextEditingController(text: name);
28
+    _cPhone = TextEditingController(text: phone);
27
   }
29
   }
28
 
30
 
29
   bool disableLogin = false;
31
   bool disableLogin = false;
41
     } else {
43
     } else {
42
       data = {
44
       data = {
43
         ...userInfo.user().toJson(),
45
         ...userInfo.user().toJson(),
44
-        'avatar': userInfo.user().avatar ?? '',
45
         'nickName': name,
46
         'nickName': name,
46
         'phone': phone
47
         'phone': phone
47
       };
48
       };
134
                   Row(
135
                   Row(
135
                       mainAxisAlignment: MainAxisAlignment.spaceBetween,
136
                       mainAxisAlignment: MainAxisAlignment.spaceBetween,
136
                       children: [
137
                       children: [
137
-                        Container(
138
+                        SizedBox(
138
                           width: 327.w,
139
                           width: 327.w,
139
                           child: TextField(
140
                           child: TextField(
140
                             controller: _cName,
141
                             controller: _cName,
158
                           ),
159
                           ),
159
                         ),
160
                         ),
160
                         GestureDetector(
161
                         GestureDetector(
162
+                          behavior: HitTestBehavior.opaque,
161
                           onTap: () {
163
                           onTap: () {
162
                             name = '';
164
                             name = '';
163
                             _cName.clear();
165
                             _cName.clear();
223
                           ),
225
                           ),
224
                         ),
226
                         ),
225
                         GestureDetector(
227
                         GestureDetector(
228
+                          behavior: HitTestBehavior.opaque,
226
                           onTap: () {
229
                           onTap: () {
227
                             phone = '';
230
                             phone = '';
228
                             _cPhone.clear();
231
                             _cPhone.clear();

+ 11
- 17
lib/services/homeAPI.dart Parādīt failu

34
  * @param {*} data
34
  * @param {*} data
35
  * @returns
35
  * @returns
36
  */
36
  */
37
-Future searchMachinery(
38
-    params
39
-) async {
37
+Future searchMachinery(params) async {
40
   return request('/machinery',
38
   return request('/machinery',
41
-      options: Options(method: 'GET'),
42
-      queryParameters: params,
43
-      data: params).catchError((error) => {
44
-        Fluttertoast.showToast(msg: error.error['message']),
45
-      });
39
+          options: Options(method: 'GET'),
40
+          queryParameters: params,
41
+          data: params)
42
+      .catchError((error) => {
43
+            Fluttertoast.showToast(msg: error.error['message']),
44
+          });
46
 }
45
 }
47
 
46
 
48
 /**
47
 /**
76
 
75
 
77
 Future getMachineryInfo(String id, String location, bool attached) async {
76
 Future getMachineryInfo(String id, String location, bool attached) async {
78
   return request('/machinery-summary/$id',
77
   return request('/machinery-summary/$id',
79
-          options: Options(method: 'GET'),
80
-          queryParameters: {'location': location, 'attached': attached})
81
-      .catchError((error) => {
82
-            Fluttertoast.showToast(msg: error.error['message']),
83
-          });
78
+      options: Options(method: 'GET'),
79
+      queryParameters: {'location': location, 'attached': attached});
84
 }
80
 }
85
 
81
 
86
 /**
82
 /**
89
  * @returns
85
  * @returns
90
  */
86
  */
91
 Future getMachineryType(params) async {
87
 Future getMachineryType(params) async {
92
-  return request('/machinery-type', options: Options(method: 'GET'),queryParameters: params);
88
+  return request('/machinery-type',
89
+      options: Options(method: 'GET'), queryParameters: params);
93
 }
90
 }
94
-
95
-
96
-

+ 2
- 2
lib/services/user.dart Parādīt failu

12
   });
12
   });
13
 }
13
 }
14
 
14
 
15
-//登
15
+//登
16
 Future userLogin(String userName, String password) async {
16
 Future userLogin(String userName, String password) async {
17
   return request(
17
   return request(
18
     '/login',
18
     '/login',
19
     options: Options(method: 'POST'),
19
     options: Options(method: 'POST'),
20
     data: {'userName': userName, 'password': password},
20
     data: {'userName': userName, 'password': password},
21
   ).catchError((error) => {
21
   ).catchError((error) => {
22
-        Fluttertoast.showToast(msg: error.error['message']),
22
+        Fluttertoast.showToast(msg: error['message']),
23
       });
23
       });
24
 }
24
 }
25
 
25
 

+ 8
- 0
lib/utils/Request.dart Parādīt failu

1
 import 'dart:convert';
1
 import 'dart:convert';
2
 
2
 
3
 import 'package:dio/dio.dart';
3
 import 'package:dio/dio.dart';
4
+import 'package:fluttertoast/fluttertoast.dart';
4
 import 'package:get/get.dart';
5
 import 'package:get/get.dart';
5
 import 'package:get_storage/get_storage.dart';
6
 import 'package:get_storage/get_storage.dart';
6
 
7
 
39
   );
40
   );
40
 
41
 
41
   var dio = Dio(options);
42
   var dio = Dio(options);
43
+  GetStorage box = GetStorage();
42
   dio.interceptors.add(InterceptorsWrapper(onRequest: (options, handler) {
44
   dio.interceptors.add(InterceptorsWrapper(onRequest: (options, handler) {
43
     // Do something before request is sent
45
     // Do something before request is sent
44
     options.headers['Authorization'] = GetStorage().read("token");
46
     options.headers['Authorization'] = GetStorage().read("token");
50
     // you can reject a `DioError` object eg: `handler.reject(dioError)`
52
     // you can reject a `DioError` object eg: `handler.reject(dioError)`
51
   }, onResponse: (response, handler) {
53
   }, onResponse: (response, handler) {
52
     var resp = response.data as Map<String, dynamic>;
54
     var resp = response.data as Map<String, dynamic>;
55
+    if(resp['code']==1001){
56
+      Fluttertoast.showToast(msg: '登录过期请重新登录!');
57
+      box.remove('token');
58
+      Get.offAllNamed('/login');
59
+      return handler.next(response);
60
+    }
53
     if (resp['code'] == 1000) {
61
     if (resp['code'] == 1000) {
54
       response.data = resp['data'];
62
       response.data = resp['data'];
55
 
63
 

+ 9
- 0
lib/utils/location.dart Parādīt failu

33
 
33
 
34
 // 判断定位权限
34
 // 判断定位权限
35
 Future _requirePermission() async {
35
 Future _requirePermission() async {
36
+  print(1);
37
+  // print(Permission.location);
38
+  print(2);
39
+  // print(Permission.locationAlways);
40
+  print(3);
41
+
36
   PermissionStatus _permissionGranted = await Permission.location.status;
42
   PermissionStatus _permissionGranted = await Permission.location.status;
37
   if (_permissionGranted == PermissionStatus.denied) {
43
   if (_permissionGranted == PermissionStatus.denied) {
38
     // 如果未允许, 尝试申请一次
44
     // 如果未允许, 尝试申请一次
40
     if (_permissionGranted != PermissionStatus.granted) {
46
     if (_permissionGranted != PermissionStatus.granted) {
41
       throw Exception("请设置允许当前程序定位功能");
47
       throw Exception("请设置允许当前程序定位功能");
42
     }
48
     }
49
+    // if (await PermissionHelper.check(Permission.locationAlways)) {
50
+    //   // 这里写应用获取权限之后的业务逻辑
51
+    // }
43
   }
52
   }
44
 }
53
 }
45
 
54
 

+ 0
- 6
lib/widgets/CarsCard.dart Parādīt failu

1
-import 'package:flutter/foundation.dart';
2
 import 'package:flutter/material.dart';
1
 import 'package:flutter/material.dart';
3
 import 'package:flutter_screenutil/flutter_screenutil.dart';
2
 import 'package:flutter_screenutil/flutter_screenutil.dart';
4
 import 'package:get/get.dart';
3
 import 'package:get/get.dart';
5
-import 'package:get/get_core/src/get_main.dart';
6
-
7
-import '../models/entities/CardInfo.dart';
8
 import '../models/entities/CardListModel.dart';
4
 import '../models/entities/CardListModel.dart';
9
-import '../pages/OrderConfirmation/index.dart';
10
 import '../pages/machinery/detail/index.dart';
5
 import '../pages/machinery/detail/index.dart';
11
-import '../pages/machinery/map/index.dart';
12
 import 'LinearGradientText.dart';
6
 import 'LinearGradientText.dart';
13
 
7
 
14
 class CarsCard extends StatefulWidget {
8
 class CarsCard extends StatefulWidget {

+ 14
- 35
lib/widgets/ExtendContentList.dart Parādīt failu

1
 import 'package:flutter/widgets.dart';
1
 import 'package:flutter/widgets.dart';
2
 import 'package:flutter_screenutil/flutter_screenutil.dart';
2
 import 'package:flutter_screenutil/flutter_screenutil.dart';
3
-import 'package:get/get_rx/src/rx_types/rx_types.dart';
4
-import 'package:get/get_state_manager/src/rx_flutter/rx_obx_widget.dart';
5
-
6
 import '../models/entities/CardInfo.dart';
3
 import '../models/entities/CardInfo.dart';
7
-import '../models/entities/ExtendContent.dart';
8
 
4
 
9
 class ExtendContentList extends StatelessWidget {
5
 class ExtendContentList extends StatelessWidget {
10
   final List<ContentImageList> item;
6
   final List<ContentImageList> item;
23
 
19
 
24
   @override
20
   @override
25
   Widget build(BuildContext context) {
21
   Widget build(BuildContext context) {
26
-    //
27
-    // List<Widget> _widgets = [];
28
-    // Container(
29
-    //   child: item.contentType == "image" ? _image(item.content) : _text(item.content),
30
-    // );
31
-    // for (var i = 0; i < item.length; i += 1) {
32
-    //   if (i != 0 ) {
33
-    //     _widgets.add(SizedBox(height: 20.w,));
34
-    //   }
35
-    //   var item = item[i];
36
-    //   _widgets.add(Container(
37
-    //     child: item.contentType == "image" ? _image(item.content) : _text(item.content),
38
-    //   ));
39
-    // }
40
-
41
-    return Container(
42
-      child: Column(
43
-        children: item.map((item) {
44
-          if (item.contentType != 'image') {
45
-            return Container(
46
-                padding: EdgeInsets.fromLTRB(0, 20, 0, 10),
47
-                width: 344.w,
48
-                child: _text(item.content));
49
-          } else {
50
-            return Container(
51
-              padding: EdgeInsets.fromLTRB(0, 10, 0, 10),
52
-              child: _image(item.content),
53
-            );
54
-          }
55
-        }).toList(),
56
-      ),
22
+    return Column(
23
+      children: item.map((item) {
24
+        if (item.contentType != 'image') {
25
+          return Container(
26
+              padding: EdgeInsets.fromLTRB(0, 20, 0, 10),
27
+              width: 344.w,
28
+              child: _text(item.content));
29
+        } else {
30
+          return Container(
31
+            padding: EdgeInsets.fromLTRB(0, 10, 0, 10),
32
+            child: _image(item.content),
33
+          );
34
+        }
35
+      }).toList(),
57
     );
36
     );
58
   }
37
   }
59
 }
38
 }

+ 133
- 124
lib/widgets/OrderListCard.dart Parādīt failu

12
   String title;
12
   String title;
13
   String? value;
13
   String? value;
14
 
14
 
15
-  TextCell({Key? key, required this.title, this.value}):super(key: key);
15
+  TextCell({Key? key, required this.title, this.value}) : super(key: key);
16
 
16
 
17
   @override
17
   @override
18
   Widget build(BuildContext context) {
18
   Widget build(BuildContext context) {
20
       text: TextSpan(children: <InlineSpan>[
20
       text: TextSpan(children: <InlineSpan>[
21
         TextSpan(
21
         TextSpan(
22
             text: title,
22
             text: title,
23
-            style: const TextStyle(
24
-                color: Color(0xff666666),
25
-                fontSize: 16,
23
+            style: TextStyle(
24
+                color: const Color(0xff666666),
25
+                fontSize: 16.sp,
26
                 fontWeight: FontWeight.bold)),
26
                 fontWeight: FontWeight.bold)),
27
         TextSpan(
27
         TextSpan(
28
             text: value,
28
             text: value,
29
-            style: const TextStyle(
30
-                color: Color(0xff222222),
31
-                fontSize: 16,
29
+            style: TextStyle(
30
+                color: const Color(0xff222222),
31
+                fontSize: 16.sp,
32
                 fontWeight: FontWeight.bold)),
32
                 fontWeight: FontWeight.bold)),
33
       ]),
33
       ]),
34
     );
34
     );
35
   }
35
   }
36
-
37
 }
36
 }
38
 
37
 
39
 class OrderListCard extends StatelessWidget {
38
 class OrderListCard extends StatelessWidget {
48
   Widget build(BuildContext context) {
47
   Widget build(BuildContext context) {
49
     return Container(
48
     return Container(
50
       width: 375.w,
49
       width: 375.w,
51
-      height: 345.h,
52
-      margin: const EdgeInsets.fromLTRB(0, 0, 0, 20),
50
+      margin: EdgeInsets.only(bottom: 20.h),
51
+      padding: EdgeInsets.symmetric(vertical: 30.h, horizontal: 15.w),
53
       decoration: const BoxDecoration(color: Colors.white, boxShadow: [
52
       decoration: const BoxDecoration(color: Colors.white, boxShadow: [
54
         BoxShadow(
53
         BoxShadow(
55
             color: Colors.black12,
54
             color: Colors.black12,
56
             offset: Offset(0.0, 15.0), //阴影xy轴偏移量
55
             offset: Offset(0.0, 15.0), //阴影xy轴偏移量
57
             blurRadius: 15.0, //阴影模糊程度
56
             blurRadius: 15.0, //阴影模糊程度
58
             spreadRadius: 1.0 //阴影扩散程度
57
             spreadRadius: 1.0 //阴影扩散程度
59
-        )
58
+            )
60
       ]),
59
       ]),
61
       child: Row(
60
       child: Row(
62
-        crossAxisAlignment: CrossAxisAlignment.start,
63
-        mainAxisAlignment: MainAxisAlignment.spaceBetween,
64
         children: [
61
         children: [
65
           Container(
62
           Container(
66
-            margin: const EdgeInsets.fromLTRB(15, 20, 15, 0),
67
-            width: 18.0,
68
-            height: 275.h,
63
+            margin: EdgeInsets.only(right: 15.w),
64
+            width: 17.w,
65
+            height: 320.h,
69
             child: const Image(
66
             child: const Image(
70
               image: AssetImage('images/ordersLeft.png'),
67
               image: AssetImage('images/ordersLeft.png'),
71
             ),
68
             ),
72
           ),
69
           ),
73
-          Expanded(
74
-            child: Column(
75
-              crossAxisAlignment: CrossAxisAlignment.start,
76
-              children: [
77
-                Container(
78
-                  width: 320.w,
79
-                  margin: const EdgeInsets.fromLTRB(0, 10, 0, 15),
80
-                  padding: const EdgeInsets.fromLTRB(0, 0, 0, 20),
81
-                  decoration: const BoxDecoration(
82
-                      border: Border(
83
-                          bottom:
84
-                          BorderSide(width: 0.5, color: Color(0x20000000)
85
-                            // 0x17000000
86
-                          ))),
87
-                  child: GestureDetector(
88
-                    child:
89
-                    Row(
90
-                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
91
-                      children: [
92
-                        TextCell(title: '订单编号:', value: item.orderNo),
93
-                        Bold(text: "详情 >>", fontSize: 16.sp, color: const Color(0xff222222)),
94
-                      ],
70
+          Column(
71
+            crossAxisAlignment: CrossAxisAlignment.start,
72
+            children: [
73
+              Container(
74
+                width: 313.w,
75
+                margin: EdgeInsets.only(bottom: 20.h),
76
+                padding: EdgeInsets.only(bottom: 20.h),
77
+                decoration: const BoxDecoration(
78
+                  border: Border(
79
+                    bottom: BorderSide(
80
+                      width: 0.5,
81
+                      color: Color(0x20000000),
95
                     ),
82
                     ),
96
-                    onTap: () {
97
-                      Get.toNamed('/orderPageInfo', arguments: {
98
-                        'id': item.orderId,
99
-                        'title': processSign.label,
100
-                        'styleColor': processSign.color
101
-                      });
102
-                    },
103
                   ),
83
                   ),
104
                 ),
84
                 ),
105
-                Expanded(
106
-                    child: Column(
107
-                      crossAxisAlignment: CrossAxisAlignment.start,
108
-                      children: [
109
-                        Padding(
110
-                          padding: const EdgeInsets.fromLTRB(0, 0, 0, 15),
111
-                          child: TextCell(title: '农机名称:', value: item.machineryName),
112
-                        ),
113
-                        Padding(
114
-                          padding: const EdgeInsets.fromLTRB(0, 0, 0, 15),
115
-                          child: TextCell(title: '作业面积:', value: item.amount.toString()),
116
-                        ),
117
-                        Padding(
118
-                          padding: const EdgeInsets.fromLTRB(0, 0, 0, 15),
119
-                          child: TextCell(title: '需求时间:', value: DateFormat("yyyy-MM-dd").format(
120
-                              DateTime.parse(item.appointmentDate.toString()))),
121
-                        ),
122
-                        Padding(
123
-                          padding: const EdgeInsets.fromLTRB(0, 0, 0, 15),
124
-                          child: TextCell(title: '需求时间:', value: DateFormat("yyyy-MM-dd").format(
125
-                              DateTime.parse(item.createDate.toString()))),
126
-                        ),
127
-                      ],
128
-                    )),
129
-                Container(
130
-                  margin: const EdgeInsets.fromLTRB(0, 0, 0, 30),
131
-                  padding: const EdgeInsets.fromLTRB(0, 20, 0, 0),
132
-                  decoration: const BoxDecoration(
133
-                      border: Border(
134
-                          top: BorderSide(
135
-                              width: 0.5, color: Color(0x20000000)))),
136
-                  width: 320.w,
85
+                child: GestureDetector(
137
                   child: Row(
86
                   child: Row(
138
                     mainAxisAlignment: MainAxisAlignment.spaceBetween,
87
                     mainAxisAlignment: MainAxisAlignment.spaceBetween,
139
                     children: [
88
                     children: [
140
-                      RichText(
141
-                        text: TextSpan(children: <InlineSpan>[
142
-                          const TextSpan(
143
-                              text: '订单状态:',
144
-                              style: TextStyle(
145
-                                  color: Color(0xff666666),
146
-                                  fontSize: 16,
147
-                                  fontWeight: FontWeight.bold)),
89
+                      TextCell(title: '订单编号:', value: item.orderNo),
90
+                      Bold(
91
+                        text: "详情 >>",
92
+                        fontSize: 16.sp,
93
+                        color: const Color(0xff222222),
94
+                      ),
95
+                    ],
96
+                  ),
97
+                  onTap: () {
98
+                    Get.toNamed('/orderPageInfo', arguments: {
99
+                      'orderId': item.orderId,
100
+                      'title': processSign.label,
101
+                      'styleColor': processSign.color
102
+                    });
103
+                  },
104
+                ),
105
+              ),
106
+              Padding(
107
+                padding: EdgeInsets.only(bottom: 30.h),
108
+                child: TextCell(title: '农机名称:', value: item.machineryName),
109
+              ),
110
+              Padding(
111
+                padding: EdgeInsets.only(bottom: 30.h),
112
+                child: TextCell(title: '作业面积:', value: item.amount.toString()),
113
+              ),
114
+              Padding(
115
+                padding: EdgeInsets.only(bottom: 30.h),
116
+                child: TextCell(
117
+                    title: '需求时间:',
118
+                    value: DateFormat("yyyy-MM-dd").format(
119
+                        DateTime.parse(item.appointmentDate.toString()))),
120
+              ),
121
+              TextCell(
122
+                title: '下单时间:',
123
+                value: DateFormat("yyyy-MM-dd")
124
+                    .format(DateTime.parse(item.createDate.toString())),
125
+              ),
126
+              Container(
127
+                margin: EdgeInsets.only(top: 22.h),
128
+                padding: EdgeInsets.only(top: 30.h),
129
+                decoration: const BoxDecoration(
130
+                  border: Border(
131
+                    top: BorderSide(
132
+                      width: 0.5,
133
+                      color: Color(0x20000000),
134
+                    ),
135
+                  ),
136
+                ),
137
+                width: 313.w,
138
+                child: Row(
139
+                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
140
+                  children: [
141
+                    RichText(
142
+                      text: TextSpan(
143
+                        children: <InlineSpan>[
148
                           TextSpan(
144
                           TextSpan(
149
-                              text: processSign.label,
150
-                              style: TextStyle(
151
-                                  color: processSign.color,
152
-                                  fontSize: 16,
153
-                                  fontWeight: FontWeight.bold)),
154
-                        ]),
145
+                            text: '订单状态:',
146
+                            style: TextStyle(
147
+                                color: const Color(0xff666666),
148
+                                fontSize: 16.sp,
149
+                                fontWeight: FontWeight.bold),
150
+                          ),
151
+                          TextSpan(
152
+                            text: processSign.label,
153
+                            style: TextStyle(
154
+                                color: processSign.color,
155
+                                fontSize: 16.sp,
156
+                                fontWeight: FontWeight.bold),
157
+                          ),
158
+                        ],
155
                       ),
159
                       ),
156
-                      Row(
157
-                        children: [
158
-                          const Text('费用:',
159
-                              style: TextStyle(
160
-                                  color: Color(0xff666666),
161
-                                  fontSize: 16,
162
-                                  fontWeight: FontWeight.bold)),
163
-                          LinearGradientText(
164
-                            colors: const <Color>[
165
-                              Color(0xFFFA7878),
166
-                              Color(0xFFB61515),
167
-                            ],
168
-                            child: RichText(
169
-                              text: TextSpan(children: <InlineSpan>[
160
+                    ),
161
+                    Row(
162
+                      children: [
163
+                        Text(
164
+                          '费用:',
165
+                          style: TextStyle(
166
+                              color: const Color(0xff666666),
167
+                              fontSize: 16.sp,
168
+                              fontWeight: FontWeight.bold),
169
+                        ),
170
+                        LinearGradientText(
171
+                          colors: const <Color>[
172
+                            Color(0xFFFA7878),
173
+                            Color(0xFFB61515),
174
+                          ],
175
+                          child: RichText(
176
+                            text: TextSpan(
177
+                              children: <InlineSpan>[
178
+                                TextSpan(
179
+                                  text: ((item.charges ?? 0) / 100).toString(),
180
+                                  style: TextStyle(
181
+                                    fontSize: 16.sp,
182
+                                    fontWeight: FontWeight.bold,
183
+                                  ),
184
+                                ),
170
                                 TextSpan(
185
                                 TextSpan(
171
-                                    text: ((item.charges ?? 0) / 100)
172
-                                        .toString(),
173
-                                    style: const TextStyle(
174
-                                      fontSize: 16,
175
-                                      fontWeight: FontWeight.bold,
176
-                                    )),
177
-                                const TextSpan(
178
-                                    text: "元",
179
-                                    style: TextStyle(
180
-                                      fontSize: 16,
181
-                                      fontWeight: FontWeight.bold,
182
-                                    )),
183
-                              ]),
186
+                                  text: "元",
187
+                                  style: TextStyle(
188
+                                    fontSize: 16.sp,
189
+                                    fontWeight: FontWeight.bold,
190
+                                  ),
191
+                                ),
192
+                              ],
184
                             ),
193
                             ),
185
                           ),
194
                           ),
186
-                        ],
187
-                      ),
188
-                    ],
189
-                  ),
195
+                        ),
196
+                      ],
197
+                    ),
198
+                  ],
190
                 ),
199
                 ),
191
-              ],
192
-            ),
200
+              ),
201
+            ],
193
           ),
202
           ),
194
         ],
203
         ],
195
       ),
204
       ),

+ 13
- 7
lib/widgets/layout/BasicPage.dart Parādīt failu

96
     }
96
     }
97
   }
97
   }
98
 
98
 
99
+  final client = GetPlatform.isAndroid ? true : false;
100
+
99
   @override
101
   @override
100
   Widget build(BuildContext context) {
102
   Widget build(BuildContext context) {
101
     return Scaffold(
103
     return Scaffold(
102
       resizeToAvoidBottomInset: false,
104
       resizeToAvoidBottomInset: false,
103
       appBar: _getAppBar(),
105
       appBar: _getAppBar(),
104
       body: SafeArea(
106
       body: SafeArea(
105
-        child: GestureDetector(
106
-          behavior: HitTestBehavior.translucent,
107
-          onTap: () {
108
-            FocusScope.of(context).requestFocus(FocusNode());
109
-          },
110
-          child: widget.builder(context),
111
-        ),
107
+        //判断是否是安卓手机  因为安卓手机键盘有收起功能所以普通就行
108
+        //如果是苹果系统 因为苹果键盘没有收起功能只能点击屏幕收起所以需要加一个代码
109
+        child: client
110
+            ? widget.builder(context)
111
+            : GestureDetector(
112
+                behavior: HitTestBehavior.translucent,
113
+                onTap: () {
114
+                  FocusScope.of(context).requestFocus(FocusNode());
115
+                },
116
+                child: widget.builder(context),
117
+              ),
112
       ),
118
       ),
113
       bottomNavigationBar: widget.tabIndex == null
119
       bottomNavigationBar: widget.tabIndex == null
114
           ? null
120
           ? null