|
@@ -89,6 +89,7 @@ class InvicationPageState extends State<InvicationPage> |
|
@@ -89,6 +89,7 @@ class InvicationPageState extends State<InvicationPage> |
|
89
|
String nameStr;
|
89
|
String nameStr;
|
|
90
|
FocusNode _nameNode = FocusNode();
|
90
|
FocusNode _nameNode = FocusNode();
|
|
91
|
FocusNode _phoneNode = FocusNode();
|
91
|
FocusNode _phoneNode = FocusNode();
|
|
|
|
92
|
+ FocusNode _pnumNode = FocusNode();
|
|
92
|
bool showPhoneHistory = false; //显示客户历史记录
|
93
|
bool showPhoneHistory = false; //显示客户历史记录
|
|
93
|
EasyContactPicker _contactPicker = EasyContactPicker();
|
94
|
EasyContactPicker _contactPicker = EasyContactPicker();
|
|
94
|
|
95
|
|
|
@@ -144,6 +145,9 @@ class InvicationPageState extends State<InvicationPage> |
|
@@ -144,6 +145,9 @@ class InvicationPageState extends State<InvicationPage> |
|
144
|
MyTextSelectionControls _myExtendedMaterialTextSelectionControls =
|
145
|
MyTextSelectionControls _myExtendedMaterialTextSelectionControls =
|
|
145
|
MyTextSelectionControls();
|
146
|
MyTextSelectionControls();
|
|
146
|
|
147
|
|
|
|
|
148
|
+ MyTextSelectionControls _myExtendedMaterialTextSelectionControlsNum =
|
|
|
|
149
|
+ MyTextSelectionControls();
|
|
|
|
150
|
+
|
|
147
|
@override
|
151
|
@override
|
|
148
|
void initState() {
|
152
|
void initState() {
|
|
149
|
super.initState();
|
153
|
super.initState();
|
|
@@ -205,6 +209,25 @@ class InvicationPageState extends State<InvicationPage> |
|
@@ -205,6 +209,25 @@ class InvicationPageState extends State<InvicationPage> |
|
205
|
}
|
209
|
}
|
|
206
|
});
|
210
|
});
|
|
207
|
|
211
|
|
|
|
|
212
|
+ _pnumNode.addListener(() {
|
|
|
|
213
|
+ if (_pnumNode.hasFocus) {
|
|
|
|
214
|
+ showOverlay(context);
|
|
|
|
215
|
+ setState(() {});
|
|
|
|
216
|
+ Scrollable.ensureVisible(botGlobalKey.currentContext);
|
|
|
|
217
|
+ } else {
|
|
|
|
218
|
+ if (!needBack &&
|
|
|
|
219
|
+ !needBlack &&
|
|
|
|
220
|
+ !needHistory &&
|
|
|
|
221
|
+ !_nameNode.hasFocus &&
|
|
|
|
222
|
+ !_cusdemNode.hasFocus &&
|
|
|
|
223
|
+ !needWechat) {
|
|
|
|
224
|
+ _showConfirmWidget();
|
|
|
|
225
|
+ }
|
|
|
|
226
|
+
|
|
|
|
227
|
+ removeOverlay();
|
|
|
|
228
|
+ }
|
|
|
|
229
|
+ });
|
|
|
|
230
|
+
|
|
208
|
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
231
|
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
|
209
|
_myExtendedMaterialTextSelectionControls =
|
232
|
_myExtendedMaterialTextSelectionControls =
|
|
210
|
MyTextSelectionControls(callback: (value) {
|
233
|
MyTextSelectionControls(callback: (value) {
|
|
@@ -214,6 +237,14 @@ class InvicationPageState extends State<InvicationPage> |
|
@@ -214,6 +237,14 @@ class InvicationPageState extends State<InvicationPage> |
|
214
|
affinity: TextAffinity.downstream,
|
237
|
affinity: TextAffinity.downstream,
|
|
215
|
offset: value.toString().length)));
|
238
|
offset: value.toString().length)));
|
|
216
|
});
|
239
|
});
|
|
|
|
240
|
+ _myExtendedMaterialTextSelectionControlsNum =
|
|
|
|
241
|
+ MyTextSelectionControls(callback: (value) {
|
|
|
|
242
|
+ _baseIndoProvider.pnumController.value = TextEditingValue(
|
|
|
|
243
|
+ text: value,
|
|
|
|
244
|
+ selection: TextSelection.fromPosition(TextPosition(
|
|
|
|
245
|
+ affinity: TextAffinity.downstream,
|
|
|
|
246
|
+ offset: value.toString().length)));
|
|
|
|
247
|
+ });
|
|
217
|
couponProvider.sendSMS = 0;
|
248
|
couponProvider.sendSMS = 0;
|
|
218
|
await _couponNetworkData(isShowLoading: false);
|
249
|
await _couponNetworkData(isShowLoading: false);
|
|
219
|
await _getCustomerActivityBaseinfo();
|
250
|
await _getCustomerActivityBaseinfo();
|
|
@@ -896,9 +927,10 @@ class InvicationPageState extends State<InvicationPage> |
|
@@ -896,9 +927,10 @@ class InvicationPageState extends State<InvicationPage> |
|
896
|
// weekInfoAndLunarCalendar = "星期${Utils.formatWeekDayNum(dateTime.weekday)}";
|
927
|
// weekInfoAndLunarCalendar = "星期${Utils.formatWeekDayNum(dateTime.weekday)}";
|
|
897
|
weekInfoAndLunarCalendar = returnWeekAndLunarCalendar(dateTime, context);
|
928
|
weekInfoAndLunarCalendar = returnWeekAndLunarCalendar(dateTime, context);
|
|
898
|
detailModel.selectNum = detailEntity.actual_pum;
|
929
|
detailModel.selectNum = detailEntity.actual_pum;
|
|
899
|
- detailModel.selectIndex = detailEntity.actual_pum != null
|
|
|
|
900
|
- ? personNumList.indexOf(detailEntity.actual_pum)
|
|
|
|
901
|
- : null;
|
930
|
+ _baseIndoProvider.pnumController.text = detailEntity.actual_pum ?? '';
|
|
|
|
931
|
+ // detailModel.selectIndex = detailEntity.actual_pum != null
|
|
|
|
932
|
+ // ? personNumList.indexOf(detailEntity.actual_pum)
|
|
|
|
933
|
+ // : null;
|
|
902
|
setState(() {});
|
934
|
setState(() {});
|
|
903
|
}
|
935
|
}
|
|
904
|
|
936
|
|
|
@@ -1462,79 +1494,168 @@ class InvicationPageState extends State<InvicationPage> |
|
@@ -1462,79 +1494,168 @@ class InvicationPageState extends State<InvicationPage> |
|
1462
|
fontSize: ScreenUtil().setSp(28)),
|
1494
|
fontSize: ScreenUtil().setSp(28)),
|
|
1463
|
),
|
1495
|
),
|
|
1464
|
Expanded(
|
1496
|
Expanded(
|
|
1465
|
- child: InkWell(
|
|
|
|
1466
|
- onTap: () {
|
|
|
|
1467
|
- FocusScope.of(context)
|
|
|
|
1468
|
- .requestFocus(FocusNode()); //隐藏键盘
|
|
|
|
1469
|
- DialogUtil.showSelectCusmanDialog(
|
|
|
|
1470
|
- context, personNumList,
|
|
|
|
1471
|
- (value) async {
|
|
|
|
1472
|
- if (value != null) {
|
|
|
|
1473
|
- detailModel.selectIndex =
|
|
|
|
1474
|
- value.first;
|
|
|
|
1475
|
- detailModel.selectNum =
|
|
|
|
1476
|
- personNumList[value.first];
|
|
|
|
1477
|
- // detailModel
|
|
|
|
1478
|
- // .notifyListeners();
|
|
|
|
1479
|
- // setState(() {
|
|
|
|
1480
|
- // selectPnum = value.first;
|
|
|
|
1481
|
- // pnum = pnumlist[value.first];
|
|
|
|
1482
|
- // });
|
|
|
|
1483
|
- bool sucess =
|
|
|
|
1484
|
- await detailModel.upReserveInfo(
|
|
|
|
1485
|
- context, widget.rid,
|
|
|
|
1486
|
- actualPum:
|
|
|
|
1487
|
- detailModel.selectNum,
|
|
|
|
1488
|
- needToast: false);
|
|
|
|
1489
|
-
|
|
|
|
1490
|
- if (sucess) {
|
|
|
|
1491
|
- EventBus().emit(
|
|
|
|
1492
|
- "refresh_tablemanager"); //刷新桌位
|
|
|
|
1493
|
- bus.emit(
|
|
|
|
1494
|
- "refresh_book_list"); //刷新已预订列表
|
|
|
|
1495
|
- bus.emit("refresh_detail");
|
|
|
|
1496
|
- await _getReserveDetail(
|
|
|
|
1497
|
- showCicle: false);
|
|
|
|
1498
|
- }
|
|
|
|
1499
|
- }
|
|
|
|
1500
|
- },
|
|
|
|
1501
|
- selecteds: detailModel
|
|
|
|
1502
|
- .selectIndex ==
|
|
|
|
1503
|
- null
|
|
|
|
1504
|
- ? []
|
|
|
|
1505
|
- : [detailModel.selectIndex])
|
|
|
|
1506
|
- .then((value) {});
|
|
|
|
1507
|
- },
|
|
|
|
1508
|
- child: Container(
|
|
|
|
1509
|
- alignment: Alignment.center,
|
|
|
|
1510
|
- child: Text(
|
|
|
|
1511
|
- detailEntity.actual_pum == null ||
|
|
|
|
1512
|
- detailEntity.actual_pum ==
|
|
|
|
1513
|
- ''
|
|
|
|
1514
|
- ? '选填'
|
|
|
|
1515
|
- : detailEntity.actual_pum,
|
|
|
|
1516
|
- style: TextStyle(
|
|
|
|
1517
|
- fontSize:
|
|
|
|
1518
|
- ScreenUtil().setSp(28),
|
|
|
|
1519
|
- color: detailEntity
|
|
|
|
1520
|
- .actual_pum ==
|
|
|
|
1521
|
- null ||
|
|
|
|
1522
|
- detailEntity
|
|
|
|
1523
|
- .actual_pum ==
|
|
|
|
1524
|
- ''
|
|
|
|
1525
|
- ? MyColours.color_999999
|
|
|
|
1526
|
- : MyColours
|
|
|
|
1527
|
- .color_515151))),
|
1497
|
+ child: TextField(
|
|
|
|
1498
|
+ textAlign: TextAlign.center,
|
|
|
|
1499
|
+ selectionControls:
|
|
|
|
1500
|
+ _myExtendedMaterialTextSelectionControlsNum,
|
|
|
|
1501
|
+ maxLines: 1,
|
|
|
|
1502
|
+ //输入文本的样式
|
|
|
|
1503
|
+ style: TextStyle(
|
|
|
|
1504
|
+ fontSize: ScreenUtil().setSp(28),
|
|
|
|
1505
|
+ color: MyColours.color_515151),
|
|
|
|
1506
|
+ controller:
|
|
|
|
1507
|
+ _baseIndoProvider.pnumController,
|
|
|
|
1508
|
+ focusNode: _pnumNode,
|
|
|
|
1509
|
+ // textAlignVertical: TextAlignVertical.top,
|
|
|
|
1510
|
+ decoration: InputDecoration(
|
|
|
|
1511
|
+ hintText: "选填",
|
|
|
|
1512
|
+ hintStyle: TextStyle(
|
|
|
|
1513
|
+ color: MyColours.color_999999,
|
|
|
|
1514
|
+ fontSize: ScreenUtil().setSp(28),
|
|
|
|
1515
|
+ ),
|
|
|
|
1516
|
+ contentPadding: EdgeInsets.zero,
|
|
|
|
1517
|
+ border: OutlineInputBorder(
|
|
|
|
1518
|
+ borderSide: BorderSide.none),
|
|
1528
|
),
|
1519
|
),
|
|
1529
|
-
|
|
|
|
1530
|
- // HEmptyView(6),
|
|
|
|
1531
|
- // Image.asset(
|
|
|
|
1532
|
- // Utils.getImgPath(
|
|
|
|
1533
|
- // false ? 'c_arrow_up' : 'c_arrow_down'),
|
|
|
|
1534
|
- // width: ScreenUtil().setWidth(28),
|
|
|
|
1535
|
- // // height: ScreenUtil().setWidth(10),
|
|
|
|
1536
|
- // ),
|
|
|
|
1537
|
- ),
|
1520
|
+ onChanged: (value) async {
|
|
|
|
1521
|
+ //操作
|
|
|
|
1522
|
+ _baseIndoProvider.pnumController.text =
|
|
|
|
1523
|
+ value;
|
|
|
|
1524
|
+ //添加的代码:光标一直在文本框后面
|
|
|
|
1525
|
+ _baseIndoProvider.pnumController.value =
|
|
|
|
1526
|
+ TextEditingValue(
|
|
|
|
1527
|
+ text: _baseIndoProvider
|
|
|
|
1528
|
+ .pnumController.text,
|
|
|
|
1529
|
+ selection:
|
|
|
|
1530
|
+ TextSelection.fromPosition(
|
|
|
|
1531
|
+ TextPosition(
|
|
|
|
1532
|
+ affinity:
|
|
|
|
1533
|
+ TextAffinity.downstream,
|
|
|
|
1534
|
+ offset: _baseIndoProvider
|
|
|
|
1535
|
+ .pnumController.text.length,
|
|
|
|
1536
|
+ )));
|
|
|
|
1537
|
+
|
|
|
|
1538
|
+ print(value);
|
|
|
|
1539
|
+ // if (value.trim().isEmpty) {
|
|
|
|
1540
|
+ // //内容为空,或 超过11位
|
|
|
|
1541
|
+ // setState(() {
|
|
|
|
1542
|
+ // _baseIndoProvider.userHistorys
|
|
|
|
1543
|
+ // .clear();
|
|
|
|
1544
|
+ // });
|
|
|
|
1545
|
+ // return;
|
|
|
|
1546
|
+ // }
|
|
|
|
1547
|
+ if (value != null) {
|
|
|
|
1548
|
+ detailModel.selectNum = value;
|
|
|
|
1549
|
+ // detailModel
|
|
|
|
1550
|
+ // .notifyListeners();
|
|
|
|
1551
|
+ // setState(() {
|
|
|
|
1552
|
+ // selectPnum = value.first;
|
|
|
|
1553
|
+ // pnum = pnumlist[value.first];
|
|
|
|
1554
|
+ // });
|
|
|
|
1555
|
+ bool sucess = await detailModel
|
|
|
|
1556
|
+ .upReserveInfo(context, widget.rid,
|
|
|
|
1557
|
+ actualPum:
|
|
|
|
1558
|
+ detailModel.selectNum,
|
|
|
|
1559
|
+ needToast: false);
|
|
|
|
1560
|
+
|
|
|
|
1561
|
+ if (sucess) {
|
|
|
|
1562
|
+ EventBus().emit(
|
|
|
|
1563
|
+ "refresh_tablemanager"); //刷新桌位
|
|
|
|
1564
|
+ bus.emit(
|
|
|
|
1565
|
+ "refresh_book_list"); //刷新已预订列表
|
|
|
|
1566
|
+ bus.emit("refresh_detail");
|
|
|
|
1567
|
+ // await _getReserveDetail(
|
|
|
|
1568
|
+ // showCicle: false);
|
|
|
|
1569
|
+ }
|
|
|
|
1570
|
+ }
|
|
|
|
1571
|
+ },
|
|
|
|
1572
|
+ onEditingComplete: () {
|
|
|
|
1573
|
+ _pnumNode.unfocus();
|
|
|
|
1574
|
+ },
|
|
|
|
1575
|
+ onTap: () {
|
|
|
|
1576
|
+ // setState(() {
|
|
|
|
1577
|
+ // showPhoneHistory = true;
|
|
|
|
1578
|
+ // });
|
|
|
|
1579
|
+ // // Future.delayed(Duration(milliseconds: 300), () {
|
|
|
|
1580
|
+ // // _controller.jumpTo(_controller.position.maxScrollExtent);
|
|
|
|
1581
|
+ // // });
|
|
|
|
1582
|
+ },
|
|
|
|
1583
|
+ keyboardType: TextInputType.number,
|
|
|
|
1584
|
+ )),
|
|
|
|
1585
|
+ // Expanded(
|
|
|
|
1586
|
+ // child: InkWell(
|
|
|
|
1587
|
+ // onTap: () {
|
|
|
|
1588
|
+ // FocusScope.of(context)
|
|
|
|
1589
|
+ // .requestFocus(FocusNode()); //隐藏键盘
|
|
|
|
1590
|
+ // DialogUtil.showSelectCusmanDialog(
|
|
|
|
1591
|
+ // context, personNumList,
|
|
|
|
1592
|
+ // (value) async {
|
|
|
|
1593
|
+ // if (value != null) {
|
|
|
|
1594
|
+ // detailModel.selectIndex =
|
|
|
|
1595
|
+ // value.first;
|
|
|
|
1596
|
+ // detailModel.selectNum =
|
|
|
|
1597
|
+ // personNumList[value.first];
|
|
|
|
1598
|
+ // // detailModel
|
|
|
|
1599
|
+ // // .notifyListeners();
|
|
|
|
1600
|
+ // // setState(() {
|
|
|
|
1601
|
+ // // selectPnum = value.first;
|
|
|
|
1602
|
+ // // pnum = pnumlist[value.first];
|
|
|
|
1603
|
+ // // });
|
|
|
|
1604
|
+ // bool sucess =
|
|
|
|
1605
|
+ // await detailModel.upReserveInfo(
|
|
|
|
1606
|
+ // context, widget.rid,
|
|
|
|
1607
|
+ // actualPum:
|
|
|
|
1608
|
+ // detailModel.selectNum,
|
|
|
|
1609
|
+ // needToast: false);
|
|
|
|
1610
|
+
|
|
|
|
1611
|
+ // if (sucess) {
|
|
|
|
1612
|
+ // EventBus().emit(
|
|
|
|
1613
|
+ // "refresh_tablemanager"); //刷新桌位
|
|
|
|
1614
|
+ // bus.emit(
|
|
|
|
1615
|
+ // "refresh_book_list"); //刷新已预订列表
|
|
|
|
1616
|
+ // bus.emit("refresh_detail");
|
|
|
|
1617
|
+ // await _getReserveDetail(
|
|
|
|
1618
|
+ // showCicle: false);
|
|
|
|
1619
|
+ // }
|
|
|
|
1620
|
+ // }
|
|
|
|
1621
|
+ // },
|
|
|
|
1622
|
+ // selecteds: detailModel
|
|
|
|
1623
|
+ // .selectIndex ==
|
|
|
|
1624
|
+ // null
|
|
|
|
1625
|
+ // ? []
|
|
|
|
1626
|
+ // : [detailModel.selectIndex])
|
|
|
|
1627
|
+ // .then((value) {});
|
|
|
|
1628
|
+ // },
|
|
|
|
1629
|
+ // child: Container(
|
|
|
|
1630
|
+ // alignment: Alignment.center,
|
|
|
|
1631
|
+ // child: Text(
|
|
|
|
1632
|
+ // detailEntity.actual_pum == null ||
|
|
|
|
1633
|
+ // detailEntity.actual_pum ==
|
|
|
|
1634
|
+ // ''
|
|
|
|
1635
|
+ // ? '选填'
|
|
|
|
1636
|
+ // : detailEntity.actual_pum,
|
|
|
|
1637
|
+ // style: TextStyle(
|
|
|
|
1638
|
+ // fontSize:
|
|
|
|
1639
|
+ // ScreenUtil().setSp(28),
|
|
|
|
1640
|
+ // color: detailEntity
|
|
|
|
1641
|
+ // .actual_pum ==
|
|
|
|
1642
|
+ // null ||
|
|
|
|
1643
|
+ // detailEntity
|
|
|
|
1644
|
+ // .actual_pum ==
|
|
|
|
1645
|
+ // ''
|
|
|
|
1646
|
+ // ? MyColours.color_999999
|
|
|
|
1647
|
+ // : MyColours
|
|
|
|
1648
|
+ // .color_515151))),
|
|
|
|
1649
|
+ // ),
|
|
|
|
1650
|
+
|
|
|
|
1651
|
+ // // HEmptyView(6),
|
|
|
|
1652
|
+ // // Image.asset(
|
|
|
|
1653
|
+ // // Utils.getImgPath(
|
|
|
|
1654
|
+ // // false ? 'c_arrow_up' : 'c_arrow_down'),
|
|
|
|
1655
|
+ // // width: ScreenUtil().setWidth(28),
|
|
|
|
1656
|
+ // // // height: ScreenUtil().setWidth(10),
|
|
|
|
1657
|
+ // // ),
|
|
|
|
1658
|
+ // ),
|
|
1538
|
]))),
|
1659
|
]))),
|
|
1539
|
MyDivider(
|
1660
|
MyDivider(
|
|
1540
|
ScreenUtil().setWidth(2), ScreenUtil().setWidth(46),
|
1661
|
ScreenUtil().setWidth(2), ScreenUtil().setWidth(46),
|