|
@@ -46,8 +46,12 @@ import 'package:scrollable_positioned_list/scrollable_positioned_list.dart'; |
|
@@ -46,8 +46,12 @@ import 'package:scrollable_positioned_list/scrollable_positioned_list.dart'; |
|
46
|
import 'package:one_key/models/table_list.dart' as table;
|
46
|
import 'package:one_key/models/table_list.dart' as table;
|
|
47
|
|
47
|
|
|
48
|
import '../../app.dart';
|
48
|
import '../../app.dart';
|
|
|
|
49
|
+import '../../models/remark.dart';
|
|
|
|
50
|
+import '../../provider/remark_manager_model.dart';
|
|
|
|
51
|
+import '../../utils/screen_util.dart';
|
|
49
|
import '../../widgets/loading.dart';
|
52
|
import '../../widgets/loading.dart';
|
|
50
|
import '../../widgets/special_text/my_extended_text_selection_controls.dart';
|
53
|
import '../../widgets/special_text/my_extended_text_selection_controls.dart';
|
|
|
|
54
|
+import '../detail/notebook_detail_change_page_f.dart';
|
|
51
|
|
55
|
|
|
52
|
const scrollDuration = Duration(microseconds: 500);
|
56
|
const scrollDuration = Duration(microseconds: 500);
|
|
53
|
|
57
|
|
|
@@ -113,6 +117,13 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -113,6 +117,13 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
113
|
|
117
|
|
|
114
|
TextEditingController pnumController = TextEditingController();
|
118
|
TextEditingController pnumController = TextEditingController();
|
|
115
|
|
119
|
|
|
|
|
120
|
+ TextEditingController customController = TextEditingController();
|
|
|
|
121
|
+ FocusNode _cusdemNode = FocusNode();
|
|
|
|
122
|
+
|
|
|
|
123
|
+ String currentRemark = '';
|
|
|
|
124
|
+ RemarkManagerModel remarkManagerModel;
|
|
|
|
125
|
+ String oldRemarkBtn = '';
|
|
|
|
126
|
+
|
|
116
|
@override
|
127
|
@override
|
|
117
|
void initState() {
|
128
|
void initState() {
|
|
118
|
// TODO: implement initState
|
129
|
// TODO: implement initState
|
|
@@ -149,6 +160,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -149,6 +160,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
149
|
tableManagerModel.initTime(context);
|
160
|
tableManagerModel.initTime(context);
|
|
150
|
_couponNetworkData(selfDismiss: true);
|
161
|
_couponNetworkData(selfDismiss: true);
|
|
151
|
_getSmsInfo(context);
|
162
|
_getSmsInfo(context);
|
|
|
|
163
|
+ _getRemark();
|
|
152
|
|
164
|
|
|
153
|
EventBus().on("refresh_tablemanager", (arg) {
|
165
|
EventBus().on("refresh_tablemanager", (arg) {
|
|
154
|
//订座-完成预订 刷新管理桌位
|
166
|
//订座-完成预订 刷新管理桌位
|
|
@@ -176,6 +188,14 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -176,6 +188,14 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
176
|
EventBus().off("refresh_table_m_coupon");
|
188
|
EventBus().off("refresh_table_m_coupon");
|
|
177
|
}
|
189
|
}
|
|
178
|
|
190
|
|
|
|
|
191
|
+ ///获取备注信息
|
|
|
|
192
|
+ _getRemark() async {
|
|
|
|
193
|
+ Map<String, String> params = {
|
|
|
|
194
|
+ "uid": Provider.of<UserModel>(context, listen: false).user.openid
|
|
|
|
195
|
+ };
|
|
|
|
196
|
+ await remarkManagerModel.getRemarks(context, params);
|
|
|
|
197
|
+ }
|
|
|
|
198
|
+
|
|
179
|
///获取短信余量
|
199
|
///获取短信余量
|
|
180
|
_getSmsInfo(context) async {
|
200
|
_getSmsInfo(context) async {
|
|
181
|
smsInfoData = await myModel.getSmsInfo(context, selfDismiss: true);
|
201
|
smsInfoData = await myModel.getSmsInfo(context, selfDismiss: true);
|
|
@@ -1328,6 +1348,164 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -1328,6 +1348,164 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
1328
|
)));
|
1348
|
)));
|
|
1329
|
}
|
1349
|
}
|
|
1330
|
|
1350
|
|
|
|
|
1351
|
+ _listWidget(List<Remark> remarks, CustomCallBack callback) {
|
|
|
|
1352
|
+ List<Widget> lists = remarks.map((item) {
|
|
|
|
1353
|
+ return remarkButton(
|
|
|
|
1354
|
+ content: item.custom,
|
|
|
|
1355
|
+ isSelect: item.selected,
|
|
|
|
1356
|
+ onPress: () {
|
|
|
|
1357
|
+ setState(() {
|
|
|
|
1358
|
+ item.selected = !item.selected;
|
|
|
|
1359
|
+ });
|
|
|
|
1360
|
+ callback(item);
|
|
|
|
1361
|
+ });
|
|
|
|
1362
|
+ }).toList();
|
|
|
|
1363
|
+ return lists;
|
|
|
|
1364
|
+ }
|
|
|
|
1365
|
+
|
|
|
|
1366
|
+ _refreshRemark(List<Remark> remark, int index) {
|
|
|
|
1367
|
+ if (remark[index].selected) {
|
|
|
|
1368
|
+ if (currentRemark.length == 0) {
|
|
|
|
1369
|
+ currentRemark += '${remark[index].custom}';
|
|
|
|
1370
|
+ } else {
|
|
|
|
1371
|
+ if (!currentRemark.contains(remark[index].custom)) {
|
|
|
|
1372
|
+ if (currentRemark.endsWith('、')) {
|
|
|
|
1373
|
+ currentRemark += '${remark[index].custom}';
|
|
|
|
1374
|
+ } else {
|
|
|
|
1375
|
+ currentRemark += '、${remark[index].custom}';
|
|
|
|
1376
|
+ }
|
|
|
|
1377
|
+ }
|
|
|
|
1378
|
+ }
|
|
|
|
1379
|
+ } else {
|
|
|
|
1380
|
+ if (currentRemark.contains(remark[index].custom)) {
|
|
|
|
1381
|
+ int start = currentRemark.indexOf(remark[index].custom);
|
|
|
|
1382
|
+ int end = start + remark[index].custom.length;
|
|
|
|
1383
|
+ currentRemark = currentRemark.replaceRange(start, end, '');
|
|
|
|
1384
|
+ if (currentRemark.endsWith('、')) {
|
|
|
|
1385
|
+ currentRemark = currentRemark.substring(0, currentRemark.length - 1);
|
|
|
|
1386
|
+ }
|
|
|
|
1387
|
+ if (currentRemark.startsWith('、')) {
|
|
|
|
1388
|
+ currentRemark = currentRemark.substring(1, currentRemark.length);
|
|
|
|
1389
|
+ }
|
|
|
|
1390
|
+ if (currentRemark.contains('、、')) {
|
|
|
|
1391
|
+ currentRemark = currentRemark.replaceRange(
|
|
|
|
1392
|
+ currentRemark.indexOf('、、'),
|
|
|
|
1393
|
+ currentRemark.indexOf('、、') + 2,
|
|
|
|
1394
|
+ '、');
|
|
|
|
1395
|
+ }
|
|
|
|
1396
|
+ }
|
|
|
|
1397
|
+ }
|
|
|
|
1398
|
+ if (currentRemark.length > 100) {
|
|
|
|
1399
|
+ currentRemark = currentRemark.substring(0, 100);
|
|
|
|
1400
|
+ }
|
|
|
|
1401
|
+ setState(() {
|
|
|
|
1402
|
+ customController.text = currentRemark;
|
|
|
|
1403
|
+ });
|
|
|
|
1404
|
+
|
|
|
|
1405
|
+ // setState(() {
|
|
|
|
1406
|
+ // // _notebookDetailChangeModel.customController.text = currentRemark;
|
|
|
|
1407
|
+ // });
|
|
|
|
1408
|
+ }
|
|
|
|
1409
|
+
|
|
|
|
1410
|
+ Widget _remarkWidget() {
|
|
|
|
1411
|
+ return Padding(
|
|
|
|
1412
|
+ padding: EdgeInsets.symmetric(
|
|
|
|
1413
|
+ horizontal: ScreenUtil().setWidth(48),
|
|
|
|
1414
|
+ ),
|
|
|
|
1415
|
+ child: Column(
|
|
|
|
1416
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
1417
|
+ children: [
|
|
|
|
1418
|
+ //输入框
|
|
|
|
1419
|
+ Container(
|
|
|
|
1420
|
+ width: double.infinity,
|
|
|
|
1421
|
+ height: ScreenUtil().setWidth(34 * 2),
|
|
|
|
1422
|
+ padding: EdgeInsets.symmetric(
|
|
|
|
1423
|
+ horizontal: ScreenUtil().setWidth(16),
|
|
|
|
1424
|
+ ),
|
|
|
|
1425
|
+ alignment: Alignment.topLeft,
|
|
|
|
1426
|
+ decoration: BoxDecoration(
|
|
|
|
1427
|
+ color: MyColours.color_ffffff,
|
|
|
|
1428
|
+ border: Border.all(
|
|
|
|
1429
|
+ color: MyColours.color_DBDBDB,
|
|
|
|
1430
|
+ width: ScreenUtil().setWidth(2)),
|
|
|
|
1431
|
+ borderRadius:
|
|
|
|
1432
|
+ BorderRadius.circular(ScreenUtil().setWidth(12))),
|
|
|
|
1433
|
+ child: TextField(
|
|
|
|
1434
|
+ controller: customController,
|
|
|
|
1435
|
+ focusNode: _cusdemNode,
|
|
|
|
1436
|
+ style: TextStyle(
|
|
|
|
1437
|
+ color: MyColours.color_515151,
|
|
|
|
1438
|
+ fontSize: ScreenUtil().setSp(28),
|
|
|
|
1439
|
+ textBaseline: TextBaseline.alphabetic),
|
|
|
|
1440
|
+ textAlignVertical: TextAlignVertical.center,
|
|
|
|
1441
|
+ maxLines: 1,
|
|
|
|
1442
|
+ // maxLength: 100,
|
|
|
|
1443
|
+ decoration: InputDecoration(
|
|
|
|
1444
|
+ hintText: "备注",
|
|
|
|
1445
|
+ hintStyle: TextStyle(
|
|
|
|
1446
|
+ color: MyColours.color_999999,
|
|
|
|
1447
|
+ fontSize: ScreenUtil().setSp(28),
|
|
|
|
1448
|
+ ),
|
|
|
|
1449
|
+ contentPadding: EdgeInsets.zero,
|
|
|
|
1450
|
+ border: OutlineInputBorder(borderSide: BorderSide.none),
|
|
|
|
1451
|
+ ),
|
|
|
|
1452
|
+ keyboardType: TextInputType.text,
|
|
|
|
1453
|
+ onChanged: (value) {
|
|
|
|
1454
|
+ setState(() {
|
|
|
|
1455
|
+ currentRemark = value ?? "";
|
|
|
|
1456
|
+ });
|
|
|
|
1457
|
+ // if (value.length < currRemark.length &&
|
|
|
|
1458
|
+ // currRemark.substring(value.length) != ',') {
|
|
|
|
1459
|
+ // setState(() {
|
|
|
|
1460
|
+ // currRemark = value ?? "";
|
|
|
|
1461
|
+ // });
|
|
|
|
1462
|
+ // if (sum == 0) {
|
|
|
|
1463
|
+ // for (int i = 0; i < remarks.length; i++) {
|
|
|
|
1464
|
+ // if (remarks[i].isSelect &&
|
|
|
|
1465
|
+ // remarks[i].remark == selectItem.last) {
|
|
|
|
1466
|
+ // setState(() {
|
|
|
|
1467
|
+ // remarks[i].isSelect = false;
|
|
|
|
1468
|
+ // });
|
|
|
|
1469
|
+ // }
|
|
|
|
1470
|
+ // }
|
|
|
|
1471
|
+ // }
|
|
|
|
1472
|
+ // sum++;
|
|
|
|
1473
|
+ // if (sum == selectItem.last.length ||
|
|
|
|
1474
|
+ // selectItem.length == 1 ||
|
|
|
|
1475
|
+ // selectItem.length == 0) {
|
|
|
|
1476
|
+ // selectItem.removeLast();
|
|
|
|
1477
|
+ // sum = 0;
|
|
|
|
1478
|
+ // }
|
|
|
|
1479
|
+ // } else {
|
|
|
|
1480
|
+ // setState(() {
|
|
|
|
1481
|
+ // currRemark = value ?? "";
|
|
|
|
1482
|
+ // });
|
|
|
|
1483
|
+ // }
|
|
|
|
1484
|
+ }),
|
|
|
|
1485
|
+ ),
|
|
|
|
1486
|
+ VEmptyView(34),
|
|
|
|
1487
|
+ Container(
|
|
|
|
1488
|
+ padding: EdgeInsets.only(bottom: ScreenUtil().setWidth(40)),
|
|
|
|
1489
|
+ child: Wrap(
|
|
|
|
1490
|
+ alignment: WrapAlignment.start,
|
|
|
|
1491
|
+ crossAxisAlignment: WrapCrossAlignment.start,
|
|
|
|
1492
|
+ children: _listWidget(remarkManagerModel.ofenRemarks, (item) {
|
|
|
|
1493
|
+ Remark object = item;
|
|
|
|
1494
|
+ oldRemarkBtn = object.custom;
|
|
|
|
1495
|
+ int index = remarkManagerModel.ofenRemarks.indexOf(item);
|
|
|
|
1496
|
+ _refreshRemark(remarkManagerModel.ofenRemarks, index);
|
|
|
|
1497
|
+ // _showConfirmWidget(needRemark: true);
|
|
|
|
1498
|
+ }),
|
|
|
|
1499
|
+ spacing: ScreenUtil().setWidth(20),
|
|
|
|
1500
|
+ runSpacing: ScreenUtil().setWidth(20),
|
|
|
|
1501
|
+ // alignment: WrapAlignment.start,
|
|
|
|
1502
|
+ // runAlignment: WrapAlignment.end,
|
|
|
|
1503
|
+ ),
|
|
|
|
1504
|
+ ),
|
|
|
|
1505
|
+ ],
|
|
|
|
1506
|
+ ));
|
|
|
|
1507
|
+ }
|
|
|
|
1508
|
+
|
|
1331
|
///优惠券选择
|
1509
|
///优惠券选择
|
|
1332
|
Widget _couponWidget() {
|
1510
|
Widget _couponWidget() {
|
|
1333
|
return Padding(
|
1511
|
return Padding(
|
|
@@ -1825,6 +2003,16 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -1825,6 +2003,16 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
1825
|
couponSelectIndex = 0;
|
2003
|
couponSelectIndex = 0;
|
|
1826
|
tableManagerModel.selectTables = [];
|
2004
|
tableManagerModel.selectTables = [];
|
|
1827
|
wechatNotification = true;
|
2005
|
wechatNotification = true;
|
|
|
|
2006
|
+ showPhoneHistory = false; //显示客户历史记录
|
|
|
|
2007
|
+
|
|
|
|
2008
|
+ currentRemark = '';
|
|
|
|
2009
|
+
|
|
|
|
2010
|
+ oldRemarkBtn = '';
|
|
|
|
2011
|
+ customController.text = '';
|
|
|
|
2012
|
+
|
|
|
|
2013
|
+ remarkManagerModel.ofenRemarks.forEach((element) {
|
|
|
|
2014
|
+ element.selected = false;
|
|
|
|
2015
|
+ });
|
|
1828
|
|
2016
|
|
|
1829
|
if (showErro != '短信余额不足,请充值短信条数') {
|
2017
|
if (showErro != '短信余额不足,请充值短信条数') {
|
|
1830
|
showErro = '';
|
2018
|
showErro = '';
|
|
@@ -1993,10 +2181,11 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -1993,10 +2181,11 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
1993
|
Column(children: [
|
2181
|
Column(children: [
|
|
1994
|
_customerInfoWidget(),
|
2182
|
_customerInfoWidget(),
|
|
1995
|
VEmptyView(44),
|
2183
|
VEmptyView(44),
|
|
1996
|
- _couponWidget(),
|
2184
|
+ _remarkWidget()
|
|
|
|
2185
|
+ // _couponWidget(),
|
|
1997
|
]),
|
2186
|
]),
|
|
1998
|
|
2187
|
|
|
1999
|
- VEmptyView(50),
|
2188
|
+ VEmptyView(20),
|
|
2000
|
Padding(
|
2189
|
Padding(
|
|
2001
|
padding: EdgeInsets.symmetric(
|
2190
|
padding: EdgeInsets.symmetric(
|
|
2002
|
horizontal: ScreenUtil().setWidth(36)),
|
2191
|
horizontal: ScreenUtil().setWidth(36)),
|
|
@@ -2116,10 +2305,15 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -2116,10 +2305,15 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
2116
|
if (pnumController.text != '') {
|
2305
|
if (pnumController.text != '') {
|
|
2117
|
pnum = pnumController.text;
|
2306
|
pnum = pnumController.text;
|
|
2118
|
}
|
2307
|
}
|
|
|
|
2308
|
+ String cusdem;
|
|
|
|
2309
|
+ if (customController.text.trim().length > 0) {
|
|
|
|
2310
|
+ cusdem = customController.text;
|
|
|
|
2311
|
+ }
|
|
2119
|
SunReserveInfoModel _model =
|
2312
|
SunReserveInfoModel _model =
|
|
2120
|
await tableManagerModel.setReserveInfo(context,
|
2313
|
await tableManagerModel.setReserveInfo(context,
|
|
2121
|
needKeep: true,
|
2314
|
needKeep: true,
|
|
2122
|
pnum: pnum,
|
2315
|
pnum: pnum,
|
|
|
|
2316
|
+ cusdem: cusdem,
|
|
2123
|
tempTime: ddateHm == '选填' ? null : ddateHm,
|
2317
|
tempTime: ddateHm == '选填' ? null : ddateHm,
|
|
2124
|
guest: widget.guest == null
|
2318
|
guest: widget.guest == null
|
|
2125
|
? guest
|
2319
|
? guest
|
|
@@ -2749,6 +2943,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -2749,6 +2943,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
2749
|
_baseIndoProvider = Provider.of<BaseIndoProvider>(context, listen: true);
|
2943
|
_baseIndoProvider = Provider.of<BaseIndoProvider>(context, listen: true);
|
|
2750
|
couponProvider = Provider.of<CouponProvider>(context, listen: true);
|
2944
|
couponProvider = Provider.of<CouponProvider>(context, listen: true);
|
|
2751
|
myModel = Provider.of<MyModel>(context, listen: true);
|
2945
|
myModel = Provider.of<MyModel>(context, listen: true);
|
|
|
|
2946
|
+ remarkManagerModel = Provider.of<RemarkManagerModel>(context, listen: true);
|
|
2752
|
return Scaffold(
|
2947
|
return Scaffold(
|
|
2753
|
resizeToAvoidBottomInset: false,
|
2948
|
resizeToAvoidBottomInset: false,
|
|
2754
|
appBar: widget.guest == null
|
2949
|
appBar: widget.guest == null
|