|
@@ -57,6 +57,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { |
|
@@ -57,6 +57,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { |
|
57
|
TextEditingController _cancelController = TextEditingController();
|
57
|
TextEditingController _cancelController = TextEditingController();
|
|
58
|
StateSetter _cancelState;
|
58
|
StateSetter _cancelState;
|
|
59
|
|
59
|
|
|
|
|
60
|
+ ScrollController _scrollController;
|
|
60
|
@override
|
61
|
@override
|
|
61
|
void initState() {
|
62
|
void initState() {
|
|
62
|
// TODO: implement initState
|
63
|
// TODO: implement initState
|
|
@@ -71,6 +72,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { |
|
@@ -71,6 +72,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { |
|
71
|
if (_cancelNode.hasFocus) {
|
72
|
if (_cancelNode.hasFocus) {
|
|
72
|
print('得到焦点');
|
73
|
print('得到焦点');
|
|
73
|
paddingTop = 80;
|
74
|
paddingTop = 80;
|
|
|
|
75
|
+ _scrollController.jumpTo(_scrollController.position.maxScrollExtent);
|
|
74
|
} else {
|
76
|
} else {
|
|
75
|
print('失去焦点');
|
77
|
print('失去焦点');
|
|
76
|
paddingTop = 138;
|
78
|
paddingTop = 138;
|
|
@@ -162,6 +164,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { |
|
@@ -162,6 +164,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { |
|
162
|
|
164
|
|
|
163
|
///取消预订弹框
|
165
|
///取消预订弹框
|
|
164
|
_showCancelWidget(context) {
|
166
|
_showCancelWidget(context) {
|
|
|
|
167
|
+ _scrollController=ScrollController();
|
|
165
|
showGeneralDialog(
|
168
|
showGeneralDialog(
|
|
166
|
context: context,
|
169
|
context: context,
|
|
167
|
barrierDismissible: false,
|
170
|
barrierDismissible: false,
|
|
@@ -185,170 +188,178 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { |
|
@@ -185,170 +188,178 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { |
|
185
|
ScreenUtil().setWidth(50),
|
188
|
ScreenUtil().setWidth(50),
|
|
186
|
ScreenUtil().setWidth(paddingTop * 2),
|
189
|
ScreenUtil().setWidth(paddingTop * 2),
|
|
187
|
ScreenUtil().setWidth(50),
|
190
|
ScreenUtil().setWidth(50),
|
|
188
|
- ScreenUtil().setWidth(paddingBottom * 2)),
|
|
|
|
189
|
- child: Container(
|
|
|
|
190
|
- padding: EdgeInsets.all(ScreenUtil().setWidth(40)),
|
|
|
|
191
|
- decoration: BoxDecoration(
|
|
|
|
192
|
- color: Colors.white,
|
|
|
|
193
|
- borderRadius:
|
|
|
|
194
|
- BorderRadius.circular(ScreenUtil().setWidth(10)),
|
|
|
|
195
|
- ),
|
|
|
|
196
|
- child: Column(
|
|
|
|
197
|
- children: [
|
|
|
|
198
|
- Stack(
|
|
|
|
199
|
- children: [
|
|
|
|
200
|
- Container(
|
|
|
|
201
|
- height: ScreenUtil().setWidth(48),
|
|
|
|
202
|
- child: Center(
|
|
|
|
203
|
- child: Text(
|
|
|
|
204
|
- '请选择取消原因',
|
|
|
|
205
|
- style: TextStyle(
|
|
|
|
206
|
- fontSize: ScreenUtil().setSp(34),
|
|
|
|
207
|
- fontWeight: FontWeight.bold,
|
|
|
|
208
|
- decoration: TextDecoration.none,
|
|
|
|
209
|
- color: MyColours.color_353535),
|
191
|
+ ScreenUtil().setWidth(0)),
|
|
|
|
192
|
+ child: Align(
|
|
|
|
193
|
+ alignment: Alignment.topCenter,
|
|
|
|
194
|
+ child: Container(
|
|
|
|
195
|
+ padding: EdgeInsets.all(ScreenUtil().setWidth(40)),
|
|
|
|
196
|
+ decoration: BoxDecoration(
|
|
|
|
197
|
+ color: Colors.white,
|
|
|
|
198
|
+ borderRadius:
|
|
|
|
199
|
+ BorderRadius.circular(ScreenUtil().setWidth(10)),
|
|
|
|
200
|
+ ),
|
|
|
|
201
|
+ child: Column(
|
|
|
|
202
|
+ mainAxisSize: MainAxisSize.min,
|
|
|
|
203
|
+ children: [
|
|
|
|
204
|
+ Stack(
|
|
|
|
205
|
+ children: [
|
|
|
|
206
|
+ Container(
|
|
|
|
207
|
+ height: ScreenUtil().setWidth(48),
|
|
|
|
208
|
+ child: Center(
|
|
|
|
209
|
+ child: Text(
|
|
|
|
210
|
+ '请选择取消原因',
|
|
|
|
211
|
+ style: TextStyle(
|
|
|
|
212
|
+ fontSize: ScreenUtil().setSp(34),
|
|
|
|
213
|
+ fontWeight: FontWeight.bold,
|
|
|
|
214
|
+ decoration: TextDecoration.none,
|
|
|
|
215
|
+ color: MyColours.color_353535),
|
|
|
|
216
|
+ ),
|
|
210
|
),
|
217
|
),
|
|
211
|
),
|
218
|
),
|
|
212
|
- ),
|
|
|
|
213
|
- Positioned(
|
|
|
|
214
|
- top: ScreenUtil().setWidth(8),
|
|
|
|
215
|
- right: ScreenUtil().setWidth(0),
|
|
|
|
216
|
- child: GestureDetector(
|
|
|
|
217
|
- onTap: () {
|
|
|
|
218
|
- _initCancel();
|
|
|
|
219
|
- Navigator.of(context).pop();
|
|
|
|
220
|
- },
|
|
|
|
221
|
- child: Container(
|
|
|
|
222
|
- padding: EdgeInsets.only(left: 20),
|
|
|
|
223
|
- child: Image.asset(
|
|
|
|
224
|
- 'assets/close.png',
|
|
|
|
225
|
- width: ScreenUtil().setWidth(32),
|
|
|
|
226
|
- height: ScreenUtil().setWidth(32),
|
|
|
|
227
|
- ),
|
|
|
|
228
|
- )))
|
|
|
|
229
|
- ],
|
|
|
|
230
|
- ),
|
|
|
|
231
|
- VEmptyView(60),
|
|
|
|
232
|
- Column(
|
|
|
|
233
|
- children: cancelReasonList.map((value) {
|
|
|
|
234
|
- return GestureDetector(
|
|
|
|
235
|
- onTap: () {
|
|
|
|
236
|
- for (var item in cancelReasonList) {
|
|
|
|
237
|
- item['select'] = false;
|
|
|
|
238
|
- isShowTF = false;
|
|
|
|
239
|
- paddingBottom =
|
|
|
|
240
|
- ScreenUtil.screenHeightDp.ceil() -
|
|
|
|
241
|
- 138 -
|
|
|
|
242
|
- 340;
|
|
|
|
243
|
- if (item['title'] == value['title']) {
|
|
|
|
244
|
- item['select'] = true;
|
|
|
|
245
|
- if (item['title'] == '其他原因') {
|
|
|
|
246
|
- isShowTF = true;
|
|
|
|
247
|
- // paddingBottom = 130;
|
219
|
+ Positioned(
|
|
|
|
220
|
+ top: ScreenUtil().setWidth(8),
|
|
|
|
221
|
+ right: ScreenUtil().setWidth(0),
|
|
|
|
222
|
+ child: GestureDetector(
|
|
|
|
223
|
+ onTap: () {
|
|
|
|
224
|
+ _initCancel();
|
|
|
|
225
|
+ Navigator.of(context).pop();
|
|
|
|
226
|
+ },
|
|
|
|
227
|
+ child: Container(
|
|
|
|
228
|
+ padding: EdgeInsets.only(left: 20),
|
|
|
|
229
|
+ child: Image.asset(
|
|
|
|
230
|
+ 'assets/close.png',
|
|
|
|
231
|
+ width: ScreenUtil().setWidth(32),
|
|
|
|
232
|
+ height: ScreenUtil().setWidth(32),
|
|
|
|
233
|
+ ),
|
|
|
|
234
|
+ )))
|
|
|
|
235
|
+ ],
|
|
|
|
236
|
+ ),
|
|
|
|
237
|
+ VEmptyView(60),
|
|
|
|
238
|
+ SingleChildScrollView(
|
|
|
|
239
|
+ controller: _scrollController,
|
|
|
|
240
|
+ child: Column(
|
|
|
|
241
|
+ mainAxisSize: MainAxisSize.min,
|
|
|
|
242
|
+ children: cancelReasonList.map((value) {
|
|
|
|
243
|
+ return GestureDetector(
|
|
|
|
244
|
+ onTap: () {
|
|
|
|
245
|
+ for (var item in cancelReasonList) {
|
|
|
|
246
|
+ item['select'] = false;
|
|
|
|
247
|
+ isShowTF = false;
|
|
248
|
paddingBottom =
|
248
|
paddingBottom =
|
|
249
|
ScreenUtil.screenHeightDp.ceil() -
|
249
|
ScreenUtil.screenHeightDp.ceil() -
|
|
250
|
138 -
|
250
|
138 -
|
|
251
|
- 340 -
|
|
|
|
252
|
- 46;
|
251
|
+ 340;
|
|
|
|
252
|
+ if (item['title'] == value['title']) {
|
|
|
|
253
|
+ item['select'] = true;
|
|
|
|
254
|
+ if (item['title'] == '其他原因') {
|
|
|
|
255
|
+ isShowTF = true;
|
|
|
|
256
|
+ // paddingBottom = 130;
|
|
|
|
257
|
+ paddingBottom =
|
|
|
|
258
|
+ ScreenUtil.screenHeightDp.ceil() -
|
|
|
|
259
|
+ 138 -
|
|
|
|
260
|
+ 340 -
|
|
|
|
261
|
+ 46;
|
|
|
|
262
|
+ }
|
|
|
|
263
|
+ }
|
|
253
|
}
|
264
|
}
|
|
254
|
- }
|
|
|
|
255
|
- }
|
|
|
|
256
|
- state(() {});
|
|
|
|
257
|
- },
|
|
|
|
258
|
- child: Column(children: [
|
|
|
|
259
|
- Row(
|
|
|
|
260
|
- children: [
|
|
|
|
261
|
- Image.asset(
|
|
|
|
262
|
- value['select']
|
|
|
|
263
|
- ? 'assets/select.png'
|
|
|
|
264
|
- : 'assets/unselect.png',
|
|
|
|
265
|
- width: ScreenUtil().setWidth(44)),
|
|
|
|
266
|
- HEmptyView(30),
|
|
|
|
267
|
- Text(value['title'],
|
|
|
|
268
|
- style: TextStyle(
|
|
|
|
269
|
- fontSize: ScreenUtil().setSp(32),
|
|
|
|
270
|
- fontWeight: FontWeight.normal,
|
|
|
|
271
|
- decoration: TextDecoration.none,
|
|
|
|
272
|
- color: MyColours.color_333333))
|
|
|
|
273
|
- ],
|
|
|
|
274
|
- ),
|
|
|
|
275
|
- value['title'] == '其他原因' && isShowTF
|
|
|
|
276
|
- ? Material(
|
265
|
+ state(() {});
|
|
|
|
266
|
+ },
|
|
|
|
267
|
+ child: Column(children: [
|
|
|
|
268
|
+ Row(
|
|
|
|
269
|
+ children: [
|
|
|
|
270
|
+ Image.asset(
|
|
|
|
271
|
+ value['select']
|
|
|
|
272
|
+ ? 'assets/select.png'
|
|
|
|
273
|
+ : 'assets/unselect.png',
|
|
|
|
274
|
+ width: ScreenUtil().setWidth(44)),
|
|
|
|
275
|
+ HEmptyView(30),
|
|
|
|
276
|
+ Text(value['title'],
|
|
|
|
277
|
+ style: TextStyle(
|
|
|
|
278
|
+ fontSize: ScreenUtil().setSp(32),
|
|
|
|
279
|
+ fontWeight: FontWeight.normal,
|
|
|
|
280
|
+ decoration: TextDecoration.none,
|
|
|
|
281
|
+ color: MyColours.color_333333))
|
|
|
|
282
|
+ ],
|
|
|
|
283
|
+ ),
|
|
|
|
284
|
+ value['title'] == '其他原因' && isShowTF
|
|
|
|
285
|
+ ? Material(
|
|
277
|
child: Container(
|
286
|
child: Container(
|
|
278
|
- color: Colors.white,
|
|
|
|
279
|
- padding: EdgeInsets.only(
|
|
|
|
280
|
- left: ScreenUtil().setWidth(76)),
|
|
|
|
281
|
- child: TextField(
|
|
|
|
282
|
- maxLines: 1,
|
|
|
|
283
|
- controller: _cancelController,
|
|
|
|
284
|
- focusNode: _cancelNode,
|
|
|
|
285
|
- textAlignVertical:
|
|
|
|
286
|
- TextAlignVertical.bottom,
|
|
|
|
287
|
- decoration: InputDecoration(
|
|
|
|
288
|
- hintText: "请填写原因",
|
|
|
|
289
|
- hintStyle: TextStyle(
|
|
|
|
290
|
- color: MyColours.color_999999,
|
|
|
|
291
|
- fontSize: ScreenUtil().setSp(30),
|
|
|
|
292
|
- ),
|
|
|
|
293
|
- enabledBorder: UnderlineInputBorder(
|
|
|
|
294
|
- borderSide: BorderSide(
|
|
|
|
295
|
- color:
|
|
|
|
296
|
- MyColours.color_d8d8d8),
|
287
|
+ color: Colors.white,
|
|
|
|
288
|
+ padding: EdgeInsets.only(
|
|
|
|
289
|
+ left: ScreenUtil().setWidth(76)),
|
|
|
|
290
|
+ child: TextField(
|
|
|
|
291
|
+ maxLines: 1,
|
|
|
|
292
|
+ controller: _cancelController,
|
|
|
|
293
|
+ focusNode: _cancelNode,
|
|
|
|
294
|
+ textAlignVertical:
|
|
|
|
295
|
+ TextAlignVertical.bottom,
|
|
|
|
296
|
+ decoration: InputDecoration(
|
|
|
|
297
|
+ hintText: "请填写原因",
|
|
|
|
298
|
+ hintStyle: TextStyle(
|
|
|
|
299
|
+ color: MyColours.color_999999,
|
|
|
|
300
|
+ fontSize: ScreenUtil().setSp(30),
|
|
|
|
301
|
+ ),
|
|
|
|
302
|
+ enabledBorder: UnderlineInputBorder(
|
|
|
|
303
|
+ borderSide: BorderSide(
|
|
|
|
304
|
+ color:
|
|
|
|
305
|
+ MyColours.color_d8d8d8),
|
|
|
|
306
|
+ ),
|
|
|
|
307
|
+ // border: InputBorder.none,
|
|
297
|
),
|
308
|
),
|
|
298
|
- // border: InputBorder.none,
|
309
|
+ onChanged: (_) {
|
|
|
|
310
|
+ setState(() {});
|
|
|
|
311
|
+ },
|
|
|
|
312
|
+ onEditingComplete: () {
|
|
|
|
313
|
+ print('fff');
|
|
|
|
314
|
+ _cancelNode.unfocus();
|
|
|
|
315
|
+ },
|
|
|
|
316
|
+ // keyboardType: TextInputType.number,
|
|
299
|
),
|
317
|
),
|
|
300
|
- onChanged: (_) {
|
|
|
|
301
|
- setState(() {});
|
|
|
|
302
|
- },
|
|
|
|
303
|
- onEditingComplete: () {
|
|
|
|
304
|
- print('fff');
|
|
|
|
305
|
- _cancelNode.unfocus();
|
|
|
|
306
|
- },
|
|
|
|
307
|
- // keyboardType: TextInputType.number,
|
|
|
|
308
|
- ),
|
|
|
|
309
|
- ))
|
|
|
|
310
|
- : Container(),
|
|
|
|
311
|
- VEmptyView(40)
|
|
|
|
312
|
- ]),
|
|
|
|
313
|
- );
|
|
|
|
314
|
- }).toList(),
|
|
|
|
315
|
- ),
|
|
|
|
316
|
- VEmptyView(15),
|
|
|
|
317
|
- Material(
|
|
|
|
318
|
- child: RoundButton(
|
|
|
|
319
|
- onPressed: () {
|
|
|
|
320
|
- String desc = '';
|
|
|
|
321
|
- for (var value in cancelReasonList) {
|
|
|
|
322
|
- if (value['select'] == true) {
|
|
|
|
323
|
- desc = value['title'];
|
|
|
|
324
|
- if (value['title'] == '其他原因') {
|
|
|
|
325
|
- desc = _cancelController.text.trim();
|
|
|
|
326
|
- if (desc.isEmpty) {
|
|
|
|
327
|
- Utils.showToast("请填写原因");
|
|
|
|
328
|
- return;
|
318
|
+ ))
|
|
|
|
319
|
+ : Container(),
|
|
|
|
320
|
+ VEmptyView(40)
|
|
|
|
321
|
+ ]),
|
|
|
|
322
|
+ );
|
|
|
|
323
|
+ }).toList(),
|
|
|
|
324
|
+ ),
|
|
|
|
325
|
+ ),
|
|
|
|
326
|
+ VEmptyView(15),
|
|
|
|
327
|
+ Material(
|
|
|
|
328
|
+ child: RoundButton(
|
|
|
|
329
|
+ onPressed: () {
|
|
|
|
330
|
+ String desc = '';
|
|
|
|
331
|
+ for (var value in cancelReasonList) {
|
|
|
|
332
|
+ if (value['select'] == true) {
|
|
|
|
333
|
+ desc = value['title'];
|
|
|
|
334
|
+ if (value['title'] == '其他原因') {
|
|
|
|
335
|
+ desc = _cancelController.text.trim();
|
|
|
|
336
|
+ if (desc.isEmpty) {
|
|
|
|
337
|
+ Utils.showToast("请填写原因");
|
|
|
|
338
|
+ return;
|
|
|
|
339
|
+ }
|
|
329
|
}
|
340
|
}
|
|
330
|
}
|
341
|
}
|
|
331
|
}
|
342
|
}
|
|
332
|
- }
|
|
|
|
333
|
|
343
|
|
|
334
|
- if (desc == '') {
|
|
|
|
335
|
- Utils.showToast('请选择原因');
|
|
|
|
336
|
- return;
|
|
|
|
337
|
- }
|
344
|
+ if (desc == '') {
|
|
|
|
345
|
+ Utils.showToast('请选择原因');
|
|
|
|
346
|
+ return;
|
|
|
|
347
|
+ }
|
|
338
|
|
348
|
|
|
339
|
- Navigator.of(context).pop();
|
|
|
|
340
|
- Loading.showLoading(context);
|
|
|
|
341
|
- setReserveStatus('4', desc: desc);
|
|
|
|
342
|
- },
|
|
|
|
343
|
- text: '确认',
|
|
|
|
344
|
- height: ScreenUtil().setWidth(80),
|
|
|
|
345
|
- width: ScreenUtil().setWidth(300),
|
|
|
|
346
|
- radius: ScreenUtil().setWidth(10),
|
|
|
|
347
|
- ),
|
|
|
|
348
|
- )
|
|
|
|
349
|
- ],
|
|
|
|
350
|
- ),
|
|
|
|
351
|
- )),
|
349
|
+ Navigator.of(context).pop();
|
|
|
|
350
|
+ Loading.showLoading(context);
|
|
|
|
351
|
+ setReserveStatus('4', desc: desc);
|
|
|
|
352
|
+ },
|
|
|
|
353
|
+ text: '确认',
|
|
|
|
354
|
+ height: ScreenUtil().setWidth(80),
|
|
|
|
355
|
+ width: ScreenUtil().setWidth(300),
|
|
|
|
356
|
+ radius: ScreenUtil().setWidth(10),
|
|
|
|
357
|
+ ),
|
|
|
|
358
|
+ )
|
|
|
|
359
|
+ ],
|
|
|
|
360
|
+ ),
|
|
|
|
361
|
+ )),
|
|
|
|
362
|
+ ),
|
|
352
|
);
|
363
|
);
|
|
353
|
});
|
364
|
});
|
|
354
|
});
|
365
|
});
|
|
@@ -511,8 +522,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { |
|
@@ -511,8 +522,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { |
|
511
|
list.add(manager.roleUserName);
|
522
|
list.add(manager.roleUserName);
|
|
512
|
}
|
523
|
}
|
|
513
|
DialogUtil.showSelectCusmanDialog(
|
524
|
DialogUtil.showSelectCusmanDialog(
|
|
514
|
- context, list)
|
|
|
|
515
|
- .then((value) {
|
525
|
+ context, list,(value){
|
|
516
|
if (value != null) {
|
526
|
if (value != null) {
|
|
517
|
setState(() {
|
527
|
setState(() {
|
|
518
|
cusmanText =
|
528
|
cusmanText =
|
|
@@ -521,6 +531,8 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { |
|
@@ -521,6 +531,8 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { |
|
521
|
});
|
531
|
});
|
|
522
|
_setCurrManager();
|
532
|
_setCurrManager();
|
|
523
|
}
|
533
|
}
|
|
|
|
534
|
+ })
|
|
|
|
535
|
+ .then((value) {
|
|
524
|
});
|
536
|
});
|
|
525
|
},
|
537
|
},
|
|
526
|
child: Text(
|
538
|
child: Text(
|