|
...
|
...
|
@@ -89,6 +89,7 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
String nameStr;
|
|
|
|
FocusNode _nameNode = FocusNode();
|
|
|
|
FocusNode _phoneNode = FocusNode();
|
|
|
|
FocusNode _pnumNode = FocusNode();
|
|
|
|
bool showPhoneHistory = false; //显示客户历史记录
|
|
|
|
EasyContactPicker _contactPicker = EasyContactPicker();
|
|
|
|
|
|
...
|
...
|
@@ -144,6 +145,9 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
MyTextSelectionControls _myExtendedMaterialTextSelectionControls =
|
|
|
|
MyTextSelectionControls();
|
|
|
|
|
|
|
|
MyTextSelectionControls _myExtendedMaterialTextSelectionControlsNum =
|
|
|
|
MyTextSelectionControls();
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
...
|
...
|
@@ -205,6 +209,25 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
_pnumNode.addListener(() {
|
|
|
|
if (_pnumNode.hasFocus) {
|
|
|
|
showOverlay(context);
|
|
|
|
setState(() {});
|
|
|
|
Scrollable.ensureVisible(botGlobalKey.currentContext);
|
|
|
|
} else {
|
|
|
|
if (!needBack &&
|
|
|
|
!needBlack &&
|
|
|
|
!needHistory &&
|
|
|
|
!_nameNode.hasFocus &&
|
|
|
|
!_cusdemNode.hasFocus &&
|
|
|
|
!needWechat) {
|
|
|
|
_showConfirmWidget();
|
|
|
|
}
|
|
|
|
|
|
|
|
removeOverlay();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
|
|
|
_myExtendedMaterialTextSelectionControls =
|
|
|
|
MyTextSelectionControls(callback: (value) {
|
|
...
|
...
|
@@ -214,6 +237,14 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
affinity: TextAffinity.downstream,
|
|
|
|
offset: value.toString().length)));
|
|
|
|
});
|
|
|
|
_myExtendedMaterialTextSelectionControlsNum =
|
|
|
|
MyTextSelectionControls(callback: (value) {
|
|
|
|
_baseIndoProvider.pnumController.value = TextEditingValue(
|
|
|
|
text: value,
|
|
|
|
selection: TextSelection.fromPosition(TextPosition(
|
|
|
|
affinity: TextAffinity.downstream,
|
|
|
|
offset: value.toString().length)));
|
|
|
|
});
|
|
|
|
couponProvider.sendSMS = 0;
|
|
|
|
await _couponNetworkData(isShowLoading: false);
|
|
|
|
await _getCustomerActivityBaseinfo();
|
|
...
|
...
|
@@ -896,9 +927,10 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
// weekInfoAndLunarCalendar = "星期${Utils.formatWeekDayNum(dateTime.weekday)}";
|
|
|
|
weekInfoAndLunarCalendar = returnWeekAndLunarCalendar(dateTime, context);
|
|
|
|
detailModel.selectNum = detailEntity.actual_pum;
|
|
|
|
detailModel.selectIndex = detailEntity.actual_pum != null
|
|
|
|
? personNumList.indexOf(detailEntity.actual_pum)
|
|
|
|
: null;
|
|
|
|
_baseIndoProvider.pnumController.text = detailEntity.actual_pum ?? '';
|
|
|
|
// detailModel.selectIndex = detailEntity.actual_pum != null
|
|
|
|
// ? personNumList.indexOf(detailEntity.actual_pum)
|
|
|
|
// : null;
|
|
|
|
setState(() {});
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -1462,79 +1494,168 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
fontSize: ScreenUtil().setSp(28)),
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
child: InkWell(
|
|
|
|
onTap: () {
|
|
|
|
FocusScope.of(context)
|
|
|
|
.requestFocus(FocusNode()); //隐藏键盘
|
|
|
|
DialogUtil.showSelectCusmanDialog(
|
|
|
|
context, personNumList,
|
|
|
|
(value) async {
|
|
|
|
if (value != null) {
|
|
|
|
detailModel.selectIndex =
|
|
|
|
value.first;
|
|
|
|
detailModel.selectNum =
|
|
|
|
personNumList[value.first];
|
|
|
|
// detailModel
|
|
|
|
// .notifyListeners();
|
|
|
|
// setState(() {
|
|
|
|
// selectPnum = value.first;
|
|
|
|
// pnum = pnumlist[value.first];
|
|
|
|
// });
|
|
|
|
bool sucess =
|
|
|
|
await detailModel.upReserveInfo(
|
|
|
|
context, widget.rid,
|
|
|
|
actualPum:
|
|
|
|
detailModel.selectNum,
|
|
|
|
needToast: false);
|
|
|
|
|
|
|
|
if (sucess) {
|
|
|
|
EventBus().emit(
|
|
|
|
"refresh_tablemanager"); //刷新桌位
|
|
|
|
bus.emit(
|
|
|
|
"refresh_book_list"); //刷新已预订列表
|
|
|
|
bus.emit("refresh_detail");
|
|
|
|
await _getReserveDetail(
|
|
|
|
showCicle: false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
selecteds: detailModel
|
|
|
|
.selectIndex ==
|
|
|
|
null
|
|
|
|
? []
|
|
|
|
: [detailModel.selectIndex])
|
|
|
|
.then((value) {});
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Text(
|
|
|
|
detailEntity.actual_pum == null ||
|
|
|
|
detailEntity.actual_pum ==
|
|
|
|
''
|
|
|
|
? '选填'
|
|
|
|
: detailEntity.actual_pum,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil().setSp(28),
|
|
|
|
color: detailEntity
|
|
|
|
.actual_pum ==
|
|
|
|
null ||
|
|
|
|
detailEntity
|
|
|
|
.actual_pum ==
|
|
|
|
''
|
|
|
|
? MyColours.color_999999
|
|
|
|
: MyColours
|
|
|
|
.color_515151))),
|
|
|
|
child: TextField(
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
selectionControls:
|
|
|
|
_myExtendedMaterialTextSelectionControlsNum,
|
|
|
|
maxLines: 1,
|
|
|
|
//输入文本的样式
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
color: MyColours.color_515151),
|
|
|
|
controller:
|
|
|
|
_baseIndoProvider.pnumController,
|
|
|
|
focusNode: _pnumNode,
|
|
|
|
// textAlignVertical: TextAlignVertical.top,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
hintText: "选填",
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
),
|
|
|
|
contentPadding: EdgeInsets.zero,
|
|
|
|
border: OutlineInputBorder(
|
|
|
|
borderSide: BorderSide.none),
|
|
|
|
),
|
|
|
|
|
|
|
|
// HEmptyView(6),
|
|
|
|
// Image.asset(
|
|
|
|
// Utils.getImgPath(
|
|
|
|
// false ? 'c_arrow_up' : 'c_arrow_down'),
|
|
|
|
// width: ScreenUtil().setWidth(28),
|
|
|
|
// // height: ScreenUtil().setWidth(10),
|
|
|
|
// ),
|
|
|
|
),
|
|
|
|
onChanged: (value) async {
|
|
|
|
//操作
|
|
|
|
_baseIndoProvider.pnumController.text =
|
|
|
|
value;
|
|
|
|
//添加的代码:光标一直在文本框后面
|
|
|
|
_baseIndoProvider.pnumController.value =
|
|
|
|
TextEditingValue(
|
|
|
|
text: _baseIndoProvider
|
|
|
|
.pnumController.text,
|
|
|
|
selection:
|
|
|
|
TextSelection.fromPosition(
|
|
|
|
TextPosition(
|
|
|
|
affinity:
|
|
|
|
TextAffinity.downstream,
|
|
|
|
offset: _baseIndoProvider
|
|
|
|
.pnumController.text.length,
|
|
|
|
)));
|
|
|
|
|
|
|
|
print(value);
|
|
|
|
// if (value.trim().isEmpty) {
|
|
|
|
// //内容为空,或 超过11位
|
|
|
|
// setState(() {
|
|
|
|
// _baseIndoProvider.userHistorys
|
|
|
|
// .clear();
|
|
|
|
// });
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
if (value != null) {
|
|
|
|
detailModel.selectNum = value;
|
|
|
|
// detailModel
|
|
|
|
// .notifyListeners();
|
|
|
|
// setState(() {
|
|
|
|
// selectPnum = value.first;
|
|
|
|
// pnum = pnumlist[value.first];
|
|
|
|
// });
|
|
|
|
bool sucess = await detailModel
|
|
|
|
.upReserveInfo(context, widget.rid,
|
|
|
|
actualPum:
|
|
|
|
detailModel.selectNum,
|
|
|
|
needToast: false);
|
|
|
|
|
|
|
|
if (sucess) {
|
|
|
|
EventBus().emit(
|
|
|
|
"refresh_tablemanager"); //刷新桌位
|
|
|
|
bus.emit(
|
|
|
|
"refresh_book_list"); //刷新已预订列表
|
|
|
|
bus.emit("refresh_detail");
|
|
|
|
// await _getReserveDetail(
|
|
|
|
// showCicle: false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
onEditingComplete: () {
|
|
|
|
_pnumNode.unfocus();
|
|
|
|
},
|
|
|
|
onTap: () {
|
|
|
|
// setState(() {
|
|
|
|
// showPhoneHistory = true;
|
|
|
|
// });
|
|
|
|
// // Future.delayed(Duration(milliseconds: 300), () {
|
|
|
|
// // _controller.jumpTo(_controller.position.maxScrollExtent);
|
|
|
|
// // });
|
|
|
|
},
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
)),
|
|
|
|
// Expanded(
|
|
|
|
// child: InkWell(
|
|
|
|
// onTap: () {
|
|
|
|
// FocusScope.of(context)
|
|
|
|
// .requestFocus(FocusNode()); //隐藏键盘
|
|
|
|
// DialogUtil.showSelectCusmanDialog(
|
|
|
|
// context, personNumList,
|
|
|
|
// (value) async {
|
|
|
|
// if (value != null) {
|
|
|
|
// detailModel.selectIndex =
|
|
|
|
// value.first;
|
|
|
|
// detailModel.selectNum =
|
|
|
|
// personNumList[value.first];
|
|
|
|
// // detailModel
|
|
|
|
// // .notifyListeners();
|
|
|
|
// // setState(() {
|
|
|
|
// // selectPnum = value.first;
|
|
|
|
// // pnum = pnumlist[value.first];
|
|
|
|
// // });
|
|
|
|
// bool sucess =
|
|
|
|
// await detailModel.upReserveInfo(
|
|
|
|
// context, widget.rid,
|
|
|
|
// actualPum:
|
|
|
|
// detailModel.selectNum,
|
|
|
|
// needToast: false);
|
|
|
|
|
|
|
|
// if (sucess) {
|
|
|
|
// EventBus().emit(
|
|
|
|
// "refresh_tablemanager"); //刷新桌位
|
|
|
|
// bus.emit(
|
|
|
|
// "refresh_book_list"); //刷新已预订列表
|
|
|
|
// bus.emit("refresh_detail");
|
|
|
|
// await _getReserveDetail(
|
|
|
|
// showCicle: false);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// },
|
|
|
|
// selecteds: detailModel
|
|
|
|
// .selectIndex ==
|
|
|
|
// null
|
|
|
|
// ? []
|
|
|
|
// : [detailModel.selectIndex])
|
|
|
|
// .then((value) {});
|
|
|
|
// },
|
|
|
|
// child: Container(
|
|
|
|
// alignment: Alignment.center,
|
|
|
|
// child: Text(
|
|
|
|
// detailEntity.actual_pum == null ||
|
|
|
|
// detailEntity.actual_pum ==
|
|
|
|
// ''
|
|
|
|
// ? '选填'
|
|
|
|
// : detailEntity.actual_pum,
|
|
|
|
// style: TextStyle(
|
|
|
|
// fontSize:
|
|
|
|
// ScreenUtil().setSp(28),
|
|
|
|
// color: detailEntity
|
|
|
|
// .actual_pum ==
|
|
|
|
// null ||
|
|
|
|
// detailEntity
|
|
|
|
// .actual_pum ==
|
|
|
|
// ''
|
|
|
|
// ? MyColours.color_999999
|
|
|
|
// : MyColours
|
|
|
|
// .color_515151))),
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// // HEmptyView(6),
|
|
|
|
// // Image.asset(
|
|
|
|
// // Utils.getImgPath(
|
|
|
|
// // false ? 'c_arrow_up' : 'c_arrow_down'),
|
|
|
|
// // width: ScreenUtil().setWidth(28),
|
|
|
|
// // // height: ScreenUtil().setWidth(10),
|
|
|
|
// // ),
|
|
|
|
// ),
|
|
|
|
]))),
|
|
|
|
MyDivider(
|
|
|
|
ScreenUtil().setWidth(2), ScreenUtil().setWidth(46),
|
...
|
...
|
|