Commit 40d232ddfe91a9c43f05cc28bd2a61c6bf62ac14

Authored by wdn127929
2 parents 57735bb1 2cf8aebd

合并宴会起始时间筛查桌位

... ... @@ -33,9 +33,9 @@ if (flutterRoot == null) {
def flutterVersionCode = "505"
def flutterVersionCode = "506"
if (flutterVersionCode == null) {
flutterVersionCode = '505'
flutterVersionCode = '506'
... ... @@ -46,9 +46,11 @@ if (flutterVersionCode == null) {
def flutterVersionName = "5.0.5"
def flutterVersionName = "5.0.6"
if (flutterVersionName == null) {
flutterVersionName = '5.0.5'
flutterVersionName = '5.0.6'
}
... ...
... ... @@ -518,7 +518,10 @@
CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 504;
CURRENT_PROJECT_VERSION = 506;
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
... ... @@ -668,7 +671,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 504;
CURRENT_PROJECT_VERSION = 506;
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
... ... @@ -707,7 +710,8 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 504;
CURRENT_PROJECT_VERSION = 506;
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
... ...
... ... @@ -285,7 +285,8 @@ class _VerificationCouponPageState extends State<VerificationCouponPage> {
: model.orderRechargeByidSunModel
.activity.use.isDish
? model
.couponSunModel.use.dish
.orderRechargeByidSunModel
.activity.use.dish
: '',
textColor: MyColours.color_438E93,
fontSize: 20),
... ...
... ... @@ -40,9 +40,19 @@ class SelectTableFPage extends StatefulWidget {
final List<TableList> tableList;
final String fromPage;
final String tid;
final String hmS;
final String hmE;
final String source;
final String ridFeast; //宴会id
SelectTableFPage(this.rid, this.dateTime, this.ddate_slot,
{this.canChoose = false, this.tableList, this.fromPage, this.tid});
{this.canChoose = false,
this.tableList,
this.fromPage,
this.tid,
this.hmS,
this.hmE,
this.source = '0',
this.ridFeast});
@override
State<StatefulWidget> createState() {
... ... @@ -232,18 +242,65 @@ class SelectTableFPageState extends State<SelectTableFPage> {
//获取预订(原来普通预订和宴会预订)
_getReserveListAndFeastData(context, params, showloading) async {
UserModel userModel = Provider.of<UserModel>(context, listen: false);
String timeStrStart = widget.dateTime.year.toString() +
"-" +
Utils.addZeroNumber(widget.dateTime.month) +
"-" +
Utils.addZeroNumber(widget.dateTime.day) +
" 00:00:00";
String timeStrEnd = widget.dateTime.year.toString() +
"-" +
Utils.addZeroNumber(widget.dateTime.month) +
"-" +
Utils.addZeroNumber(widget.dateTime.day) +
" 23:59:59";
String timeStrStart = '';
String timeStrEnd = '';
String hmsS = " ${widget.hmS}:00"; //起始
String hmsE = " ${widget.hmE}:59"; //结束
if (widget.hmS == 'null' || widget.hmE == 'null') {
//用餐段对应的时间段作为起始时间
String keys = '';
if (widget.ddate_slot == '1') {
//早市
keys = 'morning';
} else if (widget.ddate_slot == '2') {
//午市
keys = 'noon';
} else if (widget.ddate_slot == '3') {
//晚市
keys = 'night';
}
String ymd =
DateUtil.formatDate(widget.dateTime, format: DateFormats.y_mo_d);
if (keys != '') {
List temp = dailyMap[keys];
timeStrStart = ymd + ' ' + temp.first + ':00';
timeStrEnd = ymd + ' ' + temp.last + ':00';
} else {
hmsS = " 00:00:00";
hmsE = " 23:59:59";
timeStrStart = widget.dateTime.year.toString() +
"-" +
Utils.addZeroNumber(widget.dateTime.month) +
"-" +
Utils.addZeroNumber(widget.dateTime.day) +
hmsS;
timeStrEnd = widget.dateTime.year.toString() +
"-" +
Utils.addZeroNumber(widget.dateTime.month) +
"-" +
Utils.addZeroNumber(widget.dateTime.day) +
hmsE;
}
} else {
hmsS = " ${widget.hmS}:00"; //起始
hmsE = " ${widget.hmE}:59"; //结束
timeStrStart = widget.dateTime.year.toString() +
"-" +
Utils.addZeroNumber(widget.dateTime.month) +
"-" +
Utils.addZeroNumber(widget.dateTime.day) +
hmsS;
timeStrEnd = widget.dateTime.year.toString() +
"-" +
Utils.addZeroNumber(widget.dateTime.month) +
"-" +
Utils.addZeroNumber(widget.dateTime.day) +
hmsE;
}
String start =
(DateUtil.getDateMsByTimeStr(timeStrStart) / 1000).floor().toString();
String end =
... ... @@ -253,7 +310,7 @@ class SelectTableFPageState extends State<SelectTableFPage> {
'sid': userModel.user.sellerid,
'rdate': '${start}',
'edate': '${end}',
'ddate_interval': widget.ddate_slot
// 'ddate_interval': widget.ddate_slot
};
return await Future.wait<bool>([
_getOldReserve(context, params, showloading),
... ... @@ -290,12 +347,15 @@ class SelectTableFPageState extends State<SelectTableFPage> {
Map<String, String> params = {
"sid": sid,
"rdate": _getRdate(),
"ddate_solt": widget.ddate_slot,
// "ddate_solt": widget.ddate_slot,
"y": "200",
"x": "1",
"keywords": "",
"sort": "1"
};
if (widget.source == '1') {
params['source'] = '1';
}
// List<Notebook> noteBooks =
// await model.getReserveList(context, params, needLoading: needLoading);
bool success =
... ... @@ -313,29 +373,97 @@ class SelectTableFPageState extends State<SelectTableFPage> {
});
});
// banquetByDateData.map((e) => null)
String banquetKey = '';
if (widget.ddate_slot == '1') {
banquetKey = '早餐';
} else if (widget.ddate_slot == '2') {
banquetKey = '午餐';
} else if (widget.ddate_slot == '3') {
banquetKey = '晚餐';
}
// String banquetKey = '';
// if (widget.ddate_slot == '1') {
// banquetKey = '早餐';
// } else if (widget.ddate_slot == '2') {
// banquetKey = '午餐';
// } else if (widget.ddate_slot == '3') {
// banquetKey = '晚餐';
// }
Map<String, List<FeastBoardSunModel>> banquetData = {};
banquetByDateDataTemp.forEach((element) {
FeastBoardSunModel feastBoardSunModel = element.data[banquetKey][0];
if (feastBoardSunModel.lost == null || feastBoardSunModel.lost == '') {
//未丢单的宴会
Notebook notebook = Notebook();
notebook.tid = element.title;
notebook.status = '10'; //宴会类型
notebook.className = feastBoardSunModel.className;
notebook.id = feastBoardSunModel.rid;
notebook.rname = feastBoardSunModel.rname;
notebook.nick_name =
feastBoardSunModel.nickName ?? feastBoardSunModel.account;
noteBooks.add(notebook);
List<FeastBoardSunModel> data = [];
if (element.data['其他'].length > 0) {
FeastBoardSunModel feastBoardSunModel = element.data['其他'][0];
if (feastBoardSunModel.lost == null ||
feastBoardSunModel.lost == '') {
data.add(feastBoardSunModel); //未丢单宴会合集
}
}
if (element.data['早餐'].length > 0) {
FeastBoardSunModel feastBoardSunModel = element.data['早餐'][0];
if (feastBoardSunModel.lost == null ||
feastBoardSunModel.lost == '') {
data.add(feastBoardSunModel); //未丢单宴会合集
}
}
if (element.data['午餐'].length > 0) {
FeastBoardSunModel feastBoardSunModel = element.data['午餐'][0];
if (feastBoardSunModel.lost == null ||
feastBoardSunModel.lost == '') {
data.add(feastBoardSunModel); //未丢单宴会合集
}
}
if (element.data['晚餐'].length > 0) {
FeastBoardSunModel feastBoardSunModel = element.data['晚餐'][0];
if (feastBoardSunModel.lost == null ||
feastBoardSunModel.lost == '') {
data.add(feastBoardSunModel); //未丢单宴会合集
}
}
// 不是丢单宴会&&不是当前宴会
// 移除当前宴会订单
if (widget.ridFeast != null) {
print(data);
data.removeWhere((element) => element.rid == widget.ridFeast);
print(data);
}
if (!banquetData.containsKey(element.title) && data.length > 0) {
banquetData[element.title] = data;
}
});
List<String> tidsWidget =
widget.tableList.map((element) => element.id).toList();
print(tidsWidget);
banquetData.forEach((key, value) {
value.forEach((element) {
//未丢单的宴会
if (!tidsWidget.contains(key)) {
//带过来的桌子,不能标记已预订,或者已经有宴会
Notebook notebook = Notebook();
notebook.tid = key;
notebook.status = '10'; //宴会类型
notebook.className = element.className;
notebook.id = element.rid;
notebook.rname = element.rname;
notebook.nick_name = element.nickName ?? element.account;
noteBooks.add(notebook);
}
print(noteBooks);
// banquetByDateDataTemp.forEach((element) {
// FeastBoardSunModel feastBoardSunModel = element.data[banquetKey][0];
// if (feastBoardSunModel.lost == null || feastBoardSunModel.lost == '') {
//未丢单的宴会
// Notebook notebook = Notebook();
// notebook.tid = element.title;
// notebook.status = '10'; //宴会类型
// notebook.className = feastBoardSunModel.className;
// notebook.id = feastBoardSunModel.rid;
// notebook.rname = feastBoardSunModel.rname;
// notebook.nick_name =
// feastBoardSunModel.nickName ?? feastBoardSunModel.account;
// noteBooks.add(notebook);
// }
});
});
for (Notebook notebook in noteBooks) {
if (notebook.tid.isEmpty) continue;
if (notebook.status == "1" ||
... ... @@ -493,43 +621,69 @@ class SelectTableFPageState extends State<SelectTableFPage> {
//获取一天开始-结束时间字符串
String _getRdate() {
// String keys = '';
// if (widget.ddate_slot == '1') {
// //早市
// keys = 'morning';
// } else if (widget.ddate_slot == '2') {
// //午市
// keys = 'noon';
// } else if (widget.ddate_slot == '3') {
// //晚市
// keys = 'night';
// }
// String ymd =
// DateUtil.formatDate(widget.dateTime, format: DateFormats.y_mo_d);
String timeStrStart = '';
String timeStrEnd = '';
//一天开始时间
double startDay;
//一天结束时间
double endDay;
// if (keys != '') {
// List temp = dailyMap[keys];
// timeStrStart = ymd + ' ' + temp.first + ':00';
// timeStrEnd = ymd + ' ' + temp.last + ':00';
// } else {
timeStrStart = widget.dateTime.year.toString() +
"-" +
Utils.addZeroNumber(widget.dateTime.month) +
"-" +
Utils.addZeroNumber(widget.dateTime.day) +
" 00:00:00";
timeStrEnd = widget.dateTime.year.toString() +
"-" +
Utils.addZeroNumber(widget.dateTime.month) +
"-" +
Utils.addZeroNumber(widget.dateTime.day) +
" 23:59:59";
String hmsS = " ${widget.hmS}:00"; //起始
String hmsE = " ${widget.hmE}:59"; //结束
if (widget.hmS == 'null' || widget.hmE == 'null') {
//用餐段对应的时间段作为起始时间
String keys = '';
if (widget.ddate_slot == '1') {
//早市
keys = 'morning';
} else if (widget.ddate_slot == '2') {
//午市
keys = 'noon';
} else if (widget.ddate_slot == '3') {
//晚市
keys = 'night';
}
String ymd =
DateUtil.formatDate(widget.dateTime, format: DateFormats.y_mo_d);
if (keys != '') {
List temp = dailyMap[keys];
timeStrStart = ymd + ' ' + temp.first + ':00';
timeStrEnd = ymd + ' ' + temp.last + ':00';
} else {
hmsS = " 00:00:00";
hmsE = " 23:59:59";
timeStrStart = widget.dateTime.year.toString() +
"-" +
Utils.addZeroNumber(widget.dateTime.month) +
"-" +
Utils.addZeroNumber(widget.dateTime.day) +
hmsS;
timeStrEnd = widget.dateTime.year.toString() +
"-" +
Utils.addZeroNumber(widget.dateTime.month) +
"-" +
Utils.addZeroNumber(widget.dateTime.day) +
hmsE;
}
} else {
hmsS = " ${widget.hmS}:00"; //起始
hmsE = " ${widget.hmE}:59"; //结束
timeStrStart = widget.dateTime.year.toString() +
"-" +
Utils.addZeroNumber(widget.dateTime.month) +
"-" +
Utils.addZeroNumber(widget.dateTime.day) +
hmsS;
timeStrEnd = widget.dateTime.year.toString() +
"-" +
Utils.addZeroNumber(widget.dateTime.month) +
"-" +
Utils.addZeroNumber(widget.dateTime.day) +
hmsE;
}
// }
startDay = (DateTime.parse(timeStrStart).millisecondsSinceEpoch) / 1000;
endDay = (DateTime.parse(timeStrEnd).millisecondsSinceEpoch) / 1000;
... ...
... ... @@ -16,14 +16,20 @@ import 'package:one_key/widgets/round_button.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import 'package:provider/provider.dart';
import '../../app.dart';
import '../../constant/state.dart';
import '../../models/dsolt_xt.dart';
import '../../models/feast_menu_model.dart';
import '../../models/get_banquet_by_id_new_model.dart';
import '../../models/get_board_model.dart';
import '../../models/notebook.dart';
import '../../models/set_xuan_tai_model.dart';
import '../../models/setmeal_by_id_model.dart';
import '../../models/tableOuter.dart';
import '../../models/upload_img_model.dart';
import '../../provider/choose_table_model.dart';
import '../../provider/feast_model.dart';
import '../../provider/notebook_model.dart';
import '../../provider/upload_img_provider.dart';
import '../../provider/user_model.dart';
import '../../res/colors.dart';
... ... @@ -43,6 +49,8 @@ import 'package:one_key/models/table_list.dart' as t;
import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart';
import '../../widgets/special_text/my_extended_text_selection_controls.dart';
import 'package:one_key/models/table.dart' as table;
class FeastCreatePage extends StatefulWidget {
final GetBanquetByIdNewSunModel banquetDetail;
final bool isCreate;
... ... @@ -99,6 +107,11 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
MyTextSelectionControls _myExtendedMaterialTextSelectionControls =
MyTextSelectionControls();
ChooseTableModel _chooseTableModel;
List<Notebook> noteBooks;
Map<String, Notebook> tableMap = {}; //记录已预订桌位对应的订单
List<TableOuter> tableOuterList = []; //区域-桌位列表
@override
void initState() {
// TODO: implement initState
... ... @@ -252,7 +265,10 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
setXuanTaiModel.endDate; //起始时间
setXuanTaiModel.tableList = element.tableList;
setXuanTaiModel.tableSum = int.parse('${element.tableNum}'); //桌位总数
setXuanTaiModel.tableSum =
element.tableNum == null || element.tableNum == ''
? 0
: int.parse('${element.tableNum}'); //桌位总数
setXuanTaiModel.customCxt.text = element.remark; //选台备注
setXuanTaiModel.feastRemarkXtImageList =
element.feastRemarkImages; //宴会备注图片信息列表----选台
... ... @@ -1225,6 +1241,351 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
return startDay.floor().toString() + "-" + endDay.floor().toString();
}
//获取一天开始-结束时间字符串
String _getRdateGetNotebook() {
String timeStrStart = '';
String timeStrEnd = '';
//一天开始时间
double startDay;
//一天结束时间
double endDay;
SetXuanTaiModel setXuanTaiModel = xuantaiData[xuantaiSelIndex];
String hmsS = " ${setXuanTaiModel.startDate}:00"; //起始
String hmsE = " ${setXuanTaiModel.endDate}:59"; //结束
timeStrStart = setXuanTaiModel.dateTimext.year.toString() +
"-" +
Utils.addZeroNumber(setXuanTaiModel.dateTimext.month) +
"-" +
Utils.addZeroNumber(setXuanTaiModel.dateTimext.day) +
hmsS;
timeStrEnd = setXuanTaiModel.dateTimext.year.toString() +
"-" +
Utils.addZeroNumber(setXuanTaiModel.dateTimext.month) +
"-" +
Utils.addZeroNumber(setXuanTaiModel.dateTimext.day) +
hmsE;
// }
startDay = (DateTime.parse(timeStrStart).millisecondsSinceEpoch) / 1000;
endDay = (DateTime.parse(timeStrEnd).millisecondsSinceEpoch) / 1000;
return startDay.floor().toString() + "-" + endDay.floor().toString();
}
//获取预订(原来普通预订和宴会预订)
_getReserveListAndFeastData(context, params, showloading) async {
UserModel userModel = Provider.of<UserModel>(context, listen: false);
SetXuanTaiModel setXuanTaiModel = xuantaiData[xuantaiSelIndex];
String timeStrStart = '';
String timeStrEnd = '';
String hmsS = " ${setXuanTaiModel.startDate}:00"; //起始
String hmsE = " ${setXuanTaiModel.endDate}:59"; //结束
timeStrStart = setXuanTaiModel.dateTimext.year.toString() +
"-" +
Utils.addZeroNumber(setXuanTaiModel.dateTimext.month) +
"-" +
Utils.addZeroNumber(setXuanTaiModel.dateTimext.day) +
hmsS;
timeStrEnd = setXuanTaiModel.dateTimext.year.toString() +
"-" +
Utils.addZeroNumber(setXuanTaiModel.dateTimext.month) +
"-" +
Utils.addZeroNumber(setXuanTaiModel.dateTimext.day) +
hmsE;
String start =
(DateUtil.getDateMsByTimeStr(timeStrStart) / 1000).floor().toString();
String end =
(DateUtil.getDateMsByTimeStr(timeStrEnd) / 1000).floor().toString();
Map<String, String> banquetmap = {
'sid': userModel.user.sellerid,
'rdate': '${start}',
'edate': '${end}',
// 'ddate_interval': widget.ddate_slot
};
return await Future.wait<bool>([
_getOldReserve(context, params, showloading),
_chooseTableModel.getBanquetByDate(context, banquetmap,
showLoading: showloading)
]).then((results) {
if (results[0] && results[1]) {
//成功
return true;
} else {
if (!results[0]) {
// Utils.showToast('');
} else {
// Utils.showToast('');
}
return false;
}
}).catchError((e) {
print(e);
return false;
});
}
Future<bool> _getOldReserve(context, params, showloading) async {
NoteBookModel model = new NoteBookModel();
noteBooks =
await model.getReserveList(context, params, needLoading: showloading);
return true;
}
List<TableOuter> getSpTableList() {
String tableList = App.sp.getString('table_list');
if (tableList == null) {
return [];
}
List<TableOuter> temp = [];
List list = json.decode(tableList);
if (list.length > 0) {
list.forEach((element) {
temp.add(TableOuter.fromJson2(element));
});
}
return temp;
}
//获取桌位列表
_getTableList({needLoading = true}) async {
UserModel userModel = Provider.of<UserModel>(context, listen: false);
Map<String, String> params = {"sellerid": userModel.user.sellerid};
String tableSp = App.sp.getString('table_list');
if (tableSp == null) {
//接口请求桌位
tableOuterList = await _chooseTableModel.getTableList(context, params,
needLoading: needLoading);
} else {
tableOuterList = getSpTableList();
}
_chooseTableModel.tablesAll = [];
for (TableOuter item in tableOuterList) {
// if (item.name == "推荐") {
// itemModelList.remove(item);
// }
for (var item1 in item.list) {
item1.selected = false;
}
_chooseTableModel.tablesAll.addAll(item.list);
}
if (tableOuterList.isEmpty) {
// _chooseTableModel.pageState = PageState.Success;
// _chooseTableModel.notifyListeners();
} else {
_getReserveList(needLoading: needLoading);
}
// if (_chooseTableModel.pageState == PageState.Success) {
// }
}
//获取已预订列表
_getReserveList({needLoading = true}) async {
Map<String, String> params = {
"sid": Provider.of<UserModel>(context, listen: false).user.sellerid,
"rdate": _getRdateGetNotebook(),
// "ddate_solt": widget.ddate_slot,
"y": "200",
"x": "1",
"keywords": "",
"sort": "1"
};
params['source'] = '1';
bool success =
await _getReserveListAndFeastData(context, params, needLoading);
if (success) {
List<FeastBoardModel> banquetByDateDataTemp = []; //转换为桌子id为key,data为value
_chooseTableModel.banquetByDateData.forEach((element) {
_chooseTableModel.tablesAll.forEach((table) {
if (table.name == element.title) {
FeastBoardModel feastBoardModel = FeastBoardModel();
feastBoardModel.title = table.id;
feastBoardModel.data = element.data;
banquetByDateDataTemp.add(feastBoardModel);
}
});
});
Map<String, List<FeastBoardSunModel>> banquetData = {};
banquetByDateDataTemp.forEach((element) {
List<FeastBoardSunModel> data = [];
if (element.data['其他'].length > 0) {
FeastBoardSunModel feastBoardSunModel = element.data['其他'][0];
if (feastBoardSunModel.lost == null ||
feastBoardSunModel.lost == '') {
data.add(feastBoardSunModel); //未丢单宴会合集
}
}
if (element.data['早餐'].length > 0) {
FeastBoardSunModel feastBoardSunModel = element.data['早餐'][0];
if (feastBoardSunModel.lost == null ||
feastBoardSunModel.lost == '') {
data.add(feastBoardSunModel); //未丢单宴会合集
}
}
if (element.data['午餐'].length > 0) {
FeastBoardSunModel feastBoardSunModel = element.data['午餐'][0];
if (feastBoardSunModel.lost == null ||
feastBoardSunModel.lost == '') {
data.add(feastBoardSunModel); //未丢单宴会合集
}
}
if (element.data['晚餐'].length > 0) {
FeastBoardSunModel feastBoardSunModel = element.data['晚餐'][0];
if (feastBoardSunModel.lost == null ||
feastBoardSunModel.lost == '') {
data.add(feastBoardSunModel); //未丢单宴会合集
}
}
if (!banquetData.containsKey(element.title)) {
banquetData[element.title] = data;
}
});
// List<String> tidsWidget = xuantaiData[xuantaiSelIndex]
// .tableList
// .map((element) => element.id)
// .toList();
// print(tidsWidget);
banquetData.forEach((key, value) {
value.forEach((element) {
//未丢单的宴会
// if (!tidsWidget.contains(key)) {
//带过来的桌子,不能标记已预订,或者已经有宴会
Notebook notebook = Notebook();
notebook.tid = key;
notebook.status = '10'; //宴会类型
notebook.className = element.className;
notebook.id = element.rid;
notebook.rname = element.rname;
notebook.nick_name = element.nickName ?? element.account;
noteBooks.add(notebook);
// }
print(noteBooks);
});
});
for (Notebook notebook in noteBooks) {
if (notebook.tid.isEmpty) continue;
if (notebook.status == "1" ||
notebook.status == "2" ||
notebook.status == "5" ||
notebook.status == "10") {
//已预订,用餐中,已安排
List<String> tids = notebook.tid.split(",");
for (String tid in tids) {
tableMap["$tid"] = notebook;
}
}
}
// List<Notebook> noteBooks =
// await newGetReserveList(context, params, showLoading: showloading);
List<t.TableList> tempSelectTables = [];
tempSelectTables.addAll(xuantaiData[xuantaiSelIndex].tableList);
String msg = '';
for (Notebook notebook in noteBooks) {
if (notebook.tid.isEmpty) continue;
//已预订,用餐中,已安排
List<String> tids = notebook.tid.split(",");
for (String tid in tids) {
if (notebook.status == "1" ||
notebook.status == "2" ||
notebook.status == "5" ||
notebook.status == "10") {
tableMap["$tid"] = notebook;
///预订按钮点击的时候提醒已经被预订的桌子
///
if (xuantaiData[xuantaiSelIndex].tableList.length > 0) {
for (t.TableList item in xuantaiData[xuantaiSelIndex].tableList) {
// if (item.isMerge == '1') {
// // (tids.contains(item.tids))
// List<String> mergetids = item.tids.split(',');
// outerloop:
// for (int i = 0; i < mergetids.length; i++) {
// String mergetid = mergetids[i];
// if (tids.contains(mergetid)) {
// msg += '${item.name},';
// tempSelectTables.remove(item);
// break outerloop;
// }
// }
// }
if (item.id == tid) {
msg += '${item.name},';
tempSelectTables.remove(item);
xuantaiData[xuantaiSelIndex]
.tids
.removeWhere((element) => element.tid == tid);
}
}
}
}
}
// if (xuantaiData[xuantaiSelIndex].tableList.length > 0 &&
// notebook.status == "1" ||
// notebook.status == "2" ||
// notebook.status == "5" ||
// notebook.status == "10") {
// outerloop:
// for (t.TableList item in xuantaiData[xuantaiSelIndex].tableList) {
// if (item.isMerge == '1') {
// // (tids.contains(item.tids))
// List<String> mergetids = item.tids.split(',');
// for (int i = 0; i < mergetids.length; i++) {
// String mergetid = mergetids[i];
// if (tids.contains(mergetid)) {
// msg += '${item.name},';
// tempSelectTables.remove(item);
// break outerloop;
// }
// }
// }
// }
// }
}
if (msg != '' && xuantaiData[xuantaiSelIndex].tableList.length > 0) {
if (msg.endsWith(',')) {
msg = msg.substring(0, msg.length - 1);
}
xuantaiData[xuantaiSelIndex].tableList = tempSelectTables;
Utils.showToast('${msg}已被预订,请选择其他桌位!');
print(tableMap);
xuantaiData[xuantaiSelIndex].tableSum = 0;
xuantaiData[xuantaiSelIndex].tids.forEach((element) {
xuantaiData[xuantaiSelIndex].tableSum += int.parse(
element.numStr == '' || element.numStr == null
? '0'
: element.numStr);
});
setState(() {});
// initData(needKeep: needKeep);
// notifyListeners();
return false;
}
// print(tableMap);
}
return true;
}
/// 选台保存接口
Future<bool> xtSave() async {
//判断非空选项,并弹窗提醒用户填写信息
... ... @@ -1245,7 +1606,8 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
canRequest = false;
break outerloop;
}
if (element.cdShow == '不带餐' && element.qsDateShow == '暂未选择') {
// if (element.cdShow == '不带餐' && element.qsDateShow == '暂未选择') {
if (element.qsDateShow == '暂未选择') {
Utils.showToast('请选择${reserveOrder}起始时间');
canRequest = false;
break outerloop;
... ... @@ -1658,13 +2020,19 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
.then((day) async {
if (day != null) {
setState(() {
xuantaiData[xuantaiSelIndex].tids = [];
xuantaiData[xuantaiSelIndex].tableList = [];
xuantaiData[xuantaiSelIndex].tableSum = 0;
// xuantaiData[xuantaiSelIndex].tids = [];
// xuantaiData[xuantaiSelIndex].tableList = [];
// xuantaiData[xuantaiSelIndex].tableSum = 0;
xuantaiData[xuantaiSelIndex].dateTimext = day;
xuantaiData[xuantaiSelIndex].dateTimeShowxt =
createDateText(context, day);
});
if (xuantaiData[xuantaiSelIndex].startDate != '' &&
xuantaiData[xuantaiSelIndex].endDate != '' &&
xuantaiData[xuantaiSelIndex].tableList !=
null) {
_getTableList();
}
}
});
}),
... ... @@ -1677,9 +2045,9 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
return item.title;
}).toList(), (value) {
if (value != null) {
xuantaiData[xuantaiSelIndex].tids = [];
xuantaiData[xuantaiSelIndex].tableList = [];
xuantaiData[xuantaiSelIndex].tableSum = 0;
// xuantaiData[xuantaiSelIndex].tids = [];
// xuantaiData[xuantaiSelIndex].tableList = [];
// xuantaiData[xuantaiSelIndex].tableSum = 0;
setState(() {
xuantaiData[xuantaiSelIndex].cdSelIndex =
value.first;
... ... @@ -1703,16 +2071,22 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
}),
_selectWidget(
'起始时间', xuantaiData[xuantaiSelIndex].qsDateShow,
need: xuantaiData[xuantaiSelIndex].cdShow == '不带餐'
? true
: false, onTap: () {
// need: xuantaiData[xuantaiSelIndex].cdShow == '不带餐'
// ? true
// : false,
need: true, onTap: () {
FocusScope.of(context).requestFocus(FocusNode()); //隐藏键盘
SetTimeWidget.init.showFeastTimeSelector(
context,
SetTimeWidget.init.getFeastDateData('00:00-23:30'),
xuantaiData[xuantaiSelIndex].startDate,
xuantaiData[xuantaiSelIndex].endDate, (value) {
xuantaiData[xuantaiSelIndex].startDate == ''
? '8:00'
: xuantaiData[xuantaiSelIndex].startDate,
xuantaiData[xuantaiSelIndex].endDate == ''
? '8:00'
: xuantaiData[xuantaiSelIndex].endDate,
(value) {
if (value != null) {
xuantaiData[xuantaiSelIndex].startDate =
SetTimeWidget.init.getSelectTitle(value[0]);
... ... @@ -1723,6 +2097,14 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
'-' +
xuantaiData[xuantaiSelIndex].endDate;
setState(() {});
if (xuantaiData[xuantaiSelIndex].startDate != '' &&
xuantaiData[xuantaiSelIndex].endDate != '' &&
xuantaiData[xuantaiSelIndex].dateTimeShowxt !=
'请选择' &&
xuantaiData[xuantaiSelIndex].tableList !=
null) {
_getTableList();
}
}
});
// DialogUtil.showSelectCusmanDialog(
... ... @@ -1855,19 +2237,28 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
),
onChanged: (value) {
print('ggg');
print(value);
xuantaiData[xuantaiSelIndex]
.tableSum = 0;
for (Tids item
in xuantaiData[
xuantaiSelIndex]
.tids) {
item.numStr =
item.tableNumC.text;
xuantaiData[xuantaiSelIndex]
.tableSum +=
int.parse(item
.tableNumC.text);
.tableNumC
.text ==
''
? '0'
: item.tableNumC
.text);
setState(() {});
}
setState(() {});
},
onEditingComplete: () {
// print('fff');
... ... @@ -1906,23 +2297,42 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
.color_E6000000,
rTitle: "删除",
rCallback: () {
if (xuantaiData[
xuantaiSelIndex]
.tableSum >
0) {
if (xuantaiData[xuantaiSelIndex]
.tableSum >
0 &&
xuantaiData[xuantaiSelIndex]
.tids[index]
.tableNumC
.text !=
'') {
xuantaiData[xuantaiSelIndex]
.tableSum -=
int.parse(xuantaiData[
xuantaiSelIndex]
.tids[index]
.tableNumC
.text);
xuantaiSelIndex]
.tids[index]
.tableNumC
.text ==
''
? '0'
: xuantaiData[
xuantaiSelIndex]
.tids[index]
.tableNumC
.text);
}
xuantaiData[xuantaiSelIndex]
.tableList
.removeWhere((element) =>
element.id ==
xuantaiData[
xuantaiSelIndex]
.tids[index]
.tid);
xuantaiData[xuantaiSelIndex]
.tids
.removeAt(index);
print('eeeeeee');
setState(() {});
// _delGuestInfocDay(model.cday[index].id);
});
... ... @@ -1950,121 +2360,172 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
onPressed: () async {
FocusScope.of(context)
.requestFocus(FocusNode()); //点击空白处隐藏键盘
if (xuantaiData[xuantaiSelIndex]
.dateTimeShowxt ==
'请选择') {
Utils.showToast('请选择宴会日期');
return;
}
if (xuantaiData[xuantaiSelIndex].cdShow ==
'请选择') {
Utils.showToast('请选择餐段');
return;
}
if (xuantaiData[xuantaiSelIndex].qsDateShow ==
'暂未选择') {
Utils.showToast('请选择起始时间');
return;
}
if (xuantaiData[xuantaiSelIndex].cdShow ==
'不带餐') {
Map temp = {};
if (xuantaiData[xuantaiSelIndex]
.tableList !=
null &&
xuantaiData[xuantaiSelIndex]
.tableList
.length >
0) {
temp = await NavigatorUtil
.goFeastSelectTablePage(context,
object: {
'object':
xuantaiData[xuantaiSelIndex]
.tableList
});
} else {
temp = await NavigatorUtil
.goFeastSelectTablePage(
context,
);
}
// if (xuantaiData[xuantaiSelIndex].cdShow ==
// '不带餐') {
// Map temp = {};
// if (xuantaiData[xuantaiSelIndex]
// .tableList !=
// null &&
// xuantaiData[xuantaiSelIndex]
// .tableList
// .length >
// 0) {
// temp = await NavigatorUtil
// .goFeastSelectTablePage(context,
// object: {
// 'object':
// xuantaiData[xuantaiSelIndex]
// .tableList
// });
// } else {
// temp = await NavigatorUtil
// .goFeastSelectTablePage(
// context,
// );
// }
// if (temp == null) {
// } else if (temp['object'].length == 0) {
// } else {
// xuantaiData[xuantaiSelIndex].tids = [];
// xuantaiData[xuantaiSelIndex].tableList =
// temp['object'];
// for (t.TableList item
// in xuantaiData[xuantaiSelIndex]
// .tableList) {
// item.selected = true;
// Tids tids = Tids();
// tids.tid = item.id;
// tids.name = item.name ?? "";
// xuantaiData[xuantaiSelIndex]
// .tids
// .add(tids);
// }
// setState(() {});
// }
// } else {
// if (xuantaiData[xuantaiSelIndex]
// .dateTimeShowxt ==
// '请选择') {
// Utils.showToast('请选择宴会日期');
// return;
// }
//带餐
int ddate = xuantaiData[xuantaiSelIndex]
.dateTimext
.millisecondsSinceEpoch;
String ddateSolt = dsoltList[
xuantaiData[xuantaiSelIndex]
.cdSelIndex]
.id;
if (temp == null) {
} else if (temp['object'].length == 0) {
} else {
xuantaiData[xuantaiSelIndex].tids = [];
xuantaiData[xuantaiSelIndex].tableList =
temp['object'];
for (t.TableList item
in xuantaiData[xuantaiSelIndex]
.tableList) {
item.selected = true;
Tids tids = Tids();
tids.tid = item.id;
tids.name = item.name ?? "";
xuantaiData[xuantaiSelIndex]
.tids
.add(tids);
}
setState(() {});
}
Map temp = {};
if (xuantaiData[xuantaiSelIndex].tableList !=
null &&
xuantaiData[xuantaiSelIndex]
.tableList
.length >
0) {
temp =
await NavigatorUtil.goSelectTableFPage(
context, '', ddate, ddateSolt,
canChoose: true,
hmS: xuantaiData[xuantaiSelIndex]
.startDate,
hmE: xuantaiData[xuantaiSelIndex]
.endDate,
source: '1',
ridFeast:
xuantaiData[xuantaiSelIndex]
.rid,
object: {
'object': xuantaiData[xuantaiSelIndex]
.tableList
});
} else {
if (xuantaiData[xuantaiSelIndex]
.dateTimeShowxt ==
'请选择') {
Utils.showToast('请选择宴会日期');
return;
}
//带餐
int ddate = xuantaiData[xuantaiSelIndex]
.dateTimext
.millisecondsSinceEpoch;
String ddateSolt = dsoltList[
xuantaiData[xuantaiSelIndex]
.cdSelIndex]
.id;
temp =
await NavigatorUtil.goSelectTableFPage(
context,
'',
ddate,
ddateSolt,
hmS: xuantaiData[xuantaiSelIndex]
.startDate,
hmE: xuantaiData[xuantaiSelIndex].endDate,
source: '1',
ridFeast:
xuantaiData[xuantaiSelIndex].rid,
canChoose: true,
);
}
Map temp = {};
if (xuantaiData[xuantaiSelIndex]
.tableList !=
null &&
xuantaiData[xuantaiSelIndex]
.tableList
.length >
0) {
temp = await NavigatorUtil
.goSelectTableFPage(
context, '', ddate, ddateSolt,
canChoose: true,
object: {
'object':
xuantaiData[xuantaiSelIndex]
.tableList
});
} else {
temp = await NavigatorUtil
.goSelectTableFPage(
context,
'',
ddate,
ddateSolt,
canChoose: true,
);
}
if (temp == null) {
} else if (temp['object'].length == 0) {
print('----------');
xuantaiData[xuantaiSelIndex].tableList = [];
xuantaiData[xuantaiSelIndex].tids = [];
xuantaiData[xuantaiSelIndex].tableSum = 0;
if (temp == null) {
} else if (temp['object'].length == 0) {
} else {
xuantaiData[xuantaiSelIndex].tids = [];
xuantaiData[xuantaiSelIndex].tableList =
temp['object'];
for (t.TableList item
in xuantaiData[xuantaiSelIndex]
.tableList) {
item.selected = true;
Tids tids = Tids();
tids.tid = item.id;
tids.name = item.name ?? "";
xuantaiData[xuantaiSelIndex]
.tids
.add(tids);
setState(() {});
} else {
// xuantaiData[xuantaiSelIndex].tids = [];
xuantaiData[xuantaiSelIndex].tableList =
temp['object'];
xuantaiData[xuantaiSelIndex].tableSum = 0;
List<Tids> tidsTemp = [];
for (t.TableList item
in xuantaiData[xuantaiSelIndex]
.tableList) {
item.selected = true;
Tids tids = Tids();
tids.tid = item.id;
tids.name = item.name ?? "";
List<Tids> temp =
xuantaiData[xuantaiSelIndex]
.tids
.where((element) =>
element.tid == tids.tid)
.toList();
if (temp != null && temp.length > 0) {
tids.numStr = temp[0].tableNumC.text;
tids.tableNumC.text = temp[0].numStr;
}
setState(() {});
tidsTemp.add(tids);
}
xuantaiData[xuantaiSelIndex].tids =
tidsTemp;
xuantaiData[xuantaiSelIndex]
.tids
.forEach((element) {
xuantaiData[xuantaiSelIndex].tableSum +=
int.parse(element.numStr == '' ||
element.numStr == null
? '0'
: element.numStr);
});
setState(() {});
}
// }
},
),
VEmptyView(52),
... ... @@ -3224,7 +3685,10 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
total = sum + double.parse(costInfoModel.serviceC.text);
} else {
//选中百分比
if (int.parse(costInfoModel.serviceC.text) > 100) {
if (int.parse(costInfoModel.serviceC.text == ''
? '0'
: costInfoModel.serviceC.text) >
100) {
Utils.showToast('请输入小于100的数字');
return;
... ... @@ -3251,7 +3715,10 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
total -= double.parse(costInfoModel.discountC.text);
} else {
//选中百分比
if (int.parse(costInfoModel.discountC.text) > 100) {
if (int.parse(costInfoModel.discountC.text == ''
? '0'
: costInfoModel.discountC.text) >
100) {
Utils.showToast('请输入小于100的数字');
return;
... ... @@ -4646,6 +5113,8 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
userModel = Provider.of<UserModel>(context, listen: false);
_uploadImageProvider =
Provider.of<UploadImageProvider>(context, listen: true);
_chooseTableModel = Provider.of<ChooseTableModel>(context, listen: false);
return KeyboardDismissOnTap(
child: Scaffold(
backgroundColor: MyColours.color_ffffff,
... ...
... ... @@ -87,7 +87,7 @@ class _MessageHasOrderFoodPageState extends State<MessageHasOrderFoodPage> {
sumMemberPrice += double.parse(
element.specMemberPrice == '0' || element.specMemberPrice == null
? element.specPrice == null
? 0
? '0'
: element.specPrice
: element.specMemberPrice);
});
... ... @@ -499,8 +499,7 @@ class _MessageHasOrderFoodPageState extends State<MessageHasOrderFoodPage> {
Utils.goShareOrderFoodToWeChat(context,
rid: widget.rid,
title: '菜品已点好,快来看看都点了什么~',
oid: _orderFoodProvider
.createdOrderSunModel.id,
oid: _orderFoodProvider.createdOrderSunModel.id,
img:
'http://nosqn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911151148571.jpg');
},
... ...
... ... @@ -671,27 +671,27 @@ class TableManagerModel with ChangeNotifier {
String hmsS = ''; //起始
String hmsE = ''; //结束
String keys = '';
// if (currTimeIndex == 1) {
// //早市
// keys = 'morning';
// } else if (currTimeIndex == 2) {
// //午市
// keys = 'noon';
// } else if (currTimeIndex == 3) {
// //晚市
// keys = 'night';
// }
if (currTimeIndex == 1) {
//早市
keys = 'morning';
} else if (currTimeIndex == 2) {
//午市
keys = 'noon';
} else if (currTimeIndex == 3) {
//晚市
keys = 'night';
}
// if (keys != '') {
// List temp = dailyMap[keys];
// hmsS = " ${temp.first}:00";
// hmsE = " ${temp.last}:59";
// } else {
// hmsS = " 00:00:00";
// hmsE = " 23:59:59";
// }
hmsS = " 00:00:00";
hmsE = " 23:59:59";
if (keys != '') {
List temp = dailyMap[keys];
hmsS = " ${temp.first}:00";
hmsE = " ${temp.last}:59";
} else {
hmsS = " 00:00:00";
hmsE = " 23:59:59";
}
// hmsS = " 00:00:00";
// hmsE = " 23:59:59";
UserModel userModel = Provider.of<UserModel>(context, listen: false);
String timeStrStart = dateTime.year.toString() +
... ... @@ -716,7 +716,7 @@ class TableManagerModel with ChangeNotifier {
'sid': userModel.user.sellerid,
'rdate': '${start}',
'edate': '${end}',
'ddate_interval': currTimeIndex.toString()
// 'ddate_interval': currTimeIndex.toString()
};
return await Future.wait<bool>([
_getOldReserve(context, params, showloading, selfDismiss: selfDismiss),
... ... @@ -788,28 +788,61 @@ class TableManagerModel with ChangeNotifier {
});
});
// banquetByDateData.map((e) => null)
String banquetKey = '';
if (currTimeIndex == 1) {
banquetKey = '早餐';
} else if (currTimeIndex == 2) {
banquetKey = '午餐';
} else if (currTimeIndex == 3) {
banquetKey = '晚餐';
}
// String banquetKey = '';
// if (currTimeIndex == 1) {
// banquetKey = '早餐';
// } else if (currTimeIndex == 2) {
// banquetKey = '午餐';
// } else if (currTimeIndex == 3) {
// banquetKey = '晚餐';
// }
Map<String, List<FeastBoardSunModel>> banquetData = {};
banquetByDateDataTemp.forEach((element) {
FeastBoardSunModel feastBoardSunModel = element.data[banquetKey][0];
if (feastBoardSunModel.lost == null || feastBoardSunModel.lost == '') {
List<FeastBoardSunModel> data = [];
if (element.data['其他'].length > 0) {
FeastBoardSunModel feastBoardSunModel = element.data['其他'][0];
if (feastBoardSunModel.lost == null ||
feastBoardSunModel.lost == '') {
data.add(feastBoardSunModel); //未丢单宴会合集
}
}
if (element.data['早餐'].length > 0) {
FeastBoardSunModel feastBoardSunModel = element.data['早餐'][0];
if (feastBoardSunModel.lost == null ||
feastBoardSunModel.lost == '') {
data.add(feastBoardSunModel); //未丢单宴会合集
}
}
if (element.data['午餐'].length > 0) {
FeastBoardSunModel feastBoardSunModel = element.data['午餐'][0];
if (feastBoardSunModel.lost == null ||
feastBoardSunModel.lost == '') {
data.add(feastBoardSunModel); //未丢单宴会合集
}
}
if (element.data['晚餐'].length > 0) {
FeastBoardSunModel feastBoardSunModel = element.data['晚餐'][0];
if (feastBoardSunModel.lost == null ||
feastBoardSunModel.lost == '') {
data.add(feastBoardSunModel); //未丢单宴会合集
}
}
banquetData[element.title] = data;
});
banquetData.forEach((key, value) {
value.forEach((element) {
//未丢单的宴会
Notebook notebook = Notebook();
notebook.tid = element.title;
notebook.tid = key;
notebook.status = '10'; //宴会类型
notebook.className = feastBoardSunModel.className;
notebook.id = feastBoardSunModel.rid;
notebook.rname = feastBoardSunModel.rname;
notebook.nick_name =
feastBoardSunModel.nickName ?? feastBoardSunModel.account;
notebook.className = element.className;
notebook.id = element.rid;
notebook.rname = element.rname;
notebook.nick_name = element.nickName ?? element.account;
noteBooks.add(notebook);
}
});
});
// List<Notebook> noteBooks =
... ...
... ... @@ -140,14 +140,18 @@ class NavigatorUtil {
{bool canChoose = false,
Map object,
String fromPage = 'change',
String tid = ''}) {
String hmS,
String hmE,
String source,
String tid = '',
String ridFeast}) {
if (object != null) {
return _navigateTo(context,
"${Routes.select_table_f}?rid=$rid&tid=$tid&dateTime=$dateTime&fromPage=$fromPage&ddate_slot=$ddate_slot&canChoose=$canChoose&object=${FluroConvertUtils.object2string(object)}");
"${Routes.select_table_f}?rid=$rid&ridFeast=$ridFeast&tid=$tid&dateTime=$dateTime&fromPage=$fromPage&ddate_slot=$ddate_slot&canChoose=$canChoose&object=${FluroConvertUtils.object2string(object)}&hmS=$hmS&hmE=$hmE&source=$source");
}
// object = {'object': [], "tid": ''};
return _navigateTo(context,
"${Routes.select_table_f}?rid=$rid&tid=$tid&dateTime=$dateTime&fromPage=$fromPage&ddate_slot=$ddate_slot&canChoose=$canChoose");
"${Routes.select_table_f}?rid=$rid&ridFeast=$ridFeast&tid=$tid&dateTime=$dateTime&fromPage=$fromPage&ddate_slot=$ddate_slot&canChoose=$canChoose&hmS=$hmS&hmE=$hmE&source=$source");
}
/// 邀请函
... ...
... ... @@ -374,9 +374,13 @@ var handleSelectTableFHandler = new Handler(
String tid = params['tid'].first;
DateTime dateTime =
DateTime.fromMillisecondsSinceEpoch(int.parse(params["dateTime"].first));
String ddate_slot = params["ddate_slot"].first;
String ddateSlot = params["ddate_slot"].first;
String source = params["source"].first;
String fromPage = params["fromPage"].first;
bool canChoose = params["canChoose"].first == "true" ? true : false;
String hmS = params["hmS"].first;
String hmE = params["hmE"].first;
List<TableList> res = [];
if (params.keys.contains('object')) {
Map object = FluroConvertUtils.string2map(params["object"].first);
... ... @@ -387,11 +391,20 @@ var handleSelectTableFHandler = new Handler(
}
}
String ridFeast = params["ridFeast"].first;
// return SelectTablePage(rid, dateTime, ddate_slot,canChoose: canChoose);
return ChangeNotifierProvider<ChooseTableModel>(
create: (_) => ChooseTableModel(),
child: SelectTableFPage(rid, dateTime, ddate_slot,
canChoose: canChoose, tableList: res, fromPage: fromPage, tid: tid));
child: SelectTableFPage(rid, dateTime, ddateSlot,
canChoose: canChoose,
tableList: res,
fromPage: fromPage,
tid: tid,
hmS: hmS,
hmE: hmE,
source: source,
ridFeast: ridFeast));
});
// 跳转到照片管理的选择桌位_方硕新修改的页面
... ... @@ -1535,12 +1548,17 @@ var feastCreatePageHandle = new Handler(
String rid = params["rid"].first;
return ChangeNotifierProvider<FeastModel>(
create: (_) => FeastModel(),
child: FeastCreatePage(
banquetDetail: banquetDetail, isCreate: isCreate, rid: rid));
child: ChangeNotifierProvider<ChooseTableModel>(
create: (_) => ChooseTableModel(),
child: FeastCreatePage(
banquetDetail: banquetDetail, isCreate: isCreate, rid: rid)));
}
return ChangeNotifierProvider<FeastModel>(
create: (_) => FeastModel(),
child: FeastCreatePage(banquetDetail: banquetDetail, isCreate: isCreate));
child: ChangeNotifierProvider<ChooseTableModel>(
create: (_) => ChooseTableModel(),
child: FeastCreatePage(
banquetDetail: banquetDetail, isCreate: isCreate)));
});
///宴会----添加定金
... ...
... ... @@ -63,6 +63,7 @@ class DialogUtil {
backgroundColor: Colors.transparent,
isDismissible: true,
builder: (BuildContext context) {
return Scaffold(
resizeToAvoidBottomInset: false,
body: Column(mainAxisSize: MainAxisSize.min, children: [
... ... @@ -154,6 +155,77 @@ class DialogUtil {
),
)
]));
// return Container(
// // height: ScreenUtil().setWidth(180 * 2),
// decoration: BoxDecoration(
// color: MyColours.color_DBDBDB,
// // borderRadius: BorderRadius.only(
// // topLeft: Radius.circular(ScreenUtil().setWidth(24)),
// // topRight: Radius.circular(ScreenUtil().setWidth(24)))
// ),
// child: Row(
// children: <Widget>[
// InkWell(
// onTap: lCallback,
// child: Container(
// width: double.infinity,
// height: ScreenUtil().setWidth(58 * 2),
// child: Center(
// child: Text(
// '拍摄',
// style: TextStyle(
// fontSize: ScreenUtil().setSp(32),
// color: MyColours.color_353535,
// fontWeight: FontWeight.bold),
// ),
// )),
// ),
// MyDivider(
// double.infinity,
// ScreenUtil().setWidth(2),
// color: MyColours.color_EEEEEE,
// ),
// InkWell(
// onTap: rCallback,
// child: Container(
// width: double.infinity,
// height: ScreenUtil().setWidth(58 * 2),
// child: Center(
// child: Text(
// '从相册选择',
// style: TextStyle(
// fontSize: ScreenUtil().setSp(32),
// color: MyColours.color_353535,
// fontWeight: FontWeight.bold),
// ),
// )),
// ),
// MyDivider(
// double.infinity,
// ScreenUtil().setWidth(10),
// color: MyColours.color_EEEEEE,
// ),
// InkWell(
// onTap: () {
// Navigator.pop(context, '取消');
// },
// child: Container(
// width: double.infinity,
// height: ScreenUtil().setWidth(58 * 2),
// child: Center(
// child: Text(
// '取消',
// style: TextStyle(
// fontSize: ScreenUtil().setSp(32),
// color: MyColours.color_353535,
// fontWeight: FontWeight.bold),
// ),
// )))
// ],
// ),
// );
});
}
... ... @@ -5944,6 +6016,85 @@ class DialogUtil {
});
}
static showPickerDurationSelect(BuildContext context) async {
final range = <DateTime>[
DateTime(0, 1, 1, 8, 30),
DateTime(0, 1, 1, 14, 30)
];
final p1 = Picker(
adapter: DateTimePickerAdapter(
customColumnType: [6, 7, 4],
value: range[0],
),
delimiter: [
PickerDelimiter(
column: 0,
child: Container(
alignment: Alignment.center,
width: 100,
padding: EdgeInsets.fromLTRB(12, 0, 8, 0),
child: Text('Start',
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.red,
fontSize: 14)),
color: Colors.white,
)),
],
onSelect: (Picker picker, int index, List<int> selected) {
range[0] = (picker.adapter as DateTimePickerAdapter).value;
},
onConfirmBefore: (picker, selected) async {
if (range[0] == null) {
// showMsg("Please select the start time.");
return false;
}
if (range[1] == null) {
// showMsg("Please select the end time.");
return false;
}
return true;
},
onConfirm: (picker, selected) {
// showMsg(
// "Start: ${range[0].toString()}, End: ${range[1].toString()}, ${picker.adapter}");
});
final p2 = Picker(
adapter: DateTimePickerAdapter(
customColumnType: [6, 7, 4],
value: range[1],
),
hideHeader: true,
delimiter: [
PickerDelimiter(
column: 0,
child: Container(
alignment: Alignment.center,
padding: EdgeInsets.fromLTRB(12, 0, 8, 0),
width: 100,
child: Text('End',
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.red,
fontSize: 14)),
color: Colors.white,
)),
],
onSelect: (Picker picker, int index, List<int> selected) {
range[1] = (picker.adapter as DateTimePickerAdapter).value;
});
await showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
isDismissible: false,
builder: (BuildContext context) {
return Column(
mainAxisSize: MainAxisSize.min,
children: [p1.makePicker(), p2.makePicker()],
);
});
}
//显示选择客户经理弹框
static Future<List<int>> showSelectCusmanDialogNeedCustomHeader(
BuildContext context, List<dynamic> data, ValueChanged valueChanged,
... ... @@ -5953,6 +6104,8 @@ class DialogUtil {
VoidCallback onCancel,
String cancelText = '取消'}) {
return Picker(
// changeToFirst: true,
looping: true,
selecteds: selecteds,
adapter: PickerDataAdapter<String>(pickerdata: data),
height: ScreenUtil().setWidth(480),
... ... @@ -6029,6 +6182,15 @@ class DialogUtil {
width: ScreenUtil().setWidth(2),
color: MyColours.color_E7E7E7))),
),
onSelect: (Picker picker, int index, List<int> selecteds) {
print(selecteds);
print(index);
print(picker);
// picker.selecteds = [selecteds[0],selecteds[0]];
// this.setState(() {
// // stateText = picker.adapter.toString();
// });
},
onCancel: onCancel,
onConfirm: (Picker picker, List value) {
print(value.toString());
... ... @@ -7083,7 +7245,9 @@ class DialogUtil {
color: MyColours.color_E6000000)),
onPressed: () {
Navigator.of(context).pop();
lCallback();
if (lCallback != null) {
lCallback();
}
},
),
CupertinoDialogAction(
... ...
... ... @@ -165,6 +165,7 @@ class SetTimeWidget {
showFeastTimeSelector(
context, data, start, end, SetTimeCallback setTimeCallback) {
// DialogUtil.showPickerDurationSelect(context);
DialogUtil.showSelectCusmanDialogNeedCustomHeader(context, data, (value) {
setTimeCallback(value);
}, cancelText: '', title: '选择时间', selecteds: [
... ...