Commit c1199eb26c7ba68cff952173a6778b72809621eb

Authored by wdn127929
1 parent cede4233

短信,微信通知

... ... @@ -132,11 +132,13 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
solt: widget.solt,
)),
))
..add(ChangeNotifierProvider<BaseIndoProvider>(
create: (_) => BaseIndoProvider(),
child: ChangeNotifierProvider<TableManagerModel>(
create: (_) => TableManagerModel(), child: TableManagerPage()),
))
..add(ChangeNotifierProvider<MyModel>(
create: (_) => MyModel(),
child: ChangeNotifierProvider<BaseIndoProvider>(
create: (_) => BaseIndoProvider(),
child: ChangeNotifierProvider<TableManagerModel>(
create: (_) => TableManagerModel(), child: TableManagerPage()),
)))
..add(ChangeNotifierProvider<MyModel>(
create: (_) => MyModel(),
child: MyPage(),
... ...
... ... @@ -73,6 +73,7 @@ class InvicationPageState extends State<InvicationPage>
String wechat = '';
String qiniuUrl = '';
List<String> couponsCan = []; //优惠券弹框数据
final GlobalKey globalKey = GlobalKey();
String reserverPhone; //联系人保存成功后的值
... ...
... ... @@ -7,12 +7,16 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/constant/state.dart';
import 'package:one_key/models/area.dart';
import 'package:one_key/models/coupon_model.dart';
import 'package:one_key/models/guest_info_model.dart';
import 'package:one_key/models/reserve_info_model.dart';
import 'package:one_key/models/sms_info.dart';
import 'package:one_key/pages/table/area_item_table.dart';
import 'package:one_key/provider/base_info_provider.dart';
import 'package:one_key/provider/coupon_provider.dart';
import 'package:one_key/provider/my_model.dart';
import 'package:one_key/provider/table_manager_model.dart';
import 'package:one_key/provider/user_model.dart';
... ... @@ -26,6 +30,7 @@ import 'package:one_key/widgets/MyDivider.dart';
import 'package:one_key/widgets/common_button_flat.dart';
import 'package:one_key/widgets/f_table_item.dart';
import 'package:one_key/widgets/gradient_button.dart';
import 'package:one_key/widgets/h_empty_view.dart';
import 'package:one_key/widgets/page_exception.dart';
import 'package:one_key/widgets/round_button.dart';
... ... @@ -74,6 +79,15 @@ class TableManagerPageState extends State<TableManagerPage> {
String ddateHm = '选填';
int actualPnumIndex;
int ddateIndex;
List<String> couponsCan = []; //优惠券弹框数据
String youhui = '选择优惠';
int couponSelectIndex = 0;
CouponProvider couponProvider;
bool wechatNotification = true; //默认微信通知模式
SmsInfoData smsInfoData;
MyModel myModel;
String showErro = '';
// ScrollController _scrollCrl = ScrollController();
final ItemPositionsListener itemPositionsListener =
... ... @@ -93,7 +107,10 @@ class TableManagerPageState extends State<TableManagerPage> {
// personNumList.add('30以上');
WidgetsBinding.instance.addPostFrameCallback((_) {
couponProvider.sendSMS = false;
tableManagerModel.initTime(context);
_couponNetworkData();
_getSmsInfo(context);
EventBus().on("refresh_tablemanager", (arg) {
//订座-完成预订 刷新管理桌位
tableManagerModel.getReserveList(context,
... ... @@ -115,6 +132,78 @@ class TableManagerPageState extends State<TableManagerPage> {
EventBus().off("refresh_tablePhoto");
}
///获取短信余量
_getSmsInfo(context) async {
smsInfoData = await myModel.getSmsInfo(context);
if (myModel.smsInfo.isEmpty) {
setState(() {
showErro = '短信余额不足,请充值短信条数';
});
} else {
showErro = '';
}
// setState(() {
// if (smsInfoData != null) {
// smsInfo = smsInfoData?.lastNum;
// }
// });
}
///消费券
_couponNetworkData({bool isShowLoading = true}) async {
couponSelectIndex = 0;
Map<String, String> params = {
"uid": Provider.of<UserModel>(context, listen: false).user.openid,
'status': '1'
};
await couponProvider.getCustomerSelectActivityNew(context, params,
isShowLoading: isShowLoading);
//此人已经新建好券
if (couponProvider.couponListSelect.length > 0) {
// couponProvider.initCouponSelect(context);
couponsCan = [];
List<CouponSunModel> temp = [];
for (int i = 0; i < couponProvider.couponListSelect.length; i++) {
if (couponProvider.couponListSelect[i].isOpenBool) {
// 店铺优惠券
if (couponProvider.couponListSelect[i].isType == '1') {
if (couponProvider.couponListSelect[i].uidList != null) {
List<String> listuids =
couponProvider.couponListSelect[i].uidList.split(',');
if (listuids.contains(
Provider.of<UserModel>(context, listen: false).user.openid))
couponsCan.add(couponProvider.couponListSelect[i].aname);
temp.add(couponProvider.couponListSelect[i]);
}
} else {
//我的优惠券
couponsCan.add(couponProvider.couponListSelect[i].aname);
temp.add(couponProvider.couponListSelect[i]);
}
}
}
couponProvider.couponListSelect = temp;
//获取绑定的优惠券
// _getActivityByRid();
// if (couponProvider.coupons.length == 0) {
// setState(() {
// couponHeight = 0.0;
// });
// } else {
// setState(() {
// couponHeight = 140.0;
// });
// }
} else {
//没有新建的优惠券
// setState(() {
// couponHeight = 0.0;
// });
}
}
///刷新图片显示
_refreshTablePhoto() async {
List temp =
... ... @@ -795,102 +884,134 @@ class TableManagerPageState extends State<TableManagerPage> {
width: ScreenUtil().setWidth(2),
color: MyColours.color_DBDBDB)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
// mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Row(children: [
Text(
'就餐人数:',
style: TextStyle(
// letterSpacing: ScreenUtil().setWidth(1.8 * 2),
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28)),
),
InkWell(
onTap: () {
FocusScope.of(context)
.requestFocus(FocusNode()); //隐藏键盘
DialogUtil.showSelectCusmanDialog(
context, personNumList, (value) async {
if (value != null) {
actualPnumIndex = value.first;
actualPnum = personNumList[value.first];
setState(() {});
}
},
selecteds: actualPnumIndex == null
? []
: [actualPnumIndex])
.then((value) {});
},
child: Expanded(
child: Text(actualPnum,
style: TextStyle(
fontSize: ScreenUtil().setSp(28),
color: actualPnum == '选填'
? MyColours.color_999999
: MyColours.color_515151)),
),
Expanded(
child: Padding(
padding: EdgeInsets.only(
right: ScreenUtil().setWidth(14)),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Text(
'就餐人数:',
style: TextStyle(
// letterSpacing: ScreenUtil().setWidth(1.8 * 2),
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28)),
),
Expanded(
child: InkWell(
onTap: () {
FocusScope.of(context)
.requestFocus(
FocusNode()); //隐藏键盘
DialogUtil.showSelectCusmanDialog(
context, personNumList,
(value) async {
if (value != null) {
actualPnumIndex = value.first;
actualPnum = personNumList[
value.first];
setState(() {});
}
},
selecteds:
actualPnumIndex ==
null
? []
: [
actualPnumIndex
])
.then((value) {});
},
child: Container(
alignment: Alignment.center,
child: Text(actualPnum,
style: TextStyle(
fontSize: ScreenUtil()
.setSp(28),
color: actualPnum ==
'选填'
? MyColours
.color_999999
: MyColours
.color_515151))),
),
// HEmptyView(6),
// Image.asset(
// Utils.getImgPath(
// false ? 'c_arrow_up' : 'c_arrow_down'),
// width: ScreenUtil().setWidth(28),
// // height: ScreenUtil().setWidth(10),
// ),
)
]),
// HEmptyView(6),
// Image.asset(
// Utils.getImgPath(
// false ? 'c_arrow_up' : 'c_arrow_down'),
// width: ScreenUtil().setWidth(28),
// // height: ScreenUtil().setWidth(10),
// ),
),
]))),
MyDivider(ScreenUtil().setWidth(2),
ScreenUtil().setWidth(46),
color: MyColours.color_BFC4D4),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Text(
'就餐时间:',
style: TextStyle(
// letterSpacing: ScreenUtil().setWidth(1.8 * 2),
color: MyColours.color_333333,
fontSize: ScreenUtil().setSp(26)),
),
InkWell(
onTap: () {
FocusScope.of(context)
.requestFocus(FocusNode()); //隐藏键盘
DialogUtil.showSelectCusmanDialog(
context, tableManagerModel.dailyList,
(value) async {
if (value != null) {
ddateIndex = value.first;
ddateHm = tableManagerModel
.dailyList[value.first];
setState(() {});
}
},
selecteds: ddateIndex == null
? []
: [ddateIndex])
.then((value) {});
},
child: Expanded(
child: Text(ddateHm,
style: TextStyle(
fontSize: ScreenUtil().setSp(28),
color: ddateHm == '选填'
? MyColours.color_999999
: MyColours.color_515151)),
),
Expanded(
child: Padding(
padding: EdgeInsets.only(
left: ScreenUtil().setWidth(14)),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceEvenly,
children: [
Text(
'到店时间:',
style: TextStyle(
// letterSpacing: ScreenUtil().setWidth(1.8 * 2),
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28)),
),
Expanded(
child: InkWell(
onTap: () {
FocusScope.of(context).requestFocus(
FocusNode()); //隐藏键盘
DialogUtil.showSelectCusmanDialog(
context,
tableManagerModel.dailyList,
(value) async {
if (value != null) {
ddateIndex = value.first;
ddateHm = tableManagerModel
.dailyList[value.first];
setState(() {});
}
},
selecteds:
ddateIndex == null
? []
: [ddateIndex])
.then((value) {});
},
child: Container(
alignment: Alignment.center,
child: Text(ddateHm,
style: TextStyle(
fontSize: ScreenUtil()
.setSp(28),
color: ddateHm == '选填'
? MyColours
.color_999999
: MyColours
.color_515151))),
),
// HEmptyView(6),
// Image.asset(
// Utils.getImgPath(
// false ? 'c_arrow_up' : 'c_arrow_down'),
// width: ScreenUtil().setWidth(28),
// // height: ScreenUtil().setWidth(10),
// ),
),
],
)
// HEmptyView(6),
// Image.asset(
// Utils.getImgPath(
// false ? 'c_arrow_up' : 'c_arrow_down'),
// width: ScreenUtil().setWidth(28),
// // height: ScreenUtil().setWidth(10),
// ),
),
],
)))
],
),
)
... ... @@ -1024,6 +1145,153 @@ class TableManagerPageState extends State<TableManagerPage> {
));
}
// 客户经理转发记录
_addForward(String rid) async {
UserModel userModel = Provider.of<UserModel>(context, listen: false);
Map<String, String> params = {
"rid": rid,
"sid": userModel.user.sellerid,
"uid": userModel.user.openid
};
bool success = await couponProvider.addForwardAsReserve(context, params);
if (success) {
print('yes');
}
}
_buttonChoose(String title, ClickCallback callback) {
return InkWell(
onTap: () {
callback(title);
},
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(20),
vertical: ScreenUtil().setWidth(10)),
// height: ScreenUtil().setWidth(50),
// decoration: BoxDecoration(
// // border: Border.all(
// // width: ScreenUtil().setWidth(2),
// // color: MyColours.color_199095),
// borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10))),
child: Row(
children: [
Expanded(
child: Text(
title,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setWidth(28)),
)),
HEmptyView(10),
Image.asset(
Utils.getImgPath('table_m_arrow_down_white'),
width: ScreenUtil().setWidth(40),
// height: ScreenUtil().setWidth(10),
)
],
)));
}
///优惠券选择
Widget _couponWidget() {
return Padding(
padding: EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(48)),
child: Stack(
children: [
Container(
width: double.infinity,
child: Row(
children: [
Expanded(
child: GradientButton(
radius: 12,
height: ScreenUtil().setWidth(34 * 2),
colors: [
MyColours.color_5CA0AD,
MyColours.color_238389
])),
Expanded(
child: GradientButton(
left: false,
radius: 12,
height: ScreenUtil().setWidth(34 * 2),
colors: [
MyColours.color_238389,
MyColours.color_2193B0
]))
],
),
),
Row(children: [
Expanded(
child: Container(
height: ScreenUtil().setWidth(70),
// width: ScreenUtil().setWidth(130),
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(ScreenUtil().setWidth(12)),
color: Colors.transparent),
child: _buttonChoose(youhui, (value) {
if (couponsCan == null || couponsCan.length == 0) {
Utils.showToast('暂无优惠券!');
return;
}
FocusScope.of(context).requestFocus(FocusNode()); //隐藏键盘
DialogUtil.showSelectCusmanDialog(context, couponsCan,
(value) {
if (value != null) {
setState(() {
couponSelectIndex = value.first;
youhui = couponsCan[couponSelectIndex];
});
}
},
selecteds: couponSelectIndex == null
? []
: [couponSelectIndex])
.then((value) {});
}))),
// HEmptyView(40),
// InkWell(
// onTap: () async {
// UserModel userModel =
// Provider.of<UserModel>(context, listen: false);
// if (userModel.user.role_name == '管理员' ||
// userModel.user.role_name == '店长') {
// NavigatorUtil.goCouponCreateSelectTypePage(context);
// } else {
// bool needRefresh =
// await NavigatorUtil.goCouponEditPage(context);
// print(needRefresh);
// if (needRefresh != null && needRefresh) {
// _couponNetworkData();
// //刷新页面数据
// // _controller.callRefresh();
// // _couponNetworkData(tabController.index);
// }
// }
// // NavigatorUtil.goMarketingRecordsDetailPage(context);
// // bool needRefresh = await NavigatorUtil.goCouponEditPage(context);
// // print(needRefresh);
// // if (needRefresh != null && needRefresh) {
// // //刷新页面数据
// // // _controller.callRefresh();
// // _couponNetworkData();
// // }
// },
// child: Text('创建新优惠',
// style: TextStyle(
// decoration: TextDecoration.underline,
// color: MyColours.color_199095,
// fontSize: ScreenUtil().setSp(26)))),
])
],
));
}
///选中的桌子widget
Widget _selectTableWidget() {
return Container(
... ... @@ -1045,6 +1313,7 @@ class TableManagerPageState extends State<TableManagerPage> {
child: Column(
// mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Stack(alignment: Alignment.centerRight, children: [
Container(
... ... @@ -1083,7 +1352,33 @@ class TableManagerPageState extends State<TableManagerPage> {
Positioned(
right: ScreenUtil().setWidth(40),
child: InkWell(
onTap: () {},
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(
... ... @@ -1105,10 +1400,11 @@ class TableManagerPageState extends State<TableManagerPage> {
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)),
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),
... ... @@ -1124,335 +1420,807 @@ class TableManagerPageState extends State<TableManagerPage> {
fontSize: ScreenUtil().setSp(28)),
),
HEmptyView(14),
Image.asset(Utils.getImgPath('table_m_close'),
width: ScreenUtil().setWidth(32)),
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;
}
}
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)))),
],
),
);
}),
),
_customerInfoWidget(),
VEmptyView(40),
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)),
!wechatNotification
? Column(children: [
_customerInfoWidget(),
VEmptyView(44),
_couponWidget(),
])
: SizedBox(),
VEmptyView(50),
wechatNotification
? Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(36)),
child: Row(
children: [
RoundButton(
text: '仅占座',
width: ScreenUtil().setWidth(64 * 2),
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: () 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("预订失败!");
}
}),
HEmptyView(22),
RoundButton(
text: '短信通知',
width: ScreenUtil().setWidth(64 * 2),
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 = false;
});
},
),
HEmptyView(20),
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 {
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"); //刷新已预订列表
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("预订失败!");
}
},
)),
],
))
: 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.isEmpty) {
return;
}
if ((_baseIndoProvider.phoneController.text
.trim()
.isEmpty ||
!Utils.phoneRegExp(
_baseIndoProvider.phoneController.text))) {
setState(() {
showErro = '请输入正确的11位手机号码';
});
return;
} else {
setState(() {
showErro = '';
});
}
// if (!couponProvider.sendSMS) {
/*
String dateSoltStr = '';
if (widget.dateSolt == '1') {
dateSoltStr = '早餐';
} else if (widget.dateSolt == '2') {
dateSoltStr = '午餐';
} else if (widget.dateSolt == '3') {
dateSoltStr = '晚餐';
}
DateTime dateTimeTemp =
DateTime.fromMillisecondsSinceEpoch(
int.parse(widget.ddate) * 1000);
String dateTimeStrTemp =
"${Utils.addZeroNumber(dateTimeTemp.month)}月${Utils.addZeroNumber(dateTimeTemp.day)}日";
Map<String, String> params = {
"id": widget.rid,
"uid": Provider.of<UserModel>(context,
listen: false)
.user
.openid,
"phone": widget.phone,
// "Strtext": user.sellername +
// dateTimeStrTemp +
// dateSoltStr +
// ',' +
// '餐厅经理' +
// _baseIndoProvider.baseInfoSunModel.name +
// '已为您安排在' +
// widget.tableInfo.replaceAll("\n", "")
};
if (ObjectUtil.isNotEmpty(_baseIndoProvider
.baseInfoSunModel) &&
ObjectUtil.isNotEmpty(_baseIndoProvider
.baseInfoSunModel.name)) {
params['Strtext'] = user.sellername +
_baseIndoProvider
.baseInfoSunModel.name;
} else {
params['Strtext'] = user.sellername;
}
*/
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"); //刷新已预订列表
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;
});
},
)
],
)),
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)),
),
// 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),
),
),
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,
),
],
),
),
VEmptyView(40),
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)),
)
],
),
)
],
),
);
... ... @@ -1560,6 +2328,8 @@ class TableManagerPageState extends State<TableManagerPage> {
Widget build(BuildContext context) {
tableManagerModel = Provider.of<TableManagerModel>(context, listen: true);
_baseIndoProvider = Provider.of<BaseIndoProvider>(context, listen: true);
couponProvider = Provider.of<CouponProvider>(context, listen: true);
myModel = Provider.of<MyModel>(context, listen: true);
return Scaffold(
appBar: widget.guest == null
? null
... ...
import 'package:flutter/material.dart';
class MyColours {
static const Color color_8EBBBE = Color(0xff8EBBBE);
static const Color color_2193B0 = Color(0xff2193B0);
static const Color color_238389 = Color(0xff238389);
static const Color color_5CA0AD = Color(0xff5CA0AD);
static const Color color_8EBBBE = Color(0xff8EBBBE);
static const Color color_A78E44 = Color(0xffA78E44);
static const Color color_260101 = Color(0xff260101);
static const Color color_ED7B2F = Color(0xffED7B2F);
... ...
... ... @@ -1245,12 +1245,14 @@ var tableManagerPageHandle = new Handler(
// UserHistoryEntity userHistoryEntity = UserHistoryEntity.fromJson(json.decode(
// FluroConvertUtils.fluroCnParamsDecode(
// params["userHistoryEntity"].first)));
return ChangeNotifierProvider<BaseIndoProvider>(
create: (_) => BaseIndoProvider(),
child: ChangeNotifierProvider<TableManagerModel>(
create: (_) => TableManagerModel(),
child: TableManagerPage(guest: guest)),
);
return ChangeNotifierProvider<MyModel>(
create: (_) => MyModel(),
child: ChangeNotifierProvider<BaseIndoProvider>(
create: (_) => BaseIndoProvider(),
child: ChangeNotifierProvider<TableManagerModel>(
create: (_) => TableManagerModel(),
child: TableManagerPage(guest: guest)),
));
});
///账号登录页面
... ...
import 'package:amap_map_fluttify/amap_map_fluttify.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class GradientButton extends StatelessWidget {
final List<Color> colors;
final double height;
final bool left;
final double radius;
const GradientButton(
{Key key, this.colors, this.height, this.left = true, this.radius = 0})
: super(key: key);
@override
Widget build(BuildContext context) {
return // 渐变色按钮
Container(
height: height,
decoration: BoxDecoration(
gradient: LinearGradient(colors: colors), // 渐变色
borderRadius: left
? BorderRadius.only(
topLeft: Radius.circular(ScreenUtil().setWidth(radius)),
bottomLeft: Radius.circular(ScreenUtil().setWidth(radius)))
: BorderRadius.only(
topRight: Radius.circular(ScreenUtil().setWidth(radius)),
bottomRight: Radius.circular(ScreenUtil().setWidth(radius)))),
);
}
}
... ...