|
1
|
import 'package:flutter/material.dart';
|
1
|
import 'package:flutter/material.dart';
|
|
|
|
2
|
+import 'package:flutter_screenutil/screenutil.dart';
|
|
|
|
3
|
+import 'package:one_key/res/colors.dart';
|
|
|
|
4
|
+import 'package:one_key/route/navigator_util.dart';
|
|
|
|
5
|
+import 'package:one_key/utils/event_bus.dart';
|
|
|
|
6
|
+import 'package:one_key/utils/utils.dart';
|
|
|
|
7
|
+import 'package:one_key/widgets/h_empty_view.dart';
|
|
|
|
8
|
+import 'package:one_key/widgets/round_button.dart';
|
|
2
|
import 'package:one_key/widgets/system_app_bar.dart';
|
9
|
import 'package:one_key/widgets/system_app_bar.dart';
|
|
|
|
10
|
+import 'package:one_key/widgets/v_empty_view.dart';
|
|
3
|
|
11
|
|
|
4
|
class MyCustomerPage extends StatefulWidget {
|
12
|
class MyCustomerPage extends StatefulWidget {
|
|
5
|
MyCustomerPage({Key key}) : super(key: key);
|
13
|
MyCustomerPage({Key key}) : super(key: key);
|
|
@@ -9,13 +17,223 @@ class MyCustomerPage extends StatefulWidget { |
|
@@ -9,13 +17,223 @@ class MyCustomerPage extends StatefulWidget { |
|
9
|
}
|
17
|
}
|
|
10
|
|
18
|
|
|
11
|
class _MyCustomerPageState extends State<MyCustomerPage> {
|
19
|
class _MyCustomerPageState extends State<MyCustomerPage> {
|
|
|
|
20
|
+ ScrollController _controller = ScrollController();
|
|
|
|
21
|
+
|
|
|
|
22
|
+ ///活跃客户、沉睡客户、流失客户
|
|
|
|
23
|
+ Widget _percentWidget(String pnum, String btnTitle, String percent) {
|
|
|
|
24
|
+ return Container(
|
|
|
|
25
|
+ color: MyColours.color_ffffff,
|
|
|
|
26
|
+ // height: ScreenUtil().setWidth(230),
|
|
|
|
27
|
+ child: Column(
|
|
|
|
28
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
29
|
+ children: [
|
|
|
|
30
|
+ Row(
|
|
|
|
31
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
32
|
+ children: [
|
|
|
|
33
|
+ Text(pnum,
|
|
|
|
34
|
+ style: TextStyle(
|
|
|
|
35
|
+ color: MyColours.color_199095,
|
|
|
|
36
|
+ fontSize: ScreenUtil().setSp(40),
|
|
|
|
37
|
+ fontWeight: FontWeight.bold)),
|
|
|
|
38
|
+ Text('位',
|
|
|
|
39
|
+ style: TextStyle(
|
|
|
|
40
|
+ color: MyColours.color_199095,
|
|
|
|
41
|
+ fontSize: ScreenUtil().setSp(24),
|
|
|
|
42
|
+ ))
|
|
|
|
43
|
+ ],
|
|
|
|
44
|
+ ),
|
|
|
|
45
|
+ VEmptyView(20),
|
|
|
|
46
|
+ RoundButton(
|
|
|
|
47
|
+ onPressed: () async {},
|
|
|
|
48
|
+ text: btnTitle,
|
|
|
|
49
|
+ fontSize: 24,
|
|
|
|
50
|
+ isBold: false,
|
|
|
|
51
|
+ textColor: MyColours.color_333333,
|
|
|
|
52
|
+ gradientStart: MyColours.color_ffffff,
|
|
|
|
53
|
+ gradientEnd: MyColours.color_ffffff,
|
|
|
|
54
|
+ borderColor: Color.fromRGBO(118, 118, 118, 1),
|
|
|
|
55
|
+ height: ScreenUtil().setWidth(45),
|
|
|
|
56
|
+ width: ScreenUtil().setWidth(160),
|
|
|
|
57
|
+ radius: ScreenUtil().setWidth(30),
|
|
|
|
58
|
+ ),
|
|
|
|
59
|
+ VEmptyView(16),
|
|
|
|
60
|
+ percent == null
|
|
|
|
61
|
+ ? SizedBox()
|
|
|
|
62
|
+ : Text('${percent}%',
|
|
|
|
63
|
+ style: TextStyle(
|
|
|
|
64
|
+ color: MyColours.color_199095,
|
|
|
|
65
|
+ fontSize: ScreenUtil().setSp(24),
|
|
|
|
66
|
+ )),
|
|
|
|
67
|
+ ],
|
|
|
|
68
|
+ ),
|
|
|
|
69
|
+ );
|
|
|
|
70
|
+ }
|
|
|
|
71
|
+
|
|
12
|
@override
|
72
|
@override
|
|
13
|
Widget build(BuildContext context) {
|
73
|
Widget build(BuildContext context) {
|
|
14
|
return Scaffold(
|
74
|
return Scaffold(
|
|
|
|
75
|
+ backgroundColor: Color.fromRGBO(246, 248, 250, 1),
|
|
15
|
appBar: SystemAppBar('我的客情', onTap: () {
|
76
|
appBar: SystemAppBar('我的客情', onTap: () {
|
|
|
|
77
|
+ EventBus().emit('changeStatusColor');
|
|
16
|
Navigator.pop(context);
|
78
|
Navigator.pop(context);
|
|
17
|
}),
|
79
|
}),
|
|
18
|
- body: Container(),
|
80
|
+ body: WillPopScope(
|
|
|
|
81
|
+ onWillPop: () async {
|
|
|
|
82
|
+ EventBus().emit('changeStatusColor');
|
|
|
|
83
|
+ return true;
|
|
|
|
84
|
+ },
|
|
|
|
85
|
+ child: Column(children: [
|
|
|
|
86
|
+ Expanded(
|
|
|
|
87
|
+ child: SingleChildScrollView(
|
|
|
|
88
|
+ controller: _controller,
|
|
|
|
89
|
+ child: Column(
|
|
|
|
90
|
+ children: [
|
|
|
|
91
|
+ Container(
|
|
|
|
92
|
+ color: MyColours.color_ffffff,
|
|
|
|
93
|
+ padding: EdgeInsets.symmetric(
|
|
|
|
94
|
+ vertical: ScreenUtil().setWidth(30)),
|
|
|
|
95
|
+ child: Column(
|
|
|
|
96
|
+ children: [
|
|
|
|
97
|
+ Row(
|
|
|
|
98
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
99
|
+ children: [
|
|
|
|
100
|
+ Text(
|
|
|
|
101
|
+ '19',
|
|
|
|
102
|
+ style: TextStyle(
|
|
|
|
103
|
+ color: MyColours.color_199095,
|
|
|
|
104
|
+ fontSize: ScreenUtil().setSp(60),
|
|
|
|
105
|
+ fontWeight: FontWeight.bold),
|
|
|
|
106
|
+ ),
|
|
|
|
107
|
+ Text(
|
|
|
|
108
|
+ '位',
|
|
|
|
109
|
+ style: TextStyle(
|
|
|
|
110
|
+ color: MyColours.color_199095,
|
|
|
|
111
|
+ fontWeight: FontWeight.bold,
|
|
|
|
112
|
+ fontSize: ScreenUtil().setSp(30)),
|
|
|
|
113
|
+ )
|
|
|
|
114
|
+ ],
|
|
|
|
115
|
+ ),
|
|
|
|
116
|
+ VEmptyView(10),
|
|
|
|
117
|
+ RoundButton(
|
|
|
|
118
|
+ onPressed: () async {
|
|
|
|
119
|
+ NavigatorUtil.goCustomerListPage(context);
|
|
|
|
120
|
+ },
|
|
|
|
121
|
+ text: '我的客户',
|
|
|
|
122
|
+ fontSize: 24,
|
|
|
|
123
|
+ isBold: false,
|
|
|
|
124
|
+ textColor: MyColours.color_333333,
|
|
|
|
125
|
+ gradientStart: MyColours.color_ffffff,
|
|
|
|
126
|
+ gradientEnd: MyColours.color_ffffff,
|
|
|
|
127
|
+ borderColor: Color.fromRGBO(118, 118, 118, 1),
|
|
|
|
128
|
+ height: ScreenUtil().setWidth(45),
|
|
|
|
129
|
+ width: ScreenUtil().setWidth(160),
|
|
|
|
130
|
+ radius: ScreenUtil().setWidth(30),
|
|
|
|
131
|
+ )
|
|
|
|
132
|
+ ],
|
|
|
|
133
|
+ ),
|
|
|
|
134
|
+ ),
|
|
|
|
135
|
+ VEmptyView(10),
|
|
|
|
136
|
+ GridView.builder(
|
|
|
|
137
|
+ controller: _controller,
|
|
|
|
138
|
+ shrinkWrap: true,
|
|
|
|
139
|
+ cacheExtent: ScreenUtil().setWidth(0),
|
|
|
|
140
|
+ itemCount: 3,
|
|
|
|
141
|
+ gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
|
|
|
142
|
+ crossAxisCount: 3,
|
|
|
|
143
|
+ childAspectRatio: 1,
|
|
|
|
144
|
+ mainAxisSpacing: ScreenUtil().setWidth(10),
|
|
|
|
145
|
+ crossAxisSpacing: ScreenUtil().setWidth(10)),
|
|
|
|
146
|
+ itemBuilder: (BuildContext context, int index) {
|
|
|
|
147
|
+ // locationState = state;
|
|
|
|
148
|
+ return _percentWidget('1999', '活跃客户', '39.20');
|
|
|
|
149
|
+ }),
|
|
|
|
150
|
+ // Row(
|
|
|
|
151
|
+ // children: [
|
|
|
|
152
|
+ // _percentWidget('19992', '活跃客户', '90.90'),
|
|
|
|
153
|
+ // HEmptyView(10),
|
|
|
|
154
|
+ // _percentWidget('19992', '沉睡客户', '90.90'),
|
|
|
|
155
|
+ // HEmptyView(10),
|
|
|
|
156
|
+ // _percentWidget('19992', '流失客户', '5.90'),
|
|
|
|
157
|
+ // ],
|
|
|
|
158
|
+ // ),
|
|
|
|
159
|
+
|
|
|
|
160
|
+ ListView.builder(
|
|
|
|
161
|
+ controller: _controller,
|
|
|
|
162
|
+ shrinkWrap: true,
|
|
|
|
163
|
+ cacheExtent: ScreenUtil().setWidth(0),
|
|
|
|
164
|
+ itemCount: 20,
|
|
|
|
165
|
+ itemBuilder: (BuildContext context, int index) {
|
|
|
|
166
|
+ // locationState = state;
|
|
|
|
167
|
+ return Column(
|
|
|
|
168
|
+ children: [
|
|
|
|
169
|
+ VEmptyView(10),
|
|
|
|
170
|
+ Container(
|
|
|
|
171
|
+ color: MyColours.color_ffffff,
|
|
|
|
172
|
+ padding: EdgeInsets.symmetric(
|
|
|
|
173
|
+ horizontal: ScreenUtil().setWidth(20),
|
|
|
|
174
|
+ vertical: ScreenUtil().setWidth(30)),
|
|
|
|
175
|
+ child: Row(
|
|
|
|
176
|
+ children: [
|
|
|
|
177
|
+ Image.asset(
|
|
|
|
178
|
+ Utils.getImgPath('warning'),
|
|
|
|
179
|
+ width: ScreenUtil().setWidth(34),
|
|
|
|
180
|
+ ),
|
|
|
|
181
|
+ HEmptyView(10),
|
|
|
|
182
|
+ Expanded(
|
|
|
|
183
|
+ child: Text(
|
|
|
|
184
|
+ '2为顾客马上快递费哈健身房哈尽快发货阿花房间卡都会发觉客服哈空间发哈尽快发货卡上的房间卡上发哈尽快',
|
|
|
|
185
|
+ maxLines: 10,
|
|
|
|
186
|
+ overflow: TextOverflow.ellipsis,
|
|
|
|
187
|
+ style: TextStyle(
|
|
|
|
188
|
+ color: MyColours.color_333333,
|
|
|
|
189
|
+ fontSize: ScreenUtil().setSp(28)),
|
|
|
|
190
|
+ )),
|
|
|
|
191
|
+ HEmptyView(30),
|
|
|
|
192
|
+ RoundButton(
|
|
|
|
193
|
+ text: '立即完成',
|
|
|
|
194
|
+
|
|
|
|
195
|
+ padding: EdgeInsets.symmetric(
|
|
|
|
196
|
+ horizontal: ScreenUtil().setWidth(26)),
|
|
|
|
197
|
+ gradientStart: MyColours.color_199095,
|
|
|
|
198
|
+ gradientEnd: MyColours.color_199095,
|
|
|
|
199
|
+ // borderColor: MyColours.color_999999,
|
|
|
|
200
|
+ radius: ScreenUtil().setWidth(40),
|
|
|
|
201
|
+ height: ScreenUtil().setWidth(64),
|
|
|
|
202
|
+ fontSize: 26,
|
|
|
|
203
|
+ isBold: false,
|
|
|
|
204
|
+ onPressed: () {
|
|
|
|
205
|
+ // NavigatorUtil.goEnterStoreEnvironmentPage(context);
|
|
|
|
206
|
+ },
|
|
|
|
207
|
+ ),
|
|
|
|
208
|
+ ],
|
|
|
|
209
|
+ ),
|
|
|
|
210
|
+ )
|
|
|
|
211
|
+ ],
|
|
|
|
212
|
+ );
|
|
|
|
213
|
+ })
|
|
|
|
214
|
+ ],
|
|
|
|
215
|
+ ),
|
|
|
|
216
|
+ )),
|
|
|
|
217
|
+ Padding(
|
|
|
|
218
|
+ padding: EdgeInsets.only(bottom: ScreenUtil().setWidth(30)),
|
|
|
|
219
|
+ child: RoundButton(
|
|
|
|
220
|
+ onPressed: () {
|
|
|
|
221
|
+ NavigatorUtil.goMarketingRecordsPage(context);
|
|
|
|
222
|
+ },
|
|
|
|
223
|
+ text: '营销记录',
|
|
|
|
224
|
+ fontSize: 24,
|
|
|
|
225
|
+ isBold: false,
|
|
|
|
226
|
+ textColor: MyColours.color_199095,
|
|
|
|
227
|
+ gradientStart: MyColours.color_ffffff,
|
|
|
|
228
|
+ gradientEnd: MyColours.color_ffffff,
|
|
|
|
229
|
+ borderColor: MyColours.color_199095,
|
|
|
|
230
|
+ height: ScreenUtil().setWidth(75),
|
|
|
|
231
|
+ width: ScreenUtil().setWidth(260),
|
|
|
|
232
|
+ radius: ScreenUtil().setWidth(10),
|
|
|
|
233
|
+ // image: Utils.getImgPath('add_area')
|
|
|
|
234
|
+ ),
|
|
|
|
235
|
+ )
|
|
|
|
236
|
+ ])),
|
|
19
|
);
|
237
|
);
|
|
20
|
}
|
238
|
}
|
|
21
|
} |
239
|
} |