Commit 089cc473e745dd78f20f802aecd4464845d91049

Authored by wdn127929
1 parent 71a705f0

全店客情首页UI

@@ -69,52 +69,13 @@ class _BarChartWidgetState extends State<BarChartWidget> { @@ -69,52 +69,13 @@ class _BarChartWidgetState extends State<BarChartWidget> {
69 ); 69 );
70 70
71 Widget getTitles(double value, TitleMeta meta) { 71 Widget getTitles(double value, TitleMeta meta) {
  72 + print(meta);
72 final style = TextStyle( 73 final style = TextStyle(
73 color: MyColours.color_999999, 74 color: MyColours.color_999999,
74 fontSize: font(10), 75 fontSize: font(10),
75 ); 76 );
76 - String text;  
77 - switch (value.toInt()) {  
78 - case 0:  
79 - text = '1月';  
80 - break;  
81 - case 1:  
82 - text = '2月';  
83 - break;  
84 - case 2:  
85 - text = '3月';  
86 - break;  
87 - case 3:  
88 - text = '4月';  
89 - break;  
90 - case 4:  
91 - text = '5月';  
92 - break;  
93 - case 5:  
94 - text = '6月';  
95 - break;  
96 - case 6:  
97 - text = '7月';  
98 - break;  
99 - case 7:  
100 - text = '8月';  
101 - break;  
102 - case 8:  
103 - text = '9月';  
104 - break;  
105 - case 9:  
106 - text = '10月';  
107 - break;  
108 - case 10:  
109 - text = '11月';  
110 - break;  
111 - case 11:  
112 - text = '12月';  
113 - break;  
114 - default:  
115 - text = '';  
116 - break;  
117 - } 77 + String text = (value.toInt() + 1).toString() + '月';
  78 +
118 return SideTitleWidget( 79 return SideTitleWidget(
119 axisSide: meta.axisSide, 80 axisSide: meta.axisSide,
120 space: w(6), 81 space: w(6),
@@ -123,16 +84,22 @@ class _BarChartWidgetState extends State<BarChartWidget> { @@ -123,16 +84,22 @@ class _BarChartWidgetState extends State<BarChartWidget> {
123 } 84 }
124 85
125 Widget leftTitles(double value, TitleMeta meta) { 86 Widget leftTitles(double value, TitleMeta meta) {
126 - if (value == meta.max) {  
127 - return Container();  
128 - } 87 + // if (value == meta.max) {
  88 + // return Container();
  89 + // }
  90 + print(value);
  91 + print(meta);
  92 + print(meta.max);
  93 + print(meta.min);
129 TextStyle style = 94 TextStyle style =
130 TextStyle(fontSize: font(10), color: MyColours.color_999999); 95 TextStyle(fontSize: font(10), color: MyColours.color_999999);
  96 +
131 return SideTitleWidget( 97 return SideTitleWidget(
132 axisSide: meta.axisSide, 98 axisSide: meta.axisSide,
133 space: w(6), 99 space: w(6),
134 child: Text( 100 child: Text(
135 - meta.formattedValue, 101 + // meta.formattedValue,
  102 + value.toInt().toString(),
136 style: style, 103 style: style,
137 textAlign: TextAlign.right, 104 textAlign: TextAlign.right,
138 )); 105 ));
@@ -153,7 +120,6 @@ class _BarChartWidgetState extends State<BarChartWidget> { @@ -153,7 +120,6 @@ class _BarChartWidgetState extends State<BarChartWidget> {
153 showTitles: true, 120 showTitles: true,
154 reservedSize: w(30), 121 reservedSize: w(30),
155 getTitlesWidget: leftTitles, 122 getTitlesWidget: leftTitles,
156 - // interval: 5  
157 ), 123 ),
158 ), 124 ),
159 topTitles: AxisTitles( 125 topTitles: AxisTitles(
@@ -164,176 +130,19 @@ class _BarChartWidgetState extends State<BarChartWidget> { @@ -164,176 +130,19 @@ class _BarChartWidgetState extends State<BarChartWidget> {
164 ), 130 ),
165 ); 131 );
166 132
167 - FlBorderData get borderData => FlBorderData(  
168 - show: false,  
169 - );  
170 -  
171 - LinearGradient get _barsGradient => LinearGradient(  
172 - colors: [  
173 - MyColours.color_8EBBBE,  
174 - MyColours.color_8EBBBE,  
175 - ],  
176 - begin: Alignment.bottomCenter,  
177 - end: Alignment.topCenter,  
178 - );  
179 -  
180 - List<BarChartGroupData> getData(double barsWidth, double barsSpace) {  
181 - return [  
182 - BarChartGroupData(  
183 - x: 0,  
184 - barRods: [  
185 - BarChartRodData(  
186 - toY: 8,  
187 - // gradient: _barsGradient,  
188 - color: MyColours.color_8EBBBE,  
189 - borderRadius: BorderRadius.zero,  
190 - width: barsWidth,  
191 - )  
192 - ],  
193 - showingTooltipIndicators: [0],  
194 - ),  
195 - BarChartGroupData(  
196 - x: 1,  
197 - barRods: [  
198 - BarChartRodData(  
199 - toY: 10,  
200 - // gradient: _barsGradient,  
201 - borderRadius: BorderRadius.zero,  
202 - width: barsWidth,  
203 - color: MyColours.color_8EBBBE)  
204 - ],  
205 - showingTooltipIndicators: [0],  
206 - ),  
207 - BarChartGroupData(  
208 - x: 2,  
209 - barRods: [  
210 - BarChartRodData(  
211 - toY: 14,  
212 - borderRadius: BorderRadius.zero,  
213 - width: barsWidth,  
214 - // gradient: _barsGradient,  
215 - color: MyColours.color_8EBBBE)  
216 - ],  
217 - showingTooltipIndicators: [0],  
218 - ),  
219 - BarChartGroupData(  
220 - x: 3,  
221 - barRods: [  
222 - BarChartRodData(  
223 - toY: 15,  
224 - borderRadius: BorderRadius.zero,  
225 - width: barsWidth,  
226 - // gradient: _barsGradient,  
227 - color: MyColours.color_8EBBBE)  
228 - ],  
229 - showingTooltipIndicators: [0],  
230 - ),  
231 - BarChartGroupData(  
232 - x: 4,  
233 - barRods: [  
234 - BarChartRodData(  
235 - toY: 13,  
236 - borderRadius: BorderRadius.zero,  
237 - width: barsWidth,  
238 - // gradient: _barsGradient,  
239 - color: MyColours.color_8EBBBE)  
240 - ],  
241 - showingTooltipIndicators: [0],  
242 - ),  
243 - BarChartGroupData(  
244 - x: 5,  
245 - barRods: [  
246 - BarChartRodData(  
247 - toY: 10,  
248 - borderRadius: BorderRadius.zero,  
249 - width: barsWidth,  
250 - // gradient: _barsGradient,  
251 - color: MyColours.color_8EBBBE)  
252 - ],  
253 - showingTooltipIndicators: [0],  
254 - ),  
255 - BarChartGroupData(  
256 - x: 6,  
257 - barRods: [  
258 - BarChartRodData(  
259 - toY: 16,  
260 - borderRadius: BorderRadius.zero,  
261 - width: barsWidth,  
262 - // gradient: _barsGradient,  
263 - color: MyColours.color_8EBBBE)  
264 - ],  
265 - showingTooltipIndicators: [0],  
266 - ),  
267 - BarChartGroupData(  
268 - x: 7,  
269 - barRods: [  
270 - BarChartRodData(  
271 - toY: 16,  
272 - borderRadius: BorderRadius.zero,  
273 - width: barsWidth,  
274 - // gradient: _barsGradient,  
275 - color: MyColours.color_8EBBBE)  
276 - ],  
277 - showingTooltipIndicators: [0],  
278 - ),  
279 - BarChartGroupData(  
280 - x: 8,  
281 - barRods: [  
282 - BarChartRodData(  
283 - toY: 16,  
284 - borderRadius: BorderRadius.zero,  
285 - width: barsWidth,  
286 - // gradient: _barsGradient,  
287 - color: MyColours.color_8EBBBE)  
288 - ],  
289 - showingTooltipIndicators: [0],  
290 - ),  
291 - BarChartGroupData(  
292 - x: 9,  
293 - barRods: [  
294 - BarChartRodData(  
295 - toY: 16,  
296 - borderRadius: BorderRadius.zero,  
297 - width: barsWidth,  
298 - // gradient: _barsGradient,  
299 - color: MyColours.color_8EBBBE)  
300 - ],  
301 - showingTooltipIndicators: [0],  
302 - ),  
303 - BarChartGroupData(  
304 - x: 10,  
305 - barRods: [  
306 - BarChartRodData(  
307 - toY: 16,  
308 - borderRadius: BorderRadius.zero,  
309 - width: barsWidth,  
310 - // gradient: _barsGradient,  
311 - color: MyColours.color_8EBBBE)  
312 - ],  
313 - showingTooltipIndicators: [0],  
314 - ),  
315 - BarChartGroupData(  
316 - x: 11,  
317 - barRods: [  
318 - BarChartRodData(  
319 - toY: 16,  
320 - borderRadius: BorderRadius.zero,  
321 - width: barsWidth,  
322 - // gradient: _barsGradient,  
323 - color: MyColours.color_8EBBBE)  
324 - ],  
325 - showingTooltipIndicators: [0],  
326 - ),  
327 - ];  
328 - }  
329 -  
330 @override 133 @override
331 Widget build(BuildContext context) { 134 Widget build(BuildContext context) {
332 return BarChart( 135 return BarChart(
333 BarChartData( 136 BarChartData(
334 barTouchData: barTouchData, 137 barTouchData: barTouchData,
335 titlesData: titlesData, 138 titlesData: titlesData,
336 - borderData: borderData, 139 +
  140 + borderData: FlBorderData(
  141 + show: true,
  142 + border: Border.symmetric(
  143 + horizontal: BorderSide(color: MyColours.color_DBDBDB, width: w(1)),
  144 + ),
  145 + ),
337 barGroups: widget.dataList.asMap().entries.map((e) { 146 barGroups: widget.dataList.asMap().entries.map((e) {
338 final index = e.key; 147 final index = e.key;
339 final data = e.value; 148 final data = e.value;
@@ -344,6 +153,7 @@ class _BarChartWidgetState extends State<BarChartWidget> { @@ -344,6 +153,7 @@ class _BarChartWidgetState extends State<BarChartWidget> {
344 ); 153 );
345 }).toList(), 154 }).toList(),
346 groupsSpace: w(10), 155 groupsSpace: w(10),
  156 +
347 gridData: FlGridData( 157 gridData: FlGridData(
348 show: true, 158 show: true,
349 // checkToShowHorizontalLine: (value) => value % 10 == 0, 159 // checkToShowHorizontalLine: (value) => value % 10 == 0,
@@ -11,6 +11,7 @@ import 'package:one_key/res/colors.dart'; @@ -11,6 +11,7 @@ import 'package:one_key/res/colors.dart';
11 import 'package:one_key/route/navigator_util.dart'; 11 import 'package:one_key/route/navigator_util.dart';
12 import 'package:one_key/utils/event_bus.dart'; 12 import 'package:one_key/utils/event_bus.dart';
13 import 'package:one_key/utils/utils.dart'; 13 import 'package:one_key/utils/utils.dart';
  14 +import 'package:one_key/widgets/MyDivider.dart';
14 import 'package:one_key/widgets/h_empty_view.dart'; 15 import 'package:one_key/widgets/h_empty_view.dart';
15 import 'package:one_key/widgets/page_exception.dart'; 16 import 'package:one_key/widgets/page_exception.dart';
16 import 'package:one_key/widgets/round_button.dart'; 17 import 'package:one_key/widgets/round_button.dart';
@@ -31,26 +32,29 @@ class _StoreCustomerHomePageState extends State<StoreCustomerHomePage> { @@ -31,26 +32,29 @@ class _StoreCustomerHomePageState extends State<StoreCustomerHomePage> {
31 ScrollController _controller = ScrollController(); 32 ScrollController _controller = ScrollController();
32 CustomerProvider customerProvider; 33 CustomerProvider customerProvider;
33 bool showWarning = false; 34 bool showWarning = false;
34 - 35 + int year;
  36 + int month;
35 List<BarData> dataList = [ 37 List<BarData> dataList = [
36 - BarData(MyColours.color_8EBBBE, 188), 38 + BarData(MyColours.color_8EBBBE, 200),
37 BarData(MyColours.color_8EBBBE, 8), 39 BarData(MyColours.color_8EBBBE, 8),
38 BarData(MyColours.color_8EBBBE, 15), 40 BarData(MyColours.color_8EBBBE, 15),
39 BarData(MyColours.color_8EBBBE, 5), 41 BarData(MyColours.color_8EBBBE, 5),
40 BarData(MyColours.color_8EBBBE, 2), 42 BarData(MyColours.color_8EBBBE, 2),
41 BarData(MyColours.color_8EBBBE, 2), 43 BarData(MyColours.color_8EBBBE, 2),
42 BarData(MyColours.color_8EBBBE, 18), 44 BarData(MyColours.color_8EBBBE, 18),
43 - BarData(MyColours.color_8EBBBE, 8), 45 + BarData(MyColours.color_8EBBBE, 168),
44 BarData(MyColours.color_8EBBBE, 15), 46 BarData(MyColours.color_8EBBBE, 15),
45 BarData(MyColours.color_8EBBBE, 5), 47 BarData(MyColours.color_8EBBBE, 5),
46 - BarData(MyColours.color_8EBBBE, 2),  
47 - BarData(MyColours.color_8EBBBE, 2), 48 + BarData(MyColours.color_8EBBBE, null ?? 0),
  49 + BarData(MyColours.color_8EBBBE, 0),
48 ]; 50 ];
49 51
50 @override 52 @override
51 void initState() { 53 void initState() {
52 super.initState(); 54 super.initState();
53 55
  56 + year = DateTime.now().year;
  57 + month = DateTime.now().month;
54 WidgetsBinding.instance.addPostFrameCallback((_) { 58 WidgetsBinding.instance.addPostFrameCallback((_) {
55 _getSellerGuestManage(); 59 _getSellerGuestManage();
56 _getMarketingBySeller(); 60 _getMarketingBySeller();
@@ -227,28 +231,382 @@ class _StoreCustomerHomePageState extends State<StoreCustomerHomePage> { @@ -227,28 +231,382 @@ class _StoreCustomerHomePageState extends State<StoreCustomerHomePage> {
227 } 231 }
228 232
229 Widget _chart() { 233 Widget _chart() {
230 - return AspectRatio(  
231 - aspectRatio: 1.4,  
232 - child: Padding(  
233 - padding: EdgeInsets.all(w(20)),  
234 - child: LayoutBuilder(builder: (context, constraints) {  
235 - return BarChartWidget(  
236 - dataList: dataList,  
237 - );  
238 - })));  
239 - // return Container(  
240 - // height: w(143),  
241 - // child: BarChart(  
242 - // BarChartData(  
243 - // barTouchData: barTouchData,  
244 - // titlesData: titlesData,  
245 - // borderData: borderData,  
246 - // barGroups: barGroups,  
247 - // gridData: FlGridData(show: false),  
248 - // alignment: BarChartAlignment.spaceAround,  
249 - // maxY: 20,  
250 - // ),  
251 - // )); 234 + return Container(
  235 + // height: w(216),
  236 + padding: EdgeInsets.only(top: w(16), left: w(16), right: w(16)),
  237 + margin: EdgeInsets.all(w(10)),
  238 + decoration: BoxDecoration(
  239 + color: MyColours.color_ffffff,
  240 + borderRadius: BorderRadius.circular(r(8))),
  241 + child: Column(
  242 + children: [
  243 + Row(
  244 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  245 + children: [
  246 + InkWell(
  247 + onTap: () {
  248 + setState(() {
  249 + year--;
  250 + });
  251 + // _getGuestReserve(showLoading: true);
  252 + },
  253 + child: Padding(
  254 + padding:
  255 + EdgeInsets.only(right: ScreenUtil().setWidth(20)),
  256 + child: Image.asset(
  257 + Utils.getImgPath('c_arrow_left'),
  258 + width: ScreenUtil().setWidth(24),
  259 + ))),
  260 + Text(
  261 + '${year}年',
  262 + style: TextStyle(
  263 + fontSize: ScreenUtil().setSp(32),
  264 + color: MyColours.color_000000),
  265 + ),
  266 + InkWell(
  267 + onTap: () {
  268 + if (year >= DateTime.now().year) {
  269 + return;
  270 + }
  271 + setState(() {
  272 + year++;
  273 + });
  274 + // _getGuestReserve(showLoading: true);
  275 + },
  276 + child: Padding(
  277 + padding: EdgeInsets.only(
  278 + left: ScreenUtil().setWidth(20),
  279 + ),
  280 + child: Image.asset(
  281 + Utils.getImgPath(year != DateTime.now().year
  282 + ? 'c_arrow_right'
  283 + : 'c_arrow_right_gray'),
  284 + width: ScreenUtil().setWidth(24),
  285 + )))
  286 + ],
  287 + ),
  288 + VEmptyView(80),
  289 + Container(
  290 + width: double.infinity,
  291 + height: w(177),
  292 + child: LayoutBuilder(builder: (context, constraints) {
  293 + return BarChartWidget(
  294 + dataList: dataList,
  295 + );
  296 + }))
  297 + ],
  298 + ),
  299 + );
  300 + }
  301 +
  302 + Widget _monthWidget() {
  303 + return Container(
  304 + margin: EdgeInsets.symmetric(horizontal: w(10)),
  305 + padding: EdgeInsets.symmetric(horizontal: w(15), vertical: w(10)),
  306 + decoration: BoxDecoration(color: MyColours.color_ffffff),
  307 + child: Column(
  308 + crossAxisAlignment: CrossAxisAlignment.start,
  309 + children: [
  310 + Row(
  311 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  312 + children: [
  313 + InkWell(
  314 + onTap: () {
  315 + if (month == 1) {
  316 + month = 12;
  317 + setState(() {});
  318 + } else {
  319 + setState(() {
  320 + month--;
  321 + });
  322 + }
  323 +
  324 + // _getGuestReserve(showLoading: true);
  325 + },
  326 + child: Padding(
  327 + padding:
  328 + EdgeInsets.only(right: ScreenUtil().setWidth(20)),
  329 + child: Image.asset(
  330 + Utils.getImgPath('c_arrow_left'),
  331 + width: ScreenUtil().setWidth(24),
  332 + ))),
  333 + Text(
  334 + '${month}月',
  335 + style: TextStyle(
  336 + fontSize: ScreenUtil().setSp(40),
  337 + color: MyColours.color_515151),
  338 + ),
  339 + InkWell(
  340 + onTap: () {
  341 + if (month == 12) {
  342 + month = 1;
  343 + setState(() {});
  344 + } else {
  345 + setState(() {
  346 + month++;
  347 + });
  348 + }
  349 +
  350 + // _getGuestReserve(showLoading: true);
  351 + },
  352 + child: Padding(
  353 + padding: EdgeInsets.only(
  354 + left: ScreenUtil().setWidth(20),
  355 + ),
  356 + child: Image.asset(
  357 + Utils.getImgPath('c_arrow_right'),
  358 + width: ScreenUtil().setWidth(24),
  359 + )))
  360 + ],
  361 + ),
  362 + VEmptyView(20),
  363 + Row(
  364 + crossAxisAlignment: CrossAxisAlignment.center,
  365 + children: [
  366 + Text(
  367 + '预订',
  368 + style: TextStyle(
  369 + fontWeight: FontWeight.bold,
  370 + color: MyColours.color_515151,
  371 + fontSize: font(
  372 + (18),
  373 + )),
  374 + ),
  375 + HEmptyView(10),
  376 + Text(
  377 + '1089单',
  378 + style: TextStyle(
  379 + color: MyColours.color_515151,
  380 + fontSize: font(
  381 + (14),
  382 + )),
  383 + ),
  384 + HEmptyView(10),
  385 + MyDivider(
  386 + w(1),
  387 + w(15),
  388 + color: MyColours.color_DBDBDB,
  389 + ),
  390 + HEmptyView(10),
  391 + Text(
  392 + '1190桌',
  393 + style: TextStyle(
  394 + color: MyColours.color_515151,
  395 + fontSize: font(
  396 + (14),
  397 + )),
  398 + ),
  399 + ],
  400 + ),
  401 + VEmptyView(15),
  402 + Wrap(
  403 + // crossAxisAlignment: WrapCrossAlignment.center,
  404 + // runAlignment: WrapAlignment.center,
  405 + // alignment: WrapAlignment.center,
  406 + children: [
  407 + Text(
  408 + '到店',
  409 + style: TextStyle(
  410 + fontWeight: FontWeight.bold,
  411 + color: MyColours.color_515151,
  412 + fontSize: font(
  413 + (18),
  414 + )),
  415 + ),
  416 + HEmptyView(10),
  417 + Text(
  418 + '1089单',
  419 + style: TextStyle(
  420 + color: MyColours.color_515151,
  421 + fontSize: font(
  422 + (14),
  423 + )),
  424 + ),
  425 + HEmptyView(10),
  426 + MyDivider(
  427 + w(1),
  428 + w(15),
  429 + color: MyColours.color_DBDBDB,
  430 + ),
  431 + HEmptyView(10),
  432 + Text(
  433 + '1190桌',
  434 + style: TextStyle(
  435 + color: MyColours.color_515151,
  436 + fontSize: font(
  437 + (14),
  438 + )),
  439 + ),
  440 + HEmptyView(10),
  441 + MyDivider(
  442 + w(1),
  443 + w(15),
  444 + color: MyColours.color_DBDBDB,
  445 + ),
  446 + HEmptyView(10),
  447 + Text(
  448 + '1190人',
  449 + style: TextStyle(
  450 + color: MyColours.color_515151,
  451 + fontSize: font(
  452 + (14),
  453 + )),
  454 + ),
  455 + HEmptyView(10),
  456 + MyDivider(
  457 + w(1),
  458 + w(15),
  459 + color: MyColours.color_DBDBDB,
  460 + ),
  461 + HEmptyView(10),
  462 + Text(
  463 + '1190取消',
  464 + style: TextStyle(
  465 + color: MyColours.color_515151,
  466 + fontSize: font(
  467 + (14),
  468 + )),
  469 + ),
  470 + HEmptyView(10),
  471 + MyDivider(
  472 + w(1),
  473 + w(15),
  474 + color: MyColours.color_DBDBDB,
  475 + ),
  476 + HEmptyView(10),
  477 + Text(
  478 + '到客97.2%',
  479 + style: TextStyle(
  480 + color: MyColours.color_515151,
  481 + fontSize: font(
  482 + (14),
  483 + )),
  484 + ),
  485 + ],
  486 + ),
  487 + VEmptyView(15),
  488 + MyDivider(
  489 + double.infinity,
  490 + w(1),
  491 + color: MyColours.color_DBDBDB,
  492 + ),
  493 + VEmptyView(15),
  494 + Wrap(
  495 + // crossAxisAlignment: WrapCrossAlignment.start,
  496 + // runAlignment: WrapAlignment.center,
  497 + // alignment: WrapAlignment.center,
  498 + runSpacing: w(5),
  499 + children: [
  500 + Text(
  501 + '有金额订单 6000',
  502 + style: TextStyle(
  503 + color: MyColours.color_999999,
  504 + decoration: TextDecoration.underline,
  505 + fontSize: font(
  506 + (10),
  507 + )),
  508 + ),
  509 + HEmptyView(10),
  510 + MyDivider(
  511 + w(1),
  512 + w(12),
  513 + color: MyColours.color_DBDBDB,
  514 + ),
  515 + HEmptyView(10),
  516 + Text(
  517 + '消费 9585800.00元',
  518 + style: TextStyle(
  519 + color: MyColours.color_999999,
  520 + decoration: TextDecoration.underline,
  521 + fontSize: font(
  522 + (10),
  523 + )),
  524 + ),
  525 + HEmptyView(10),
  526 + MyDivider(
  527 + w(1),
  528 + w(12),
  529 + color: MyColours.color_DBDBDB,
  530 + ),
  531 + HEmptyView(10),
  532 + Text(
  533 + '人均 8885.58元',
  534 + style: TextStyle(
  535 + color: MyColours.color_999999,
  536 + decoration: TextDecoration.underline,
  537 + fontSize: font(
  538 + (10),
  539 + )),
  540 + ),
  541 + HEmptyView(10),
  542 + MyDivider(
  543 + w(1),
  544 + w(12),
  545 + color: MyColours.color_DBDBDB,
  546 + ),
  547 + HEmptyView(10),
  548 + Text(
  549 + '桌均 95888.58元',
  550 + style: TextStyle(
  551 + color: MyColours.color_999999,
  552 + decoration: TextDecoration.underline,
  553 + fontSize: font(
  554 + (10),
  555 + )),
  556 + ),
  557 + HEmptyView(10),
  558 + MyDivider(
  559 + w(1),
  560 + w(12),
  561 + color: MyColours.color_DBDBDB,
  562 + ),
  563 + HEmptyView(10),
  564 + Text(
  565 + '存酒 8位',
  566 + style: TextStyle(
  567 + color: MyColours.color_999999,
  568 + decoration: TextDecoration.underline,
  569 + fontSize: font(
  570 + (10),
  571 + )),
  572 + ),
  573 + HEmptyView(10),
  574 + MyDivider(
  575 + w(1),
  576 + w(12),
  577 + color: MyColours.color_DBDBDB,
  578 + ),
  579 + HEmptyView(10),
  580 + Text(
  581 + '提前点餐 9位',
  582 + style: TextStyle(
  583 + color: MyColours.color_999999,
  584 + decoration: TextDecoration.underline,
  585 + fontSize: font(
  586 + (10),
  587 + )),
  588 + ),
  589 + HEmptyView(10),
  590 + MyDivider(
  591 + w(1),
  592 + w(12),
  593 + color: MyColours.color_DBDBDB,
  594 + ),
  595 + HEmptyView(10),
  596 + Text(
  597 + '安排菜 9位',
  598 + style: TextStyle(
  599 + color: MyColours.color_999999,
  600 + decoration: TextDecoration.underline,
  601 + fontSize: font(
  602 + (10),
  603 + )),
  604 + ),
  605 + ],
  606 + ),
  607 + ],
  608 + ),
  609 + );
252 } 610 }
253 611
254 @override 612 @override
@@ -424,8 +782,377 @@ class _StoreCustomerHomePageState extends State<StoreCustomerHomePage> { @@ -424,8 +782,377 @@ class _StoreCustomerHomePageState extends State<StoreCustomerHomePage> {
424 uid: customerProvider 782 uid: customerProvider
425 .storeSunmodel.sellerUser[index - 1].uid); 783 .storeSunmodel.sellerUser[index - 1].uid);
426 }), 784 }),
427 - VEmptyView(100),  
428 - _chart() 785 + _chart(),
  786 + _monthWidget(),
  787 + VEmptyView(24),
  788 +
  789 + ListView.builder(
  790 + itemCount: 10,
  791 + controller: _controller,
  792 + shrinkWrap: true,
  793 + padding: EdgeInsets.symmetric(horizontal: w(10)),
  794 + itemBuilder: (context, index) {
  795 + return Container(
  796 + margin: EdgeInsets.only(bottom: w(10)),
  797 + padding: EdgeInsets.symmetric(horizontal: w(10)),
  798 + decoration: BoxDecoration(
  799 + color: MyColours.color_ffffff,
  800 + borderRadius: BorderRadius.only(
  801 + topRight: Radius.circular(r(8)),
  802 + bottomRight: Radius.circular(r(8))),
  803 + ),
  804 + child: Row(
  805 + children: [
  806 + Container(
  807 + width: w(122),
  808 + padding: EdgeInsets.symmetric(vertical: w(5)),
  809 + decoration: BoxDecoration(
  810 + border: Border(
  811 + right: BorderSide(
  812 + color: MyColours.color_f3f3f3,
  813 + width: w(1)))),
  814 + child: Column(
  815 + children: [
  816 + VEmptyView(24),
  817 + Align(
  818 + alignment: Alignment.centerLeft,
  819 + child: Container(
  820 + padding: EdgeInsets.symmetric(
  821 + vertical: w(4), horizontal: w(5)),
  822 + decoration: BoxDecoration(
  823 + borderRadius:
  824 + BorderRadius.circular(r(3)),
  825 + border: Border.all(
  826 + color: MyColours.color_999999,
  827 + width: w(1))),
  828 + child: Text(
  829 + '张珊珊',
  830 + style: TextStyle(
  831 + fontSize: font(12),
  832 + fontWeight: FontWeight.bold,
  833 + color: MyColours.color_999999),
  834 + ),
  835 + ),
  836 + ),
  837 + VEmptyView(10),
  838 + Row(
  839 + mainAxisAlignment:
  840 + MainAxisAlignment.center,
  841 + children: [
  842 + Text(
  843 + '34',
  844 + style: TextStyle(
  845 + fontSize: font(24),
  846 + fontWeight: FontWeight.bold,
  847 + color: MyColours.color_438E93),
  848 + ),
  849 + Text(
  850 + '位',
  851 + style: TextStyle(
  852 + fontSize: font(14),
  853 + color: MyColours.color_000000),
  854 + ),
  855 + ],
  856 + ),
  857 + VEmptyView(10),
  858 + Row(
  859 + mainAxisAlignment:
  860 + MainAxisAlignment.center,
  861 + children: [
  862 + Text(
  863 + '23',
  864 + style: TextStyle(
  865 + fontSize: font(14),
  866 + fontWeight: FontWeight.bold,
  867 + color: MyColours.color_438E93),
  868 + ),
  869 + MyDivider(
  870 + w(4),
  871 + w(1),
  872 + color: MyColours.color_999999,
  873 + ),
  874 + Text(
  875 + '9',
  876 + style: TextStyle(
  877 + fontSize: font(14),
  878 + fontWeight: FontWeight.bold,
  879 + color: MyColours.color_E89243),
  880 + ),
  881 + MyDivider(
  882 + w(4),
  883 + w(1),
  884 + color: MyColours.color_999999,
  885 + ),
  886 + Text(
  887 + '2',
  888 + style: TextStyle(
  889 + fontSize: font(14),
  890 + fontWeight: FontWeight.bold,
  891 + color: MyColours.color_E34D59),
  892 + ),
  893 + ],
  894 + ),
  895 + VEmptyView(24),
  896 + ],
  897 + ),
  898 + ),
  899 + Expanded(
  900 + child: Container(
  901 + padding: EdgeInsets.only(
  902 + top: w(5), bottom: w(5), left: w(10)),
  903 + child: Row(
  904 + mainAxisAlignment:
  905 + MainAxisAlignment.spaceBetween,
  906 + // crossAxisAlignment: CrossAxisAlignment.start,
  907 + children: [
  908 + Column(
  909 + mainAxisAlignment:
  910 + MainAxisAlignment.start,
  911 + crossAxisAlignment:
  912 + CrossAxisAlignment.start,
  913 + children: [
  914 + Row(
  915 + crossAxisAlignment:
  916 + CrossAxisAlignment.start,
  917 + children: [
  918 + Text(
  919 + '预订',
  920 + style: TextStyle(
  921 + fontWeight: FontWeight.bold,
  922 + color: MyColours.color_515151,
  923 + fontSize: font(
  924 + (12),
  925 + )),
  926 + ),
  927 + HEmptyView(10),
  928 + Text(
  929 + '1089单',
  930 + style: TextStyle(
  931 + color: MyColours.color_515151,
  932 + fontSize: font(
  933 + (10),
  934 + )),
  935 + ),
  936 + HEmptyView(10),
  937 + MyDivider(
  938 + w(1),
  939 + w(15),
  940 + color: MyColours.color_DBDBDB,
  941 + ),
  942 + HEmptyView(10),
  943 + Text(
  944 + '1190桌',
  945 + style: TextStyle(
  946 + color: MyColours.color_515151,
  947 + fontSize: font(
  948 + (10),
  949 + )),
  950 + ),
  951 + ],
  952 + ),
  953 + VEmptyView(10),
  954 + Row(
  955 + crossAxisAlignment:
  956 + CrossAxisAlignment.start,
  957 + children: [
  958 + Text(
  959 + '到店',
  960 + style: TextStyle(
  961 + fontWeight: FontWeight.bold,
  962 + color: MyColours.color_515151,
  963 + fontSize: font(
  964 + (12),
  965 + )),
  966 + ),
  967 + HEmptyView(10),
  968 + Text(
  969 + '1089单',
  970 + style: TextStyle(
  971 + color: MyColours.color_515151,
  972 + fontSize: font(
  973 + (10),
  974 + )),
  975 + ),
  976 + HEmptyView(10),
  977 + MyDivider(
  978 + w(1),
  979 + w(15),
  980 + color: MyColours.color_DBDBDB,
  981 + ),
  982 + HEmptyView(10),
  983 + Text(
  984 + '1190桌',
  985 + style: TextStyle(
  986 + color: MyColours.color_515151,
  987 + fontSize: font(
  988 + (10),
  989 + )),
  990 + ),
  991 + ],
  992 + ),
  993 + VEmptyView(10),
  994 + Row(
  995 + crossAxisAlignment:
  996 + CrossAxisAlignment.start,
  997 + children: [
  998 + Text(
  999 + '1089人',
  1000 + style: TextStyle(
  1001 + color: MyColours.color_515151,
  1002 + fontSize: font(
  1003 + (10),
  1004 + )),
  1005 + ),
  1006 + HEmptyView(10),
  1007 + MyDivider(
  1008 + w(1),
  1009 + w(15),
  1010 + color: MyColours.color_DBDBDB,
  1011 + ),
  1012 + HEmptyView(10),
  1013 + Text(
  1014 + '1190取消',
  1015 + style: TextStyle(
  1016 + color: MyColours.color_515151,
  1017 + fontSize: font(
  1018 + (10),
  1019 + )),
  1020 + ),
  1021 + HEmptyView(10),
  1022 + MyDivider(
  1023 + w(1),
  1024 + w(15),
  1025 + color: MyColours.color_DBDBDB,
  1026 + ),
  1027 + HEmptyView(10),
  1028 + Text(
  1029 + '到客90.1%',
  1030 + style: TextStyle(
  1031 + color: MyColours.color_515151,
  1032 + fontSize: font(
  1033 + (10),
  1034 + )),
  1035 + ),
  1036 + ],
  1037 + ),
  1038 + VEmptyView(10),
  1039 + Row(
  1040 + crossAxisAlignment:
  1041 + CrossAxisAlignment.start,
  1042 + children: [
  1043 + Text(
  1044 + '有金额订单数 25',
  1045 + style: TextStyle(
  1046 + color: MyColours.color_999999,
  1047 + fontSize: font(
  1048 + (10),
  1049 + )),
  1050 + ),
  1051 + HEmptyView(10),
  1052 + MyDivider(
  1053 + w(1),
  1054 + w(15),
  1055 + color: MyColours.color_DBDBDB,
  1056 + ),
  1057 + HEmptyView(10),
  1058 + Text(
  1059 + '总消费 25800元',
  1060 + style: TextStyle(
  1061 + color: MyColours.color_999999,
  1062 + fontSize: font(
  1063 + (10),
  1064 + )),
  1065 + ),
  1066 + ],
  1067 + ),
  1068 + VEmptyView(10),
  1069 + Row(
  1070 + crossAxisAlignment:
  1071 + CrossAxisAlignment.start,
  1072 + children: [
  1073 + Text(
  1074 + '人均 103.2元',
  1075 + style: TextStyle(
  1076 + color: MyColours.color_999999,
  1077 + fontSize: font(
  1078 + (10),
  1079 + )),
  1080 + ),
  1081 + HEmptyView(10),
  1082 + MyDivider(
  1083 + w(1),
  1084 + w(15),
  1085 + color: MyColours.color_DBDBDB,
  1086 + ),
  1087 + HEmptyView(10),
  1088 + Text(
  1089 + '桌均 860元',
  1090 + style: TextStyle(
  1091 + color: MyColours.color_999999,
  1092 + fontSize: font(
  1093 + (10),
  1094 + )),
  1095 + ),
  1096 + ],
  1097 + ),
  1098 + VEmptyView(10),
  1099 + Row(
  1100 + crossAxisAlignment:
  1101 + CrossAxisAlignment.start,
  1102 + children: [
  1103 + Text(
  1104 + '存酒 1位',
  1105 + style: TextStyle(
  1106 + color: MyColours.color_999999,
  1107 + fontSize: font(
  1108 + (10),
  1109 + )),
  1110 + ),
  1111 + HEmptyView(10),
  1112 + MyDivider(
  1113 + w(1),
  1114 + w(15),
  1115 + color: MyColours.color_DBDBDB,
  1116 + ),
  1117 + HEmptyView(10),
  1118 + Text(
  1119 + '提前点餐 9位',
  1120 + style: TextStyle(
  1121 + color: MyColours.color_999999,
  1122 + fontSize: font(
  1123 + (10),
  1124 + )),
  1125 + ),
  1126 + HEmptyView(10),
  1127 + MyDivider(
  1128 + w(1),
  1129 + w(15),
  1130 + color: MyColours.color_DBDBDB,
  1131 + ),
  1132 + HEmptyView(10),
  1133 + Text(
  1134 + '安排菜 9位',
  1135 + style: TextStyle(
  1136 + color: MyColours.color_999999,
  1137 + fontSize: font(
  1138 + (10),
  1139 + )),
  1140 + ),
  1141 + ],
  1142 + ),
  1143 + ],
  1144 + ),
  1145 + Image.asset(
  1146 + Utils.getImgPath('arrow_right_new'),
  1147 + width: w(12),
  1148 + )
  1149 + ],
  1150 + ),
  1151 + ))
  1152 + ],
  1153 + ),
  1154 + );
  1155 + })
429 ], 1156 ],
430 ), 1157 ),
431 )), 1158 )),
1 import 'package:flutter/material.dart'; 1 import 'package:flutter/material.dart';
2 2
3 class MyColours { 3 class MyColours {
  4 + static const Color color_E89243 = Color(0xFFE89243);
4 static const Color color_3E6F51 = Color(0xFF3E6F51); 5 static const Color color_3E6F51 = Color(0xFF3E6F51);
5 static const Color color_877952 = Color(0xFF877952); 6 static const Color color_877952 = Color(0xFF877952);
6 static const Color color_FBF6F1 = Color(0xFFFBF6F1); 7 static const Color color_FBF6F1 = Color(0xFFFBF6F1);
@@ -46,6 +46,14 @@ import '../models/recharge_list_model.dart'; @@ -46,6 +46,14 @@ import '../models/recharge_list_model.dart';
46 typedef BookTimeSetCallback = void Function(bool needChange); 46 typedef BookTimeSetCallback = void Function(bool needChange);
47 47
48 class Utils { 48 class Utils {
  49 + //得到当月最后一天
  50 +
  51 + static getCurrentMonthLast(int month) {
  52 + var date = new DateTime(2013, month + 1, 0);
  53 + // print(date.day); // 28 for February
  54 + return date.day;
  55 + }
  56 +
49 static randomGet(int min, int max) { 57 static randomGet(int min, int max) {
50 //实例化 Random类 并赋值给 私有变量 _random 58 //实例化 Random类 并赋值给 私有变量 _random
51 final _random = new Random(); 59 final _random = new Random();