|
...
|
...
|
@@ -104,6 +104,10 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { |
|
|
|
MyTextSelectionControls _myExtendedMaterialTextSelectionControls =
|
|
|
|
MyTextSelectionControls();
|
|
|
|
|
|
|
|
TextEditingController pnumC = TextEditingController();
|
|
|
|
FocusNode pnumF = FocusNode();
|
|
|
|
FocusNode priceF = FocusNode();
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
// TODO: implement initState
|
|
...
|
...
|
@@ -120,7 +124,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { |
|
|
|
_initCancel();
|
|
|
|
_getReserveDetail();
|
|
|
|
_getOrderInfo();
|
|
|
|
_initPersonNumList();
|
|
|
|
// _initPersonNumList();
|
|
|
|
Map<String, String> params = {
|
|
|
|
"uid": Provider.of<UserModel>(context, listen: false).user.openid
|
|
|
|
};
|
|
...
|
...
|
@@ -345,10 +349,11 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { |
|
|
|
showCircle: showCicle);
|
|
|
|
_initTime(int.parse(detailEntity.ddate_solt));
|
|
|
|
setState(() {
|
|
|
|
detailModel.selectNum = detailEntity.actual_pum;
|
|
|
|
detailModel.selectIndex = detailEntity.actual_pum != null
|
|
|
|
? personNumList.indexOf(detailEntity.actual_pum)
|
|
|
|
: null;
|
|
|
|
// detailModel.selectNum = detailEntity.actual_pum;
|
|
|
|
// detailModel.selectIndex = detailEntity.actual_pum != null
|
|
|
|
// ? personNumList.indexOf(detailEntity.actual_pum)
|
|
|
|
// : null;
|
|
|
|
pnumC.text = detailEntity.actual_pum;
|
|
|
|
if (detailEntity.con_amount != null) {
|
|
|
|
detailModel.prestrTF = detailEntity.con_amount;
|
|
|
|
detailModel.numController.text = detailEntity.con_amount;
|
|
...
|
...
|
@@ -1407,57 +1412,80 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { |
|
|
|
// ? false
|
|
|
|
// : true,
|
|
|
|
// child:
|
|
|
|
TitleAndBtn(
|
|
|
|
// TitleAndBtn(
|
|
|
|
// title: "人数",
|
|
|
|
// content:
|
|
|
|
// detailEntity.actual_pum,
|
|
|
|
// list: personNumList,
|
|
|
|
// detailModel: model,
|
|
|
|
// callback: () {
|
|
|
|
// 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);
|
|
|
|
|
|
|
|
// if (sucess) {
|
|
|
|
// EventBus().emit(
|
|
|
|
// "refresh_tablemanager"); //刷新桌位
|
|
|
|
// await _getReserveDetail(
|
|
|
|
// showCicle: false);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// },
|
|
|
|
// selecteds: detailModel
|
|
|
|
// .selectIndex ==
|
|
|
|
// null
|
|
|
|
// ? []
|
|
|
|
// : [
|
|
|
|
// detailModel
|
|
|
|
// .selectIndex
|
|
|
|
// ])
|
|
|
|
// .then((value) {});
|
|
|
|
// }),
|
|
|
|
TitleAndTextfield(
|
|
|
|
title: "人数",
|
|
|
|
content:
|
|
|
|
detailEntity.actual_pum,
|
|
|
|
list: personNumList,
|
|
|
|
detailModel: model,
|
|
|
|
callback: () {
|
|
|
|
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
|
|
|
|
detailModel: detailModel,
|
|
|
|
rid: widget.rid,
|
|
|
|
isPrice: false,
|
|
|
|
controller: pnumC,
|
|
|
|
focusNode: pnumF,
|
|
|
|
callback: () async {
|
|
|
|
bool sucess =
|
|
|
|
await detailModel
|
|
|
|
.upReserveInfo(
|
|
|
|
context,
|
|
|
|
widget.rid,
|
|
|
|
actualPum:
|
|
|
|
detailModel
|
|
|
|
.selectNum);
|
|
|
|
|
|
|
|
if (sucess) {
|
|
|
|
EventBus().emit(
|
|
|
|
"refresh_tablemanager"); //刷新桌位
|
|
|
|
await _getReserveDetail(
|
|
|
|
showCicle: false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
selecteds: detailModel
|
|
|
|
.selectIndex ==
|
|
|
|
null
|
|
|
|
? []
|
|
|
|
: [
|
|
|
|
detailModel
|
|
|
|
.selectIndex
|
|
|
|
])
|
|
|
|
.then((value) {});
|
|
|
|
pnumC.text);
|
|
|
|
|
|
|
|
if (sucess) {
|
|
|
|
EventBus().emit(
|
|
|
|
"refresh_tablemanager"); //刷新桌位
|
|
|
|
await _getReserveDetail(
|
|
|
|
showCicle: false);
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
// ),
|
|
|
|
// Offstage(
|
|
...
|
...
|
@@ -1516,6 +1544,10 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { |
|
|
|
title: "消费金额",
|
|
|
|
detailModel: detailModel,
|
|
|
|
rid: widget.rid,
|
|
|
|
isPrice: true,
|
|
|
|
controller:
|
|
|
|
detailModel.numController,
|
|
|
|
focusNode: priceF,
|
|
|
|
),
|
|
|
|
Offstage(
|
|
|
|
offstage:
|
|
...
|
...
|
@@ -3323,6 +3355,11 @@ class TitleAndTextfield extends StatefulWidget { |
|
|
|
final List<String> pnumlist;
|
|
|
|
final NotebookDetailModel detailModel;
|
|
|
|
final String rid;
|
|
|
|
final TextEditingController controller;
|
|
|
|
final FocusNode focusNode;
|
|
|
|
final bool isPrice;
|
|
|
|
|
|
|
|
final VoidCallback callback;
|
|
|
|
|
|
|
|
const TitleAndTextfield(
|
|
|
|
{Key key,
|
|
...
|
...
|
@@ -3330,7 +3367,11 @@ class TitleAndTextfield extends StatefulWidget { |
|
|
|
this.bookNum,
|
|
|
|
this.pnumlist,
|
|
|
|
this.detailModel,
|
|
|
|
this.rid})
|
|
|
|
this.rid,
|
|
|
|
this.controller,
|
|
|
|
this.focusNode,
|
|
|
|
this.isPrice = true,
|
|
|
|
this.callback})
|
|
|
|
: super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
...
|
...
|
@@ -3338,18 +3379,24 @@ class TitleAndTextfield extends StatefulWidget { |
|
|
|
}
|
|
|
|
|
|
|
|
class _TitleAndTextfieldState extends State<TitleAndTextfield> {
|
|
|
|
FocusNode numberFocusNode = new FocusNode();
|
|
|
|
// FocusNode numberFocusNode = new FocusNode();
|
|
|
|
OverlayEntry overlayEntry;
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
|
|
|
|
// if (Platform.isIOS) {
|
|
|
|
numberFocusNode.addListener(() {
|
|
|
|
if (numberFocusNode.hasFocus) {
|
|
|
|
widget.focusNode.addListener(() {
|
|
|
|
if (widget.focusNode.hasFocus) {
|
|
|
|
showOverlay(context);
|
|
|
|
} else {
|
|
|
|
_updateMoney();
|
|
|
|
if (widget.isPrice) {
|
|
|
|
_updateMoney();
|
|
|
|
} else {
|
|
|
|
//人数
|
|
|
|
widget.callback();
|
|
|
|
}
|
|
|
|
|
|
|
|
removeOverlay();
|
|
|
|
}
|
|
|
|
});
|
|
...
|
...
|
@@ -3457,18 +3504,20 @@ class _TitleAndTextfieldState extends State<TitleAndTextfield> { |
|
|
|
color: MyColours.color_199095))),
|
|
|
|
child: IntrinsicWidth(
|
|
|
|
child: TextField(
|
|
|
|
controller: widget.detailModel.numController,
|
|
|
|
controller: widget.controller,
|
|
|
|
maxLines: 1,
|
|
|
|
// inputFormatters: [
|
|
|
|
// LengthLimitingTextInputFormatter(9),
|
|
|
|
// FilteringTextInputFormatter.digitsOnly
|
|
|
|
// ],
|
|
|
|
|
|
|
|
inputFormatters: [
|
|
|
|
NumLengthInputFormatter(
|
|
|
|
decimalLength: 2, integerLength: 6),
|
|
|
|
],
|
|
|
|
focusNode: numberFocusNode,
|
|
|
|
inputFormatters: widget.isPrice
|
|
|
|
? [
|
|
|
|
NumLengthInputFormatter(
|
|
|
|
decimalLength: 2, integerLength: 6),
|
|
|
|
]
|
|
|
|
: [],
|
|
|
|
focusNode: widget.focusNode,
|
|
|
|
|
|
|
|
//光标颜色
|
|
|
|
cursorColor: MyColours.color_199095,
|
|
...
|
...
|
@@ -3485,7 +3534,8 @@ class _TitleAndTextfieldState extends State<TitleAndTextfield> { |
|
|
|
fontSize: ScreenUtil().setSp(30),
|
|
|
|
),
|
|
|
|
prefix: widget.detailModel.strTF != null &&
|
|
|
|
widget.detailModel.strTF.trim().length > 0
|
|
|
|
widget.detailModel.strTF.trim().length > 0 &&
|
|
|
|
widget.isPrice
|
|
|
|
? Text("¥",
|
|
|
|
style: TextStyle(color: MyColours.color_199095))
|
|
|
|
: SizedBox(),
|
|
...
|
...
|
@@ -3504,17 +3554,20 @@ class _TitleAndTextfieldState extends State<TitleAndTextfield> { |
|
|
|
border: OutlineInputBorder(borderSide: BorderSide.none),
|
|
|
|
),
|
|
|
|
onChanged: (value) {
|
|
|
|
widget.detailModel.strTF = value;
|
|
|
|
if (widget.isPrice) {
|
|
|
|
widget.detailModel.strTF = value;
|
|
|
|
|
|
|
|
print(widget.detailModel.numController.text);
|
|
|
|
widget.detailModel.notifyListeners();
|
|
|
|
print(widget.detailModel.numController.text);
|
|
|
|
widget.detailModel.notifyListeners();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
onEditingComplete: () {
|
|
|
|
FocusScope.of(context).requestFocus(FocusNode()); //隐藏键盘
|
|
|
|
// _updateMoney();
|
|
|
|
},
|
|
|
|
keyboardType:
|
|
|
|
TextInputType.numberWithOptions(decimal: true),
|
|
|
|
keyboardType: widget.isPrice
|
|
|
|
? TextInputType.numberWithOptions(decimal: true)
|
|
|
|
: TextInputType.number,
|
|
|
|
))),
|
|
|
|
]));
|
|
|
|
}
|
...
|
...
|
|