|
@@ -81,140 +81,141 @@ class OrderConfirmation extends BasicPage {
|
81
|
81
|
child: Form(
|
82
|
82
|
key: _formKey, //设置globalKey,用于后面获取FormState
|
83
|
83
|
autovalidateMode: AutovalidateMode.onUserInteraction,
|
84
|
|
- child: Column(
|
85
|
|
- children: <Widget>[
|
86
|
|
- Container(
|
87
|
|
- margin: EdgeInsets.fromLTRB(15, 20, 0, 0),
|
88
|
|
- alignment: Alignment.topLeft,
|
89
|
|
- child: Text(
|
90
|
|
- '作业面积/公顷',
|
91
|
|
- style: TextStyle(
|
92
|
|
- color: Color(0xff222222),
|
93
|
|
- fontSize: 17.sp,
|
94
|
|
- fontWeight: FontWeight.bold),
|
95
|
|
- ),
|
96
|
|
- ),
|
97
|
|
- TextFormField(
|
98
|
|
- autofocus: false,
|
99
|
|
- keyboardType: TextInputType.number,
|
100
|
|
- controller: _unameController,
|
101
|
|
- decoration: const InputDecoration(
|
102
|
|
- isCollapsed: true,
|
103
|
|
- contentPadding:
|
|
84
|
+ child:
|
|
85
|
+ Column(
|
|
86
|
+ children: [
|
|
87
|
+ Container(
|
|
88
|
+ margin: EdgeInsets.fromLTRB(15, 20, 0, 0),
|
|
89
|
+ alignment: Alignment.topLeft,
|
|
90
|
+ child: Text(
|
|
91
|
+ '作业面积/公顷',
|
|
92
|
+ style: TextStyle(
|
|
93
|
+ color: Color(0xff222222),
|
|
94
|
+ fontSize: 17.sp,
|
|
95
|
+ fontWeight: FontWeight.bold),
|
|
96
|
+ ),
|
|
97
|
+ ),
|
|
98
|
+ TextFormField(
|
|
99
|
+ autofocus: false,
|
|
100
|
+ keyboardType: TextInputType.number,
|
|
101
|
+ controller: _unameController,
|
|
102
|
+ decoration: const InputDecoration(
|
|
103
|
+ isCollapsed: true,
|
|
104
|
+ contentPadding:
|
104
|
105
|
EdgeInsets.symmetric(vertical: 8, horizontal: 16),
|
105
|
|
- counterText: '', //去掉计数
|
106
|
|
- /// UnderlineInputBorder 只有下边框 默认使用的就是下边框
|
107
|
|
- border: UnderlineInputBorder(
|
108
|
|
- borderRadius: BorderRadius.all(Radius.circular(10)),
|
109
|
|
- borderSide: BorderSide(
|
110
|
|
- color: Color(0x30000000),
|
111
|
|
- width: 2.0,
|
|
106
|
+ counterText: '', //去掉计数
|
|
107
|
+ /// UnderlineInputBorder 只有下边框 默认使用的就是下边框
|
|
108
|
+ border: UnderlineInputBorder(
|
|
109
|
+ borderRadius: BorderRadius.all(Radius.circular(10)),
|
|
110
|
+ borderSide: BorderSide(
|
|
111
|
+ color: Color(0x30000000),
|
|
112
|
+ width: 2.0,
|
|
113
|
+ ),
|
|
114
|
+ ),
|
|
115
|
+ floatingLabelBehavior: FloatingLabelBehavior.never,
|
|
116
|
+ hintText: "请输入具体面积(公顷)",
|
112
|
117
|
),
|
|
118
|
+ onChanged: (e) {
|
|
119
|
+ workingArea(int.parse(e));
|
|
120
|
+ },
|
|
121
|
+ // 校验用户名
|
|
122
|
+ validator: (v) {
|
|
123
|
+ return v!.trim().isNotEmpty ? null : "作业面积/公顷不能为空";
|
|
124
|
+ },
|
113
|
125
|
),
|
114
|
|
- floatingLabelBehavior: FloatingLabelBehavior.never,
|
115
|
|
- hintText: "请输入具体面积(公顷)",
|
116
|
|
- ),
|
117
|
|
- onChanged: (e) {
|
118
|
|
- workingArea(int.parse(e));
|
119
|
|
- },
|
120
|
|
- // 校验用户名
|
121
|
|
- validator: (v) {
|
122
|
|
- return v!.trim().isNotEmpty ? null : "作业面积/公顷不能为空";
|
123
|
|
- },
|
124
|
|
- ),
|
125
|
|
- Container(
|
126
|
|
- margin: EdgeInsets.fromLTRB(15, 20, 0, 0),
|
127
|
|
- alignment: Alignment.topLeft,
|
128
|
|
- child: Text(
|
129
|
|
- '作业时间:',
|
130
|
|
- style: TextStyle(
|
131
|
|
- color: Color(0xff222222),
|
132
|
|
- fontSize: 17.sp,
|
133
|
|
- fontWeight: FontWeight.bold),
|
134
|
|
- ),
|
135
|
|
- ),
|
136
|
|
- Container(
|
137
|
|
- width: 345.w,
|
138
|
|
- padding: EdgeInsets.fromLTRB(0, 15, 0, 15),
|
139
|
|
- decoration: const BoxDecoration(
|
140
|
|
- border: Border(
|
141
|
|
- bottom: BorderSide(width: 1, color: Color(0x20000000)
|
142
|
|
- // 0x17000000
|
143
|
|
- )),
|
|
126
|
+ Container(
|
|
127
|
+ margin: EdgeInsets.fromLTRB(15, 20, 0, 0),
|
|
128
|
+ alignment: Alignment.topLeft,
|
|
129
|
+ child: Text(
|
|
130
|
+ '作业时间:',
|
|
131
|
+ style: TextStyle(
|
|
132
|
+ color: Color(0xff222222),
|
|
133
|
+ fontSize: 17.sp,
|
|
134
|
+ fontWeight: FontWeight.bold),
|
|
135
|
+ ),
|
144
|
136
|
),
|
145
|
|
- child: Row(
|
146
|
|
- children: [
|
147
|
|
- Image(
|
148
|
|
- image: AssetImage('images/icons/timeImage.png'),
|
149
|
|
- fit: BoxFit.cover,
|
150
|
|
- width: 18.w,
|
151
|
|
- height: 18.w,
|
152
|
|
- ),
|
153
|
|
- Padding(
|
154
|
|
- padding: EdgeInsets.fromLTRB(10, 0, 0, 0),
|
155
|
|
- child: GestureDetector(
|
156
|
|
- onTap: () async {
|
157
|
|
- var handleChnage = await showDatePicker(
|
158
|
|
- context: context,
|
159
|
|
- helpText: '请选择作业开始时间',
|
160
|
|
- cancelText: '取消',
|
161
|
|
- confirmText: '确定',
|
162
|
|
- initialDate: selectDate() == null
|
163
|
|
- ? DateTime.now()
|
164
|
|
- : selectDate(),
|
165
|
|
- firstDate: DateTime.now(),
|
166
|
|
- lastDate: DateTime(2030),
|
167
|
|
- );
|
168
|
|
- selectDate(handleChnage!);
|
169
|
|
- print('${selectDate}+');
|
170
|
|
- },
|
171
|
|
- child: Obx(
|
172
|
|
- () => Text(selectDate == null
|
173
|
|
- ? '请选择日期'
|
174
|
|
- : '${DateFormat("yyyy-MM-dd").format(selectDate())}'),
|
|
137
|
+ Container(
|
|
138
|
+ width: 345.w,
|
|
139
|
+ padding: EdgeInsets.fromLTRB(0, 15, 0, 15),
|
|
140
|
+ decoration: const BoxDecoration(
|
|
141
|
+ border: Border(
|
|
142
|
+ bottom: BorderSide(width: 1, color: Color(0x20000000)
|
|
143
|
+ // 0x17000000
|
175
|
144
|
)),
|
176
|
|
- )
|
177
|
|
- ],
|
178
|
|
- )),
|
179
|
|
- Container(
|
180
|
|
- margin: EdgeInsets.fromLTRB(15, 20, 0, 0),
|
181
|
|
- alignment: Alignment.topLeft,
|
182
|
|
- child: Text(
|
183
|
|
- '作业位置:',
|
184
|
|
- style: TextStyle(
|
185
|
|
- color: Color(0xff222222),
|
186
|
|
- fontSize: 17.sp,
|
187
|
|
- fontWeight: FontWeight.bold),
|
188
|
|
- ),
|
189
|
|
- ),
|
190
|
|
- Container(
|
191
|
|
- width: 345.w,
|
192
|
|
- padding: EdgeInsets.fromLTRB(0, 15, 0, 15),
|
193
|
|
- decoration: BoxDecoration(
|
194
|
|
- border: Border(
|
195
|
|
- bottom: BorderSide(width: 1, color: Color(0x20000000)
|
196
|
|
- // 0x17000000
|
|
145
|
+ ),
|
|
146
|
+ child: Row(
|
|
147
|
+ children: [
|
|
148
|
+ Image(
|
|
149
|
+ image: AssetImage('images/icons/timeImage.png'),
|
|
150
|
+ fit: BoxFit.cover,
|
|
151
|
+ width: 18.w,
|
|
152
|
+ height: 18.w,
|
|
153
|
+ ),
|
|
154
|
+ Padding(
|
|
155
|
+ padding: EdgeInsets.fromLTRB(10, 0, 0, 0),
|
|
156
|
+ child: GestureDetector(
|
|
157
|
+ onTap: () async {
|
|
158
|
+ var handleChnage = await showDatePicker(
|
|
159
|
+ context: context,
|
|
160
|
+ helpText: '请选择作业开始时间',
|
|
161
|
+ cancelText: '取消',
|
|
162
|
+ confirmText: '确定',
|
|
163
|
+ initialDate: selectDate() == null
|
|
164
|
+ ? DateTime.now()
|
|
165
|
+ : selectDate(),
|
|
166
|
+ firstDate: DateTime.now(),
|
|
167
|
+ lastDate: DateTime(2030),
|
|
168
|
+ );
|
|
169
|
+ selectDate(handleChnage!);
|
|
170
|
+ print('${selectDate}+');
|
|
171
|
+ },
|
|
172
|
+ child: Obx(
|
|
173
|
+ () => Text(selectDate == null
|
|
174
|
+ ? '请选择日期'
|
|
175
|
+ : '${DateFormat("yyyy-MM-dd").format(selectDate())}'),
|
|
176
|
+ )),
|
|
177
|
+ )
|
|
178
|
+ ],
|
|
179
|
+ )),
|
|
180
|
+ Container(
|
|
181
|
+ margin: EdgeInsets.fromLTRB(15, 20, 0, 0),
|
|
182
|
+ alignment: Alignment.topLeft,
|
|
183
|
+ child: Text(
|
|
184
|
+ '作业位置:',
|
|
185
|
+ style: TextStyle(
|
|
186
|
+ color: Color(0xff222222),
|
|
187
|
+ fontSize: 17.sp,
|
|
188
|
+ fontWeight: FontWeight.bold),
|
|
189
|
+ ),
|
|
190
|
+ ),
|
|
191
|
+ Container(
|
|
192
|
+ width: 345.w,
|
|
193
|
+ padding: EdgeInsets.fromLTRB(0, 15, 0, 15),
|
|
194
|
+ decoration: BoxDecoration(
|
|
195
|
+ border: Border(
|
|
196
|
+ bottom: BorderSide(width: 1, color: Color(0x20000000)
|
|
197
|
+ // 0x17000000
|
197
|
198
|
)),
|
198
|
|
- ),
|
199
|
|
- child: Row(
|
200
|
|
- mainAxisAlignment: MainAxisAlignment.start,
|
201
|
|
- children: [
|
202
|
|
- Image(
|
203
|
|
- image: AssetImage('images/gpsImgae.png'),
|
204
|
|
- fit: BoxFit.cover,
|
205
|
|
- width: 14.w,
|
206
|
|
- height: 17.h,
|
207
|
199
|
),
|
208
|
|
- Padding(
|
209
|
|
- padding: EdgeInsets.fromLTRB(10, 0, 0, 0),
|
210
|
|
- child: GestureDetector(
|
211
|
|
- onTap: () {
|
212
|
|
- Get.toNamed('/addressList',
|
213
|
|
- arguments: {'isBack': true});
|
214
|
|
- },
|
215
|
|
- child: Container(
|
216
|
|
- width: 290.w,
|
217
|
|
- child: Obx(() => Text(
|
|
200
|
+ child: Row(
|
|
201
|
+ mainAxisAlignment: MainAxisAlignment.start,
|
|
202
|
+ children: [
|
|
203
|
+ Image(
|
|
204
|
+ image: AssetImage('images/gpsImgae.png'),
|
|
205
|
+ fit: BoxFit.cover,
|
|
206
|
+ width: 14.w,
|
|
207
|
+ height: 17.h,
|
|
208
|
+ ),
|
|
209
|
+ Padding(
|
|
210
|
+ padding: EdgeInsets.fromLTRB(10, 0, 0, 0),
|
|
211
|
+ child: GestureDetector(
|
|
212
|
+ onTap: () {
|
|
213
|
+ Get.toNamed('/addressList',
|
|
214
|
+ arguments: {'isBack': true});
|
|
215
|
+ },
|
|
216
|
+ child: Container(
|
|
217
|
+ width: 290.w,
|
|
218
|
+ child: Obx(() => Text(
|
218
|
219
|
addressController.address.value.address
|
219
|
220
|
.toString(),
|
220
|
221
|
softWrap: true,
|
|
@@ -222,73 +223,76 @@ class OrderConfirmation extends BasicPage {
|
222
|
223
|
textAlign: TextAlign.left,
|
223
|
224
|
overflow: TextOverflow.ellipsis,
|
224
|
225
|
)),
|
225
|
|
- ),
|
226
|
|
- ))
|
227
|
|
- ],
|
228
|
|
- ),
|
229
|
|
- ),
|
230
|
|
- Spacer(),
|
231
|
|
- Container(
|
232
|
|
- alignment: Alignment.bottomCenter,
|
233
|
|
- child: SizedBox(
|
234
|
|
- width: 315.w,
|
235
|
|
- height: 49.h,
|
236
|
|
- child: ElevatedButton(
|
237
|
|
- onPressed: () {
|
238
|
|
- _orderSubmit();
|
239
|
|
- },
|
240
|
|
- child: const Text(
|
241
|
|
- "确定",
|
242
|
|
- style: TextStyle(
|
243
|
|
- fontSize: 18,
|
244
|
|
- color: Colors.white,
|
245
|
|
- fontWeight: FontWeight.bold),
|
|
226
|
+ ),
|
|
227
|
+ ))
|
|
228
|
+ ],
|
246
|
229
|
),
|
247
|
|
- style: ButtonStyle(
|
248
|
|
- elevation: MaterialStateProperty.all(0),
|
249
|
|
- backgroundColor:
|
|
230
|
+ ),
|
|
231
|
+ Spacer(),
|
|
232
|
+ Container(
|
|
233
|
+ alignment: Alignment.bottomCenter,
|
|
234
|
+ child: SizedBox(
|
|
235
|
+ width: 315.w,
|
|
236
|
+ height: 49.h,
|
|
237
|
+ child: ElevatedButton(
|
|
238
|
+ onPressed: () {
|
|
239
|
+ _orderSubmit();
|
|
240
|
+ },
|
|
241
|
+ child: const Text(
|
|
242
|
+ "确定",
|
|
243
|
+ style: TextStyle(
|
|
244
|
+ fontSize: 18,
|
|
245
|
+ color: Colors.white,
|
|
246
|
+ fontWeight: FontWeight.bold),
|
|
247
|
+ ),
|
|
248
|
+ style: ButtonStyle(
|
|
249
|
+ elevation: MaterialStateProperty.all(0),
|
|
250
|
+ backgroundColor:
|
250
|
251
|
MaterialStateProperty.all(const Color(0xFFFF703B)),
|
251
|
|
- shape: MaterialStateProperty.all(
|
252
|
|
- const RoundedRectangleBorder(
|
253
|
|
- borderRadius:
|
|
252
|
+ shape: MaterialStateProperty.all(
|
|
253
|
+ const RoundedRectangleBorder(
|
|
254
|
+ borderRadius:
|
254
|
255
|
BorderRadius.all(Radius.circular(24.4)))),
|
|
256
|
+ ),
|
|
257
|
+ ),
|
255
|
258
|
),
|
256
|
259
|
),
|
257
|
|
- ),
|
258
|
|
- ),
|
259
|
|
- Container(
|
260
|
|
- margin: EdgeInsets.fromLTRB(0, 30.w, 0, 30.w),
|
261
|
|
- alignment: Alignment.bottomCenter,
|
262
|
|
- child: SizedBox(
|
263
|
|
- width: 315.w,
|
264
|
|
- height: 49.h,
|
265
|
|
- child: ElevatedButton(
|
266
|
|
- onPressed: () {
|
267
|
|
- Get.back();
|
268
|
|
- },
|
269
|
|
- child: const Text(
|
270
|
|
- "取消",
|
271
|
|
- style: TextStyle(
|
272
|
|
- fontSize: 18,
|
273
|
|
- color: Color(0xFFFF703B),
|
274
|
|
- fontWeight: FontWeight.bold),
|
275
|
|
- ),
|
276
|
|
- style: ButtonStyle(
|
277
|
|
- side: MaterialStateProperty.all(
|
278
|
|
- BorderSide(width: 1, color: Color(0xFFFF703B))), //边框
|
279
|
|
- elevation: MaterialStateProperty.all(0),
|
280
|
|
- backgroundColor: MaterialStateProperty.all(Colors.white),
|
281
|
|
- shape: MaterialStateProperty.all(
|
282
|
|
- RoundedRectangleBorder(
|
283
|
|
- borderRadius:
|
|
260
|
+ Container(
|
|
261
|
+ margin: EdgeInsets.fromLTRB(0, 30.w, 0, 30.w),
|
|
262
|
+ alignment: Alignment.bottomCenter,
|
|
263
|
+ child: SizedBox(
|
|
264
|
+ width: 315.w,
|
|
265
|
+ height: 49.h,
|
|
266
|
+ child: ElevatedButton(
|
|
267
|
+ onPressed: () {
|
|
268
|
+ Get.back();
|
|
269
|
+ },
|
|
270
|
+ child: const Text(
|
|
271
|
+ "取消",
|
|
272
|
+ style: TextStyle(
|
|
273
|
+ fontSize: 18,
|
|
274
|
+ color: Color(0xFFFF703B),
|
|
275
|
+ fontWeight: FontWeight.bold),
|
|
276
|
+ ),
|
|
277
|
+ style: ButtonStyle(
|
|
278
|
+ side: MaterialStateProperty.all(
|
|
279
|
+ BorderSide(width: 1, color: Color(0xFFFF703B))), //边框
|
|
280
|
+ elevation: MaterialStateProperty.all(0),
|
|
281
|
+ backgroundColor: MaterialStateProperty.all(Colors.white),
|
|
282
|
+ shape: MaterialStateProperty.all(
|
|
283
|
+ RoundedRectangleBorder(
|
|
284
|
+ borderRadius:
|
284
|
285
|
BorderRadius.all(Radius.circular(24.4))),
|
|
286
|
+ ),
|
|
287
|
+ ),
|
285
|
288
|
),
|
286
|
289
|
),
|
287
|
290
|
),
|
288
|
|
- ),
|
|
291
|
+ ],
|
289
|
292
|
),
|
290
|
|
- ],
|
291
|
|
- ),
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
|
292
|
296
|
),
|
293
|
297
|
);
|
294
|
298
|
}
|