|
|
|
import 'package:common_utils/common_utils.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:one_key/res/colors.dart';
|
|
|
|
import 'package:one_key/utils/utils.dart';
|
|
...
|
...
|
@@ -7,8 +8,10 @@ import 'package:one_key/widgets/v_empty_view.dart'; |
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
import '../../../../constant/state.dart';
|
|
|
|
import '../../../../models/day_statics_model.dart';
|
|
|
|
import '../../../../provider/customer_provider.dart';
|
|
|
|
import '../../../../provider/user_model.dart';
|
|
|
|
import '../../../../route/navigator_util.dart';
|
|
|
|
import '../../../../utils/screen_util.dart';
|
|
|
|
import '../../../../widgets/page_exception.dart';
|
|
|
|
|
|
...
|
...
|
@@ -27,20 +30,20 @@ class DayOrderLeftPage extends StatefulWidget { |
|
|
|
_DayOrderLeftPageState createState() => _DayOrderLeftPageState();
|
|
|
|
}
|
|
|
|
|
|
|
|
var data = {
|
|
|
|
"早餐": {
|
|
|
|
'data': ["东城区", "西城区", "朝阳区", "丰台区", "石景山区", "顺义区", "海淀区"],
|
|
|
|
'expansion': true
|
|
|
|
},
|
|
|
|
"午餐": {
|
|
|
|
'data': ["东城区", "西城区", "朝阳区", "丰台区", "石景山区", "顺义区", "海淀区"],
|
|
|
|
'expansion': true
|
|
|
|
},
|
|
|
|
"晚餐": {
|
|
|
|
'data': ["东城区", "西城区", "朝阳区", "丰台区", "石景山区", "顺义区", "海淀区"],
|
|
|
|
'expansion': true
|
|
|
|
},
|
|
|
|
};
|
|
|
|
// var data = {
|
|
|
|
// "早餐": {
|
|
|
|
// 'data': ["东城区", "西城区", "朝阳区", "丰台区", "石景山区", "顺义区", "海淀区"],
|
|
|
|
// 'expansion': true
|
|
|
|
// },
|
|
|
|
// "午餐": {
|
|
|
|
// 'data': ["东城区", "西城区", "朝阳区", "丰台区", "石景山区", "顺义区", "海淀区"],
|
|
|
|
// 'expansion': true
|
|
|
|
// },
|
|
|
|
// "晚餐": {
|
|
|
|
// 'data': ["东城区", "西城区", "朝阳区", "丰台区", "石景山区", "顺义区", "海淀区"],
|
|
|
|
// 'expansion': true
|
|
|
|
// },
|
|
|
|
// };
|
|
|
|
|
|
|
|
class _DayOrderLeftPageState extends State<DayOrderLeftPage> {
|
|
|
|
CustomerProvider customerProvider;
|
|
...
|
...
|
@@ -68,6 +71,8 @@ class _DayOrderLeftPageState extends State<DayOrderLeftPage> { |
|
|
|
isShowLoading: isShowLoading);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
customerProvider = Provider.of<CustomerProvider>(context, listen: true);
|
|
...
|
...
|
@@ -95,25 +100,25 @@ class _DayOrderLeftPageState extends State<DayOrderLeftPage> { |
|
|
|
|
|
|
|
List<Widget> _buildList() {
|
|
|
|
List<Widget> widgets = [];
|
|
|
|
data.keys.forEach((key) {
|
|
|
|
customerProvider.dayStaticsData.daydata.keys.forEach((key) {
|
|
|
|
widgets.add(_item(key));
|
|
|
|
});
|
|
|
|
|
|
|
|
return widgets;
|
|
|
|
}
|
|
|
|
|
|
|
|
Widget _item(String city) {
|
|
|
|
Widget _item(String key) {
|
|
|
|
return ExpansionTile(
|
|
|
|
tilePadding: EdgeInsets.symmetric(horizontal: w(10)),
|
|
|
|
|
|
|
|
// childrenPadding: EdgeInsets.only(bottom: w(10)),
|
|
|
|
|
|
|
|
title: Text(
|
|
|
|
city,
|
|
|
|
key,
|
|
|
|
style: TextStyle(color: MyColours.color_515151, fontSize: font(16)),
|
|
|
|
),
|
|
|
|
trailing: Image.asset(
|
|
|
|
data[city]['expansion']
|
|
|
|
customerProvider.dayStaticsData.daydata[key].expansion
|
|
|
|
? Utils.getImgPath('up')
|
|
|
|
: Utils.getImgPath('down'),
|
|
|
|
width: w(12),
|
|
...
|
...
|
@@ -128,219 +133,258 @@ class _DayOrderLeftPageState extends State<DayOrderLeftPage> { |
|
|
|
|
|
|
|
onExpansionChanged: (value) {
|
|
|
|
print(value);
|
|
|
|
data[city]['expansion'] = value;
|
|
|
|
customerProvider.dayStaticsData.daydata[key].expansion = value;
|
|
|
|
setState(() {});
|
|
|
|
},
|
|
|
|
initiallyExpanded: true,
|
|
|
|
// title:,
|
|
|
|
children: List.from(data[city]['data'])
|
|
|
|
.map((area) => _buildArea(area))
|
|
|
|
children: customerProvider.dayStaticsData.daydata[key].dsoltListModelItem
|
|
|
|
.map((dsoltListModel) => _buildArea(dsoltListModel))
|
|
|
|
.toList(),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
Widget _buildArea(String area) {
|
|
|
|
return Container(
|
|
|
|
// constraints: BoxConstraints(minHeight: w(10)),
|
|
|
|
// padding: EdgeInsets.only(top: w(10), left: w(10), right: w(10)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_f3f3f3,
|
|
|
|
),
|
|
|
|
padding:
|
|
|
|
EdgeInsets.only(top: w(5), bottom: w(5), left: w(10), right: w(10)),
|
|
|
|
Widget _buildArea(DsoltListModel dsoltListModel) {
|
|
|
|
return InkWell(
|
|
|
|
onTap: () {
|
|
|
|
NavigatorUtil.goNotebookDetailPage(
|
|
|
|
context, dsoltListModel.id, dsoltListModel.uid);
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
// constraints: BoxConstraints(minHeight: w(10)),
|
|
|
|
// padding: EdgeInsets.only(top: w(10), left: w(10), right: w(10)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
borderRadius: BorderRadius.circular(r(8))),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: Container(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
// color: Colors.red,
|
|
|
|
border: Border(
|
|
|
|
right: BorderSide(
|
|
|
|
color: MyColours.color_f3f3f3, width: w(1)))),
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
// height: w(34),
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: w(10), vertical: w(10)),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment:
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'包间1',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: font(14),
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
'张先生',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: font(14),
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
'186****6909',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: font(14),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
MyDivider(
|
|
|
|
double.infinity,
|
|
|
|
w(1),
|
|
|
|
color: MyColours.color_f3f3f3,
|
|
|
|
),
|
|
|
|
VEmptyView(10),
|
|
|
|
Container(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: w(10)),
|
|
|
|
child: Wrap(
|
|
|
|
runSpacing: w(6),
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'李霞订',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: font(10),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
HEmptyView(10),
|
|
|
|
MyDivider(
|
|
|
|
w(1),
|
|
|
|
w(15),
|
|
|
|
color: MyColours.color_DBDBDB,
|
|
|
|
),
|
|
|
|
HEmptyView(10),
|
|
|
|
Text(
|
|
|
|
'2023-11-05 12:23:34',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: font(10),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
VEmptyView(10),
|
|
|
|
widget.index == 1
|
|
|
|
? Padding(
|
|
|
|
padding:
|
|
|
|
EdgeInsets.symmetric(horizontal: w(10)),
|
|
|
|
child: Text(
|
|
|
|
'6人',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: font(10),
|
|
|
|
),
|
|
|
|
))
|
|
|
|
: Padding(
|
|
|
|
padding:
|
|
|
|
EdgeInsets.symmetric(horizontal: w(10)),
|
|
|
|
child: Wrap(
|
|
|
|
runSpacing: w(6),
|
|
|
|
// constraints: BoxConstraints(minHeight: w(10)),
|
|
|
|
// padding: EdgeInsets.only(top: w(10), left: w(10), right: w(10)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_f3f3f3,
|
|
|
|
),
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
top: w(5), bottom: w(5), left: w(10), right: w(10)),
|
|
|
|
child: Container(
|
|
|
|
// constraints: BoxConstraints(minHeight: w(10)),
|
|
|
|
// padding: EdgeInsets.only(top: w(10), left: w(10), right: w(10)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
borderRadius: BorderRadius.circular(r(8))),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: Container(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
// color: Colors.red,
|
|
|
|
border: Border(
|
|
|
|
right: BorderSide(
|
|
|
|
color: MyColours.color_f3f3f3,
|
|
|
|
width: w(1)))),
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
// height: w(34),
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: w(10), vertical: w(10)),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment:
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'6人',
|
|
|
|
Expanded(
|
|
|
|
child: Text(
|
|
|
|
'${dsoltListModel.tableinfoName}',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: font(10),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
HEmptyView(10),
|
|
|
|
MyDivider(
|
|
|
|
w(1),
|
|
|
|
w(15),
|
|
|
|
color: MyColours.color_DBDBDB,
|
|
|
|
),
|
|
|
|
HEmptyView(10),
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: font(14),
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
)),
|
|
|
|
HEmptyView(44),
|
|
|
|
Text(
|
|
|
|
'消费 25800.99元',
|
|
|
|
'${dsoltListModel.rnameStr}',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: font(10),
|
|
|
|
),
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: font(14),
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
),
|
|
|
|
HEmptyView(10),
|
|
|
|
MyDivider(
|
|
|
|
w(1),
|
|
|
|
w(15),
|
|
|
|
color: MyColours.color_DBDBDB,
|
|
|
|
),
|
|
|
|
HEmptyView(10),
|
|
|
|
HEmptyView(44),
|
|
|
|
Text(
|
|
|
|
'人均 103.2元',
|
|
|
|
Utils.starPhone(dsoltListModel.phone),
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: font(10),
|
|
|
|
fontSize: font(14),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
HEmptyView(10),
|
|
|
|
MyDivider(
|
|
|
|
w(1),
|
|
|
|
w(15),
|
|
|
|
color: MyColours.color_DBDBDB,
|
|
|
|
),
|
|
|
|
HEmptyView(10),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
MyDivider(
|
|
|
|
double.infinity,
|
|
|
|
w(1),
|
|
|
|
color: MyColours.color_f3f3f3,
|
|
|
|
),
|
|
|
|
VEmptyView(10),
|
|
|
|
Container(
|
|
|
|
padding:
|
|
|
|
EdgeInsets.symmetric(horizontal: w(10)),
|
|
|
|
child: Wrap(
|
|
|
|
runSpacing: w(6),
|
|
|
|
children: [
|
|
|
|
if (dsoltListModel.nickName != null &&
|
|
|
|
dsoltListModel.nickName != '')
|
|
|
|
Row(
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
dsoltListModel.nickName ==
|
|
|
|
null ||
|
|
|
|
dsoltListModel
|
|
|
|
.nickName ==
|
|
|
|
''
|
|
|
|
? ''
|
|
|
|
: '${dsoltListModel.nickName}订',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: font(10),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
HEmptyView(10),
|
|
|
|
MyDivider(
|
|
|
|
w(1),
|
|
|
|
w(15),
|
|
|
|
color: MyColours.color_DBDBDB,
|
|
|
|
),
|
|
|
|
HEmptyView(10),
|
|
|
|
]),
|
|
|
|
Text(
|
|
|
|
'存酒',
|
|
|
|
dsoltListModel.ddateStr,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: font(10),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
HEmptyView(10),
|
|
|
|
MyDivider(
|
|
|
|
w(1),
|
|
|
|
w(15),
|
|
|
|
color: MyColours.color_DBDBDB,
|
|
|
|
),
|
|
|
|
HEmptyView(10),
|
|
|
|
Text(
|
|
|
|
'提前点餐',
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
VEmptyView(10),
|
|
|
|
widget.index == 1
|
|
|
|
? Padding(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: w(10)),
|
|
|
|
child: Text(
|
|
|
|
'${dsoltListModel.pnum ?? '0'}人',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: font(10),
|
|
|
|
),
|
|
|
|
))
|
|
|
|
: Padding(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: w(10)),
|
|
|
|
child: Wrap(
|
|
|
|
runSpacing: w(6),
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'${dsoltListModel.pnum ?? '0'}人',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: font(10),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
HEmptyView(10),
|
|
|
|
MyDivider(
|
|
|
|
w(1),
|
|
|
|
w(15),
|
|
|
|
color: MyColours.color_DBDBDB,
|
|
|
|
),
|
|
|
|
HEmptyView(10),
|
|
|
|
Text(
|
|
|
|
'消费 ${dsoltListModel.conAmount ?? 0}元',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: font(10),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
HEmptyView(10),
|
|
|
|
MyDivider(
|
|
|
|
w(1),
|
|
|
|
w(15),
|
|
|
|
color: MyColours.color_DBDBDB,
|
|
|
|
),
|
|
|
|
HEmptyView(10),
|
|
|
|
Text(
|
|
|
|
'人均 ${dsoltListModel.avgPrice ?? 0}元',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: font(10),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
HEmptyView(10),
|
|
|
|
if (dsoltListModel.isStoreWine
|
|
|
|
.toString() ==
|
|
|
|
'1')
|
|
|
|
Row(children: [
|
|
|
|
MyDivider(
|
|
|
|
w(1),
|
|
|
|
w(15),
|
|
|
|
color: MyColours.color_DBDBDB,
|
|
|
|
),
|
|
|
|
HEmptyView(10),
|
|
|
|
Text(
|
|
|
|
'存酒',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: font(10),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
HEmptyView(10),
|
|
|
|
]),
|
|
|
|
if (dsoltListModel.isOrder
|
|
|
|
.toString() ==
|
|
|
|
'1')
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
MyDivider(
|
|
|
|
w(1),
|
|
|
|
w(15),
|
|
|
|
color: MyColours.color_DBDBDB,
|
|
|
|
),
|
|
|
|
HEmptyView(10),
|
|
|
|
Text(
|
|
|
|
'提前点餐',
|
|
|
|
style: TextStyle(
|
|
|
|
color:
|
|
|
|
MyColours.color_999999,
|
|
|
|
fontSize: font(10),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
)
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
VEmptyView(10),
|
|
|
|
if (dsoltListModel.cusdem != 'null' &&
|
|
|
|
dsoltListModel.cusdem != null &&
|
|
|
|
dsoltListModel.cusdem != '')
|
|
|
|
Padding(
|
|
|
|
padding:
|
|
|
|
EdgeInsets.symmetric(horizontal: w(10)),
|
|
|
|
child: Text(
|
|
|
|
'备注:${dsoltListModel.cusdem}',
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
maxLines: 10,
|
|
|
|
style: TextStyle(
|
|
|
|
height: 1.2,
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: font(10),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
VEmptyView(10),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: w(10)),
|
|
|
|
child: Text(
|
|
|
|
'备注:生日女35岁 蛋糕布置备注:生日女35岁 蛋糕布置备注:生日女35岁 蛋糕布置备注:生日女35岁 蛋糕布置',
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
maxLines: 10,
|
|
|
|
style: TextStyle(
|
|
|
|
height: 1.2,
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: font(10),
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
VEmptyView(10),
|
|
|
|
],
|
|
|
|
))),
|
|
|
|
Container(
|
|
|
|
width: w(70),
|
|
|
|
padding: EdgeInsets.zero,
|
|
|
|
child: Image.asset(
|
|
|
|
Utils.getImgPath('arrow_right_new'),
|
|
|
|
width: w(12),
|
|
|
|
height: w(12),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
));
|
|
|
|
)),
|
|
|
|
VEmptyView(10),
|
|
|
|
],
|
|
|
|
))),
|
|
|
|
Container(
|
|
|
|
width: w(70),
|
|
|
|
padding: EdgeInsets.zero,
|
|
|
|
child: Image.asset(
|
|
|
|
Utils.getImgPath('arrow_right_new'),
|
|
|
|
width: w(12),
|
|
|
|
height: w(12),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)));
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|