Commit 2311dc1c5a1ecc68d40e119cd45dbd1710187f53

Authored by gaiyaguang
2 parents 558c1117 31467915

取消预订弹框适配

... ... @@ -13,12 +13,12 @@ if (flutterRoot == null) {
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '7'
flutterVersionCode = '112'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0.7'
flutterVersionName = '1.1.2'
}
apply plugin: 'com.android.application'
... ...
... ... @@ -404,7 +404,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 8;
CURRENT_PROJECT_VERSION = 112;
DEVELOPMENT_TEAM = "";
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
... ... @@ -417,7 +417,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 1.0.8;
MARKETING_VERSION = 1.1.2;
PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine;
PRODUCT_NAME = "一键订";
PROVISIONING_PROFILE_SPECIFIER = "";
... ... @@ -545,7 +545,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 8;
CURRENT_PROJECT_VERSION = 112;
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
... ... @@ -558,7 +558,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 1.0.8;
MARKETING_VERSION = 1.1.2;
PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine;
PRODUCT_NAME = "一键订";
PROVISIONING_PROFILE_SPECIFIER = "Push Development Profile";
... ... @@ -577,7 +577,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 8;
CURRENT_PROJECT_VERSION = 112;
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
... ... @@ -590,7 +590,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 1.0.8;
MARKETING_VERSION = 1.1.2;
PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine;
PRODUCT_NAME = "一键订";
PROVISIONING_PROFILE_SPECIFIER = "OneKey Distribution Profile";
... ...
... ... @@ -82,11 +82,11 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>XG_ACCESS_ID</key>
<string>1600012876</string>
<key>XG_ACCESS_KEY</key>
<string>INUIMFK21WGH</string>
<key>io.flutter.embedded_views_preview</key>
<true/>
<key>XG_ACCESS_ID</key>
<string>1600012876</string>
<key>XG_ACCESS_KEY</key>
<string>INUIMFK21WGH</string>
</dict>
</plist>
... ...
... ... @@ -24,6 +24,7 @@ import 'package:one_key/widgets/table_item.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import 'package:provider/provider.dart';
import 'package:one_key/models/table_list.dart' as t;
import 'dart:convert' as convert;
typedef clickCallback = void Function(String value);
... ... @@ -50,6 +51,7 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> {
FocusNode _nameNode = FocusNode();
FocusNode _needNode = FocusNode();
NotebookDetailModel detailModel = NotebookDetailModel();
bool isRecommend = false; //可订桌位是否展示推荐桌位,无已选中包间情况下展示推荐的包间
// //生成日期文本
// _createDateText(DateTime day) {
... ... @@ -225,66 +227,82 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> {
isImage: value['isImage'],
isSelect: value['select'],
onTap: () {
for (int j = 0;
j < _notebookDetailChangeModel.dateList.length;
j++) {
_notebookDetailChangeModel.dateList[j]['select'] = false;
if (_notebookDetailChangeModel.dateList[j]['title'] ==
value['title']) {
_notebookDetailChangeModel.dateList[j]['select'] = true;
if (j == 0 || j == 1) {
_notebookDetailChangeModel.dateList[2]['title'] =
'其他';
}
if (j ==
_notebookDetailChangeModel.dateList.length - 1) {
String selectStr =
_notebookDetailChangeModel.dateList[2]['title'];
String timeNow = DateUtil.formatDate(
DateTime.now(),
);
String selectDate =
timeNow.replaceRange(5, 10, selectStr);
DialogUtil.showCalendarDialog(
context, DateUtil.getDateTime(selectDate))
.then((day) {
if (day != null) {
// _createDateText(day);
dateTime = day;
int dateTimeMill = day.millisecondsSinceEpoch;
String dateText = DateUtil.formatDateMs(
dateTimeMill,
format: 'MM-dd');
bool isThird = true;
for (int i = 0;
i <
_notebookDetailChangeModel
.dateList.length;
i++) {
_notebookDetailChangeModel.dateList[i]
['select'] = false;
if (_notebookDetailChangeModel.dateList[i]
['title'] ==
dateText) {
_notebookDetailChangeModel.dateList[i]
['select'] = true;
isThird = false;
}
}
if (isThird) {
_notebookDetailChangeModel.dateList[2]
['select'] = true;
_notebookDetailChangeModel.dateList[2]
['title'] = dateText;
} else {
_notebookDetailChangeModel.dateList[2]
['title'] = '其他';
}
}
_notebookDetailChangeModel.notifyListeners();
});
if (_notebookDetailChangeModel.dateList.length > 2 &&
_notebookDetailChangeModel.dateList[2]['title'] ==
'其他') {
_calendWidget(DateTime.now());
} else {
for (int j = 0;
j < _notebookDetailChangeModel.dateList.length;
j++) {
_notebookDetailChangeModel.dateList[j]['select'] =
false;
if (_notebookDetailChangeModel.dateList[j]['title'] ==
value['title']) {
_notebookDetailChangeModel.dateList[j]['select'] =
true;
if (j == 0 || j == 1) {
_notebookDetailChangeModel.dateList[2]['title'] =
'其他';
}
if (j ==
_notebookDetailChangeModel.dateList.length - 1) {
String selectStr =
_notebookDetailChangeModel.dateList[2]['title'];
String timeNow = DateUtil.formatDate(
DateTime.now(),
);
String selectDate =
timeNow.replaceRange(5, 10, selectStr);
_calendWidget(DateUtil.getDateTime(selectDate));
// String selectStr =
// _notebookDetailChangeModel.dateList[2]['title'];
// String timeNow = DateUtil.formatDate(
// DateTime.now(),
// );
// String selectDate =
// timeNow.replaceRange(5, 10, selectStr);
// DialogUtil.showCalendarDialog(
// context, DateUtil.getDateTime(selectDate))
// .then((day) {
// if (day != null) {
// // _createDateText(day);
// dateTime = day;
// int dateTimeMill = day.millisecondsSinceEpoch;
// String dateText = DateUtil.formatDateMs(
// dateTimeMill,
// format: 'MM-dd');
// bool isThird = true;
// for (int i = 0;
// i <
// _notebookDetailChangeModel
// .dateList.length;
// i++) {
// _notebookDetailChangeModel.dateList[i]
// ['select'] = false;
// if (_notebookDetailChangeModel.dateList[i]
// ['title'] ==
// dateText) {
// _notebookDetailChangeModel.dateList[i]
// ['select'] = true;
// isThird = false;
// }
// }
// if (isThird) {
// _notebookDetailChangeModel.dateList[2]
// ['select'] = true;
// _notebookDetailChangeModel.dateList[2]
// ['title'] = dateText;
// } else {
// _notebookDetailChangeModel.dateList[2]
// ['title'] = '其他';
// }
// }
// _notebookDetailChangeModel.notifyListeners();
// });
}
}
}
}
... ... @@ -385,8 +403,41 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> {
);
}
_calendWidget(DateTime dateTime) {
DialogUtil.showCalendarDialog(context, dateTime).then((day) {
if (day != null) {
// _createDateText(day);
dateTime = day;
int dateTimeMill = day.millisecondsSinceEpoch;
String dateText = DateUtil.formatDateMs(dateTimeMill, format: 'MM-dd');
bool isThird = true;
for (int i = 0; i < _notebookDetailChangeModel.dateList.length; i++) {
_notebookDetailChangeModel.dateList[i]['select'] = false;
if (_notebookDetailChangeModel.dateList[i]['title'] == dateText) {
_notebookDetailChangeModel.dateList[i]['select'] = true;
isThird = false;
}
}
if (isThird) {
_notebookDetailChangeModel.dateList[2]['select'] = true;
_notebookDetailChangeModel.dateList[2]['title'] = dateText;
} else {
_notebookDetailChangeModel.dateList[2]['title'] = '其他';
}
}
_notebookDetailChangeModel.notifyListeners();
});
}
/// 可订桌位
_middleWidget() {
List canBookTable = [];
if (isRecommend) {
canBookTable = _notebookDetailChangeModel.recommendList;
} else {
canBookTable = _notebookDetailChangeModel.tableList;
}
return Container(
padding: EdgeInsets.all(ScreenUtil().setWidth(40)),
color: MyColours.color_f5f5f5,
... ... @@ -404,22 +455,56 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> {
),
InkWell(
onTap: () async {
//当前选中 月 日string
String mdStr = '';
//今天 明天 其他天
for (var item in _notebookDetailChangeModel.dateList) {
if (item['select'] == true) {
mdStr = item['title'];
}
}
String timeNowYear =
DateUtil.formatDate(DateTime.now(), format: 'yyyy');
String ymyStr = timeNowYear + '-' + mdStr; //年月日
String timeStr = ymyStr + ' ' + "00:00:00";
int ddate = DateUtil.getDateMsByTimeStr(timeStr); //筛选日期时间戳
String ddateSolt = '';
for (var item in _notebookDetailChangeModel.sunDateList) {
if (item['isSelect']) {
ddateSolt = '${item['ddateSolt']}';
}
}
// String tempDdate = ymyStr + ' ' + ddateStr + ':00';
// int ddate = DateUtil.getDateMsByTimeStr(timeStr);
Map temp = await NavigatorUtil.goSelectTablePage(
context,
widget.rid,
int.parse(widget.detailEntity.ddate) * 1000,
widget.detailEntity.ddate_solt,
context, widget.rid, ddate, ddateSolt,
canChoose: true,
object: {'object': _notebookDetailChangeModel.tableList});
// if (temp['tid'] != null) {
// setReserveStatus("5", tid: temp['tid']);
// }
_notebookDetailChangeModel.tableList = temp['object'];
for (t.TableList item
in _notebookDetailChangeModel.tableList) {
item.selected = true;
if (temp == null || temp['object'].length == 0) {
isRecommend = true;
_notebookDetailChangeModel.tableList = [];
for (t.TableList item
in _notebookDetailChangeModel.recommendList) {
item.selected = false;
}
setState(() {});
} else {
isRecommend = false;
_notebookDetailChangeModel.tableList = temp['object'];
// if (_notebookDetailChangeModel.tableList.length == 0) {
// isRecommend = true;
// }
for (t.TableList item
in _notebookDetailChangeModel.tableList) {
item.selected = true;
}
setState(() {});
}
setState(() {});
// _notebookDetailChangeModel.notifyListeners();
},
child: Row(
... ... @@ -441,39 +526,34 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> {
),
VEmptyView(32),
Align(
alignment: Alignment.centerRight,
child: Offstage(
offstage: _notebookDetailChangeModel.tableList.length > 0
? false
: true,
child: Container(
// height: ScreenUtil().setHeight(178),
height: ScreenUtil().setHeight(210),
child: ListView.builder(
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (BuildContext contxt, int index) {
return NewTableItem(
_notebookDetailChangeModel.tableList[index],
isRegionName: true,
canSelected: true,
onSelected: (table) {
if ((table as t.TableList).selected) {
_notebookDetailChangeModel.tableList.add(table);
} else {
_notebookDetailChangeModel.tableList
.removeWhere((t) => t.id == table.id);
}
},
);
alignment: Alignment.centerRight,
child: Container(
// color: Colors.red,
// height: ScreenUtil().setHeight(178),
height: ScreenUtil().setHeight(170),
child: ListView.builder(
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (BuildContext contxt, int index) {
return NewTableItem(
canBookTable[index],
isRegionName: true,
canSelected: true,
onSelected: (table) {
if ((table as t.TableList).selected) {
_notebookDetailChangeModel.tableList.add(table);
} else {
_notebookDetailChangeModel.tableList
.removeWhere((t) => t.id == table.id);
}
},
itemCount: _notebookDetailChangeModel.tableList.length > 3
? 3
: _notebookDetailChangeModel.tableList.length,
shrinkWrap: true,
scrollDirection: Axis.horizontal,
),
),
)),
);
},
itemCount: canBookTable.length > 3 ? 3 : canBookTable.length,
shrinkWrap: true,
scrollDirection: Axis.horizontal,
),
),
),
],
),
);
... ... @@ -549,6 +629,7 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> {
Expanded(
child: TextField(
maxLines: 1,
//输入文本的样式
style: TextStyle(
fontSize: ScreenUtil().setSp(34),
... ... @@ -599,6 +680,7 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> {
VEmptyView(72),
TextField(
maxLines: 1,
inputFormatters: [LengthLimitingTextInputFormatter(25)],
//输入文本的样式
style: TextStyle(
fontSize: ScreenUtil().setSp(34),
... ... @@ -682,8 +764,9 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> {
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(10)),
child: Image.asset(
'assets/icon_exist.png',
'assets/close.png',
width: ScreenUtil().setWidth(32),
height: ScreenUtil().setWidth(32),
),
),
),
... ... @@ -828,6 +911,10 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> {
Utils.showToast("请填写客户姓名");
return;
}
if (_notebookDetailChangeModel.tableList.length == 0) {
Utils.showToast("请选择桌位");
return;
}
SunReserveInfoModel _model =
await _notebookDetailChangeModel
.setReserveInfo(context);
... ... @@ -837,15 +924,35 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> {
// _notebookDetailChangeModel.clearData();
bus.emit("refresh_detail");
String ddate_solt = '';
if (_model.row.ddateSolt == '1') {
ddate_solt = '早餐';
} else if (_model.row.ddateSolt == '2') {
ddate_solt = '午餐';
} else if (_model.row.ddateSolt == '3') {
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 = _model.row.name;
if (tableinfo.length > 1) {
_nameStr = _model.row.name + '等${tableinfo.length}桌';
}
// t.TableList _tableList = t.TableList.fromJson(tableinfo);
// _model.row.tableinfo
NavigatorUtil.goInvicationPage(context, _model.row.id,
_model.row.name, _model.row.ddate, ddate_solt,
_nameStr, _model.row.ddate, ddate_solt,
replace: true);
} else {
Utils.showToast("变更预订订单失败,请重试!");
... ... @@ -895,6 +1002,12 @@ class _ButtonState extends State<CustomButton> {
FocusNode _cancelNode = FocusNode();
@override
Widget build(BuildContext context) {
String imgStrSelect = widget.isImage && !widget.isTextFiled
? 'assets/calender_select.png'
: 'assets/more_select.png';
String imgStrNormal = widget.isImage && !widget.isTextFiled
? 'assets/calender_narmol.png'
: 'assets/more_narmol.png';
return InkWell(
onTap: widget.onTap,
child: Container(
... ... @@ -978,7 +1091,9 @@ class _ButtonState extends State<CustomButton> {
)
: Text(widget.dateText,
style: TextStyle(
fontWeight: FontWeight.bold,
fontWeight: widget.isImage && widget.dateText == "其他"
? FontWeight.normal
: FontWeight.bold,
color: widget.isSelect
? MyColours.color_fefefe
: MyColours.color_199095,
... ... @@ -987,10 +1102,7 @@ class _ButtonState extends State<CustomButton> {
? HEmptyView(20)
: Container(),
widget.isImage
? Image.asset(
widget.isSelect
? 'assets/calender_select.png'
: 'assets/calender_narmol.png',
? Image.asset(widget.isSelect ? imgStrSelect : imgStrNormal,
width: ScreenUtil().setWidth(36))
: Text(widget.dayText,
style: TextStyle(
... ...
... ... @@ -8,64 +8,78 @@ import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import 'package:provider/provider.dart';
class InvicationPage extends StatefulWidget{
final String rid;//预订订单id
final String tableInfo;//桌位信息
class InvicationPage extends StatefulWidget {
final String rid; //预订订单id
final String tableInfo; //桌位信息
final String ddate;
final String ddateStr;
InvicationPage(this.rid,this.tableInfo,this.ddate,this.ddateStr);
InvicationPage(this.rid, this.tableInfo, this.ddate, this.ddateStr);
@override
State<StatefulWidget> createState() {
// TODO: implement createState
return new InvicationPageState();
}
}
class InvicationPageState extends State<InvicationPage>{
class InvicationPageState extends State<InvicationPage> {
User user;
DateTime dateTime;
String dateTimeStr="";
String dateTimeStr = "";
@override
void initState() {
// TODO: implement initState
super.initState();
dateTime=DateTime.fromMillisecondsSinceEpoch(int.parse(widget.ddate)*1000);
user=Provider.of<UserModel>(context,listen:false).user;
dateTimeStr="${dateTime.year}/${Utils.addZeroNumber(dateTime.month)}/${Utils.addZeroNumber(dateTime.day)} 星期${Utils.formatWeekDayNum(dateTime.weekday)} ${widget.ddateStr}";
dateTime =
DateTime.fromMillisecondsSinceEpoch(int.parse(widget.ddate) * 1000);
user = Provider.of<UserModel>(context, listen: false).user;
dateTimeStr =
"${dateTime.year}/${Utils.addZeroNumber(dateTime.month)}/${Utils.addZeroNumber(dateTime.day)} 星期${Utils.formatWeekDayNum(dateTime.weekday)} ${widget.ddateStr}";
}
//中间内容显示组件
Widget _middleWidget(String title,String content){
Widget _middleWidget(String title, String content) {
return Column(
children: <Widget>[
VEmptyView(38),
Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Image.asset("assets/invication_line_left.png",width: ScreenUtil().setWidth(44),height: ScreenUtil().setWidth(4),),
Image.asset(
"assets/invication_line_left.png",
width: ScreenUtil().setWidth(44),
height: ScreenUtil().setWidth(4),
),
Container(
margin: EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(13)),
child: Text(title,style: TextStyle(color: MyColours.color_eadab9,fontSize: ScreenUtil().setSp(32))),
margin:
EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(13)),
child: Text(title,
style: TextStyle(
color: MyColours.color_eadab9,
fontSize: ScreenUtil().setSp(32))),
),
Image.asset("assets/invication_line_right.png",width: ScreenUtil().setWidth(44),height: ScreenUtil().setWidth(4),)
Image.asset(
"assets/invication_line_right.png",
width: ScreenUtil().setWidth(44),
height: ScreenUtil().setWidth(4),
)
],
),
Container(
margin: EdgeInsets.only(top: ScreenUtil().setHeight(20)),
child: Text(content,style: TextStyle(color: MyColours.color_ffffff,fontSize: ScreenUtil().setSp(34)),),
child: Text(
content,
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(34)),
),
)
],
);
}
@override
Widget build(BuildContext context) {
// TODO: implement build
... ... @@ -74,127 +88,168 @@ class InvicationPageState extends State<InvicationPage>{
width: double.infinity,
height: double.infinity,
decoration: BoxDecoration(
image: DecorationImage(image: AssetImage("assets/bg_invication.png"),fit: BoxFit.cover),
image: DecorationImage(
image: AssetImage("assets/bg_invication.png"), fit: BoxFit.cover),
),
child: DefaultTextStyle(style: TextStyle(decoration: TextDecoration.none), child: Column(
children: <Widget>[
GestureDetector(
onTap: (){
Navigator.of(context).pop();
},
behavior: HitTestBehavior.opaque,
child: Container(
width: double.infinity,
alignment: Alignment.centerLeft,
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40),
vertical: ScreenUtil().setHeight(15)),
child: Image.asset(
"assets/invication_back.png",
width: ScreenUtil().setWidth(20),
height: ScreenUtil().setHeight(31),
)
child: DefaultTextStyle(
style: TextStyle(decoration: TextDecoration.none),
child: Column(
children: <Widget>[
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
behavior: HitTestBehavior.opaque,
child: Container(
width: double.infinity,
alignment: Alignment.centerLeft,
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40),
vertical: ScreenUtil().setHeight(15)),
child: Image.asset(
"assets/invication_back.png",
width: ScreenUtil().setWidth(20),
height: ScreenUtil().setHeight(31),
)),
),
),
),
),
Expanded(
child: Center(
child: Column(
children: <Widget>[
Image.asset("assets/img_ydap.png",width: ScreenUtil().setWidth(500),height: ScreenUtil().setHeight(300),),
VEmptyView(69),
Row(
mainAxisSize: MainAxisSize.min,
Expanded(
child: Center(
child: Column(
children: <Widget>[
Container(
width: ScreenUtil().setWidth(108),
height: ScreenUtil().setHeight(2),
color: MyColours.color_ffffff,
),
Container(
width: ScreenUtil().setWidth(442),
height: ScreenUtil().setHeight(43),
alignment: Alignment.center,
decoration: BoxDecoration(
border: Border.all(color: MyColours.color_ffffff,width: ScreenUtil().setWidth(2)),
borderRadius: BorderRadius.all(Radius.circular(ScreenUtil().setWidth(18)))
),
child: Text("订包间,用周到安排",style: TextStyle(color: MyColours.color_ffffff,fontSize: ScreenUtil().setSp(28)),),
),
Container(
width: ScreenUtil().setWidth(108),
height: ScreenUtil().setHeight(2),
color: MyColours.color_ffffff,
Image.asset(
"assets/img_ydap.png",
width: ScreenUtil().setWidth(500),
height: ScreenUtil().setHeight(300),
),
],
),
_middleWidget("餐厅", user.sellername),
_middleWidget("包间", widget.tableInfo.replaceAll("\n","")),
_middleWidget("时间", dateTimeStr),
VEmptyView(38),
Column(
children: <Widget>[
VEmptyView(69),
Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Image.asset("assets/invication_map.png",width: ScreenUtil().setWidth(22),height: ScreenUtil().setWidth(28),),
Container(
margin: EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(13)),
child: Text("地址导航",style: TextStyle(color: MyColours.color_eadab9,fontSize: ScreenUtil().setSp(32))),
width: ScreenUtil().setWidth(108),
height: ScreenUtil().setHeight(2),
color: MyColours.color_ffffff,
),
Container(
width: ScreenUtil().setWidth(442),
height: ScreenUtil().setHeight(43),
alignment: Alignment.center,
decoration: BoxDecoration(
border: Border.all(
color: MyColours.color_ffffff,
width: ScreenUtil().setWidth(2)),
borderRadius: BorderRadius.all(
Radius.circular(
ScreenUtil().setWidth(18)))),
child: Text(
"订包间,用周到安排",
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(28)),
),
),
Container(
width: ScreenUtil().setWidth(108),
height: ScreenUtil().setHeight(2),
color: MyColours.color_ffffff,
),
Image.asset("assets/invication_arrow_right.png",width: ScreenUtil().setWidth(14),height: ScreenUtil().setWidth(22),),
],
),
Container(
margin: EdgeInsets.only(top: ScreenUtil().setHeight(20)),
child: Text(user.sellerAddr,style: TextStyle(color: MyColours.color_ffffff,fontSize: ScreenUtil().setSp(34)),),
_middleWidget("餐厅", user.sellername),
_middleWidget(
"包间", widget.tableInfo.replaceAll("\n", "")),
_middleWidget("时间", dateTimeStr),
VEmptyView(38),
Column(
children: <Widget>[
Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Image.asset(
"assets/invication_map.png",
width: ScreenUtil().setWidth(22),
height: ScreenUtil().setWidth(28),
),
Container(
margin: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(13)),
child: Text("地址导航",
style: TextStyle(
color: MyColours.color_eadab9,
fontSize: ScreenUtil().setSp(32))),
),
Image.asset(
"assets/invication_arrow_right.png",
width: ScreenUtil().setWidth(14),
height: ScreenUtil().setWidth(22),
),
],
),
Container(
margin: EdgeInsets.only(
top: ScreenUtil().setHeight(20)),
child: Text(
user.sellerAddr,
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(34)),
),
)
],
)
],
)
],
),
),
),
Container(
width: double.infinity,
height: ScreenUtil().setHeight(99),
child: Row(
children: <Widget>[
GestureDetector(
onTap: (){
NavigatorUtil.goSmsPage(context, widget.rid);
},
child: Container(
width: ScreenUtil().setWidth(232),
height: double.infinity,
color: MyColours.color_000000,
alignment: Alignment.center,
child: Text("发短信",style: TextStyle(color: MyColours.color_eadab9,fontSize: ScreenUtil().setSp(34)),),
),
),
Expanded(
child:
GestureDetector(
onTap: (){
Utils.goShareInvicationToWeChat(widget.rid);
},
child:Container(
width: double.infinity,
height: double.infinity,
color: MyColours.color_e3d2ac,
alignment: Alignment.center,
child: Text("通知客户",style: TextStyle(color: MyColours.color_83734d,fontSize: ScreenUtil().setSp(34)),),
),
Container(
width: double.infinity,
height: ScreenUtil().setHeight(99),
child: Row(
children: <Widget>[
GestureDetector(
onTap: () {
NavigatorUtil.goSmsPage(context, widget.rid);
},
child: Container(
width: ScreenUtil().setWidth(232),
height: double.infinity,
color: MyColours.color_000000,
alignment: Alignment.center,
child: Text(
"发短信",
style: TextStyle(
color: MyColours.color_eadab9,
fontSize: ScreenUtil().setSp(34)),
),
),
),
),
)
],
),
)
],
)),
Expanded(
child: GestureDetector(
onTap: () {
Utils.goShareInvicationToWeChat(widget.rid);
},
child: Container(
width: double.infinity,
height: double.infinity,
color: MyColours.color_e3d2ac,
alignment: Alignment.center,
child: Text(
"通知客户",
style: TextStyle(
color: MyColours.color_83734d,
fontSize: ScreenUtil().setSp(34)),
),
),
),
)
],
),
)
],
)),
),
);
}
}
\ No newline at end of file
}
... ...
... ... @@ -111,6 +111,7 @@ class SelectTablePageState extends State<SelectTablePage> {
}
}
}
print(tableMap);
initData();
}
... ... @@ -220,22 +221,23 @@ class SelectTablePageState extends State<SelectTablePage> {
crossAxisCount: 3, childAspectRatio: 0.8),
itemBuilder: (context, index) {
return TableItem(
areaTableMap[currentArea][index],
onSelected: (table) {
if ((table as t.Table).selected) {
selectTables.add(table);
widget.tableList
.add(tableToTableList(table));
} else {
widget.tableList
.removeWhere((t) => t.id == table.id);
selectTables
.removeWhere((t) => t.id == table.id);
}
},
canSelected: true,
canChoose: widget.canChoose,
);
areaTableMap[currentArea][index],
onSelected: (table) {
if ((table as t.Table).selected) {
selectTables.add(table);
widget.tableList
.add(tableToTableList(table));
} else {
widget.tableList
.removeWhere((t) => t.id == table.id);
selectTables
.removeWhere((t) => t.id == table.id);
}
},
canSelected: true,
canChoose: widget.canChoose,
tableMap: tableMap,
rid: widget.rid);
},
itemCount: areaTableMap[currentArea].length,
),
... ... @@ -263,7 +265,7 @@ class SelectTablePageState extends State<SelectTablePage> {
state: 1,
onPress: () {
if (widget.canChoose) {
if (widget.tableList.length > 0) {
// if (widget.tableList.length > 0) {
String tid = "";
for (TableList table in widget.tableList) {
tid += table.id + ",";
... ... @@ -274,7 +276,7 @@ class SelectTablePageState extends State<SelectTablePage> {
Map temp = {'object': widget.tableList, 'tid': tid};
Navigator.of(context).pop(temp);
}
// }
} else {
if (selectTables.length > 0) {
String tid = "";
... ...
... ... @@ -27,6 +27,7 @@ class NotebookDetailChangeModel with ChangeNotifier {
NotebookDetail detailEntity;
List<TableList> tableList = [];
String isSetDate = '0';
List<TableList> recommendList = []; //推荐列表
clearData() {
dateList = []; //日期选择 月-日 某天
... ... @@ -377,6 +378,7 @@ class NotebookDetailChangeModel with ChangeNotifier {
tableList = [];
for (int i = 0; i < itemModelList.length; i++) {
if (itemModelList[i].name == "推荐") {
recommendList = itemModelList[i].list;
itemModelList.removeAt(i);
}
}
... ...
... ... @@ -47,7 +47,7 @@ class NewTableItemState extends State<NewTableItem> {
Container(
width: ScreenUtil().setWidth(150),
height: ScreenUtil().setWidth(widget.height),
margin: EdgeInsets.all(ScreenUtil().setWidth(9)),
margin: EdgeInsets.only(left:ScreenUtil().setWidth(40)),
decoration: BoxDecoration(
color: MyColours.color_a8e2e4,
borderRadius: BorderRadius.all(
... ... @@ -183,8 +183,8 @@ class NewTableItemState extends State<NewTableItem> {
),
),
Positioned(
top: 3,
right: 5,
top: 0,
right: 0,
child: !(table.selected ?? false)
? Container()
: Image.asset(
... ...
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/models/notebook.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/models/table.dart' as t;
... ... @@ -9,7 +10,9 @@ class TableItem extends StatefulWidget {
final t.Table table;
final bool canSelected; //是否能选中
final ValueChanged onSelected;
final bool canChoose;
final bool canChoose; //从变更页面进来 = true
final String rid;
final Map<String, Notebook> tableMap; //记录已预订桌位对应的订单
final int height; //高度
... ... @@ -17,7 +20,9 @@ class TableItem extends StatefulWidget {
{this.onSelected,
this.canSelected = false,
this.height = 183,
this.canChoose = false});
this.canChoose = false,
this.rid,
this.tableMap});
@override
State<StatefulWidget> createState() {
... ... @@ -29,20 +34,36 @@ class TableItem extends StatefulWidget {
class TableItemState extends State<TableItem> {
@override
Widget build(BuildContext context) {
// TODO: implement build
t.Table table = widget.table;
return GestureDetector(
onTap: () {
if (widget.canSelected && widget.canChoose) {
if (table.sign == '5' || table.signStr.isEmpty) {
//从变更页面进来 canChoose = true
if (widget.canSelected && table.signStr.isEmpty) {
setState(() {
table.selected = !(table.selected ?? false);
});
widget.onSelected(table);
} else {
if (table.sign == '5') {
//已预订状态 不是自己的不可以选择,是自己的可以选择
//当前桌子的预订id
String idNow = '';
if (widget.tableMap.containsKey('${table.id}')) {
//包含,证明该桌子已经被预订了
idNow = widget.tableMap['${table.id}'].id;
if (idNow == widget.rid) {
setState(() {
table.selected = !(table.selected ?? false);
});
widget.onSelected(table);
}
}
}
}
} else {
//从安排桌位进来
if (widget.canSelected && table.signStr.isEmpty) {
setState(() {
table.selected = !(table.selected ?? false);
... ...