|
|
|
1
|
+import 'dart:convert';
|
|
1
|
import 'dart:ui';
|
2
|
import 'dart:ui';
|
|
2
|
|
3
|
|
|
3
|
import 'package:flutter/material.dart';
|
4
|
import 'package:flutter/material.dart';
|
|
4
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
5
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
5
|
import 'package:one_key/models/notebook.dart';
|
6
|
import 'package:one_key/models/notebook.dart';
|
|
6
|
import 'package:one_key/pages/notebook/spread_widget.dart';
|
7
|
import 'package:one_key/pages/notebook/spread_widget.dart';
|
|
|
|
8
|
+import 'package:one_key/provider/notebook_detail_model.dart';
|
|
7
|
import 'package:one_key/provider/user_model.dart';
|
9
|
import 'package:one_key/provider/user_model.dart';
|
|
8
|
import 'package:one_key/res/colors.dart';
|
10
|
import 'package:one_key/res/colors.dart';
|
|
9
|
import 'package:one_key/route/navigator_util.dart';
|
11
|
import 'package:one_key/route/navigator_util.dart';
|
|
|
|
12
|
+import 'package:one_key/utils/event_bus.dart';
|
|
10
|
import 'package:one_key/utils/utils.dart';
|
13
|
import 'package:one_key/utils/utils.dart';
|
|
11
|
import 'package:one_key/widgets/MyDivider.dart';
|
14
|
import 'package:one_key/widgets/MyDivider.dart';
|
|
12
|
import 'package:one_key/widgets/h_empty_view.dart';
|
15
|
import 'package:one_key/widgets/h_empty_view.dart';
|
|
|
|
16
|
+import 'package:one_key/widgets/loading.dart';
|
|
13
|
import 'package:one_key/widgets/round_button.dart';
|
17
|
import 'package:one_key/widgets/round_button.dart';
|
|
14
|
import 'package:one_key/widgets/v_empty_view.dart';
|
18
|
import 'package:one_key/widgets/v_empty_view.dart';
|
|
15
|
import 'package:provider/provider.dart';
|
19
|
import 'package:provider/provider.dart';
|
|
@@ -33,6 +37,16 @@ class NoteBookItemF extends StatefulWidget { |
|
@@ -33,6 +37,16 @@ class NoteBookItemF extends StatefulWidget { |
|
33
|
class NoteBookItemFState extends State<NoteBookItemF>
|
37
|
class NoteBookItemFState extends State<NoteBookItemF>
|
|
34
|
with SingleTickerProviderStateMixin {
|
38
|
with SingleTickerProviderStateMixin {
|
|
35
|
bool _large = false;
|
39
|
bool _large = false;
|
|
|
|
40
|
+ List cancelReasonList = [];
|
|
|
|
41
|
+ bool isShowTF = false;
|
|
|
|
42
|
+ // int paddingBottom;
|
|
|
|
43
|
+ int paddingTop = 138;
|
|
|
|
44
|
+ FocusNode _cancelNode = FocusNode();
|
|
|
|
45
|
+ TextEditingController _cancelController = TextEditingController();
|
|
|
|
46
|
+ StateSetter _cancelState;
|
|
|
|
47
|
+
|
|
|
|
48
|
+ ScrollController _scrollController;
|
|
|
|
49
|
+
|
|
36
|
_onOperateClick() {
|
50
|
_onOperateClick() {
|
|
37
|
if (widget.notebook.operationText == "通知客户") {
|
51
|
if (widget.notebook.operationText == "通知客户") {
|
|
38
|
// String _nameStr = '';
|
52
|
// String _nameStr = '';
|
|
@@ -74,6 +88,19 @@ class NoteBookItemFState extends State<NoteBookItemF> |
|
@@ -74,6 +88,19 @@ class NoteBookItemFState extends State<NoteBookItemF> |
|
74
|
}
|
88
|
}
|
|
75
|
}
|
89
|
}
|
|
76
|
|
90
|
|
|
|
|
91
|
+ /// 初始化取消原因数据
|
|
|
|
92
|
+ _initCancel() {
|
|
|
|
93
|
+ // isShowTF = false;
|
|
|
|
94
|
+ // paddingBottom = ScreenUtil.screenHeightDp.ceil() - 138 - 340;
|
|
|
|
95
|
+ cancelReasonList = [
|
|
|
|
96
|
+ {'title': '顾客取消', 'select': false},
|
|
|
|
97
|
+ {'title': '顾客行程有变', 'select': false},
|
|
|
|
98
|
+ {'title': '信息填写有误', 'select': false},
|
|
|
|
99
|
+ {'title': '操作失误', 'select': false},
|
|
|
|
100
|
+ {'title': '其他原因', 'select': false},
|
|
|
|
101
|
+ ];
|
|
|
|
102
|
+ }
|
|
|
|
103
|
+
|
|
77
|
_updateSize(bool cando) {
|
104
|
_updateSize(bool cando) {
|
|
78
|
if (!cando) {
|
105
|
if (!cando) {
|
|
79
|
return;
|
106
|
return;
|
|
@@ -83,6 +110,294 @@ class NoteBookItemFState extends State<NoteBookItemF> |
|
@@ -83,6 +110,294 @@ class NoteBookItemFState extends State<NoteBookItemF> |
|
83
|
});
|
110
|
});
|
|
84
|
}
|
111
|
}
|
|
85
|
|
112
|
|
|
|
|
113
|
+ ///处理在线预订
|
|
|
|
114
|
+ setReserveStatus(String status, {String desc}) async {
|
|
|
|
115
|
+ // bus.emit("remove_untreated_message",widget.mid);
|
|
|
|
116
|
+ UserModel userModel = Provider.of<UserModel>(context, listen: false);
|
|
|
|
117
|
+
|
|
|
|
118
|
+ Map<String, String> params = {
|
|
|
|
119
|
+ "rid": widget.notebook.id,
|
|
|
|
120
|
+ "status": status, //5安排包间 2:确认到店(到店),3:用餐完成(离店),4:取消预定,5:分配包间:6:拒单
|
|
|
|
121
|
+ "uid": userModel.user.openid,
|
|
|
|
122
|
+ };
|
|
|
|
123
|
+ if (status == '4') {
|
|
|
|
124
|
+ Map<String, String> causeMap = {
|
|
|
|
125
|
+ "uid": userModel.user.openid,
|
|
|
|
126
|
+ "uname": userModel.user.account,
|
|
|
|
127
|
+ "desc": desc,
|
|
|
|
128
|
+ };
|
|
|
|
129
|
+ params["cause"] = json.encode(causeMap);
|
|
|
|
130
|
+ }
|
|
|
|
131
|
+ NotebookDetailModel detailModel =
|
|
|
|
132
|
+ Provider.of<NotebookDetailModel>(context, listen: false);
|
|
|
|
133
|
+ bool success =
|
|
|
|
134
|
+ await detailModel.setReserveStatus(context, params, ifPush: false);
|
|
|
|
135
|
+ if (success) {
|
|
|
|
136
|
+ bus.emit("refresh_book_list");
|
|
|
|
137
|
+ // if (status == "4") {
|
|
|
|
138
|
+ // //取消预订
|
|
|
|
139
|
+ // bus.emit("refresh_tablemanager"); //刷新桌位
|
|
|
|
140
|
+ // }
|
|
|
|
141
|
+ // _getReserveDetail();
|
|
|
|
142
|
+ }
|
|
|
|
143
|
+ }
|
|
|
|
144
|
+
|
|
|
|
145
|
+ ///取消预订弹框
|
|
|
|
146
|
+ _showCancelWidget(context) {
|
|
|
|
147
|
+ _scrollController = ScrollController();
|
|
|
|
148
|
+ _initCancel();
|
|
|
|
149
|
+ showGeneralDialog(
|
|
|
|
150
|
+ context: context,
|
|
|
|
151
|
+ barrierDismissible: false,
|
|
|
|
152
|
+ barrierLabel:
|
|
|
|
153
|
+ MaterialLocalizations.of(context).modalBarrierDismissLabel,
|
|
|
|
154
|
+ transitionDuration: const Duration(milliseconds: 150),
|
|
|
|
155
|
+ barrierColor: Color.fromRGBO(0, 0, 0, 0.25),
|
|
|
|
156
|
+ pageBuilder: (BuildContext context, Animation animation,
|
|
|
|
157
|
+ Animation secondaryAnimation) {
|
|
|
|
158
|
+ return Scaffold(
|
|
|
|
159
|
+ backgroundColor: Color.fromRGBO(0, 0, 0, 0.25),
|
|
|
|
160
|
+ body: StatefulBuilder(builder: (context, state) {
|
|
|
|
161
|
+ _cancelState = state;
|
|
|
|
162
|
+ return GestureDetector(
|
|
|
|
163
|
+ behavior: HitTestBehavior.opaque,
|
|
|
|
164
|
+ // onTap: () {
|
|
|
|
165
|
+ // Navigator.of(context).pop();
|
|
|
|
166
|
+ // },
|
|
|
|
167
|
+ child: Center(
|
|
|
|
168
|
+ child: Container(
|
|
|
|
169
|
+ margin: EdgeInsets.symmetric(
|
|
|
|
170
|
+ horizontal: ScreenUtil().setWidth(28 * 2)),
|
|
|
|
171
|
+ padding: EdgeInsets.symmetric(
|
|
|
|
172
|
+ horizontal: ScreenUtil().setWidth(32)),
|
|
|
|
173
|
+ decoration: BoxDecoration(
|
|
|
|
174
|
+ color: Colors.white,
|
|
|
|
175
|
+ borderRadius:
|
|
|
|
176
|
+ BorderRadius.circular(ScreenUtil().setWidth(10)),
|
|
|
|
177
|
+ ),
|
|
|
|
178
|
+ height: ScreenUtil().setWidth(355 * 2),
|
|
|
|
179
|
+ child: Column(
|
|
|
|
180
|
+ // mainAxisSize: MainAxisSize.min,
|
|
|
|
181
|
+ children: [
|
|
|
|
182
|
+ // Stack(
|
|
|
|
183
|
+ // children: [
|
|
|
|
184
|
+ VEmptyView(48),
|
|
|
|
185
|
+ Container(
|
|
|
|
186
|
+ height: ScreenUtil().setWidth(48),
|
|
|
|
187
|
+ child: Text(
|
|
|
|
188
|
+ '是否确定取消预订',
|
|
|
|
189
|
+ style: TextStyle(
|
|
|
|
190
|
+ fontSize: ScreenUtil().setSp(32),
|
|
|
|
191
|
+ fontWeight: FontWeight.bold,
|
|
|
|
192
|
+ decoration: TextDecoration.none,
|
|
|
|
193
|
+ color: Color.fromRGBO(0, 0, 0, 0.9)),
|
|
|
|
194
|
+ ),
|
|
|
|
195
|
+ ),
|
|
|
|
196
|
+ // Positioned(
|
|
|
|
197
|
+ // top: ScreenUtil().setWidth(8),
|
|
|
|
198
|
+ // right: ScreenUtil().setWidth(0),
|
|
|
|
199
|
+ // child: GestureDetector(
|
|
|
|
200
|
+ // onTap: () {
|
|
|
|
201
|
+ // _initCancel();
|
|
|
|
202
|
+ // Navigator.of(context).pop();
|
|
|
|
203
|
+ // },
|
|
|
|
204
|
+ // child: Container(
|
|
|
|
205
|
+ // padding: EdgeInsets.only(left: 20),
|
|
|
|
206
|
+ // child: Image.asset(
|
|
|
|
207
|
+ // 'assets/close.png',
|
|
|
|
208
|
+ // width: ScreenUtil().setWidth(32),
|
|
|
|
209
|
+ // height: ScreenUtil().setWidth(32),
|
|
|
|
210
|
+ // ),
|
|
|
|
211
|
+ // )))
|
|
|
|
212
|
+ // ],
|
|
|
|
213
|
+ // ),
|
|
|
|
214
|
+ VEmptyView(40),
|
|
|
|
215
|
+ Container(
|
|
|
|
216
|
+ child: Column(
|
|
|
|
217
|
+ // mainAxisSize: MainAxisSize.min,
|
|
|
|
218
|
+ children: cancelReasonList.map((value) {
|
|
|
|
219
|
+ return value['title'] == '其他原因'
|
|
|
|
220
|
+ ? SizedBox()
|
|
|
|
221
|
+ : GestureDetector(
|
|
|
|
222
|
+ onTap: () {
|
|
|
|
223
|
+ for (var item in cancelReasonList) {
|
|
|
|
224
|
+ item['select'] = false;
|
|
|
|
225
|
+ // isShowTF = false;
|
|
|
|
226
|
+ // paddingBottom =
|
|
|
|
227
|
+ // ScreenUtil.screenHeightDp.ceil() -
|
|
|
|
228
|
+ // 138 -
|
|
|
|
229
|
+ // 340;
|
|
|
|
230
|
+ if (item['title'] ==
|
|
|
|
231
|
+ value['title']) {
|
|
|
|
232
|
+ item['select'] = true;
|
|
|
|
233
|
+ // if (item['title'] == '其他原因') {
|
|
|
|
234
|
+ // // isShowTF = true;
|
|
|
|
235
|
+ // // paddingBottom = 130;
|
|
|
|
236
|
+ // // paddingBottom =
|
|
|
|
237
|
+ // // ScreenUtil.screenHeightDp.ceil() -
|
|
|
|
238
|
+ // // 138 -
|
|
|
|
239
|
+ // // 340 -
|
|
|
|
240
|
+ // // 46;
|
|
|
|
241
|
+ // }
|
|
|
|
242
|
+ }
|
|
|
|
243
|
+ }
|
|
|
|
244
|
+ state(() {});
|
|
|
|
245
|
+ },
|
|
|
|
246
|
+ child: Container(
|
|
|
|
247
|
+ height: ScreenUtil().setWidth(48),
|
|
|
|
248
|
+ margin: EdgeInsets.only(
|
|
|
|
249
|
+ bottom:
|
|
|
|
250
|
+ ScreenUtil().setWidth(40)),
|
|
|
|
251
|
+ child: Row(
|
|
|
|
252
|
+ children: [
|
|
|
|
253
|
+ Image.asset(
|
|
|
|
254
|
+ value['select']
|
|
|
|
255
|
+ ? 'assets/select.png'
|
|
|
|
256
|
+ : 'assets/unselect.png',
|
|
|
|
257
|
+ width: ScreenUtil()
|
|
|
|
258
|
+ .setWidth(42)),
|
|
|
|
259
|
+ HEmptyView(20),
|
|
|
|
260
|
+ Container(
|
|
|
|
261
|
+ child: Text(value['title'],
|
|
|
|
262
|
+ style: TextStyle(
|
|
|
|
263
|
+ fontSize: ScreenUtil()
|
|
|
|
264
|
+ .setSp(32),
|
|
|
|
265
|
+ fontWeight:
|
|
|
|
266
|
+ FontWeight.normal,
|
|
|
|
267
|
+ decoration:
|
|
|
|
268
|
+ TextDecoration
|
|
|
|
269
|
+ .none,
|
|
|
|
270
|
+ color: MyColours
|
|
|
|
271
|
+ .color_333333)))
|
|
|
|
272
|
+ ],
|
|
|
|
273
|
+ ),
|
|
|
|
274
|
+ ),
|
|
|
|
275
|
+ );
|
|
|
|
276
|
+ }).toList(),
|
|
|
|
277
|
+ )),
|
|
|
|
278
|
+ Material(
|
|
|
|
279
|
+ child: Container(
|
|
|
|
280
|
+ color: Colors.white,
|
|
|
|
281
|
+ height: ScreenUtil().setWidth(42 * 2),
|
|
|
|
282
|
+ child: Row(children: [
|
|
|
|
283
|
+ InkWell(
|
|
|
|
284
|
+ onTap: () {
|
|
|
|
285
|
+ for (var item in cancelReasonList) {
|
|
|
|
286
|
+ item['select'] = false;
|
|
|
|
287
|
+ }
|
|
|
|
288
|
+ cancelReasonList[4]['select'] =
|
|
|
|
289
|
+ true;
|
|
|
|
290
|
+ state(() {});
|
|
|
|
291
|
+ },
|
|
|
|
292
|
+ child: Padding(
|
|
|
|
293
|
+ padding: EdgeInsets.only(
|
|
|
|
294
|
+ right: ScreenUtil()
|
|
|
|
295
|
+ .setWidth(20)),
|
|
|
|
296
|
+ child: Image.asset(
|
|
|
|
297
|
+ cancelReasonList[4]['select']
|
|
|
|
298
|
+ ? 'assets/select.png'
|
|
|
|
299
|
+ : 'assets/unselect.png',
|
|
|
|
300
|
+ width: ScreenUtil()
|
|
|
|
301
|
+ .setWidth(44)))),
|
|
|
|
302
|
+ Expanded(
|
|
|
|
303
|
+ child: Container(
|
|
|
|
304
|
+ decoration: BoxDecoration(
|
|
|
|
305
|
+ color: Color.fromRGBO(
|
|
|
|
306
|
+ 240, 240, 240, 1),
|
|
|
|
307
|
+ borderRadius: BorderRadius.circular(
|
|
|
|
308
|
+ ScreenUtil().setWidth(8))),
|
|
|
|
309
|
+ // height: ScreenUtil().setWidth(42 * 2),
|
|
|
|
310
|
+ padding: EdgeInsets.symmetric(
|
|
|
|
311
|
+ horizontal:
|
|
|
|
312
|
+ ScreenUtil().setWidth(16)),
|
|
|
|
313
|
+ child: TextField(
|
|
|
|
314
|
+ maxLines: 1,
|
|
|
|
315
|
+ controller: _cancelController,
|
|
|
|
316
|
+ focusNode: _cancelNode,
|
|
|
|
317
|
+ style: TextStyle(
|
|
|
|
318
|
+ textBaseline:
|
|
|
|
319
|
+ TextBaseline.alphabetic),
|
|
|
|
320
|
+ textAlignVertical:
|
|
|
|
321
|
+ TextAlignVertical.center,
|
|
|
|
322
|
+ decoration: InputDecoration(
|
|
|
|
323
|
+ contentPadding: EdgeInsets.zero,
|
|
|
|
324
|
+ hintText: "其他",
|
|
|
|
325
|
+ // focusColor: Color.fromRGBO(0, 0, 0, 0.4),
|
|
|
|
326
|
+ hintStyle: TextStyle(
|
|
|
|
327
|
+ color:
|
|
|
|
328
|
+ Color.fromRGBO(0, 0, 0, 0.4),
|
|
|
|
329
|
+ fontSize: ScreenUtil().setSp(32),
|
|
|
|
330
|
+ ),
|
|
|
|
331
|
+ enabledBorder: OutlineInputBorder(
|
|
|
|
332
|
+ borderSide: BorderSide(
|
|
|
|
333
|
+ width: 0,
|
|
|
|
334
|
+ color: Colors.transparent)),
|
|
|
|
335
|
+ border: OutlineInputBorder(
|
|
|
|
336
|
+ borderSide: BorderSide(
|
|
|
|
337
|
+ width: 0,
|
|
|
|
338
|
+ color: Colors.transparent)),
|
|
|
|
339
|
+ focusedBorder: OutlineInputBorder(
|
|
|
|
340
|
+ borderSide: BorderSide(
|
|
|
|
341
|
+ width: 0,
|
|
|
|
342
|
+ color: Colors.transparent)),
|
|
|
|
343
|
+ ),
|
|
|
|
344
|
+
|
|
|
|
345
|
+ // border: InputBorder.none,
|
|
|
|
346
|
+
|
|
|
|
347
|
+ onChanged: (_) {
|
|
|
|
348
|
+ setState(() {});
|
|
|
|
349
|
+ },
|
|
|
|
350
|
+ onEditingComplete: () {
|
|
|
|
351
|
+ print('fff');
|
|
|
|
352
|
+ _cancelNode.unfocus();
|
|
|
|
353
|
+ },
|
|
|
|
354
|
+ // keyboardType: TextInputType.number,
|
|
|
|
355
|
+ ),
|
|
|
|
356
|
+ ))
|
|
|
|
357
|
+ ]))),
|
|
|
|
358
|
+
|
|
|
|
359
|
+ VEmptyView(15),
|
|
|
|
360
|
+ Material(
|
|
|
|
361
|
+ child: RoundButton(
|
|
|
|
362
|
+ onPressed: () {
|
|
|
|
363
|
+ String desc = '';
|
|
|
|
364
|
+ for (var value in cancelReasonList) {
|
|
|
|
365
|
+ if (value['select'] == true) {
|
|
|
|
366
|
+ desc = value['title'];
|
|
|
|
367
|
+ if (value['title'] == '其他原因') {
|
|
|
|
368
|
+ desc = _cancelController.text.trim();
|
|
|
|
369
|
+ if (desc.isEmpty) {
|
|
|
|
370
|
+ Utils.showToast("请填写原因");
|
|
|
|
371
|
+ return;
|
|
|
|
372
|
+ }
|
|
|
|
373
|
+ }
|
|
|
|
374
|
+ }
|
|
|
|
375
|
+ }
|
|
|
|
376
|
+
|
|
|
|
377
|
+ if (desc == '') {
|
|
|
|
378
|
+ Utils.showToast('请选择原因');
|
|
|
|
379
|
+ return;
|
|
|
|
380
|
+ }
|
|
|
|
381
|
+
|
|
|
|
382
|
+ Navigator.of(context).pop();
|
|
|
|
383
|
+ Loading.showLoading(context);
|
|
|
|
384
|
+
|
|
|
|
385
|
+ setReserveStatus('4', desc: desc);
|
|
|
|
386
|
+ },
|
|
|
|
387
|
+ text: '确认',
|
|
|
|
388
|
+ height: ScreenUtil().setWidth(80),
|
|
|
|
389
|
+ width: ScreenUtil().setWidth(300),
|
|
|
|
390
|
+ radius: ScreenUtil().setWidth(10),
|
|
|
|
391
|
+ ),
|
|
|
|
392
|
+ )
|
|
|
|
393
|
+ ],
|
|
|
|
394
|
+ ),
|
|
|
|
395
|
+ ),
|
|
|
|
396
|
+ ));
|
|
|
|
397
|
+ }));
|
|
|
|
398
|
+ });
|
|
|
|
399
|
+ }
|
|
|
|
400
|
+
|
|
86
|
@override
|
401
|
@override
|
|
87
|
Widget build(BuildContext context) {
|
402
|
Widget build(BuildContext context) {
|
|
88
|
// TODO: implement build
|
403
|
// TODO: implement build
|
|
@@ -94,11 +409,23 @@ class NoteBookItemFState extends State<NoteBookItemF> |
|
@@ -94,11 +409,23 @@ class NoteBookItemFState extends State<NoteBookItemF> |
|
94
|
notebook.uid != "null" &&
|
409
|
notebook.uid != "null" &&
|
|
95
|
notebook.uid != userModel.user.openid) {
|
410
|
notebook.uid != userModel.user.openid) {
|
|
96
|
canDo = false;
|
411
|
canDo = false;
|
|
|
|
412
|
+ } else {
|
|
|
|
413
|
+ if (notebook.status == '0' ||
|
|
|
|
414
|
+ notebook.status == '1' ||
|
|
|
|
415
|
+ notebook.status == '2' ||
|
|
|
|
416
|
+ notebook.status == '5') {
|
|
|
|
417
|
+ canDo = true;
|
|
|
|
418
|
+ } else {
|
|
|
|
419
|
+ canDo = false;
|
|
|
|
420
|
+ }
|
|
97
|
}
|
421
|
}
|
|
98
|
|
422
|
|
|
99
|
- Color bgColor = notebook.status == "2" || notebook.status == "1"
|
423
|
+ Color bgColor = notebook.status == '0' ||
|
|
|
|
424
|
+ notebook.status == "2" ||
|
|
|
|
425
|
+ notebook.status == "1" ||
|
|
|
|
426
|
+ notebook.status == '5'
|
|
100
|
? MyColours.color_438E93
|
427
|
? MyColours.color_438E93
|
|
101
|
- : Color.fromRGBO(191, 196, 212, 0.2);
|
428
|
+ : MyColours.color_BFC4D4;
|
|
102
|
|
429
|
|
|
103
|
String detail = '';
|
430
|
String detail = '';
|
|
104
|
if (notebook.tid.split(",").length >= 2) {
|
431
|
if (notebook.tid.split(",").length >= 2) {
|
|
@@ -109,13 +436,17 @@ class NoteBookItemFState extends State<NoteBookItemF> |
|
@@ -109,13 +436,17 @@ class NoteBookItemFState extends State<NoteBookItemF> |
|
109
|
//有备注
|
436
|
//有备注
|
|
110
|
detail += '[备注]:${notebook.cusdem};';
|
437
|
detail += '[备注]:${notebook.cusdem};';
|
|
111
|
}
|
438
|
}
|
|
112
|
- if (true) {
|
439
|
+ if (notebook.aname != null) {
|
|
113
|
//有优惠
|
440
|
//有优惠
|
|
114
|
- detail += '[优惠]:';
|
441
|
+ detail += '[优惠]:${notebook.aname}';
|
|
115
|
}
|
442
|
}
|
|
116
|
if (detail.endsWith(';')) {
|
443
|
if (detail.endsWith(';')) {
|
|
117
|
detail = detail.substring(0, detail.length - 1);
|
444
|
detail = detail.substring(0, detail.length - 1);
|
|
118
|
}
|
445
|
}
|
|
|
|
446
|
+ double widthBtn = 464.0;
|
|
|
|
447
|
+ if (notebook.status == '2') {
|
|
|
|
448
|
+ widthBtn = 208.0;
|
|
|
|
449
|
+ }
|
|
119
|
return Stack(
|
450
|
return Stack(
|
|
120
|
clipBehavior: Clip.none,
|
451
|
clipBehavior: Clip.none,
|
|
121
|
alignment: Alignment.centerRight,
|
452
|
alignment: Alignment.centerRight,
|
|
@@ -181,7 +512,7 @@ class NoteBookItemFState extends State<NoteBookItemF> |
|
@@ -181,7 +512,7 @@ class NoteBookItemFState extends State<NoteBookItemF> |
|
181
|
),
|
512
|
),
|
|
182
|
false ? SizedBox() : HEmptyView(8),
|
513
|
false ? SizedBox() : HEmptyView(8),
|
|
183
|
Offstage(
|
514
|
Offstage(
|
|
184
|
- offstage: true,
|
515
|
+ offstage: notebook.aname == null,
|
|
185
|
child: Image.asset(
|
516
|
child: Image.asset(
|
|
186
|
Utils.getImgPath('ordered_hui'),
|
517
|
Utils.getImgPath('ordered_hui'),
|
|
187
|
width: ScreenUtil().setWidth(18 * 2),
|
518
|
width: ScreenUtil().setWidth(18 * 2),
|
|
@@ -197,8 +528,9 @@ class NoteBookItemFState extends State<NoteBookItemF> |
|
@@ -197,8 +528,9 @@ class NoteBookItemFState extends State<NoteBookItemF> |
|
197
|
gradientEnd: bgColor,
|
528
|
gradientEnd: bgColor,
|
|
198
|
textColor: MyColours.color_ffffff,
|
529
|
textColor: MyColours.color_ffffff,
|
|
199
|
radius: ScreenUtil().setWidth(6),
|
530
|
radius: ScreenUtil().setWidth(6),
|
|
200
|
- fontSize: 28,
|
|
|
|
201
|
- width: ScreenUtil().setWidth(56 * 2),
|
531
|
+ fontSize: 24,
|
|
|
|
532
|
+ width: ScreenUtil().setWidth(42 * 2),
|
|
|
|
533
|
+ height: ScreenUtil().setWidth(17 * 2),
|
|
202
|
)
|
534
|
)
|
|
203
|
],
|
535
|
],
|
|
204
|
),
|
536
|
),
|
|
@@ -306,14 +638,16 @@ class NoteBookItemFState extends State<NoteBookItemF> |
|
@@ -306,14 +638,16 @@ class NoteBookItemFState extends State<NoteBookItemF> |
|
306
|
notebook.nick_name == ''
|
638
|
notebook.nick_name == ''
|
|
307
|
? VEmptyView(6)
|
639
|
? VEmptyView(6)
|
|
308
|
: SizedBox(),
|
640
|
: SizedBox(),
|
|
309
|
- Text(
|
|
|
|
310
|
- detail,
|
|
|
|
311
|
- maxLines: 100,
|
|
|
|
312
|
- overflow: TextOverflow.ellipsis,
|
|
|
|
313
|
- style: TextStyle(
|
|
|
|
314
|
- color: MyColours.color_999999,
|
|
|
|
315
|
- fontSize: ScreenUtil().setSp(24)),
|
|
|
|
316
|
- ),
|
641
|
+ detail == ''
|
|
|
|
642
|
+ ? SizedBox()
|
|
|
|
643
|
+ : Text(
|
|
|
|
644
|
+ detail,
|
|
|
|
645
|
+ maxLines: 100,
|
|
|
|
646
|
+ overflow: TextOverflow.ellipsis,
|
|
|
|
647
|
+ style: TextStyle(
|
|
|
|
648
|
+ color: MyColours.color_999999,
|
|
|
|
649
|
+ fontSize: ScreenUtil().setSp(24)),
|
|
|
|
650
|
+ ),
|
|
317
|
],
|
651
|
],
|
|
318
|
)))
|
652
|
)))
|
|
319
|
],
|
653
|
],
|
|
@@ -322,118 +656,124 @@ class NoteBookItemFState extends State<NoteBookItemF> |
|
@@ -322,118 +656,124 @@ class NoteBookItemFState extends State<NoteBookItemF> |
|
322
|
|
656
|
|
|
323
|
Positioned(
|
657
|
Positioned(
|
|
324
|
right: ScreenUtil().setWidth(8),
|
658
|
right: ScreenUtil().setWidth(8),
|
|
325
|
- child: StatefulBuilder(builder: (context, state) {
|
|
|
|
326
|
- // return ScaleAnimatedContent(
|
|
|
|
327
|
- // child: InkWell(
|
|
|
|
328
|
- // onTap: () {
|
|
|
|
329
|
- // state(() {
|
|
|
|
330
|
- // show = !show;
|
|
|
|
331
|
- // });
|
|
|
|
332
|
- // },
|
|
|
|
333
|
- // child: Image.asset(
|
|
|
|
334
|
- // Utils.getImgPath(show ? 'ordered_open' : 'ordered_off'),
|
|
|
|
335
|
- // width: ScreenUtil().setWidth(80),
|
|
|
|
336
|
- // )),
|
|
|
|
337
|
- // show: show,
|
|
|
|
338
|
- // );
|
|
|
|
339
|
- return InkWell(
|
|
|
|
340
|
- onTap: () => _updateSize(canDo),
|
|
|
|
341
|
- child: AnimatedSize(
|
|
|
|
342
|
- curve: Curves.easeIn,
|
|
|
|
343
|
- duration: Duration(microseconds: 30000),
|
|
|
|
344
|
- vsync: this,
|
|
|
|
345
|
- child: _large
|
|
|
|
346
|
- ? Stack(
|
|
|
|
347
|
- children: [
|
|
|
|
348
|
- Container(
|
|
|
|
349
|
- width: ScreenUtil()
|
|
|
|
350
|
- .setWidth(232 * 2 + 8 * 2),
|
|
|
|
351
|
- height: ScreenUtil().setWidth(80),
|
659
|
+ child: AnimatedSize(
|
|
|
|
660
|
+ curve: Curves.easeIn,
|
|
|
|
661
|
+ duration: Duration(microseconds: 30000),
|
|
|
|
662
|
+ vsync: this,
|
|
|
|
663
|
+ child: InkWell(
|
|
|
|
664
|
+ onTap: () => _updateSize(canDo),
|
|
|
|
665
|
+ child: _large
|
|
|
|
666
|
+ ? Stack(
|
|
|
|
667
|
+ children: [
|
|
|
|
668
|
+ Container(
|
|
|
|
669
|
+ width:
|
|
|
|
670
|
+ ScreenUtil().setWidth(widthBtn + 8 * 2),
|
|
|
|
671
|
+ height: ScreenUtil().setWidth(80),
|
|
|
|
672
|
+ decoration: BoxDecoration(
|
|
|
|
673
|
+ color: Color.fromRGBO(67, 142, 147, 0.2),
|
|
|
|
674
|
+ borderRadius: BorderRadius.circular(
|
|
|
|
675
|
+ ScreenUtil().setWidth(16)),
|
|
|
|
676
|
+ )),
|
|
|
|
677
|
+ Positioned(
|
|
|
|
678
|
+ top: ScreenUtil().setWidth(8),
|
|
|
|
679
|
+ left: ScreenUtil().setWidth(8),
|
|
|
|
680
|
+ child: Container(
|
|
|
|
681
|
+ width: ScreenUtil().setWidth(widthBtn),
|
|
|
|
682
|
+ height: ScreenUtil().setWidth(32 * 2),
|
|
352
|
decoration: BoxDecoration(
|
683
|
decoration: BoxDecoration(
|
|
353
|
- color:
|
|
|
|
354
|
- Color.fromRGBO(67, 142, 147, 0.2),
|
684
|
+ color: Color.fromRGBO(125, 174, 177, 1),
|
|
355
|
borderRadius: BorderRadius.circular(
|
685
|
borderRadius: BorderRadius.circular(
|
|
356
|
- ScreenUtil().setWidth(16)),
|
|
|
|
357
|
- )),
|
|
|
|
358
|
- Positioned(
|
|
|
|
359
|
- top: ScreenUtil().setWidth(8),
|
|
|
|
360
|
- left: ScreenUtil().setWidth(8),
|
|
|
|
361
|
- child: Container(
|
|
|
|
362
|
- width: ScreenUtil().setWidth(232 * 2),
|
|
|
|
363
|
- height: ScreenUtil().setWidth(32 * 2),
|
|
|
|
364
|
- decoration: BoxDecoration(
|
|
|
|
365
|
- color:
|
|
|
|
366
|
- Color.fromRGBO(125, 174, 177, 1),
|
|
|
|
367
|
- borderRadius: BorderRadius.circular(
|
|
|
|
368
|
- ScreenUtil().setWidth(8)),
|
|
|
|
369
|
- ),
|
|
|
|
370
|
- padding: EdgeInsets.symmetric(
|
|
|
|
371
|
- horizontal:
|
|
|
|
372
|
- ScreenUtil().setWidth(16)),
|
|
|
|
373
|
- child: Row(
|
|
|
|
374
|
- children: [
|
|
|
|
375
|
- Image.asset(
|
|
|
|
376
|
- Utils.getImgPath(
|
|
|
|
377
|
- 'ordered_arrow_right'),
|
|
|
|
378
|
- width:
|
|
|
|
379
|
- ScreenUtil().setWidth(24 * 2),
|
|
|
|
380
|
- ),
|
|
|
|
381
|
- HEmptyView(32),
|
|
|
|
382
|
- RoundButton(
|
|
|
|
383
|
- text: '到店',
|
|
|
|
384
|
- width: ScreenUtil()
|
|
|
|
385
|
- .setWidth(36 * 2),
|
|
|
|
386
|
- height: ScreenUtil()
|
|
|
|
387
|
- .setWidth(24 * 2),
|
|
|
|
388
|
- gradientStart:
|
|
|
|
389
|
- MyColours.color_ffffff,
|
|
|
|
390
|
- gradientEnd:
|
|
|
|
391
|
- MyColours.color_ffffff,
|
|
|
|
392
|
- textColor:
|
|
|
|
393
|
- MyColours.color_260101,
|
|
|
|
394
|
- isBold: true,
|
|
|
|
395
|
- fontSize: 28,
|
|
|
|
396
|
- radius:
|
|
|
|
397
|
- ScreenUtil().setWidth(8)),
|
|
|
|
398
|
- HEmptyView(44),
|
|
|
|
399
|
- RoundButton(
|
|
|
|
400
|
- text: '离店',
|
|
|
|
401
|
- width: ScreenUtil()
|
|
|
|
402
|
- .setWidth(36 * 2),
|
|
|
|
403
|
- height: ScreenUtil()
|
|
|
|
404
|
- .setWidth(24 * 2),
|
|
|
|
405
|
- gradientStart:
|
|
|
|
406
|
- MyColours.color_ffffff,
|
|
|
|
407
|
- gradientEnd:
|
|
|
|
408
|
- MyColours.color_ffffff,
|
|
|
|
409
|
- textColor:
|
|
|
|
410
|
- MyColours.color_260101,
|
|
|
|
411
|
- isBold: true,
|
|
|
|
412
|
- fontSize: 28,
|
|
|
|
413
|
- radius:
|
|
|
|
414
|
- ScreenUtil().setWidth(8)),
|
|
|
|
415
|
- HEmptyView(44),
|
|
|
|
416
|
- Text(
|
|
|
|
417
|
- '取消预订',
|
|
|
|
418
|
- style: TextStyle(
|
|
|
|
419
|
- decoration:
|
|
|
|
420
|
- TextDecoration.underline,
|
|
|
|
421
|
- color: MyColours.color_ffffff,
|
|
|
|
422
|
- fontSize:
|
|
|
|
423
|
- ScreenUtil().setSp(28),
|
|
|
|
424
|
- fontWeight: FontWeight.bold),
|
|
|
|
425
|
- )
|
|
|
|
426
|
- ],
|
|
|
|
427
|
- ),
|
|
|
|
428
|
- ))
|
|
|
|
429
|
- ],
|
|
|
|
430
|
- )
|
|
|
|
431
|
- : Image.asset(
|
|
|
|
432
|
- Utils.getImgPath(
|
|
|
|
433
|
- canDo ? 'ordered_open' : 'ordered_off'),
|
|
|
|
434
|
- width: ScreenUtil().setWidth(80),
|
|
|
|
435
|
- )));
|
|
|
|
436
|
- }))
|
686
|
+ ScreenUtil().setWidth(8)),
|
|
|
|
687
|
+ ),
|
|
|
|
688
|
+ padding: EdgeInsets.symmetric(
|
|
|
|
689
|
+ horizontal:
|
|
|
|
690
|
+ ScreenUtil().setWidth(16)),
|
|
|
|
691
|
+ child: Row(
|
|
|
|
692
|
+ children: [
|
|
|
|
693
|
+ Image.asset(
|
|
|
|
694
|
+ Utils.getImgPath(
|
|
|
|
695
|
+ 'ordered_arrow_right'),
|
|
|
|
696
|
+ width:
|
|
|
|
697
|
+ ScreenUtil().setWidth(24 * 2),
|
|
|
|
698
|
+ ),
|
|
|
|
699
|
+ HEmptyView(32),
|
|
|
|
700
|
+ notebook.status == '2'
|
|
|
|
701
|
+ ? SizedBox()
|
|
|
|
702
|
+ : RoundButton(
|
|
|
|
703
|
+ text: '到店',
|
|
|
|
704
|
+ width: ScreenUtil()
|
|
|
|
705
|
+ .setWidth(36 * 2),
|
|
|
|
706
|
+ height: ScreenUtil()
|
|
|
|
707
|
+ .setWidth(24 * 2),
|
|
|
|
708
|
+ gradientStart:
|
|
|
|
709
|
+ MyColours.color_ffffff,
|
|
|
|
710
|
+ gradientEnd:
|
|
|
|
711
|
+ MyColours.color_ffffff,
|
|
|
|
712
|
+ textColor:
|
|
|
|
713
|
+ MyColours.color_260101,
|
|
|
|
714
|
+ isBold: true,
|
|
|
|
715
|
+ fontSize: 28,
|
|
|
|
716
|
+ radius:
|
|
|
|
717
|
+ ScreenUtil().setWidth(8),
|
|
|
|
718
|
+ onPressed: () {
|
|
|
|
719
|
+ Loading.showLoading(
|
|
|
|
720
|
+ context);
|
|
|
|
721
|
+ setReserveStatus('2');
|
|
|
|
722
|
+ },
|
|
|
|
723
|
+ ),
|
|
|
|
724
|
+ notebook.status == '2'
|
|
|
|
725
|
+ ? SizedBox()
|
|
|
|
726
|
+ : HEmptyView(44),
|
|
|
|
727
|
+ RoundButton(
|
|
|
|
728
|
+ text: '离店',
|
|
|
|
729
|
+ width:
|
|
|
|
730
|
+ ScreenUtil().setWidth(36 * 2),
|
|
|
|
731
|
+ height:
|
|
|
|
732
|
+ ScreenUtil().setWidth(24 * 2),
|
|
|
|
733
|
+ gradientStart:
|
|
|
|
734
|
+ MyColours.color_ffffff,
|
|
|
|
735
|
+ gradientEnd: MyColours.color_ffffff,
|
|
|
|
736
|
+ textColor: MyColours.color_260101,
|
|
|
|
737
|
+ isBold: true,
|
|
|
|
738
|
+ fontSize: 28,
|
|
|
|
739
|
+ radius: ScreenUtil().setWidth(8),
|
|
|
|
740
|
+ onPressed: () {
|
|
|
|
741
|
+ Loading.showLoading(context);
|
|
|
|
742
|
+ setReserveStatus('3');
|
|
|
|
743
|
+ },
|
|
|
|
744
|
+ ),
|
|
|
|
745
|
+ notebook.status == '2'
|
|
|
|
746
|
+ ? SizedBox()
|
|
|
|
747
|
+ : HEmptyView(44),
|
|
|
|
748
|
+ notebook.status == '2'
|
|
|
|
749
|
+ ? SizedBox()
|
|
|
|
750
|
+ : InkWell(
|
|
|
|
751
|
+ onTap: () {
|
|
|
|
752
|
+ _showCancelWidget(context);
|
|
|
|
753
|
+ },
|
|
|
|
754
|
+ child: Text(
|
|
|
|
755
|
+ '取消预订',
|
|
|
|
756
|
+ style: TextStyle(
|
|
|
|
757
|
+ decoration:
|
|
|
|
758
|
+ TextDecoration
|
|
|
|
759
|
+ .underline,
|
|
|
|
760
|
+ color: MyColours
|
|
|
|
761
|
+ .color_ffffff,
|
|
|
|
762
|
+ fontSize: ScreenUtil()
|
|
|
|
763
|
+ .setSp(28),
|
|
|
|
764
|
+ fontWeight:
|
|
|
|
765
|
+ FontWeight.bold),
|
|
|
|
766
|
+ ))
|
|
|
|
767
|
+ ],
|
|
|
|
768
|
+ ),
|
|
|
|
769
|
+ ))
|
|
|
|
770
|
+ ],
|
|
|
|
771
|
+ )
|
|
|
|
772
|
+ : Image.asset(
|
|
|
|
773
|
+ Utils.getImgPath(
|
|
|
|
774
|
+ canDo ? 'ordered_open' : 'ordered_off'),
|
|
|
|
775
|
+ width: ScreenUtil().setWidth(80),
|
|
|
|
776
|
+ ))))
|
|
437
|
// Positioned(
|
777
|
// Positioned(
|
|
438
|
// right: ScreenUtil().setWidth(8),
|
778
|
// right: ScreenUtil().setWidth(8),
|
|
439
|
// child: Image.asset(
|
779
|
// child: Image.asset(
|