|
|
|
import 'dart:ui';
|
|
|
|
|
|
|
|
import 'package:cached_network_image/cached_network_image.dart';
|
|
|
|
import 'package:fijkplayer/fijkplayer.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/rendering.dart';
|
|
|
|
import 'package:one_key/models/comments_label_model.dart';
|
|
|
|
import 'package:one_key/models/comments_model.dart';
|
|
|
|
import 'package:one_key/pages/my/comment_manage/input_buttom_widget.dart';
|
|
|
|
import 'package:one_key/pages/my/comment_manage/pop_route.dart';
|
|
|
|
import 'package:one_key/pages/my/comment_manage/video_page.dart';
|
|
|
|
import 'package:one_key/provider/user_model.dart';
|
|
|
|
import 'package:one_key/res/colors.dart';
|
|
|
|
import 'package:one_key/utils/dialog_util.dart';
|
|
...
|
...
|
@@ -13,6 +17,7 @@ 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 'package:video_player/video_player.dart';
|
|
|
|
|
|
|
|
import '../../../constant/state.dart';
|
|
|
|
import '../../../provider/comment_manage_provider.dart';
|
|
...
|
...
|
@@ -21,7 +26,10 @@ import '../../../utils/screen_util.dart'; |
|
|
|
import '../../../utils/utils.dart';
|
|
|
|
import '../../../widgets/page_exception.dart';
|
|
|
|
import '../../online_check/photo_view_wiget.dart';
|
|
|
|
import 'package:sliding_up_panel2/sliding_up_panel2.dart';
|
|
|
|
// import 'package:chewie/chewie.dart';
|
|
|
|
// import 'package:fijkplayer/fijkplayer.dart';
|
|
|
|
// import 'package:video_thumbnail/video_thumbnail.dart';
|
|
|
|
import 'package:cached_video_player/cached_video_player.dart';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 评价管理
|
|
...
|
...
|
@@ -40,6 +48,13 @@ class _CommentManageHomePageState extends State<CommentManageHomePage> { |
|
|
|
String label = '';
|
|
|
|
|
|
|
|
TextEditingController replyController = TextEditingController();
|
|
|
|
// 声明控制器(两个)
|
|
|
|
CachedVideoPlayerController videoPlayerController;
|
|
|
|
// ChewieController chewieController;
|
|
|
|
// final FijkPlayer player = FijkPlayer();
|
|
|
|
// VideoPlayerController _controller;
|
|
|
|
Future _initializeVideoPlayerFuture;
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
...
|
...
|
@@ -48,7 +63,7 @@ class _CommentManageHomePageState extends State<CommentManageHomePage> { |
|
|
|
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
|
|
_getSellerComments(isShowLoading: false);
|
|
|
|
_getCountCommentLabel(isShowLoading: false);
|
|
|
|
// _getCountCommentLabel(isShowLoading: false);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -56,18 +71,20 @@ class _CommentManageHomePageState extends State<CommentManageHomePage> { |
|
|
|
void dispose() {
|
|
|
|
bus.emit('changeStatusColor');
|
|
|
|
|
|
|
|
// videoPlayerController.dispose();
|
|
|
|
|
|
|
|
super.dispose();
|
|
|
|
}
|
|
|
|
|
|
|
|
///评价标签
|
|
|
|
_getCountCommentLabel({bool isShowLoading = true}) async {
|
|
|
|
Map<String, String> pramas = {
|
|
|
|
'sid': Provider.of<UserModel>(context, listen: false).user.sellerid,
|
|
|
|
};
|
|
|
|
// label
|
|
|
|
await commentManageProvider.getCountCommentLabel(context, pramas,
|
|
|
|
isShowLoading: isShowLoading);
|
|
|
|
}
|
|
|
|
// _getCountCommentLabel({bool isShowLoading = true}) async {
|
|
|
|
// Map<String, String> pramas = {
|
|
|
|
// 'sid': Provider.of<UserModel>(context, listen: false).user.sellerid,
|
|
|
|
// };
|
|
|
|
// // label
|
|
|
|
// await commentManageProvider.getCountCommentLabel(context, pramas,
|
|
|
|
// isShowLoading: isShowLoading);
|
|
|
|
// }
|
|
|
|
|
|
|
|
///评价列表
|
|
|
|
_getSellerComments({bool isShowLoading = true}) async {
|
|
...
|
...
|
@@ -76,9 +93,9 @@ class _CommentManageHomePageState extends State<CommentManageHomePage> { |
|
|
|
'scene': '3',
|
|
|
|
'status': '1'
|
|
|
|
};
|
|
|
|
if (label != '') {
|
|
|
|
pramas['label'] = label;
|
|
|
|
}
|
|
|
|
// if (label != '') {
|
|
|
|
// pramas['label'] = label;
|
|
|
|
// }
|
|
|
|
|
|
|
|
await commentManageProvider.getSellerComments(context, pramas,
|
|
|
|
isShowLoading: isShowLoading);
|
|
...
|
...
|
@@ -102,67 +119,67 @@ class _CommentManageHomePageState extends State<CommentManageHomePage> { |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
List<Widget> _labelWidget() {
|
|
|
|
List<Widget> data = [];
|
|
|
|
data.add(InkWell(
|
|
|
|
onTap: () {
|
|
|
|
allSelect = true;
|
|
|
|
commentManageProvider.commentsLabeldata.forEach((element) {
|
|
|
|
element.select = false;
|
|
|
|
});
|
|
|
|
setState(() {});
|
|
|
|
label = '';
|
|
|
|
_getSellerComments(isShowLoading: true);
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: w(8), vertical: w(3)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.circular(r(10)),
|
|
|
|
color: allSelect
|
|
|
|
? MyColours.color_33438E93
|
|
|
|
: MyColours.color_F8F7F3),
|
|
|
|
child: Text(
|
|
|
|
'全部',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: font(14),
|
|
|
|
color: allSelect
|
|
|
|
? MyColours.color_438E93
|
|
|
|
: MyColours.color_515151),
|
|
|
|
),
|
|
|
|
)));
|
|
|
|
for (int i = 0; i < commentManageProvider.commentsLabeldata.length; i++) {
|
|
|
|
CommentsLabelSunModel sunModel =
|
|
|
|
commentManageProvider.commentsLabeldata[i];
|
|
|
|
data.add(InkWell(
|
|
|
|
onTap: () {
|
|
|
|
commentManageProvider.commentsLabeldata.forEach((element) {
|
|
|
|
element.select = false;
|
|
|
|
});
|
|
|
|
allSelect = false;
|
|
|
|
sunModel.select = true;
|
|
|
|
setState(() {});
|
|
|
|
label = sunModel.name;
|
|
|
|
_getSellerComments(isShowLoading: true);
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: w(8), vertical: w(3)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.circular(r(10)),
|
|
|
|
color: sunModel.select
|
|
|
|
? MyColours.color_33438E93
|
|
|
|
: MyColours.color_F8F7F3),
|
|
|
|
child: Text(
|
|
|
|
sunModel.name,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: font(14),
|
|
|
|
color: sunModel.select
|
|
|
|
? MyColours.color_438E93
|
|
|
|
: MyColours.color_515151),
|
|
|
|
),
|
|
|
|
)));
|
|
|
|
}
|
|
|
|
return data;
|
|
|
|
}
|
|
|
|
// List<Widget> _labelWidget() {
|
|
|
|
// List<Widget> data = [];
|
|
|
|
// data.add(InkWell(
|
|
|
|
// onTap: () {
|
|
|
|
// allSelect = true;
|
|
|
|
// commentManageProvider.commentsLabeldata.forEach((element) {
|
|
|
|
// element.select = false;
|
|
|
|
// });
|
|
|
|
// setState(() {});
|
|
|
|
// label = '';
|
|
|
|
// _getSellerComments(isShowLoading: true);
|
|
|
|
// },
|
|
|
|
// child: Container(
|
|
|
|
// padding: EdgeInsets.symmetric(horizontal: w(8), vertical: w(3)),
|
|
|
|
// decoration: BoxDecoration(
|
|
|
|
// borderRadius: BorderRadius.circular(r(10)),
|
|
|
|
// color: allSelect
|
|
|
|
// ? MyColours.color_33438E93
|
|
|
|
// : MyColours.color_F8F7F3),
|
|
|
|
// child: Text(
|
|
|
|
// '全部',
|
|
|
|
// style: TextStyle(
|
|
|
|
// fontSize: font(14),
|
|
|
|
// color: allSelect
|
|
|
|
// ? MyColours.color_438E93
|
|
|
|
// : MyColours.color_515151),
|
|
|
|
// ),
|
|
|
|
// )));
|
|
|
|
// for (int i = 0; i < commentManageProvider.commentsLabeldata.length; i++) {
|
|
|
|
// CommentsLabelSunModel sunModel =
|
|
|
|
// commentManageProvider.commentsLabeldata[i];
|
|
|
|
// data.add(InkWell(
|
|
|
|
// onTap: () {
|
|
|
|
// commentManageProvider.commentsLabeldata.forEach((element) {
|
|
|
|
// element.select = false;
|
|
|
|
// });
|
|
|
|
// allSelect = false;
|
|
|
|
// sunModel.select = true;
|
|
|
|
// setState(() {});
|
|
|
|
// label = sunModel.name;
|
|
|
|
// _getSellerComments(isShowLoading: true);
|
|
|
|
// },
|
|
|
|
// child: Container(
|
|
|
|
// padding: EdgeInsets.symmetric(horizontal: w(8), vertical: w(3)),
|
|
|
|
// decoration: BoxDecoration(
|
|
|
|
// borderRadius: BorderRadius.circular(r(10)),
|
|
|
|
// color: sunModel.select
|
|
|
|
// ? MyColours.color_33438E93
|
|
|
|
// : MyColours.color_F8F7F3),
|
|
|
|
// child: Text(
|
|
|
|
// sunModel.name,
|
|
|
|
// style: TextStyle(
|
|
|
|
// fontSize: font(14),
|
|
|
|
// color: sunModel.select
|
|
|
|
// ? MyColours.color_438E93
|
|
|
|
// : MyColours.color_515151),
|
|
|
|
// ),
|
|
|
|
// )));
|
|
|
|
// }
|
|
|
|
// return data;
|
|
|
|
// }
|
|
|
|
|
|
|
|
/// 九宫格
|
|
|
|
Widget _getGridImg(List<CommentsImageModel> imags) {
|
|
...
|
...
|
@@ -184,9 +201,63 @@ class _CommentManageHomePageState extends State<CommentManageHomePage> { |
|
|
|
//子组件宽高长度比例
|
|
|
|
childAspectRatio: 1.0),
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
if (imags[index].avinfo != null) {
|
|
|
|
videoPlayerController =
|
|
|
|
CachedVideoPlayerController.network(imags[index].url);
|
|
|
|
videoPlayerController.setLooping(false);
|
|
|
|
_initializeVideoPlayerFuture = videoPlayerController.initialize();
|
|
|
|
|
|
|
|
//视频
|
|
|
|
return InkWell(
|
|
|
|
onTap: () {
|
|
|
|
Navigator.push(
|
|
|
|
context,
|
|
|
|
PopRoute(
|
|
|
|
child: VideoPage(
|
|
|
|
url: imags[index].url,
|
|
|
|
)));
|
|
|
|
},
|
|
|
|
child: Stack(alignment: Alignment.center, children: [
|
|
|
|
ClipRRect(
|
|
|
|
borderRadius: BorderRadius.circular(r(8)),
|
|
|
|
child: FutureBuilder(
|
|
|
|
//显示缩略图
|
|
|
|
future: _initializeVideoPlayerFuture,
|
|
|
|
builder: (context, snapshot) {
|
|
|
|
print(snapshot.connectionState);
|
|
|
|
if (snapshot.hasError) print(snapshot.error);
|
|
|
|
if (snapshot.connectionState ==
|
|
|
|
ConnectionState.done) {
|
|
|
|
return AspectRatio(
|
|
|
|
aspectRatio: 1 / 1,
|
|
|
|
// aspectRatio: _controller.value.aspectRatio,
|
|
|
|
// child: VideoPlayer(videoPlayerController),
|
|
|
|
child:
|
|
|
|
CachedVideoPlayer(videoPlayerController));
|
|
|
|
} else {
|
|
|
|
return Center(
|
|
|
|
child: CircularProgressIndicator(),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
)),
|
|
|
|
Positioned(
|
|
|
|
child: Image.asset(
|
|
|
|
Utils.getImgPath('play'),
|
|
|
|
width: w(20),
|
|
|
|
))
|
|
|
|
]));
|
|
|
|
}
|
|
|
|
|
|
|
|
return InkWell(
|
|
|
|
onTap: () {
|
|
|
|
List<String> images = imags.map((e) => e.url).toList();
|
|
|
|
List<String> images = [];
|
|
|
|
imags.forEach((element) {
|
|
|
|
if (!element.mimeType.startsWith('video')) {
|
|
|
|
images.add(element.url);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
_showPhotoView(context, index, images);
|
|
|
|
},
|
|
|
|
child: ClipRRect(
|
|
...
|
...
|
@@ -246,7 +317,7 @@ class _CommentManageHomePageState extends State<CommentManageHomePage> { |
|
|
|
return ExceptionPage(
|
|
|
|
pageState: model.pageState,
|
|
|
|
callback: () async {
|
|
|
|
_getCountCommentLabel();
|
|
|
|
// _getCountCommentLabel();
|
|
|
|
_getSellerComments();
|
|
|
|
},
|
|
|
|
emptyMsg: "暂时没有评论列表信息哦",
|
|
...
|
...
|
@@ -259,13 +330,13 @@ class _CommentManageHomePageState extends State<CommentManageHomePage> { |
|
|
|
padding: EdgeInsets.symmetric(horizontal: w(20)),
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
child: Wrap(
|
|
|
|
runSpacing: w(10),
|
|
|
|
spacing: w(10),
|
|
|
|
children: _labelWidget()),
|
|
|
|
),
|
|
|
|
VEmptyView(10),
|
|
|
|
// Container(
|
|
|
|
// child: Wrap(
|
|
|
|
// runSpacing: w(10),
|
|
|
|
// spacing: w(10),
|
|
|
|
// children: _labelWidget()),
|
|
|
|
// ),
|
|
|
|
// VEmptyView(10),
|
|
|
|
Expanded(
|
|
|
|
child: ListView.builder(
|
|
|
|
itemCount:
|
|
...
|
...
|
@@ -299,10 +370,7 @@ class _CommentManageHomePageState extends State<CommentManageHomePage> { |
|
|
|
BorderRadius.circular(w(50)),
|
|
|
|
child: sunModel.authorImage !=
|
|
|
|
null &&
|
|
|
|
sunModel.authorImage !=
|
|
|
|
'' &&
|
|
|
|
!sunModel.authorImage
|
|
|
|
.endsWith('.mp4')
|
|
|
|
sunModel.authorImage != ''
|
|
|
|
? CachedNetworkImage(
|
|
|
|
imageUrl:
|
|
|
|
sunModel.authorImage,
|
|
...
|
...
|
@@ -356,51 +424,51 @@ class _CommentManageHomePageState extends State<CommentManageHomePage> { |
|
|
|
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 CachedNetworkImage(
|
|
|
|
imageUrl: index <=
|
|
|
|
int.parse(sunModel.grade) - 1
|
|
|
|
? 'http://nosqn.colorcun.com/pinglun/p%20%283%29.png'
|
|
|
|
: 'http://nosqn.colorcun.com/pinglun/p%20%284%29.png',
|
|
|
|
width: w(
|
|
|
|
15),
|
|
|
|
);
|
|
|
|
})),
|
|
|
|
HEmptyView(3),
|
|
|
|
Container(
|
|
|
|
padding: EdgeInsets
|
|
|
|
.symmetric(
|
|
|
|
vertical:
|
|
|
|
w(4)),
|
|
|
|
child: Text(
|
|
|
|
starTextMap[
|
|
|
|
'${sunModel.grade}'] ??
|
|
|
|
'',
|
|
|
|
maxLines: 2,
|
|
|
|
overflow:
|
|
|
|
TextOverflow
|
|
|
|
.ellipsis,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize:
|
|
|
|
font(12),
|
|
|
|
color: MyColours
|
|
|
|
.color_999999),
|
|
|
|
)),
|
|
|
|
// Spacer(),
|
|
|
|
// Container(
|
|
|
|
// width: w(75),
|
|
|
|
// height: w(24),
|
|
|
|
// child: ListView
|
|
|
|
// .builder(
|
|
|
|
// itemCount:
|
|
|
|
// 5,
|
|
|
|
// shrinkWrap:
|
|
|
|
// true,
|
|
|
|
// scrollDirection:
|
|
|
|
// Axis
|
|
|
|
// .horizontal,
|
|
|
|
// itemBuilder:
|
|
|
|
// (context,
|
|
|
|
// index) {
|
|
|
|
// return CachedNetworkImage(
|
|
|
|
// imageUrl: index <=
|
|
|
|
// int.parse(sunModel.grade) - 1
|
|
|
|
// ? 'http://nosqn.colorcun.com/pinglun/p%20%283%29.png'
|
|
|
|
// : 'http://nosqn.colorcun.com/pinglun/p%20%284%29.png',
|
|
|
|
// width: w(
|
|
|
|
// 15),
|
|
|
|
// );
|
|
|
|
// })),
|
|
|
|
// HEmptyView(3),
|
|
|
|
// Container(
|
|
|
|
// padding: EdgeInsets
|
|
|
|
// .symmetric(
|
|
|
|
// vertical:
|
|
|
|
// w(4)),
|
|
|
|
// child: Text(
|
|
|
|
// starTextMap[
|
|
|
|
// '${sunModel.grade}'] ??
|
|
|
|
// '',
|
|
|
|
// maxLines: 2,
|
|
|
|
// overflow:
|
|
|
|
// TextOverflow
|
|
|
|
// .ellipsis,
|
|
|
|
// style: TextStyle(
|
|
|
|
// fontSize:
|
|
|
|
// font(12),
|
|
|
|
// color: MyColours
|
|
|
|
// .color_999999),
|
|
|
|
// )),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
VEmptyView(8),
|
|
...
|
...
|
@@ -409,7 +477,7 @@ class _CommentManageHomePageState extends State<CommentManageHomePage> { |
|
|
|
.symmetric(
|
|
|
|
vertical: w(4)),
|
|
|
|
child: Text(
|
|
|
|
'就餐于 ${sunModel.ddate} ${sunModel.ddateSolt} ${sunModel.tableinfo}',
|
|
|
|
'就餐于 ${sunModel.ddate ?? ''} ${sunModel.ddateSolt ?? ''} ${sunModel.tableinfo ?? ''}',
|
|
|
|
maxLines: 10,
|
|
|
|
overflow: TextOverflow
|
|
|
|
.ellipsis,
|
|
...
|
...
|
@@ -452,19 +520,19 @@ class _CommentManageHomePageState extends State<CommentManageHomePage> { |
|
|
|
color: MyColours
|
|
|
|
.color_515151),
|
|
|
|
)),
|
|
|
|
Container(
|
|
|
|
padding: EdgeInsets
|
|
|
|
.symmetric(
|
|
|
|
vertical: w(4)),
|
|
|
|
child: Text(
|
|
|
|
'#${sunModel.evalLabel ?? ''}',
|
|
|
|
style: TextStyle(
|
|
|
|
height: 1.8,
|
|
|
|
fontSize:
|
|
|
|
font(12),
|
|
|
|
color: MyColours
|
|
|
|
.color_438E93),
|
|
|
|
)),
|
|
|
|
// Container(
|
|
|
|
// padding: EdgeInsets
|
|
|
|
// .symmetric(
|
|
|
|
// vertical: w(4)),
|
|
|
|
// child: Text(
|
|
|
|
// '#${sunModel.evalLabel ?? ''}',
|
|
|
|
// style: TextStyle(
|
|
|
|
// height: 1.8,
|
|
|
|
// fontSize:
|
|
|
|
// font(12),
|
|
|
|
// color: MyColours
|
|
|
|
// .color_438E93),
|
|
|
|
// )),
|
|
|
|
if (sunModel
|
|
|
|
.enclosure.length >
|
|
|
|
0)
|
...
|
...
|
|