wine_detail_page.dart
10.8 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/pages/my/store_wine_manage/wine_detail_item_page.dart';
import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:provider/provider.dart';
import '../../../models/wine_manage_model.dart';
import '../../../provider/store_wine_provider.dart';
import '../../../res/colors.dart';
import '../../../route/navigator_util.dart';
import '../../../utils/screen_util.dart';
import '../../../widgets/MyDivider.dart';
import '../../../widgets/h_empty_view.dart';
import '../../../widgets/round_button.dart';
import '../../../widgets/v_empty_view.dart';
/**
*
* 存酒详情页,只查看
*/
class WineDetailPage extends StatefulWidget {
WineDetailPage({Key key}) : super(key: key);
@override
_WineDetailPageState createState() => _WineDetailPageState();
}
class _WineDetailPageState extends State<WineDetailPage> {
StoreWineProvider storeWineProvider;
ScrollController _controller = ScrollController();
List dataWine = [];
@override
void initState() {
// TODO: implement initState
super.initState();
WineManageModel wineManageModel = WineManageModel();
dataWine.add(wineManageModel);
dataWine.add(wineManageModel);
}
Widget _textItemWidget(
String title,
String subTitle,
) {
return Column(children: [
Container(
height: ScreenUtil().setWidth(48 * 2),
padding: EdgeInsets.only(right: ScreenUtil().setWidth(16 * 2)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
title,
style: TextStyle(
color: MyColours.color_515151, fontSize: font(16)),
),
Text(subTitle,
//输入文本的样式
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_999999)),
// ),
],
)),
MyDivider(
double.infinity,
h(0.5),
color: MyColours.color_E7E7E7,
),
]);
}
@override
Widget build(BuildContext context) {
storeWineProvider = Provider.of<StoreWineProvider>(context, listen: true);
return Scaffold(
appBar: SystemAppBar(
'存酒详情',
onTap: () {
Navigator.pop(context);
},
),
body: Container(
child: Column(
children: [
Expanded(
child: SingleChildScrollView(
controller: _controller,
child: Column(
children: [
Container(
color: Colors.white,
padding: EdgeInsets.only(
left: ScreenUtil().setWidth(16 * 2)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
VEmptyView(32),
_textItemWidget(
'联系电话', Utils.starPhone('18799999999')),
Container(
height: ScreenUtil().setWidth(48 * 2),
padding: EdgeInsets.only(
top: ScreenUtil().setWidth(16 * 2),
right: ScreenUtil().setWidth(16 * 2)),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
'客人姓名',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(16)),
),
Expanded(
child: Container(
height: ScreenUtil().setWidth(16 * 2),
alignment: Alignment.centerRight,
child: Text('fff先生',
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_999999)),
)),
HEmptyView(40),
Container(
width: w(100),
alignment: Alignment.centerRight,
child: Text(
// '会员状态未知',
'会员',
style: TextStyle(
color: true
? MyColours.color_999999
: MyColours.color_515151,
fontSize: ScreenUtil().setSp(32),
),
),
),
],
)),
],
)),
ListView.builder(
shrinkWrap: true,
controller: _controller,
itemCount: dataWine.length,
itemBuilder: (context, index) {
WineManageModel wineManageModel = dataWine[index];
return WineDetailItemPage(
wineManageModel: wineManageModel,
controller: _controller,
index: index,
);
}),
],
),
)),
Container(
alignment: Alignment.centerLeft,
margin: EdgeInsets.only(
left: w(20), right: w(20), top: w(10), bottom: w(16)),
child: Text(
'注:为保障酒品安排,只有存酒管理员才可以进行存酒操作!',
style: TextStyle(
color: MyColours.color_999999, fontSize: font(10)),
)),
Container(
color: MyColours.color_ffffff,
padding: EdgeInsets.only(
top: ScreenUtil().setWidth(16 * 2),
bottom: ScreenUtil().setWidth(35 * 2),
left: ScreenUtil().setWidth(45 * 2),
right: ScreenUtil().setWidth(45 * 2),
),
child: Row(
children: [
RoundButton(
text: '出库记录',
width: w(100),
height: ScreenUtil().setWidth(80),
radius: ScreenUtil().setWidth(10),
isBold: true,
borderColor: MyColours.color_438E93,
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
textColor: MyColours.color_438E93,
fontSize: 32,
onPressed: () async {
// UserModel userModel =
// Provider.of<UserModel>(context, listen: false);
// if (userModel.user.role_name == '管理员' ||
// userModel.user.role_name == '店长') {
NavigatorUtil.goOutStoreRecordPage(context);
// } else {
// bool needRefresh =
// await NavigatorUtil.goCouponEditPage(context);
// print(needRefresh);
// if (needRefresh != null && needRefresh) {
// bus.emit('refresh_coupon_list_f');
// //刷新页面数据
// // _controller.callRefresh();
// // _couponNetworkData(tabController.index);
// }
// }
},
),
HEmptyView(30),
Expanded(
child: RoundButton(
text: '存酒出库',
// width: w(218),
height: ScreenUtil().setWidth(80),
radius: ScreenUtil().setWidth(10),
isBold: true,
gradientStart: true
? MyColours.color_BFC4D4
: MyColours.color_438E93,
gradientEnd: true
? MyColours.color_BFC4D4
: MyColours.color_438E93,
fontSize: 32,
onPressed: () async {
Utils.showToast('您不是店铺的存酒管理员,无权进行相关操作。');
// UserModel userModel =
// Provider.of<UserModel>(context, listen: false);
// if (userModel.user.role_name == '管理员' ||
// userModel.user.role_name == '店长') {
NavigatorUtil.goApplyOutStorePage(context);
// } else {
// bool needRefresh =
// await NavigatorUtil.goCouponEditPage(context);
// print(needRefresh);
// if (needRefresh != null && needRefresh) {
// bus.emit('refresh_coupon_list_f');
// //刷新页面数据
// // _controller.callRefresh();
// // _couponNetworkData(tabController.index);
// }
// }
},
)),
],
))
],
),
));
}
}