feast_page.dart
4.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/pages/feast/feast_item.dart';
import 'package:one_key/provider/feast_model.dart';
import 'package:one_key/route/navigator_util.dart';
import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import 'package:provider/provider.dart';
import '../../constant/state.dart';
import '../../res/colors.dart';
import '../../widgets/page_exception.dart';
class FeastPage extends StatefulWidget {
FeastPage({Key key}) : super(key: key);
@override
_FeastPageState createState() => _FeastPageState();
}
class _FeastPageState extends State<FeastPage> {
Widget upAndDown(String image, String title, {GestureTapCallback onTap}) {
return InkWell(
onTap: onTap,
child: Column(
children: [
Image.asset(Utils.getImgPath(image),
width: ScreenUtil().setWidth(36 * 2)),
VEmptyView(8),
Text(
title,
style: TextStyle(
fontSize: ScreenUtil().setSp(28),
color: MyColours.color_515151),
)
],
));
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: MyColours.color_ffffff,
// appBar: SystemAppBar(''),
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
VEmptyView(112),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
upAndDown('y_kanban', '宴会看板', onTap: () {
NavigatorUtil.goFeastBoardPage(context);
}),
upAndDown('y_new', '新建宴会', onTap: () {
NavigatorUtil.goFeastCreatePage(context);
}),
Stack(clipBehavior: Clip.none, children: [
upAndDown('y_schedule', '待跟进', onTap: () {
NavigatorUtil.goFeastFollowUpPage(context);
}),
Positioned(
right: ScreenUtil().setWidth(-6),
bottom: ScreenUtil().setWidth(32),
child: Container(
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(ScreenUtil().setWidth(16)),
color: MyColours.color_E34D59),
width: ScreenUtil().setWidth(32),
height: ScreenUtil().setWidth(32),
child: Text(
'7',
style: TextStyle(
color: MyColours.color_F6F6F6,
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(24)),
),
),
)
]),
upAndDown('y_money', '定金管理',onTap: (){
NavigatorUtil.goFeastDepositDataPage(context);
})
],
),
VEmptyView(102),
Padding(
padding: EdgeInsets.only(left: ScreenUtil().setWidth(48)),
child: Text(
'30天内宴会',
style: TextStyle(
color: MyColours.color_000000,
fontSize: ScreenUtil().setSp(28)),
),
),
VEmptyView(26),
Expanded(child: Consumer<FeastModel>(builder: (context, model, _) {
if (model.pageState != PageState.Success) {
return ExceptionPage(
pageState: model.pageState,
callback: () {
// offset = 0;
// getMessage(showLoading: true);
},
emptyMsg: "还未创建宴会",
emptyImg: "empty_search",
showMsg: "加载中,请稍后...",
);
} else {
return ListView.builder(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(24)),
itemBuilder: (context, index) {
return FeastItem();
},
itemCount: 100,
);
}
}))
],
));
}
}