Commit 44762f62d798e17d0aff883c3e92a46c2e52f6ab

Authored by “gaiyaguang”
1 parent c2e69018

选中状态处理

... ... @@ -411,11 +411,16 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> {
widget.detailEntity.ddate_solt,
canChoose: true,
object: {'object': _notebookDetailChangeModel.tableList});
if (temp['tid'] != null) {
setReserveStatus("5", tid: temp['tid']);
}
// if (temp['tid'] != null) {
// setReserveStatus("5", tid: temp['tid']);
// }
_notebookDetailChangeModel.tableList = temp['object'];
_notebookDetailChangeModel.notifyListeners();
for (t.TableList item
in _notebookDetailChangeModel.tableList) {
item.selected = true;
}
setState(() {});
// _notebookDetailChangeModel.notifyListeners();
},
child: Row(
children: [
... ...
... ... @@ -51,7 +51,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
Manager manager = Manager();
List cancelReasonList = [];
bool isShowTF = false;
int paddingBottom = 174;
int paddingBottom;
int paddingTop = 138;
FocusNode _cancelNode = FocusNode();
TextEditingController _cancelController = TextEditingController();
... ... @@ -100,7 +100,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
/// 初始化取消原因数据
_initCancel() {
isShowTF = false;
paddingBottom = 174;
paddingBottom = ScreenUtil.screenHeightDp.ceil() - 138 - 340;
cancelReasonList = [
{'title': '顾客取消', 'select': false},
{'title': '顾客行程有变', 'select': false},
... ... @@ -197,27 +197,35 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
children: [
Stack(
children: [
Center(
child: Text(
'请选择取消原因',
style: TextStyle(
fontSize: ScreenUtil().setSp(34),
fontWeight: FontWeight.bold,
decoration: TextDecoration.none,
color: MyColours.color_353535),
Container(
height: ScreenUtil().setWidth(48),
child: Center(
child: Text(
'请选择取消原因',
style: TextStyle(
fontSize: ScreenUtil().setSp(34),
fontWeight: FontWeight.bold,
decoration: TextDecoration.none,
color: MyColours.color_353535),
),
),
),
Positioned(
top: ScreenUtil().setWidth(8),
right: ScreenUtil().setWidth(0),
child: GestureDetector(
onTap: () {
_initCancel();
Navigator.of(context).pop();
},
child: Image.asset('assets/close.png',
width: ScreenUtil().setWidth(32)),
))
onTap: () {
_initCancel();
Navigator.of(context).pop();
},
child: Container(
padding: EdgeInsets.only(left: 20),
child: Image.asset(
'assets/close.png',
width: ScreenUtil().setWidth(32),
height: ScreenUtil().setWidth(32),
),
)))
],
),
VEmptyView(60),
... ... @@ -228,12 +236,20 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
for (var item in cancelReasonList) {
item['select'] = false;
isShowTF = false;
paddingBottom = 174;
paddingBottom =
ScreenUtil.screenHeightDp.ceil() -
138 -
340;
if (item['title'] == value['title']) {
item['select'] = true;
if (item['title'] == '其他原因') {
isShowTF = true;
paddingBottom = 130;
// paddingBottom = 130;
paddingBottom =
ScreenUtil.screenHeightDp.ceil() -
138 -
340 -
46;
}
}
}
... ... @@ -321,6 +337,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
}
Navigator.of(context).pop();
Loading.showLoading(context);
setReserveStatus('4', desc: desc);
},
text: '确认',
... ...
... ... @@ -262,14 +262,32 @@ class SelectTablePageState extends State<SelectTablePage> {
fontSize: 34,
state: 1,
onPress: () {
if (selectTables.length > 0) {
String tid = "";
for (t.Table table in selectTables) {
tid += table.id + ",";
if (widget.canChoose) {
if (widget.tableList.length > 0) {
String tid = "";
for (TableList table in widget.tableList) {
tid += table.id + ",";
}
if (widget.tableList.length > 0) {
tid = tid.substring(0, tid.length - 1);
}
Map temp = {'object': widget.tableList, 'tid': tid};
Navigator.of(context).pop(temp);
}
} else {
if (selectTables.length > 0) {
String tid = "";
for (t.Table table in selectTables) {
tid += table.id + ",";
}
if (selectTables.length > 0) {
tid = tid.substring(0, tid.length - 1);
}
Map temp = {'object': widget.tableList, 'tid': tid};
Navigator.of(context).pop(temp);
}
tid = tid.substring(0, tid.length - 1);
Map temp = {'object': widget.tableList, 'tid': tid};
Navigator.of(context).pop(temp);
}
},
))
... ... @@ -279,7 +297,8 @@ class SelectTablePageState extends State<SelectTablePage> {
}
tableToTableList(t.Table table) {
TableList _tableList;
TableList _tableList = TableList(
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '');
_tableList.id = table.id;
_tableList.rid = table.rid;
_tableList.tid = table.tid;
... ... @@ -295,7 +314,8 @@ class SelectTablePageState extends State<SelectTablePage> {
_tableList.spell = table.spell;
_tableList.cdate = null;
_tableList.rname = table.rname;
_tableList.regionName = null;
_tableList.regionName = table.rname;
_tableList.selected = true;
return _tableList;
}
}
... ...
... ... @@ -433,9 +433,9 @@ class NotebookDetailChangeModel with ChangeNotifier {
int ddate = DateUtil.getDateMsByTimeStr(timeStr);
String tableSelectInfo = '';
for (TableList item in tableList) {
if (item.selected) {
tableSelectInfo += ',${item.id}';
}
// if (item.selected) {
tableSelectInfo += ',${item.id}';
// }
}
print(tableSelectInfo);
if (tableSelectInfo.startsWith(',')) {
... ...