comment_manage_home_page.dart
13.6 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
257
258
259
260
261
262
263
264
265
266
267
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:one_key/provider/user_model.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/widgets/h_empty_view.dart';
import 'package:one_key/widgets/round_button.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 '../../../provider/comment_manage_provider.dart';
import '../../../utils/event_bus.dart';
import '../../../utils/screen_util.dart';
import '../../../utils/utils.dart';
/**
* 评价管理
*/
class CommentManageHomePage extends StatefulWidget {
@override
_CommentManageHomePageState createState() => _CommentManageHomePageState();
}
class _CommentManageHomePageState extends State<CommentManageHomePage> {
CommentManageProvider commentManageProvider;
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
_getSellerComments();
});
}
@override
void dispose() {
bus.emit('changeStatusColor');
super.dispose();
}
///我的客户首页
_getSellerComments({bool isShowLoading = true}) async {
Map<String, String> pramas = {
'sid': Provider.of<UserModel>(context, listen: false).user.sellerid,
'scene': '3',
'status': '1'
};
// label
await commentManageProvider.getSellerComments(context, pramas,
isShowLoading: isShowLoading);
}
List<Widget> _labelWidget() {
List<Widget> data = [];
for (int i = 0; i < 10; i++) {
data.add(Container(
padding: EdgeInsets.symmetric(horizontal: w(8), vertical: w(3)),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(r(10)),
color: true ? MyColours.color_33438E93 : MyColours.color_F8F7F3),
child: Text(
'全部',
style: TextStyle(
fontSize: font(14),
color: true ? MyColours.color_438E93 : MyColours.color_515151),
),
));
}
return data;
}
@override
Widget build(BuildContext context) {
commentManageProvider =
Provider.of<CommentManageProvider>(context, listen: true);
return Scaffold(
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar('评价管理'),
body: Padding(
padding: EdgeInsets.symmetric(horizontal: w(20)),
child: Column(
children: [
Container(
child: Wrap(
runSpacing: w(10),
spacing: w(10),
children: _labelWidget()),
),
VEmptyView(10),
Expanded(
child: ListView.builder(
itemCount: 10,
shrinkWrap: true,
itemBuilder: (context, index) {
return Container(
margin: EdgeInsets.only(top: w(10)),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: w(0.5),
color: MyColours.color_DBDBDB))),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: w(50),
height: w(50),
margin: EdgeInsets.only(
left: w(8), right: w(8), top: w(20)),
child: ClipRRect(
borderRadius:
BorderRadius.circular(w(50)),
child: Container(
width: w(50),
height: w(50),
decoration: BoxDecoration(
color: MyColours.color_d9d9d9,
borderRadius:
BorderRadius.circular(r(50))),
))),
HEmptyView(34),
Expanded(
child: Padding(
padding: EdgeInsets.symmetric(
vertical: w(4)),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Row(
children: [
Container(
padding:
EdgeInsets.symmetric(
vertical: w(4)),
constraints:
BoxConstraints(
maxWidth: w(120)),
child: Text(
'四处行走的花',
maxLines: 10,
overflow: TextOverflow
.ellipsis,
style: TextStyle(
fontSize: font(14),
fontWeight:
FontWeight.bold,
color: MyColours
.color_515151),
)),
Spacer(),
Container(
width: w(75),
height: w(24),
child: ListView.builder(
itemCount: 5,
shrinkWrap: true,
scrollDirection:
Axis.horizontal,
itemBuilder:
(context, index) {
return Image.asset(
Utils.getImgPath(
'zwzp'),
width: w(15),
);
})),
Container(
padding:
EdgeInsets.symmetric(
vertical: w(4)),
child: Text(
'非常满意',
maxLines: 2,
overflow: TextOverflow
.ellipsis,
style: TextStyle(
fontSize: font(12),
color: MyColours
.color_999999),
)),
],
),
VEmptyView(8),
Container(
padding: EdgeInsets.symmetric(
vertical: w(4)),
child: Text(
'就餐于 2023-8-24 午餐 二楼205',
maxLines: 10,
overflow:
TextOverflow.ellipsis,
style: TextStyle(
fontSize: font(12),
color: MyColours
.color_999999),
)),
Container(
padding: EdgeInsets.symmetric(
vertical: w(4)),
child: Text(
'发表于 2023-8-25',
maxLines: 10,
overflow:
TextOverflow.ellipsis,
style: TextStyle(
fontSize: font(12),
color: MyColours
.color_999999),
)),
VEmptyView(8),
Container(
padding: EdgeInsets.symmetric(
vertical: w(4)),
child: Text(
'第二次来了,味道还是一如既往的好吃,包间也很干净整洁,',
style: TextStyle(
height: 1.8,
fontSize: font(12),
color: MyColours
.color_515151),
)),
Container(
padding: EdgeInsets.symmetric(
vertical: w(4)),
child: Text(
'#口味佳,服务热情',
style: TextStyle(
height: 1.8,
fontSize: font(12),
color: MyColours
.color_438E93),
)),
VEmptyView(8),
Align(
alignment:
Alignment.centerRight,
child: RoundButton(
text: '回复',
width: w(54),
height: w(24),
gradientStart:
MyColours.color_ffffff,
gradientEnd:
MyColours.color_ffffff,
textColor:
MyColours.color_000000,
fontSize: 24,
borderColor:
MyColours.color_999999,
radius: r(15),
),
),
VEmptyView(26),
]))),
],
),
);
}))
],
)));
}
}