Commit 36c7b48311cf63f9bdc8ee9faed550b9c17fd68e

Authored by wdn127929
1 parent fb01c7e9

预订安排

... ... @@ -75,7 +75,7 @@ class InvicationPageState extends State<InvicationPage>
List<String> couponsCan = []; //优惠券弹框数据
final GlobalKey globalKey = GlobalKey();
String reserverPhone;
String reserverPhone; //联系人保存成功后的值
String nameStr;
FocusNode _nameNode = FocusNode();
... ... @@ -89,7 +89,6 @@ class InvicationPageState extends State<InvicationPage>
List<Map<String, String>> tableInfo = []; //桌位信息
String ddate;
String ddateStr;
String phoneWidget;
String dateSolt;
String tid;
String nameWidget;
... ... @@ -101,12 +100,15 @@ class InvicationPageState extends State<InvicationPage>
List dailyList = []; // 早市对应半点钟,午市对应半点钟、晚市对应半点钟
String ddateHm = '';
String oldName;
String oldPhone;
String oldPhone; //联系人保存之前的值
String oldSex;
bool needBack = false;
bool needBlack = false;
bool needHistory = false;
String youhui = '选择优惠';
ScrollController scrollController = ScrollController();
final GlobalKey botGlobalKey = GlobalKey();
@override
void initState() {
super.initState();
... ... @@ -128,6 +130,7 @@ class InvicationPageState extends State<InvicationPage>
_phoneNode.addListener(() {
if (_phoneNode.hasFocus) {
showOverlay(context);
Scrollable.ensureVisible(botGlobalKey.currentContext);
} else {
if (!needBack && !needBlack && !needHistory && !_nameNode.hasFocus) {
_showConfirmWidget();
... ... @@ -535,9 +538,20 @@ class InvicationPageState extends State<InvicationPage>
bool sucess = await detailModel.upReserveInfo(context, widget.rid,
name: name, sex: sex, phone: phone);
if (sucess) {
reserverPhone = phone;
oldPhone = phone;
oldName = name;
oldSex = sex;
EventBus().emit("refresh_tablemanager"); //刷新桌位
bus.emit("refresh_book_list"); //刷新已预订列表
bus.emit("refresh_detail");
} else {
reserverPhone = oldPhone;
_baseIndoProvider.phoneController.text = oldPhone;
// oldName = nameStr;
// reserverPhone = oldPhone;
// sex = oldSex;
}
}
... ... @@ -579,14 +593,13 @@ class InvicationPageState extends State<InvicationPage>
ddate = detailEntity.ddate;
ddateStr = detailEntity.ddateStr;
phoneWidget = detailEntity.phone;
reserverPhone = phoneWidget;
reserverPhone = detailEntity.phone;
_baseIndoProvider.phoneController.text = reserverPhone;
dateSolt = detailEntity.ddate_solt;
nameWidget = detailEntity.rname == null ? '' : detailEntity.rname;
sex = detailEntity.sex == null ? '' : detailEntity.sex;
oldName = nameWidget;
oldPhone = phoneWidget;
oldPhone = reserverPhone;
oldSex = sex;
if (nameWidget != '' && nameWidget != null && sex != '' && sex != null) {
nameStr = nameWidget;
... ... @@ -1608,6 +1621,7 @@ class InvicationPageState extends State<InvicationPage>
],
),
Stack(
clipBehavior: Clip.none,
children: [
Column(
children: [
... ... @@ -1651,14 +1665,7 @@ class InvicationPageState extends State<InvicationPage>
onChanged: (value) {
print('ggg');
if (value.endsWith('先生') ||
value.endsWith('女士') ||
value.endsWith('公司')) {
nameStr = value.substring(
0, value.length - 2);
} else {
nameStr = value;
}
nameStr = value;
},
onEditingComplete: () {
print('fff');
... ... @@ -1716,6 +1723,7 @@ class InvicationPageState extends State<InvicationPage>
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.white),
color: MyColours.color_ffffff,
// color: Colors.red,
boxShadow: [
BoxShadow(
color: MyColours.color_e5e5e5,
... ... @@ -1723,7 +1731,7 @@ class InvicationPageState extends State<InvicationPage>
]),
width: ScreenUtil().setWidth(440),
height: _baseIndoProvider.userHistorys.length > 1
? ScreenUtil().setWidth(260)
? ScreenUtil().setWidth(140)
: ScreenUtil().setWidth(104),
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(30)),
... ... @@ -2407,17 +2415,27 @@ class InvicationPageState extends State<InvicationPage>
children: [
Expanded(
child: SingleChildScrollView(
controller: scrollController,
scrollDirection: Axis.vertical,
//true 滑动到底部
padding: EdgeInsets.all(0.0),
reverse:
_phoneNode.hasFocus ? true : false,
child: Column(
children: [
VEmptyView(40),
_managerWidget(),
VEmptyView(50),
_orderInfoWidget(),
VEmptyView(30),
_couponWidget(),
VEmptyView(20),
],
))),
children: [
VEmptyView(40),
_managerWidget(),
VEmptyView(50),
_orderInfoWidget(),
VEmptyView(30),
_couponWidget(),
VEmptyView(20),
Container(
key: botGlobalKey,
height:
ScreenUtil().setWidth(20))
],
))),
_btnWidget(),
],
),
... ...