|
...
|
...
|
@@ -101,7 +101,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
String smsErro = '';
|
|
|
|
String showErro = '';
|
|
|
|
|
|
|
|
// ScrollController _scrollCrl = ScrollController();
|
|
|
|
ScrollController _scrollCrl = ScrollController();
|
|
|
|
final ItemPositionsListener itemPositionsListener =
|
|
|
|
ItemPositionsListener.create();
|
|
|
|
|
|
...
|
...
|
@@ -813,6 +813,9 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
});
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
setState(() {
|
|
|
|
showPhoneHistory = true;
|
|
|
|
});
|
|
|
|
Map<String, String> params = {
|
|
|
|
"keywords": value,
|
|
|
|
"sid": Provider.of<UserModel>(context, listen: false)
|
|
...
|
...
|
@@ -1190,7 +1193,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
blurRadius: ScreenUtil().setWidth(20))
|
|
|
|
]),
|
|
|
|
// width: double.infinity,
|
|
|
|
width: ScreenUtil().screenWidth-w(60),
|
|
|
|
width: ScreenUtil().screenWidth - w(60),
|
|
|
|
// width: ScreenUtil().setWidth(350),
|
|
|
|
constraints: BoxConstraints(maxHeight: w(170)),
|
|
|
|
// height: _baseIndoProvider.userHistorys.length > 1
|
|
...
|
...
|
@@ -1203,98 +1206,110 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
child: MediaQuery.removePadding(
|
|
|
|
context: context,
|
|
|
|
removeTop: true,
|
|
|
|
child: ListView.builder(
|
|
|
|
shrinkWrap: true,
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
return GestureDetector(
|
|
|
|
onTap: () {
|
|
|
|
setState(() {
|
|
|
|
showPhoneHistory = false;
|
|
|
|
_baseIndoProvider.phoneController
|
|
|
|
.text = _baseIndoProvider
|
|
|
|
.userHistorys[index]
|
|
|
|
.phone !=
|
|
|
|
null
|
|
|
|
? _baseIndoProvider
|
|
|
|
.userHistorys[index].phone
|
|
|
|
: '';
|
|
|
|
// _homeEnterModel.nameController.text =
|
|
|
|
// _homeEnterModel
|
|
|
|
// .userHistorys[index].rname +
|
|
|
|
// _nameSuffix();
|
|
|
|
_addNameSuffix(
|
|
|
|
_baseIndoProvider
|
|
|
|
.userHistorys[index].rname,
|
|
|
|
sexStr);
|
|
|
|
nameStr = _baseIndoProvider
|
|
|
|
.userHistorys[index].rname;
|
|
|
|
_phoneNode.unfocus();
|
|
|
|
_baseIndoProvider.userHistorys
|
|
|
|
.clear();
|
|
|
|
});
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
width: double.infinity,
|
|
|
|
height: ScreenUtil().setWidth(102),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border(
|
|
|
|
bottom: (index !=
|
|
|
|
(_baseIndoProvider
|
|
|
|
.userHistorys
|
|
|
|
.length -
|
|
|
|
1) &&
|
|
|
|
_baseIndoProvider
|
|
|
|
.userHistorys
|
|
|
|
.length >
|
|
|
|
1)
|
|
|
|
? BorderSide(
|
|
|
|
color: MyColours
|
|
|
|
.color_e5e5e5,
|
|
|
|
width: ScreenUtil()
|
|
|
|
.setWidth(2))
|
|
|
|
: BorderSide.none)),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment:
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
_baseIndoProvider
|
|
|
|
.userHistorys[index]
|
|
|
|
.phone ==
|
|
|
|
null
|
|
|
|
? ''
|
|
|
|
: _baseIndoProvider
|
|
|
|
.userHistorys[index]
|
|
|
|
.phone,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_333333,
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil().setSp(32)),
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
child: Text(
|
|
|
|
_baseIndoProvider
|
|
|
|
child: Scrollbar(
|
|
|
|
isAlwaysShown: true, //设置滚动条常亮
|
|
|
|
controller: _scrollCrl, //必须设置一个controller
|
|
|
|
|
|
|
|
///添加进度条
|
|
|
|
child: ListView.builder(
|
|
|
|
shrinkWrap: true,
|
|
|
|
controller: _scrollCrl,
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
return GestureDetector(
|
|
|
|
onTap: () {
|
|
|
|
setState(() {
|
|
|
|
showPhoneHistory = false;
|
|
|
|
_baseIndoProvider.phoneController
|
|
|
|
.text = _baseIndoProvider
|
|
|
|
.userHistorys[index]
|
|
|
|
.rname ==
|
|
|
|
.phone !=
|
|
|
|
null
|
|
|
|
? ''
|
|
|
|
: _baseIndoProvider
|
|
|
|
? _baseIndoProvider
|
|
|
|
.userHistorys[index].phone
|
|
|
|
: '';
|
|
|
|
// _homeEnterModel.nameController.text =
|
|
|
|
// _homeEnterModel
|
|
|
|
// .userHistorys[index].rname +
|
|
|
|
// _nameSuffix();
|
|
|
|
_addNameSuffix(
|
|
|
|
_baseIndoProvider
|
|
|
|
.userHistorys[index]
|
|
|
|
.rname,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_333333,
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil().setSp(32)),
|
|
|
|
))
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
},
|
|
|
|
itemExtent: ScreenUtil().setWidth(104),
|
|
|
|
itemCount:
|
|
|
|
_baseIndoProvider.userHistorys.length,
|
|
|
|
))),
|
|
|
|
sexStr);
|
|
|
|
nameStr = _baseIndoProvider
|
|
|
|
.userHistorys[index].rname;
|
|
|
|
_phoneNode.unfocus();
|
|
|
|
_baseIndoProvider.userHistorys
|
|
|
|
.clear();
|
|
|
|
});
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
width: double.infinity,
|
|
|
|
height: ScreenUtil().setWidth(102),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border(
|
|
|
|
bottom: (index !=
|
|
|
|
(_baseIndoProvider
|
|
|
|
.userHistorys
|
|
|
|
.length -
|
|
|
|
1) &&
|
|
|
|
_baseIndoProvider
|
|
|
|
.userHistorys
|
|
|
|
.length >
|
|
|
|
1)
|
|
|
|
? BorderSide(
|
|
|
|
color: MyColours
|
|
|
|
.color_e5e5e5,
|
|
|
|
width: ScreenUtil()
|
|
|
|
.setWidth(2))
|
|
|
|
: BorderSide.none)),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment:
|
|
|
|
MainAxisAlignment
|
|
|
|
.spaceBetween,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
_baseIndoProvider
|
|
|
|
.userHistorys[
|
|
|
|
index]
|
|
|
|
.phone ==
|
|
|
|
null
|
|
|
|
? ''
|
|
|
|
: _baseIndoProvider
|
|
|
|
.userHistorys[index]
|
|
|
|
.phone,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours
|
|
|
|
.color_333333,
|
|
|
|
fontSize: ScreenUtil()
|
|
|
|
.setSp(32)),
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
child: Text(
|
|
|
|
_baseIndoProvider
|
|
|
|
.userHistorys[
|
|
|
|
index]
|
|
|
|
.rname ==
|
|
|
|
null
|
|
|
|
? ''
|
|
|
|
: _baseIndoProvider
|
|
|
|
.userHistorys[index]
|
|
|
|
.rname,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours
|
|
|
|
.color_333333,
|
|
|
|
fontSize: ScreenUtil()
|
|
|
|
.setSp(32)),
|
|
|
|
))
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
},
|
|
|
|
itemExtent: ScreenUtil().setWidth(104),
|
|
|
|
itemCount:
|
|
|
|
_baseIndoProvider.userHistorys.length,
|
|
|
|
)))),
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
],
|
|
...
|
...
|
@@ -2010,6 +2025,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
tableManagerModel.selectTables = [];
|
|
|
|
wechatNotification = true;
|
|
|
|
showPhoneHistory = false; //显示客户历史记录
|
|
|
|
_baseIndoProvider.userHistorys.clear();
|
|
|
|
|
|
|
|
currentRemark = '';
|
|
|
|
|
|
...
|
...
|
@@ -2037,199 +2053,211 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
|
|
|
|
///选中的桌子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),
|
|
|
|
return InkWell(
|
|
|
|
onTap: () {
|
|
|
|
if (showPhoneHistory) {
|
|
|
|
setState(() {
|
|
|
|
showPhoneHistory = false;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
child: 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),
|
|
|
|
),
|
|
|
|
VEmptyView(8),
|
|
|
|
Text(
|
|
|
|
tableManagerModel.selectWeekAndLunarCalendar,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(20)),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Positioned(
|
|
|
|
right: ScreenUtil().setWidth(40),
|
|
|
|
child: InkWell(
|
|
|
|
onTap: () {
|
|
|
|
_clearData();
|
|
|
|
},
|
|
|
|
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,
|
|
|
|
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: () {
|
|
|
|
_clearData();
|
|
|
|
},
|
|
|
|
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);
|
|
|
|
if (tableManagerModel.selectTables.length ==
|
|
|
|
0) {
|
|
|
|
// wechatNotification = true;
|
|
|
|
_clearData();
|
|
|
|
}
|
|
|
|
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);
|
|
|
|
if (tableManagerModel
|
|
|
|
.selectTables.length ==
|
|
|
|
0) {
|
|
|
|
// wechatNotification = true;
|
|
|
|
_clearData();
|
|
|
|
}
|
|
|
|
|
|
|
|
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(),
|
|
|
|
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(),
|
|
|
|
|
|
|
|
// _couponWidget(),
|
|
|
|
// ]),
|
|
|
|
// _couponWidget(),
|
|
|
|
// ]),
|
|
|
|
|
|
|
|
VEmptyView(20),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(36)),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: RoundButton(
|
|
|
|
text: '短信通知',
|
|
|
|
height: ScreenUtil().setWidth(96),
|
|
|
|
fontSize: 32,
|
|
|
|
gradientStart: MyColours.color_438E93,
|
|
|
|
gradientEnd: MyColours.color_438E93,
|
|
|
|
radius: ScreenUtil().setWidth(8),
|
|
|
|
isBold: false,
|
|
|
|
onPressed: () async {
|
|
|
|
if (myModel.smsInfo == '0') {
|
|
|
|
setState(() {
|
|
|
|
showErro = smsErro;
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if ((_baseIndoProvider.phoneController.text
|
|
|
|
.replaceAll(' ', '')
|
|
|
|
.isEmpty ||
|
|
|
|
!Utils.phoneRegExp(_baseIndoProvider
|
|
|
|
.phoneController.text
|
|
|
|
.replaceAll(' ', '')))) {
|
|
|
|
setState(() {
|
|
|
|
showErro = '请输入正确的11位手机号码';
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
} else {
|
|
|
|
setState(() {
|
|
|
|
showErro = '';
|
|
|
|
});
|
|
|
|
}
|
|
|
|
VEmptyView(20),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(36)),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: RoundButton(
|
|
|
|
text: '短信通知',
|
|
|
|
height: ScreenUtil().setWidth(96),
|
|
|
|
fontSize: 32,
|
|
|
|
gradientStart: MyColours.color_438E93,
|
|
|
|
gradientEnd: MyColours.color_438E93,
|
|
|
|
radius: ScreenUtil().setWidth(8),
|
|
|
|
isBold: false,
|
|
|
|
onPressed: () async {
|
|
|
|
if (myModel.smsInfo == '0') {
|
|
|
|
setState(() {
|
|
|
|
showErro = smsErro;
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if ((_baseIndoProvider.phoneController.text
|
|
|
|
.replaceAll(' ', '')
|
|
|
|
.isEmpty ||
|
|
|
|
!Utils.phoneRegExp(_baseIndoProvider
|
|
|
|
.phoneController.text
|
|
|
|
.replaceAll(' ', '')))) {
|
|
|
|
setState(() {
|
|
|
|
showErro = '请输入正确的11位手机号码';
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
} else {
|
|
|
|
setState(() {
|
|
|
|
showErro = '';
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
// if (!couponProvider.sendSMS) {
|
|
|
|
/*
|
|
|
|
// if (!couponProvider.sendSMS) {
|
|
|
|
/*
|
|
|
|
String dateSoltStr = '';
|
|
|
|
if (widget.dateSolt == '1') {
|
|
|
|
dateSoltStr = '早餐';
|
|
...
|
...
|
@@ -2271,572 +2299,576 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
params['Strtext'] = user.sellername;
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
Guest guest = Guest(
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
null);
|
|
|
|
if (widget.guest == null) {
|
|
|
|
guest.phone = _baseIndoProvider.phoneController.text
|
|
|
|
.replaceAll(' ', ''); //预订人电话
|
|
|
|
|
|
|
|
if (nameStr != null && nameStr.trim().length > 0) {
|
|
|
|
String sex = '1';
|
|
|
|
if (sexStr == '女士') {
|
|
|
|
sex = '2';
|
|
|
|
} else if (sexStr == '公司') {
|
|
|
|
sex = '3';
|
|
|
|
}
|
|
|
|
guest.rname = nameStr; //预订人姓名
|
|
|
|
guest.sex = sex; //预订人性别:1:男 2:女
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String pnum;
|
|
|
|
if (pnumController.text != '') {
|
|
|
|
pnum = pnumController.text;
|
|
|
|
}
|
|
|
|
String cusdem;
|
|
|
|
if (customController.text.trim().length > 0) {
|
|
|
|
cusdem = customController.text;
|
|
|
|
}
|
|
|
|
SunReserveInfoModel _model =
|
|
|
|
await tableManagerModel.setReserveInfo(context,
|
|
|
|
needKeep: true,
|
|
|
|
pnum: pnum,
|
|
|
|
cusdem: cusdem,
|
|
|
|
tempTime: ddateHm == '选填' ? null : ddateHm,
|
|
|
|
guest: widget.guest == null
|
|
|
|
? guest
|
|
|
|
: widget.guest);
|
|
|
|
if (_model != null &&
|
|
|
|
ObjectUtil.isNotEmpty(_model.row) &&
|
|
|
|
ObjectUtil.isNotEmpty(_model.row.id)) {
|
|
|
|
print('成功');
|
|
|
|
// tableManagerModel.selectTables = [];
|
|
|
|
// wechatNotification = true;
|
|
|
|
_clearData();
|
|
|
|
Guest guest = Guest(
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
null);
|
|
|
|
if (widget.guest == null) {
|
|
|
|
guest.phone = _baseIndoProvider
|
|
|
|
.phoneController.text
|
|
|
|
.replaceAll(' ', ''); //预订人电话
|
|
|
|
|
|
|
|
if (nameStr != null &&
|
|
|
|
nameStr.trim().length > 0) {
|
|
|
|
String sex = '1';
|
|
|
|
if (sexStr == '女士') {
|
|
|
|
sex = '2';
|
|
|
|
} else if (sexStr == '公司') {
|
|
|
|
sex = '3';
|
|
|
|
}
|
|
|
|
guest.rname = nameStr; //预订人姓名
|
|
|
|
guest.sex = sex; //预订人性别:1:男 2:女
|
|
|
|
|
|
|
|
// _homeEnterModel.clearData();
|
|
|
|
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;
|
|
|
|
UserModel userModel = Provider.of<UserModel>(
|
|
|
|
context,
|
|
|
|
listen: false);
|
|
|
|
Map<String, String> params = {
|
|
|
|
"rid": _model.row.id,
|
|
|
|
"sid": userModel.user.sellerid
|
|
|
|
};
|
|
|
|
bool success = await couponProvider
|
|
|
|
.sendSMSWxSendSms(context, params);
|
|
|
|
print(success);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
UserModel userModel = Provider.of<UserModel>(
|
|
|
|
context,
|
|
|
|
listen: false);
|
|
|
|
Map<String, String> params = {
|
|
|
|
"rid": _model.row.id,
|
|
|
|
"sid": userModel.user.sellerid
|
|
|
|
};
|
|
|
|
bool success = await couponProvider
|
|
|
|
.sendSMSWxSendSms(context, params);
|
|
|
|
print(success);
|
|
|
|
}
|
|
|
|
|
|
|
|
// if (success) {
|
|
|
|
// Utils.showToast('短信已经发送成功!');
|
|
|
|
// } else {
|
|
|
|
// Utils.showToast('发送次数太频繁!');
|
|
|
|
// }
|
|
|
|
// } else {
|
|
|
|
// Utils.showToast('短信已经发送成功!');
|
|
|
|
// }
|
|
|
|
// //进入订座详情页面
|
|
|
|
// 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("预订失败!");
|
|
|
|
}
|
|
|
|
},
|
|
|
|
)),
|
|
|
|
HEmptyView(36),
|
|
|
|
RoundButton(
|
|
|
|
text: '返回微信通知',
|
|
|
|
width: ScreenUtil().setWidth(182),
|
|
|
|
height: ScreenUtil().setWidth(96),
|
|
|
|
fontSize: 24,
|
|
|
|
textColor: MyColours.color_515151,
|
|
|
|
gradientStart: MyColours.color_f3f3f3,
|
|
|
|
gradientEnd: MyColours.color_f3f3f3,
|
|
|
|
radius: ScreenUtil().setWidth(8),
|
|
|
|
isBold: false,
|
|
|
|
onPressed: () {
|
|
|
|
setState(() {
|
|
|
|
wechatNotification = true;
|
|
|
|
});
|
|
|
|
},
|
|
|
|
)
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
String pnum;
|
|
|
|
if (pnumController.text != '') {
|
|
|
|
pnum = pnumController.text;
|
|
|
|
}
|
|
|
|
String cusdem;
|
|
|
|
if (customController.text.trim().length > 0) {
|
|
|
|
cusdem = customController.text;
|
|
|
|
}
|
|
|
|
SunReserveInfoModel _model =
|
|
|
|
await tableManagerModel.setReserveInfo(
|
|
|
|
context,
|
|
|
|
needKeep: true,
|
|
|
|
pnum: pnum,
|
|
|
|
cusdem: cusdem,
|
|
|
|
tempTime:
|
|
|
|
ddateHm == '选填' ? null : ddateHm,
|
|
|
|
guest: widget.guest == null
|
|
|
|
? guest
|
|
|
|
: widget.guest);
|
|
|
|
if (_model != null &&
|
|
|
|
ObjectUtil.isNotEmpty(_model.row) &&
|
|
|
|
ObjectUtil.isNotEmpty(_model.row.id)) {
|
|
|
|
print('成功');
|
|
|
|
// tableManagerModel.selectTables = [];
|
|
|
|
// wechatNotification = true;
|
|
|
|
_clearData();
|
|
|
|
|
|
|
|
// _homeEnterModel.clearData();
|
|
|
|
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;
|
|
|
|
UserModel userModel =
|
|
|
|
Provider.of<UserModel>(context,
|
|
|
|
listen: false);
|
|
|
|
Map<String, String> params = {
|
|
|
|
"rid": _model.row.id,
|
|
|
|
"sid": userModel.user.sellerid
|
|
|
|
};
|
|
|
|
bool success = await couponProvider
|
|
|
|
.sendSMSWxSendSms(context, params);
|
|
|
|
print(success);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
UserModel userModel = Provider.of<UserModel>(
|
|
|
|
context,
|
|
|
|
listen: false);
|
|
|
|
Map<String, String> params = {
|
|
|
|
"rid": _model.row.id,
|
|
|
|
"sid": userModel.user.sellerid
|
|
|
|
};
|
|
|
|
bool success = await couponProvider
|
|
|
|
.sendSMSWxSendSms(context, params);
|
|
|
|
print(success);
|
|
|
|
}
|
|
|
|
|
|
|
|
// 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)),
|
|
|
|
// if (success) {
|
|
|
|
// Utils.showToast('短信已经发送成功!');
|
|
|
|
// } else {
|
|
|
|
// Utils.showToast('发送次数太频繁!');
|
|
|
|
// }
|
|
|
|
// } else {
|
|
|
|
// Utils.showToast('短信已经发送成功!');
|
|
|
|
// }
|
|
|
|
// //进入订座详情页面
|
|
|
|
// 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("预订失败!");
|
|
|
|
}
|
|
|
|
},
|
|
|
|
)),
|
|
|
|
HEmptyView(36),
|
|
|
|
RoundButton(
|
|
|
|
text: '返回微信通知',
|
|
|
|
width: ScreenUtil().setWidth(182),
|
|
|
|
height: ScreenUtil().setWidth(96),
|
|
|
|
fontSize: 24,
|
|
|
|
textColor: MyColours.color_515151,
|
|
|
|
gradientStart: MyColours.color_f3f3f3,
|
|
|
|
gradientEnd: MyColours.color_f3f3f3,
|
|
|
|
radius: ScreenUtil().setWidth(8),
|
|
|
|
isBold: false,
|
|
|
|
onPressed: () {
|
|
|
|
setState(() {
|
|
|
|
wechatNotification = true;
|
|
|
|
});
|
|
|
|
},
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
));
|
|
|
|
)),
|
|
|
|
|
|
|
|
// 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)),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)));
|
|
|
|
}
|
|
|
|
|
|
|
|
//构建常用备注
|
...
|
...
|
|