|
...
|
...
|
@@ -6,10 +6,10 @@ import 'package:one_key/utils/dialog_util.dart'; |
|
|
|
import 'package:one_key/utils/utils.dart';
|
|
|
|
import 'package:one_key/widgets/h_empty_view.dart';
|
|
|
|
import 'package:one_key/widgets/system_app_bar.dart';
|
|
|
|
import 'package:video_compress/video_compress.dart';
|
|
|
|
|
|
|
|
typedef ClickCallback = void Function(String value);
|
|
|
|
enum TimeType { TimeTypeStart, TimeTypeEnd, TimeTypeDefalt }
|
|
|
|
enum TableItemType { TableItemTypeHeader, TableItemTypeBody }
|
|
|
|
|
|
|
|
class StatisticsPage extends StatefulWidget {
|
|
|
|
StatisticsPage({Key key}) : super(key: key);
|
|
...
|
...
|
@@ -24,15 +24,23 @@ class _StatisticsPageState extends State<StatisticsPage> { |
|
|
|
DateTime datetimeS; //开始时间
|
|
|
|
DateTime datetimeE; //结束时间
|
|
|
|
DateTime dateNow; //当前日期
|
|
|
|
bool showWidget = false;
|
|
|
|
bool showWidget = true;
|
|
|
|
List<String> selectList;
|
|
|
|
int currentIndex = 0;
|
|
|
|
TextEditingController controller = TextEditingController();
|
|
|
|
StaticsModel tableHeaderModel;
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
|
|
|
|
tableHeaderModel = StaticsModel();
|
|
|
|
tableHeaderModel.select = true;
|
|
|
|
tableHeaderModel.numstr = '序号';
|
|
|
|
tableHeaderModel.name = '顾客姓名';
|
|
|
|
tableHeaderModel.phone = '电话';
|
|
|
|
tableHeaderModel.count = '预订次数';
|
|
|
|
|
|
|
|
datetimeS = DateTime.now();
|
|
|
|
datetimeE = datetimeS.add(Duration(days: 1));
|
|
|
|
// dateS = DateUtil.formatDate(datetimeS, format: DateFormats.y_mo_d);
|
|
...
|
...
|
@@ -306,8 +314,112 @@ class _StatisticsPageState extends State<StatisticsPage> { |
|
|
|
)))
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
//表头
|
|
|
|
_tableItem(tableHeaderModel, 3, TableItemType.TableItemTypeHeader),
|
|
|
|
Expanded(
|
|
|
|
child: ListView.builder(
|
|
|
|
itemCount: 100,
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
StaticsModel tableHeaderModel1 = StaticsModel();
|
|
|
|
tableHeaderModel1.select = true;
|
|
|
|
tableHeaderModel1.numstr = '$index';
|
|
|
|
tableHeaderModel1.name = '某某';
|
|
|
|
tableHeaderModel1.phone = '1879097890';
|
|
|
|
tableHeaderModel1.count = '${index}次';
|
|
|
|
return _tableItem(tableHeaderModel1, index,
|
|
|
|
TableItemType.TableItemTypeBody);
|
|
|
|
}))
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
///表头
|
|
|
|
Widget _tableItem(StaticsModel model, int index, TableItemType type) {
|
|
|
|
return Container(
|
|
|
|
padding: EdgeInsets.only(left: ScreenUtil().setWidth(30)),
|
|
|
|
height: ScreenUtil()
|
|
|
|
.setWidth(type == TableItemType.TableItemTypeBody ? 100 : 80),
|
|
|
|
color: index % 2 == 0 ? MyColours.color_f7fdfd : MyColours.color_fefefe,
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
width: ScreenUtil().setWidth(85 * 2),
|
|
|
|
height: double.infinity,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border(
|
|
|
|
right: BorderSide(
|
|
|
|
width: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_f5f5f5))),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath(model.select ? 'select' : 'unselect'),
|
|
|
|
width: ScreenUtil().setWidth(34),
|
|
|
|
height: ScreenUtil().setWidth(34),
|
|
|
|
),
|
|
|
|
// HEmptyView(20),
|
|
|
|
Expanded(
|
|
|
|
child: Text(
|
|
|
|
model.numstr,
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
color: MyColours.color_333333),
|
|
|
|
)),
|
|
|
|
HEmptyView(30),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
width: ScreenUtil().setWidth(87 * 2),
|
|
|
|
height: double.infinity,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border(
|
|
|
|
right: BorderSide(
|
|
|
|
width: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_f5f5f5))),
|
|
|
|
child: Text(
|
|
|
|
model.name,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
color: MyColours.color_333333),
|
|
|
|
)),
|
|
|
|
Container(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
width: ScreenUtil().setWidth(116 * 2),
|
|
|
|
height: double.infinity,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border(
|
|
|
|
right: BorderSide(
|
|
|
|
width: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_f5f5f5))),
|
|
|
|
child: Text(
|
|
|
|
model.phone,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
color: MyColours.color_333333),
|
|
|
|
)),
|
|
|
|
Expanded(
|
|
|
|
child: Center(
|
|
|
|
child: Text(
|
|
|
|
model.count,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
color: MyColours.color_333333),
|
|
|
|
),
|
|
|
|
))
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class StaticsModel extends Object {
|
|
|
|
bool select;
|
|
|
|
String numstr;
|
|
|
|
String name;
|
|
|
|
String phone;
|
|
|
|
String count;
|
|
|
|
} |
...
|
...
|
|