|
|
|
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),
|
|
|
|
]))),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}))
|
|
|
|
],
|
|
|
|
)));
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|