Commit b283fea625b18928329a987fe0b6ac3349e54945

Authored by wdn127929
1 parent d561a492

桌位弹窗内容修改OK

... ... @@ -1342,182 +1342,176 @@ class TableManagerPageState extends State<TableManagerPage> {
}
///选中的桌子widget
Widget _selectTableWidget() {
Widget _selectTableWidgetWechat() {
return Container(
// constraints: BoxConstraints(maxHeight: ScreenUtil().setWidth(760)),
// height: ScreenUtil().setWidth(400),
width: double.infinity,
decoration: BoxDecoration(
color: MyColours.color_ffffff,
boxShadow: [
BoxShadow(
color: MyColours.color_333333,
blurRadius: ScreenUtil().setWidth(14))
],
borderRadius: BorderRadius.only(
topLeft: Radius.circular(ScreenUtil().setWidth(24)),
topRight: Radius.circular(ScreenUtil().setWidth(24)),
)),
child: Column(
// mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Stack(alignment: Alignment.centerRight, children: [
Container(
width: double.infinity,
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40),
vertical: ScreenUtil().setSp(16),
),
decoration: BoxDecoration(
color: MyColours.color_f3f3f3,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(ScreenUtil().setWidth(24)),
topRight: Radius.circular(ScreenUtil().setWidth(24)),
)),
child: Column(
children: [
Text(
tableManagerModel.selectDateStr +
' ' +
tableManagerModel.doltStr,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28),
fontWeight: FontWeight.bold),
// constraints: BoxConstraints(maxHeight: ScreenUtil().setWidth(760)),
// height: ScreenUtil().setWidth(400),
width: double.infinity,
decoration: BoxDecoration(
color: MyColours.color_ffffff,
boxShadow: [
BoxShadow(
color: MyColours.color_333333,
blurRadius: ScreenUtil().setWidth(14))
],
borderRadius: BorderRadius.only(
topLeft: Radius.circular(ScreenUtil().setWidth(24)),
topRight: Radius.circular(ScreenUtil().setWidth(24)),
)),
child: SingleChildScrollView(
child: Column(
// mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Stack(alignment: Alignment.centerRight, children: [
Container(
width: double.infinity,
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40),
vertical: ScreenUtil().setSp(16),
),
VEmptyView(8),
Text(
tableManagerModel.selectWeekAndLunarCalendar,
style: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(20)),
)
],
),
),
Positioned(
right: ScreenUtil().setWidth(40),
child: InkWell(
onTap: () {
nameStr = '';
_baseIndoProvider.nameController.text = '';
_baseIndoProvider.phoneController.text = '';
sexSelectIndex = 0;
sexStr = '先生';
actualPnum = '选填';
ddateHm = '选填';
actualPnumIndex = null;
ddateIndex = null;
youhui = '选择优惠';
couponSelectIndex = 0;
tableManagerModel.selectTables = [];
if (showErro != '短信余额不足,请充值短信条数') {
showErro = '';
}
for (t.Table item in tableManagerModel.tablesShow) {
item.selected = false;
}
tableManagerModel.areaTableMapShow.forEach((key, value) {
value.forEach((element) {
element.selected = false;
});
});
decoration: BoxDecoration(
color: MyColours.color_f3f3f3,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(ScreenUtil().setWidth(24)),
topRight: Radius.circular(ScreenUtil().setWidth(24)),
)),
child: Column(
children: [
Text(
tableManagerModel.selectDateStr +
' ' +
tableManagerModel.doltStr,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28),
fontWeight: FontWeight.bold),
),
VEmptyView(8),
Text(
tableManagerModel.selectWeekAndLunarCalendar,
style: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(20)),
)
],
),
),
Positioned(
right: ScreenUtil().setWidth(40),
child: InkWell(
onTap: () {
nameStr = '';
_baseIndoProvider.nameController.text = '';
_baseIndoProvider.phoneController.text = '';
sexSelectIndex = 0;
sexStr = '先生';
actualPnum = '选填';
ddateHm = '选填';
actualPnumIndex = null;
ddateIndex = null;
youhui = '选择优惠';
couponSelectIndex = 0;
tableManagerModel.selectTables = [];
if (showErro != '短信余额不足,请充值短信条数') {
showErro = '';
}
for (t.Table item in tableManagerModel.tablesShow) {
item.selected = false;
}
tableManagerModel.areaTableMapShow
.forEach((key, value) {
value.forEach((element) {
element.selected = false;
});
});
tableManagerModel.notifyListeners();
},
child: Text(
'清空',
style: TextStyle(
decoration: TextDecoration.underline,
color: MyColours.color_438E93,
fontSize: ScreenUtil().setSp(20)),
)))
]),
Container(
margin: EdgeInsets.only(top: ScreenUtil().setWidth(44)),
height: ScreenUtil().setWidth(60),
child: ListView.builder(
padding: EdgeInsets.only(left: ScreenUtil().setWidth(48)),
itemCount: tableManagerModel.selectTables.length,
shrinkWrap: true,
scrollDirection: Axis.horizontal,
itemBuilder: (BuildContext contxt, int index) {
t.Table table = tableManagerModel.selectTables[index];
return Container(
margin: EdgeInsets.only(right: ScreenUtil().setWidth(20)),
padding: EdgeInsets.only(
left: ScreenUtil().setWidth(16),
// right: ScreenUtil().setWidth(4),
// top: ScreenUtil().setWidth(14),
// bottom: ScreenUtil().setWidth(14)
),
decoration: BoxDecoration(
border: Border.all(
width: ScreenUtil().setWidth(2),
color: MyColours.color_438E93),
borderRadius:
BorderRadius.circular(ScreenUtil().setWidth(8))),
child: Row(
children: [
Text(
table.name,
tableManagerModel.notifyListeners();
},
child: Text(
'清空',
style: TextStyle(
decoration: TextDecoration.underline,
color: MyColours.color_438E93,
fontSize: ScreenUtil().setSp(28)),
fontSize: ScreenUtil().setSp(20)),
)))
]),
Container(
margin: EdgeInsets.only(top: ScreenUtil().setWidth(44)),
height: ScreenUtil().setWidth(60),
child: ListView.builder(
padding: EdgeInsets.only(left: ScreenUtil().setWidth(48)),
itemCount: tableManagerModel.selectTables.length,
shrinkWrap: true,
scrollDirection: Axis.horizontal,
itemBuilder: (BuildContext contxt, int index) {
t.Table table = tableManagerModel.selectTables[index];
return Container(
margin:
EdgeInsets.only(right: ScreenUtil().setWidth(20)),
padding: EdgeInsets.only(
left: ScreenUtil().setWidth(16),
// right: ScreenUtil().setWidth(4),
// top: ScreenUtil().setWidth(14),
// bottom: ScreenUtil().setWidth(14)
),
HEmptyView(14),
InkWell(
onTap: () {
//删除已经选择的桌位
tableManagerModel.selectTables
.removeWhere((t) => t.id == table.id);
for (t.Table item
in tableManagerModel.tablesShow) {
if (item.id == table.id) {
item.selected = false;
setState(() {});
}
}
for (t.Table item
in tableManagerModel.areaTableMapShow[
decoration: BoxDecoration(
border: Border.all(
width: ScreenUtil().setWidth(2),
color: MyColours.color_438E93),
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(8))),
child: Row(
children: [
Text(
table.name,
style: TextStyle(
color: MyColours.color_438E93,
fontSize: ScreenUtil().setSp(28)),
),
HEmptyView(14),
InkWell(
onTap: () {
//删除已经选择的桌位
tableManagerModel.selectTables
.removeWhere((t) => t.id == table.id);
for (t.Table item
in tableManagerModel.tablesShow) {
if (item.id == table.id) {
item.selected = false;
setState(() {});
}
}
for (t.Table item in tableManagerModel
.areaTableMapShow[
tableManagerModel
.areas[tableManagerModel.selectNumber]
.name]) {
if (item.id == table.id) {
item.selected = false;
setState(() {});
}
}
},
child: Container(
// color: Colors.red,
padding: EdgeInsets.only(
top: ScreenUtil().setWidth(14),
bottom: ScreenUtil().setWidth(14),
left: ScreenUtil().setWidth(14),
right: ScreenUtil().setWidth(4)),
child: Image.asset(
Utils.getImgPath('table_m_close'),
width: ScreenUtil().setWidth(32)))),
],
),
);
}),
),
!wechatNotification
? Column(children: [
_customerInfoWidget(),
VEmptyView(44),
_couponWidget(),
])
: SizedBox(),
VEmptyView(50),
wechatNotification
? Padding(
if (item.id == table.id) {
item.selected = false;
setState(() {});
}
}
},
child: Container(
// color: Colors.red,
padding: EdgeInsets.only(
top: ScreenUtil().setWidth(14),
bottom: ScreenUtil().setWidth(14),
left: ScreenUtil().setWidth(14),
right: ScreenUtil().setWidth(4)),
child: Image.asset(
Utils.getImgPath('table_m_close'),
width: ScreenUtil().setWidth(32)))),
],
),
);
}),
),
VEmptyView(50),
Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(36)),
child: Row(
... ... @@ -1664,43 +1658,43 @@ class TableManagerPageState extends State<TableManagerPage> {
bus.emit("refresh_tablemanager"); //刷新当前页面
bus.emit("refresh_book_list"); //刷新已预订列表
if (youhui != '选择优惠') {
Map<String, String> params = {
"rid": _model.row.id,
"aid":
'${couponProvider.couponListSelect[couponSelectIndex].id}'
};
bool isSuc = await couponProvider
.setActivityAsReserve(context, params);
if (isSuc) {
couponProvider.hasModify = true;
// bus.emit("refresh_book_list");
bool isSuccess =
await Utils.goShareInvicationToWeChat(
context,
_model.row.id,
Provider.of<UserModel>(context,
listen: false)
.user
.openid);
print(isSuccess);
if (isSuccess) {
_addForward(_model.row.id);
}
}
} else {
bool isSuccess =
await Utils.goShareInvicationToWeChat(
context,
_model.row.id,
Provider.of<UserModel>(context,
listen: false)
.user
.openid);
if (isSuccess) {
_addForward(_model.row.id);
}
// if (youhui != '选择优惠') {
// Map<String, String> params = {
// "rid": _model.row.id,
// "aid":
// '${couponProvider.couponListSelect[couponSelectIndex].id}'
// };
// bool isSuc = await couponProvider
// .setActivityAsReserve(context, params);
// if (isSuc) {
// couponProvider.hasModify = true;
// // bus.emit("refresh_book_list");
// bool isSuccess =
// await Utils.goShareInvicationToWeChat(
// context,
// _model.row.id,
// Provider.of<UserModel>(context,
// listen: false)
// .user
// .openid);
// print(isSuccess);
// if (isSuccess) {
// _addForward(_model.row.id);
// }
// }
// } else {
bool isSuccess =
await Utils.goShareInvicationToWeChat(
context,
_model.row.id,
Provider.of<UserModel>(context,
listen: false)
.user
.openid);
if (isSuccess) {
_addForward(_model.row.id);
}
// }
} else {
//失败
Utils.showToast("预订失败!");
... ... @@ -1708,8 +1702,190 @@ class TableManagerPageState extends State<TableManagerPage> {
},
)),
],
))
: Padding(
)),
VEmptyView(62)
],
),
));
}
///选中的桌子widget
Widget _selectTableWidgetSms() {
return Container(
// constraints: BoxConstraints(maxHeight: ScreenUtil().setWidth(760)),
// height: ScreenUtil().setWidth(400),
width: double.infinity,
decoration: BoxDecoration(
color: MyColours.color_ffffff,
boxShadow: [
BoxShadow(
color: MyColours.color_333333,
blurRadius: ScreenUtil().setWidth(14))
],
borderRadius: BorderRadius.only(
topLeft: Radius.circular(ScreenUtil().setWidth(24)),
topRight: Radius.circular(ScreenUtil().setWidth(24)),
)),
child: SingleChildScrollView(
child: Column(
// mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Stack(alignment: Alignment.centerRight, children: [
Container(
width: double.infinity,
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40),
vertical: ScreenUtil().setSp(16),
),
decoration: BoxDecoration(
color: MyColours.color_f3f3f3,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(ScreenUtil().setWidth(24)),
topRight: Radius.circular(ScreenUtil().setWidth(24)),
)),
child: Column(
children: [
Text(
tableManagerModel.selectDateStr +
' ' +
tableManagerModel.doltStr,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28),
fontWeight: FontWeight.bold),
),
VEmptyView(8),
Text(
tableManagerModel.selectWeekAndLunarCalendar,
style: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(20)),
)
],
),
),
Positioned(
right: ScreenUtil().setWidth(40),
child: InkWell(
onTap: () {
nameStr = '';
_baseIndoProvider.nameController.text = '';
_baseIndoProvider.phoneController.text = '';
sexSelectIndex = 0;
sexStr = '先生';
actualPnum = '选填';
ddateHm = '选填';
actualPnumIndex = null;
ddateIndex = null;
youhui = '选择优惠';
couponSelectIndex = 0;
tableManagerModel.selectTables = [];
if (showErro != '短信余额不足,请充值短信条数') {
showErro = '';
}
for (t.Table item in tableManagerModel.tablesShow) {
item.selected = false;
}
tableManagerModel.areaTableMapShow
.forEach((key, value) {
value.forEach((element) {
element.selected = false;
});
});
tableManagerModel.notifyListeners();
},
child: Text(
'清空',
style: TextStyle(
decoration: TextDecoration.underline,
color: MyColours.color_438E93,
fontSize: ScreenUtil().setSp(20)),
)))
]),
Container(
margin: EdgeInsets.only(top: ScreenUtil().setWidth(44)),
height: ScreenUtil().setWidth(60),
child: ListView.builder(
padding: EdgeInsets.only(left: ScreenUtil().setWidth(48)),
itemCount: tableManagerModel.selectTables.length,
shrinkWrap: true,
scrollDirection: Axis.horizontal,
itemBuilder: (BuildContext contxt, int index) {
t.Table table = tableManagerModel.selectTables[index];
return Container(
margin:
EdgeInsets.only(right: ScreenUtil().setWidth(20)),
padding: EdgeInsets.only(
left: ScreenUtil().setWidth(16),
// right: ScreenUtil().setWidth(4),
// top: ScreenUtil().setWidth(14),
// bottom: ScreenUtil().setWidth(14)
),
decoration: BoxDecoration(
border: Border.all(
width: ScreenUtil().setWidth(2),
color: MyColours.color_438E93),
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(8))),
child: Row(
children: [
Text(
table.name,
style: TextStyle(
color: MyColours.color_438E93,
fontSize: ScreenUtil().setSp(28)),
),
HEmptyView(14),
InkWell(
onTap: () {
//删除已经选择的桌位
tableManagerModel.selectTables
.removeWhere((t) => t.id == table.id);
for (t.Table item
in tableManagerModel.tablesShow) {
if (item.id == table.id) {
item.selected = false;
setState(() {});
}
}
for (t.Table item in tableManagerModel
.areaTableMapShow[
tableManagerModel
.areas[tableManagerModel.selectNumber]
.name]) {
if (item.id == table.id) {
item.selected = false;
setState(() {});
}
}
},
child: Container(
// color: Colors.red,
padding: EdgeInsets.only(
top: ScreenUtil().setWidth(14),
bottom: ScreenUtil().setWidth(14),
left: ScreenUtil().setWidth(14),
right: ScreenUtil().setWidth(4)),
child: Image.asset(
Utils.getImgPath('table_m_close'),
width: ScreenUtil().setWidth(32)))),
],
),
);
}),
),
Column(children: [
_customerInfoWidget(),
VEmptyView(44),
_couponWidget(),
]),
VEmptyView(50),
Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(36)),
child: Row(
... ... @@ -2000,351 +2176,351 @@ class TableManagerPageState extends State<TableManagerPage> {
],
)),
// Row(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// // HEmptyView(15),
// Padding(
// // width: ScreenUtil().setWidth(120),
// padding: EdgeInsets.only(top: ScreenUtil().setWidth(10)),
// child: Text(
// '已选桌位:',
// style: TextStyle(
// color: MyColours.color_333333,
// fontSize: ScreenUtil().setSp(26)),
// )),
// HEmptyView(15),
// // Expanded(
// // child:
// // width: ScreenUtil().screenWidth -
// // ScreenUtil().setWidth(160),
// // constraints:
// // BoxConstraints(maxHeight: ScreenUtil().setWidth(140)),
// // color: Colors.blueAccent,
// // ListView.builder(
// // shrinkWrap: true,
// // itemBuilder: (BuildContext context, int index) {
// // return
// // Scrollbar(
// // isAlwaysShown: true, //设置滚动条常亮
// // controller: _scrollCrl, //必须设置一个controller
// // ///添加进度条
// // child:
// // SingleChildScrollView(
// // controller: _scrollCrl,
// // child:
// Container(
// // color: Colors.red,
// width: ScreenUtil().screenWidth -
// ScreenUtil().setWidth(100 + 130),
// child: Wrap(
// spacing: ScreenUtil().setWidth(20),
// runSpacing: ScreenUtil().setWidth(20),
// children: _buildAlwayItems())),
// // )
// // )
// // },
// // itemCount: 1,
// // ),
// // )
// ],
// ),
// VEmptyView(40),
// Container(
// // width: ScreenUtil().setWidth(100),
// // color: Colors.red,
// // constraints: BoxConstraints(
// // minHeight: ScreenUtil().setWidth(500),
// // ),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
// children: [
// InkWell(
// onTap: () {
// tableManagerModel.selectTables = [];
// for (t.Table item in tableManagerModel.tablesShow) {
// item.selected = false;
// }
// tableManagerModel.areaTableMapShow.forEach((key, value) {
// value.forEach((element) {
// element.selected = false;
// });
// });
// tableManagerModel.notifyListeners();
// },
// child: Container(
// padding: EdgeInsets.all(
// ScreenUtil().setWidth(30),
// ),
// child: Text(
// '取消重置',
// style: TextStyle(
// color: MyColours.color_199095,
// fontSize: ScreenUtil().setSp(26)),
// ),
// ),
// ),
// RoundButton(
// onPressed: () async {
// SunReserveInfoModel _model =
// await tableManagerModel.setReserveInfo(context,
// needKeep: true, guest: widget.guest);
// if (_model != null &&
// ObjectUtil.isNotEmpty(_model.row) &&
// ObjectUtil.isNotEmpty(_model.row.id)) {
// print('成功');
// tableManagerModel.selectTables = [];
// // _homeEnterModel.clearData();
// bus.emit("refresh_tablemanager"); //刷新当前页面
// bus.emit("refresh_book_list"); //刷新已预订列表
// //进入订座详情页面
// // NavigatorUtil.goNotebookDetailPage(
// // context,
// // _model.row.id,
// // Provider.of<UserModel>(context, listen: false)
// // .user
// // .openid,
// // );
// // String ddate_solt = '';
// // if (_model.row.isSetDdate == '1') {
// // String createtime =
// // _model.row.ddate.toString() + '000';
// // DateTime createTime =
// // DateTime.fromMillisecondsSinceEpoch(
// // int.parse(createtime));
// // ddate_solt = DateUtil.formatDate(createTime,
// // format: DateFormats.h_m);
// // } else {
// // if (_model.row.ddateSolt == '1') {
// // ddate_solt = '早餐';
// // } else if (_model.row.ddateSolt == '2') {
// // ddate_solt = '午餐';
// // } else if (_model.row.ddateSolt == '3') {
// // ddate_solt = '晚餐';
// // }
// // }
// // List<dynamic> tableinfo =
// // convert.jsonDecode(_model.row.tableinfo);
// // print(tableinfo);
// // String _nameStr =
// // t.TableList.fromJson(tableinfo[0]).name;
// // if (tableinfo.length > 1) {
// // _nameStr = t.TableList.fromJson(tableinfo[0]).name +
// // '等${tableinfo.length}桌';
// // }
// // LogUtil.v(_nameStr);
// // String _tid = '';
// // for (int i = 0; i < tableinfo.length; i++) {
// // _tid += '${t.TableList.fromJson(tableinfo[i]).id},';
// // }
// // if (_tid.endsWith(',')) {
// // _tid = _tid.substring(0, _tid.length - 1);
// // }
// // NavigatorUtil.goInvicationPage(
// // context,
// // _model.row.id,
// // _nameStr,
// // _model.row.ddate,
// // ddate_solt,
// // _model.row.phone,
// // _model.row.ddateSolt,
// // tid: _tid,
// // replace: false);
// // //今天 明天 其他天
// // String tempTime = _homeEnterModel.ddateStr;
// // if (_homeEnterModel.ddateStr == '') {
// // if (currTimeIndex == 1) {
// // tempTime = '08:00';
// // } else if (currTimeIndex == 2) {
// // tempTime = '12:00';
// // } else if (currTimeIndex == 3) {
// // tempTime = '18:00';
// // }
// // }
// // print(_model.row.tableinfo);
// // _clearData();
// // String timeStr = dateText + ' ' + tempTime + ':00';
// // LogUtil.v(timeStr);
// // int ddate = DateUtil.getDateMsByTimeStr(timeStr);
// // _homeEnterModel.getNewTableList(context, '${ddate}',
// // currTimeIndex.toString(), pnum);
// // EventBus().emit("refresh_tablemanager"); //刷新桌位
// } else {
// Utils.showToast("预订失败!");
// }
// },
// text: '仅预订',
// fontSize: 32,
// isBold: false,
// width: ScreenUtil().setWidth(180),
// height: ScreenUtil().setWidth(90),
// padding: EdgeInsets.symmetric(
// horizontal: ScreenUtil().setWidth(20),
// vertical: ScreenUtil().setWidth(4)),
// textColor: MyColours.color_199095,
// gradientStart: MyColours.color_ffffff,
// gradientEnd: MyColours.color_ffffff,
// radius: ScreenUtil().setWidth(10),
// borderColor: MyColours.color_199095,
// ),
// RoundButton(
// onPressed: () async {
// SunReserveInfoModel _model =
// await tableManagerModel.setReserveInfo(context,
// needKeep: true, guest: widget.guest);
// if (_model != null &&
// ObjectUtil.isNotEmpty(_model.row) &&
// ObjectUtil.isNotEmpty(_model.row.id)) {
// print('成功');
// tableManagerModel.selectTables = [];
// // _homeEnterModel.clearData();
// bus.emit("refresh_tablemanager"); //刷新当前页面
// bus.emit("refresh_book_list"); //刷新已预订列表
// // //进入订座详情页面
// // NavigatorUtil.goNotebookDetailPage(
// // context,
// // _model.row.id,
// // Provider.of<UserModel>(context, listen: false)
// // .user
// // .openid,
// // );
// String ddate_solt = '';
// if (_model.row.isSetDdate == '1') {
// String createtime = _model.row.ddate.toString() + '000';
// DateTime createTime =
// DateTime.fromMillisecondsSinceEpoch(
// int.parse(createtime));
// ddate_solt = DateUtil.formatDate(createTime,
// format: DateFormats.h_m);
// } else {
// if (_model.row.ddateSolt == '1') {
// ddate_solt = '早餐';
// } else if (_model.row.ddateSolt == '2') {
// ddate_solt = '午餐';
// } else if (_model.row.ddateSolt == '3') {
// ddate_solt = '晚餐';
// }
// }
// List<dynamic> tableinfo =
// convert.jsonDecode(_model.row.tableinfo);
// print(tableinfo);
// // String _nameStr =
// // table.TableList.fromJson(tableinfo[0]).name;
// // if (tableinfo.length > 1) {
// // _nameStr = table.TableList.fromJson(tableinfo[0]).name +
// // '等${tableinfo.length}桌';
// // }
// // LogUtil.v(_nameStr);
// // String _tid = '';
// // for (int i = 0; i < tableinfo.length; i++) {
// // _tid += '${table.TableList.fromJson(tableinfo[i]).id},';
// // }
// // if (_tid.endsWith(',')) {
// // _tid = _tid.substring(0, _tid.length - 1);
// // }
// String _nameStr = '';
// String _tid = '';
// for (int i = 0; i < tableinfo.length; i++) {
// _nameStr +=
// '${table.TableList.fromJson(tableinfo[i]).name},';
// _tid += '${table.TableList.fromJson(tableinfo[i]).id},';
// }
// if (_tid.endsWith(',')) {
// _tid = _tid.substring(0, _tid.length - 1);
// }
// if (_nameStr.endsWith(',')) {
// _nameStr = _nameStr.substring(0, _nameStr.length - 1);
// }
// NavigatorUtil.goInvicationPage(
// context,
// _model.row.id,
// _nameStr,
// _model.row.ddate,
// ddate_solt,
// _model.row.phone,
// _model.row.ddateSolt,
// _model.row.rname == null ? '' : _model.row.rname,
// _model.row.sex == null ? '' : _model.row.sex,
// tid: _tid,
// replace: false);
// // //今天 明天 其他天
// // String tempTime = _homeEnterModel.ddateStr;
// // if (_homeEnterModel.ddateStr == '') {
// // if (currTimeIndex == 1) {
// // tempTime = '08:00';
// // } else if (currTimeIndex == 2) {
// // tempTime = '12:00';
// // } else if (currTimeIndex == 3) {
// // tempTime = '18:00';
// // }
// // }
// // print(_model.row.tableinfo);
// // _clearData();
// // String timeStr = dateText + ' ' + tempTime + ':00';
// // LogUtil.v(timeStr);
// // int ddate = DateUtil.getDateMsByTimeStr(timeStr);
// // _homeEnterModel.getNewTableList(context, '${ddate}',
// // currTimeIndex.toString(), pnum);
// // EventBus().emit("refresh_tablemanager"); //刷新桌位
// } else {
// Utils.showToast("预订失败!");
// }
// },
// text: '预订并通知',
// fontSize: 32,
// isBold: false,
// width: ScreenUtil().setWidth(220),
// height: ScreenUtil().setWidth(90),
// padding: EdgeInsets.symmetric(
// horizontal: ScreenUtil().setWidth(20),
// vertical: ScreenUtil().setWidth(4)),
// textColor: MyColours.color_ffffff,
// gradientStart: MyColours.color_199095,
// gradientEnd: MyColours.color_199095,
// radius: ScreenUtil().setWidth(10),
// borderColor: MyColours.color_199095,
// ),
// ],
// ),
// ),
wechatNotification || showErro == ''
? VEmptyView(62)
: Container(
padding: EdgeInsets.only(
left: ScreenUtil().setWidth(36),
top: ScreenUtil().setWidth(12),
right: ScreenUtil().setWidth(36),
bottom: ScreenUtil().setWidth(18),
),
child: Row(
children: [
Image.asset(Utils.getImgPath('error_circle_red'),
width: ScreenUtil().setWidth(44)),
HEmptyView(16),
Text(
showErro,
style: TextStyle(
color: MyColours.color_E34D59,
fontSize: ScreenUtil().setSp(28)),
)
],
),
)
],
),
);
// Row(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// // HEmptyView(15),
// Padding(
// // width: ScreenUtil().setWidth(120),
// padding: EdgeInsets.only(top: ScreenUtil().setWidth(10)),
// child: Text(
// '已选桌位:',
// style: TextStyle(
// color: MyColours.color_333333,
// fontSize: ScreenUtil().setSp(26)),
// )),
// HEmptyView(15),
// // Expanded(
// // child:
// // width: ScreenUtil().screenWidth -
// // ScreenUtil().setWidth(160),
// // constraints:
// // BoxConstraints(maxHeight: ScreenUtil().setWidth(140)),
// // color: Colors.blueAccent,
// // ListView.builder(
// // shrinkWrap: true,
// // itemBuilder: (BuildContext context, int index) {
// // return
// // Scrollbar(
// // isAlwaysShown: true, //设置滚动条常亮
// // controller: _scrollCrl, //必须设置一个controller
// // ///添加进度条
// // child:
// // SingleChildScrollView(
// // controller: _scrollCrl,
// // child:
// Container(
// // color: Colors.red,
// width: ScreenUtil().screenWidth -
// ScreenUtil().setWidth(100 + 130),
// child: Wrap(
// spacing: ScreenUtil().setWidth(20),
// runSpacing: ScreenUtil().setWidth(20),
// children: _buildAlwayItems())),
// // )
// // )
// // },
// // itemCount: 1,
// // ),
// // )
// ],
// ),
// VEmptyView(40),
// Container(
// // width: ScreenUtil().setWidth(100),
// // color: Colors.red,
// // constraints: BoxConstraints(
// // minHeight: ScreenUtil().setWidth(500),
// // ),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
// children: [
// InkWell(
// onTap: () {
// tableManagerModel.selectTables = [];
// for (t.Table item in tableManagerModel.tablesShow) {
// item.selected = false;
// }
// tableManagerModel.areaTableMapShow.forEach((key, value) {
// value.forEach((element) {
// element.selected = false;
// });
// });
// tableManagerModel.notifyListeners();
// },
// child: Container(
// padding: EdgeInsets.all(
// ScreenUtil().setWidth(30),
// ),
// child: Text(
// '取消重置',
// style: TextStyle(
// color: MyColours.color_199095,
// fontSize: ScreenUtil().setSp(26)),
// ),
// ),
// ),
// RoundButton(
// onPressed: () async {
// SunReserveInfoModel _model =
// await tableManagerModel.setReserveInfo(context,
// needKeep: true, guest: widget.guest);
// if (_model != null &&
// ObjectUtil.isNotEmpty(_model.row) &&
// ObjectUtil.isNotEmpty(_model.row.id)) {
// print('成功');
// tableManagerModel.selectTables = [];
// // _homeEnterModel.clearData();
// bus.emit("refresh_tablemanager"); //刷新当前页面
// bus.emit("refresh_book_list"); //刷新已预订列表
// //进入订座详情页面
// // NavigatorUtil.goNotebookDetailPage(
// // context,
// // _model.row.id,
// // Provider.of<UserModel>(context, listen: false)
// // .user
// // .openid,
// // );
// // String ddate_solt = '';
// // if (_model.row.isSetDdate == '1') {
// // String createtime =
// // _model.row.ddate.toString() + '000';
// // DateTime createTime =
// // DateTime.fromMillisecondsSinceEpoch(
// // int.parse(createtime));
// // ddate_solt = DateUtil.formatDate(createTime,
// // format: DateFormats.h_m);
// // } else {
// // if (_model.row.ddateSolt == '1') {
// // ddate_solt = '早餐';
// // } else if (_model.row.ddateSolt == '2') {
// // ddate_solt = '午餐';
// // } else if (_model.row.ddateSolt == '3') {
// // ddate_solt = '晚餐';
// // }
// // }
// // List<dynamic> tableinfo =
// // convert.jsonDecode(_model.row.tableinfo);
// // print(tableinfo);
// // String _nameStr =
// // t.TableList.fromJson(tableinfo[0]).name;
// // if (tableinfo.length > 1) {
// // _nameStr = t.TableList.fromJson(tableinfo[0]).name +
// // '等${tableinfo.length}桌';
// // }
// // LogUtil.v(_nameStr);
// // String _tid = '';
// // for (int i = 0; i < tableinfo.length; i++) {
// // _tid += '${t.TableList.fromJson(tableinfo[i]).id},';
// // }
// // if (_tid.endsWith(',')) {
// // _tid = _tid.substring(0, _tid.length - 1);
// // }
// // NavigatorUtil.goInvicationPage(
// // context,
// // _model.row.id,
// // _nameStr,
// // _model.row.ddate,
// // ddate_solt,
// // _model.row.phone,
// // _model.row.ddateSolt,
// // tid: _tid,
// // replace: false);
// // //今天 明天 其他天
// // String tempTime = _homeEnterModel.ddateStr;
// // if (_homeEnterModel.ddateStr == '') {
// // if (currTimeIndex == 1) {
// // tempTime = '08:00';
// // } else if (currTimeIndex == 2) {
// // tempTime = '12:00';
// // } else if (currTimeIndex == 3) {
// // tempTime = '18:00';
// // }
// // }
// // print(_model.row.tableinfo);
// // _clearData();
// // String timeStr = dateText + ' ' + tempTime + ':00';
// // LogUtil.v(timeStr);
// // int ddate = DateUtil.getDateMsByTimeStr(timeStr);
// // _homeEnterModel.getNewTableList(context, '${ddate}',
// // currTimeIndex.toString(), pnum);
// // EventBus().emit("refresh_tablemanager"); //刷新桌位
// } else {
// Utils.showToast("预订失败!");
// }
// },
// text: '仅预订',
// fontSize: 32,
// isBold: false,
// width: ScreenUtil().setWidth(180),
// height: ScreenUtil().setWidth(90),
// padding: EdgeInsets.symmetric(
// horizontal: ScreenUtil().setWidth(20),
// vertical: ScreenUtil().setWidth(4)),
// textColor: MyColours.color_199095,
// gradientStart: MyColours.color_ffffff,
// gradientEnd: MyColours.color_ffffff,
// radius: ScreenUtil().setWidth(10),
// borderColor: MyColours.color_199095,
// ),
// RoundButton(
// onPressed: () async {
// SunReserveInfoModel _model =
// await tableManagerModel.setReserveInfo(context,
// needKeep: true, guest: widget.guest);
// if (_model != null &&
// ObjectUtil.isNotEmpty(_model.row) &&
// ObjectUtil.isNotEmpty(_model.row.id)) {
// print('成功');
// tableManagerModel.selectTables = [];
// // _homeEnterModel.clearData();
// bus.emit("refresh_tablemanager"); //刷新当前页面
// bus.emit("refresh_book_list"); //刷新已预订列表
// // //进入订座详情页面
// // NavigatorUtil.goNotebookDetailPage(
// // context,
// // _model.row.id,
// // Provider.of<UserModel>(context, listen: false)
// // .user
// // .openid,
// // );
// String ddate_solt = '';
// if (_model.row.isSetDdate == '1') {
// String createtime = _model.row.ddate.toString() + '000';
// DateTime createTime =
// DateTime.fromMillisecondsSinceEpoch(
// int.parse(createtime));
// ddate_solt = DateUtil.formatDate(createTime,
// format: DateFormats.h_m);
// } else {
// if (_model.row.ddateSolt == '1') {
// ddate_solt = '早餐';
// } else if (_model.row.ddateSolt == '2') {
// ddate_solt = '午餐';
// } else if (_model.row.ddateSolt == '3') {
// ddate_solt = '晚餐';
// }
// }
// List<dynamic> tableinfo =
// convert.jsonDecode(_model.row.tableinfo);
// print(tableinfo);
// // String _nameStr =
// // table.TableList.fromJson(tableinfo[0]).name;
// // if (tableinfo.length > 1) {
// // _nameStr = table.TableList.fromJson(tableinfo[0]).name +
// // '等${tableinfo.length}桌';
// // }
// // LogUtil.v(_nameStr);
// // String _tid = '';
// // for (int i = 0; i < tableinfo.length; i++) {
// // _tid += '${table.TableList.fromJson(tableinfo[i]).id},';
// // }
// // if (_tid.endsWith(',')) {
// // _tid = _tid.substring(0, _tid.length - 1);
// // }
// String _nameStr = '';
// String _tid = '';
// for (int i = 0; i < tableinfo.length; i++) {
// _nameStr +=
// '${table.TableList.fromJson(tableinfo[i]).name},';
// _tid += '${table.TableList.fromJson(tableinfo[i]).id},';
// }
// if (_tid.endsWith(',')) {
// _tid = _tid.substring(0, _tid.length - 1);
// }
// if (_nameStr.endsWith(',')) {
// _nameStr = _nameStr.substring(0, _nameStr.length - 1);
// }
// NavigatorUtil.goInvicationPage(
// context,
// _model.row.id,
// _nameStr,
// _model.row.ddate,
// ddate_solt,
// _model.row.phone,
// _model.row.ddateSolt,
// _model.row.rname == null ? '' : _model.row.rname,
// _model.row.sex == null ? '' : _model.row.sex,
// tid: _tid,
// replace: false);
// // //今天 明天 其他天
// // String tempTime = _homeEnterModel.ddateStr;
// // if (_homeEnterModel.ddateStr == '') {
// // if (currTimeIndex == 1) {
// // tempTime = '08:00';
// // } else if (currTimeIndex == 2) {
// // tempTime = '12:00';
// // } else if (currTimeIndex == 3) {
// // tempTime = '18:00';
// // }
// // }
// // print(_model.row.tableinfo);
// // _clearData();
// // String timeStr = dateText + ' ' + tempTime + ':00';
// // LogUtil.v(timeStr);
// // int ddate = DateUtil.getDateMsByTimeStr(timeStr);
// // _homeEnterModel.getNewTableList(context, '${ddate}',
// // currTimeIndex.toString(), pnum);
// // EventBus().emit("refresh_tablemanager"); //刷新桌位
// } else {
// Utils.showToast("预订失败!");
// }
// },
// text: '预订并通知',
// fontSize: 32,
// isBold: false,
// width: ScreenUtil().setWidth(220),
// height: ScreenUtil().setWidth(90),
// padding: EdgeInsets.symmetric(
// horizontal: ScreenUtil().setWidth(20),
// vertical: ScreenUtil().setWidth(4)),
// textColor: MyColours.color_ffffff,
// gradientStart: MyColours.color_199095,
// gradientEnd: MyColours.color_199095,
// radius: ScreenUtil().setWidth(10),
// borderColor: MyColours.color_199095,
// ),
// ],
// ),
// ),
showErro == ''
? VEmptyView(62)
: Container(
padding: EdgeInsets.only(
left: ScreenUtil().setWidth(36),
top: ScreenUtil().setWidth(12),
right: ScreenUtil().setWidth(36),
bottom: ScreenUtil().setWidth(18),
),
child: Row(
children: [
Image.asset(Utils.getImgPath('error_circle_red'),
width: ScreenUtil().setWidth(44)),
HEmptyView(16),
Text(
showErro,
style: TextStyle(
color: MyColours.color_E34D59,
fontSize: ScreenUtil().setSp(28)),
)
],
),
)
],
),
));
}
//构建常用备注
... ... @@ -2452,6 +2628,7 @@ class TableManagerPageState extends State<TableManagerPage> {
couponProvider = Provider.of<CouponProvider>(context, listen: true);
myModel = Provider.of<MyModel>(context, listen: true);
return Scaffold(
resizeToAvoidBottomInset: false,
appBar: widget.guest == null
? null
: SystemAppBar(
... ... @@ -2918,7 +3095,10 @@ class TableManagerPageState extends State<TableManagerPage> {
child:
item(tableManagerModel.selectNumber))),
tableManagerModel.selectTables.length > 0
? _selectTableWidget()
? wechatNotification
? _selectTableWidgetWechat()
: Expanded(
flex: 5, child: _selectTableWidgetSms())
: SizedBox()
]))
// return CCMenuPage.builder(
... ...
... ... @@ -356,8 +356,8 @@ class TableManagerModel with ChangeNotifier {
// "cusdem": ''
};
if (pnum != null && pnum != '') {
// params["actual_pum"] = pnum; //预定用餐人数
params["pnum"] = pnum; //预定用餐人数
params["actual_pum"] = pnum; //预定用餐人数
// params["pnum"] = pnum; //预定用餐人数
}
if (guest != null) {
if (guest.rnameStr != '') {
... ...