feat: 动态页面二级评论查看
This commit is contained in:
@ -23,7 +23,7 @@ class ReplyHttp {
|
|||||||
Map errMap = {
|
Map errMap = {
|
||||||
-400: '请求错误',
|
-400: '请求错误',
|
||||||
-404: '无此项',
|
-404: '无此项',
|
||||||
12002: '评论区已关闭',
|
12002: '当前页面评论功能已关闭"',
|
||||||
12009: '评论主体的type不合法',
|
12009: '评论主体的type不合法',
|
||||||
12061: 'UP主已关闭评论区',
|
12061: 'UP主已关闭评论区',
|
||||||
};
|
};
|
||||||
@ -48,6 +48,7 @@ class ReplyHttp {
|
|||||||
'pn': pageNum,
|
'pn': pageNum,
|
||||||
'type': type,
|
'type': type,
|
||||||
'sort': 1,
|
'sort': 1,
|
||||||
|
'csrf': await Request.getCsrf(),
|
||||||
});
|
});
|
||||||
if (res.data['code'] == 0) {
|
if (res.data['code'] == 0) {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@ -4,6 +4,8 @@ enum ReplyType {
|
|||||||
video,
|
video,
|
||||||
// 话题
|
// 话题
|
||||||
topic,
|
topic,
|
||||||
|
//
|
||||||
|
unset2,
|
||||||
// 活动
|
// 活动
|
||||||
activity,
|
activity,
|
||||||
// 小视频
|
// 小视频
|
||||||
|
|||||||
@ -4,9 +4,11 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:pilipala/common/skeleton/video_reply.dart';
|
import 'package:pilipala/common/skeleton/video_reply.dart';
|
||||||
import 'package:pilipala/common/widgets/http_error.dart';
|
import 'package:pilipala/common/widgets/http_error.dart';
|
||||||
|
import 'package:pilipala/models/common/reply_type.dart';
|
||||||
import 'package:pilipala/pages/dynamics/deatil/index.dart';
|
import 'package:pilipala/pages/dynamics/deatil/index.dart';
|
||||||
import 'package:pilipala/pages/dynamics/widgets/author_panel.dart';
|
import 'package:pilipala/pages/dynamics/widgets/author_panel.dart';
|
||||||
import 'package:pilipala/pages/video/detail/reply/widgets/reply_item.dart';
|
import 'package:pilipala/pages/video/detail/reply/widgets/reply_item.dart';
|
||||||
|
import 'package:pilipala/pages/video/detail/replyReply/index.dart';
|
||||||
|
|
||||||
import '../widgets/dynamic_panel.dart';
|
import '../widgets/dynamic_panel.dart';
|
||||||
|
|
||||||
@ -25,19 +27,20 @@ class _DynamicDetailPageState extends State<DynamicDetailPage> {
|
|||||||
final ScrollController scrollController = ScrollController();
|
final ScrollController scrollController = ScrollController();
|
||||||
bool _visibleTitle = false;
|
bool _visibleTitle = false;
|
||||||
String? action;
|
String? action;
|
||||||
|
// 回复类型
|
||||||
|
late int type;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
int oid = 0;
|
int oid = 0;
|
||||||
int type = 0;
|
// floor 1原创 2转发
|
||||||
if (Get.arguments['floor'] == 1) {
|
if (Get.arguments['floor'] == 1) {
|
||||||
oid = int.parse(Get.arguments['item'].basic!['comment_id_str']);
|
oid = int.parse(Get.arguments['item'].basic!['comment_id_str']);
|
||||||
type = Get.arguments['item'].basic!['comment_type'];
|
|
||||||
} else {
|
} else {
|
||||||
oid = Get.arguments['item'].modules.moduleDynamic.major.draw.id;
|
oid = Get.arguments['item'].modules.moduleDynamic.major.draw.id;
|
||||||
type = 11;
|
|
||||||
}
|
}
|
||||||
|
type = Get.arguments['item'].basic!['comment_type'];
|
||||||
action =
|
action =
|
||||||
Get.arguments.containsKey('action') ? Get.arguments['action'] : null;
|
Get.arguments.containsKey('action') ? Get.arguments['action'] : null;
|
||||||
_dynamicDetailController = Get.put(DynamicDetailController(oid, type));
|
_dynamicDetailController = Get.put(DynamicDetailController(oid, type));
|
||||||
@ -68,6 +71,26 @@ class _DynamicDetailPageState extends State<DynamicDetailPage> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void replyReply(replyItem, paddingTop) {
|
||||||
|
int oid = replyItem.replies!.first.oid;
|
||||||
|
int rpid = replyItem.rpid!;
|
||||||
|
Get.to(
|
||||||
|
() => Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: const Text('评论详情'),
|
||||||
|
centerTitle: false,
|
||||||
|
),
|
||||||
|
body: VideoReplyReplyPanel(
|
||||||
|
oid: oid,
|
||||||
|
rpid: rpid,
|
||||||
|
paddingTop: paddingTop,
|
||||||
|
source: 'dynamic',
|
||||||
|
replyType: ReplyType.values[type],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
@ -189,10 +212,14 @@ class _DynamicDetailPageState extends State<DynamicDetailPage> {
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return ReplyItem(
|
return ReplyItem(
|
||||||
replyItem: _dynamicDetailController!
|
replyItem:
|
||||||
.replyList[index],
|
_dynamicDetailController!.replyList[index],
|
||||||
showReplyRow: true,
|
showReplyRow: true,
|
||||||
replyLevel: '1');
|
replyLevel: '1',
|
||||||
|
replyReply: (replyItem, paddingTop) =>
|
||||||
|
replyReply(replyItem, paddingTop),
|
||||||
|
replyType: ReplyType.album,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
childCount:
|
childCount:
|
||||||
@ -212,7 +239,7 @@ class _DynamicDetailPageState extends State<DynamicDetailPage> {
|
|||||||
return SliverList(
|
return SliverList(
|
||||||
delegate: SliverChildBuilderDelegate((context, index) {
|
delegate: SliverChildBuilderDelegate((context, index) {
|
||||||
return const VideoReplySkeleton();
|
return const VideoReplySkeleton();
|
||||||
}, childCount: 5),
|
}, childCount: 8),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import 'package:get/get.dart';
|
|||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
import 'package:pilipala/http/constants.dart';
|
import 'package:pilipala/http/constants.dart';
|
||||||
import 'package:pilipala/http/video.dart';
|
import 'package:pilipala/http/video.dart';
|
||||||
|
import 'package:pilipala/models/common/reply_type.dart';
|
||||||
import 'package:pilipala/models/video/play/url.dart';
|
import 'package:pilipala/models/video/play/url.dart';
|
||||||
import 'package:pilipala/models/video/reply/item.dart';
|
import 'package:pilipala/models/video/reply/item.dart';
|
||||||
import 'package:pilipala/pages/video/detail/replyReply/index.dart';
|
import 'package:pilipala/pages/video/detail/replyReply/index.dart';
|
||||||
@ -87,6 +88,8 @@ class VideoDetailController extends GetxController
|
|||||||
},
|
},
|
||||||
firstFloor: firstFloor,
|
firstFloor: firstFloor,
|
||||||
paddingTop: paddingTop,
|
paddingTop: paddingTop,
|
||||||
|
replyType: ReplyType.video,
|
||||||
|
source: 'videoDetail',
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
ctr?.closed.then((value) {
|
ctr?.closed.then((value) {
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import 'package:get/get.dart';
|
|||||||
import 'package:pilipala/common/skeleton/video_reply.dart';
|
import 'package:pilipala/common/skeleton/video_reply.dart';
|
||||||
import 'package:pilipala/common/widgets/http_error.dart';
|
import 'package:pilipala/common/widgets/http_error.dart';
|
||||||
import 'package:pilipala/models/video/reply/item.dart';
|
import 'package:pilipala/models/video/reply/item.dart';
|
||||||
|
import 'package:pilipala/pages/video/detail/index.dart';
|
||||||
import 'package:pilipala/pages/video/detail/replyNew/index.dart';
|
import 'package:pilipala/pages/video/detail/replyNew/index.dart';
|
||||||
import 'package:pilipala/utils/id_utils.dart';
|
import 'package:pilipala/utils/id_utils.dart';
|
||||||
import 'controller.dart';
|
import 'controller.dart';
|
||||||
@ -113,6 +114,16 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
|
|||||||
_videoReplyController.wakeUpReply();
|
_videoReplyController.wakeUpReply();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 展示二级回复
|
||||||
|
void replyReply(replyItem, paddingTop) {
|
||||||
|
VideoDetailController videoDetailCtr =
|
||||||
|
Get.find<VideoDetailController>(tag: Get.arguments['heroTag']);
|
||||||
|
videoDetailCtr.oid = replyItem.replies!.first.oid;
|
||||||
|
videoDetailCtr.fRpid = replyItem.rpid!;
|
||||||
|
videoDetailCtr.firstFloor = replyItem;
|
||||||
|
videoDetailCtr.showReplyReplyPanel(paddingTop);
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
super.dispose();
|
super.dispose();
|
||||||
@ -164,10 +175,13 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return ReplyItem(
|
return ReplyItem(
|
||||||
replyItem:
|
replyItem:
|
||||||
_videoReplyController.replyList[index],
|
_videoReplyController.replyList[index],
|
||||||
showReplyRow: true,
|
showReplyRow: true,
|
||||||
replyLevel: replyLevel);
|
replyLevel: replyLevel,
|
||||||
|
replyReply: (replyItem, paddingTop) =>
|
||||||
|
replyReply(replyItem, paddingTop),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
childCount:
|
childCount:
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import 'package:flutter_meedu_media_kit/meedu_player.dart';
|
|||||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
||||||
|
import 'package:pilipala/models/common/reply_type.dart';
|
||||||
import 'package:pilipala/models/video/reply/item.dart';
|
import 'package:pilipala/models/video/reply/item.dart';
|
||||||
import 'package:pilipala/pages/video/detail/controller.dart';
|
import 'package:pilipala/pages/video/detail/controller.dart';
|
||||||
import 'package:pilipala/pages/video/detail/reply/index.dart';
|
import 'package:pilipala/pages/video/detail/reply/index.dart';
|
||||||
@ -14,16 +15,21 @@ import 'package:pilipala/pages/video/detail/replyReply/index.dart';
|
|||||||
import 'package:pilipala/utils/utils.dart';
|
import 'package:pilipala/utils/utils.dart';
|
||||||
|
|
||||||
class ReplyItem extends StatelessWidget {
|
class ReplyItem extends StatelessWidget {
|
||||||
ReplyItem(
|
ReplyItem({
|
||||||
{super.key,
|
super.key,
|
||||||
this.replyItem,
|
this.replyItem,
|
||||||
this.addReply,
|
this.addReply,
|
||||||
this.replyLevel,
|
this.replyLevel,
|
||||||
this.showReplyRow});
|
this.showReplyRow,
|
||||||
|
this.replyReply,
|
||||||
|
this.replyType,
|
||||||
|
});
|
||||||
ReplyItemModel? replyItem;
|
ReplyItemModel? replyItem;
|
||||||
Function? addReply;
|
Function? addReply;
|
||||||
String? replyLevel;
|
String? replyLevel;
|
||||||
bool? showReplyRow = true;
|
bool? showReplyRow = true;
|
||||||
|
Function? replyReply;
|
||||||
|
ReplyType? replyType;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -212,6 +218,7 @@ class ReplyItem extends StatelessWidget {
|
|||||||
replyControl: replyItem!.replyControl,
|
replyControl: replyItem!.replyControl,
|
||||||
f_rpid: replyItem!.rpid,
|
f_rpid: replyItem!.rpid,
|
||||||
replyItem: replyItem,
|
replyItem: replyItem,
|
||||||
|
replyReply: replyReply,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -272,11 +279,13 @@ class ReplyItem extends StatelessWidget {
|
|||||||
isScrollControlled: true,
|
isScrollControlled: true,
|
||||||
builder: (builder) {
|
builder: (builder) {
|
||||||
return VideoReplyNewDialog(
|
return VideoReplyNewDialog(
|
||||||
replyLevel: replyLevel,
|
replyLevel: replyLevel,
|
||||||
oid: replyItem!.oid,
|
oid: replyItem!.oid,
|
||||||
root: replyItem!.rpid,
|
root: replyItem!.rpid,
|
||||||
parent: replyItem!.rpid,
|
parent: replyItem!.rpid,
|
||||||
paddingTop: paddingTop);
|
paddingTop: paddingTop,
|
||||||
|
replyType: replyType,
|
||||||
|
);
|
||||||
},
|
},
|
||||||
).then((value) => {
|
).then((value) => {
|
||||||
// 完成评论,数据添加
|
// 完成评论,数据添加
|
||||||
@ -320,21 +329,25 @@ class ReplyItem extends StatelessWidget {
|
|||||||
|
|
||||||
// ignore: must_be_immutable
|
// ignore: must_be_immutable
|
||||||
class ReplyItemRow extends StatelessWidget {
|
class ReplyItemRow extends StatelessWidget {
|
||||||
ReplyItemRow(
|
ReplyItemRow({
|
||||||
{super.key,
|
super.key,
|
||||||
this.replies,
|
this.replies,
|
||||||
this.replyControl,
|
this.replyControl,
|
||||||
this.f_rpid,
|
this.f_rpid,
|
||||||
this.replyItem});
|
this.replyItem,
|
||||||
|
this.replyReply,
|
||||||
|
});
|
||||||
List? replies;
|
List? replies;
|
||||||
ReplyControl? replyControl;
|
ReplyControl? replyControl;
|
||||||
int? f_rpid;
|
int? f_rpid;
|
||||||
ReplyItemModel? replyItem;
|
ReplyItemModel? replyItem;
|
||||||
|
Function? replyReply;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
bool isShow = replyControl!.isShow!;
|
bool isShow = replyControl!.isShow!;
|
||||||
int extraRow = replyControl != null && isShow ? 1 : 0;
|
int extraRow = replyControl != null && isShow ? 1 : 0;
|
||||||
|
double paddingTop = MediaQuery.of(context).padding.top;
|
||||||
return Container(
|
return Container(
|
||||||
margin: const EdgeInsets.only(left: 42, right: 4, top: 0),
|
margin: const EdgeInsets.only(left: 42, right: 4, top: 0),
|
||||||
child: Material(
|
child: Material(
|
||||||
@ -347,8 +360,7 @@ class ReplyItemRow extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
for (var i = 0; i < replies!.length; i++) ...[
|
for (var i = 0; i < replies!.length; i++) ...[
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () =>
|
onTap: () => replyReply!(replyItem, paddingTop),
|
||||||
replyReply(replyItem, MediaQuery.of(context).padding.top),
|
|
||||||
child: Container(
|
child: Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
padding: EdgeInsets.fromLTRB(
|
padding: EdgeInsets.fromLTRB(
|
||||||
@ -398,8 +410,7 @@ class ReplyItemRow extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
if (extraRow == 1)
|
if (extraRow == 1)
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () =>
|
onTap: () => replyReply!(replyItem, paddingTop),
|
||||||
replyReply(replyItem, MediaQuery.of(context).padding.top),
|
|
||||||
child: Container(
|
child: Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
padding: const EdgeInsets.fromLTRB(8, 5, 8, 8),
|
padding: const EdgeInsets.fromLTRB(8, 5, 8, 8),
|
||||||
@ -428,16 +439,6 @@ class ReplyItemRow extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void replyReply(replyItem, paddingTop) {
|
|
||||||
// replyItem 楼主评论
|
|
||||||
VideoDetailController videoDetailCtr =
|
|
||||||
Get.find<VideoDetailController>(tag: Get.arguments['heroTag']);
|
|
||||||
videoDetailCtr.oid = replies!.first.oid;
|
|
||||||
videoDetailCtr.fRpid = f_rpid!;
|
|
||||||
videoDetailCtr.firstFloor = replyItem;
|
|
||||||
videoDetailCtr.showReplyReplyPanel(paddingTop);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
InlineSpan buildContent(BuildContext context, content) {
|
InlineSpan buildContent(BuildContext context, content) {
|
||||||
|
|||||||
@ -13,6 +13,7 @@ class VideoReplyNewDialog extends StatefulWidget {
|
|||||||
String? replyLevel;
|
String? replyLevel;
|
||||||
int? parent;
|
int? parent;
|
||||||
double? paddingTop;
|
double? paddingTop;
|
||||||
|
ReplyType? replyType;
|
||||||
|
|
||||||
VideoReplyNewDialog({
|
VideoReplyNewDialog({
|
||||||
this.oid,
|
this.oid,
|
||||||
@ -20,6 +21,7 @@ class VideoReplyNewDialog extends StatefulWidget {
|
|||||||
this.replyLevel,
|
this.replyLevel,
|
||||||
this.parent,
|
this.parent,
|
||||||
this.paddingTop,
|
this.paddingTop,
|
||||||
|
this.replyType,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -64,7 +66,7 @@ class _VideoReplyNewDialogState extends State<VideoReplyNewDialog>
|
|||||||
Future submitReplyAdd() async {
|
Future submitReplyAdd() async {
|
||||||
String message = _replyContentController.text;
|
String message = _replyContentController.text;
|
||||||
var result = await VideoHttp.replyAdd(
|
var result = await VideoHttp.replyAdd(
|
||||||
type: ReplyType.video,
|
type: widget.replyType!,
|
||||||
oid: widget.oid!,
|
oid: widget.oid!,
|
||||||
root: widget.root!,
|
root: widget.root!,
|
||||||
parent: widget.parent!,
|
parent: widget.parent!,
|
||||||
|
|||||||
@ -1,16 +1,18 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:pilipala/http/reply.dart';
|
import 'package:pilipala/http/reply.dart';
|
||||||
|
import 'package:pilipala/models/common/reply_type.dart';
|
||||||
import 'package:pilipala/models/video/reply/data.dart';
|
import 'package:pilipala/models/video/reply/data.dart';
|
||||||
import 'package:pilipala/models/video/reply/item.dart';
|
import 'package:pilipala/models/video/reply/item.dart';
|
||||||
|
|
||||||
class VideoReplyReplyController extends GetxController {
|
class VideoReplyReplyController extends GetxController {
|
||||||
VideoReplyReplyController(this.aid, this.rpid);
|
VideoReplyReplyController(this.aid, this.rpid, this.replyType);
|
||||||
final ScrollController scrollController = ScrollController();
|
final ScrollController scrollController = ScrollController();
|
||||||
// 视频aid 请求时使用的oid
|
// 视频aid 请求时使用的oid
|
||||||
int? aid;
|
int? aid;
|
||||||
// rpid 请求楼中楼回复
|
// rpid 请求楼中楼回复
|
||||||
String? rpid;
|
String? rpid;
|
||||||
|
ReplyType replyType = ReplyType.video;
|
||||||
RxList<ReplyItemModel> replyList = [ReplyItemModel()].obs;
|
RxList<ReplyItemModel> replyList = [ReplyItemModel()].obs;
|
||||||
// 当前页
|
// 当前页
|
||||||
int currentPage = 0;
|
int currentPage = 0;
|
||||||
@ -41,7 +43,10 @@ class VideoReplyReplyController extends GetxController {
|
|||||||
}
|
}
|
||||||
isLoadingMore = true;
|
isLoadingMore = true;
|
||||||
var res = await ReplyHttp.replyReplyList(
|
var res = await ReplyHttp.replyReplyList(
|
||||||
oid: aid!, root: rpid!, pageNum: currentPage + 1, type: 1);
|
oid: aid!,
|
||||||
|
root: rpid!,
|
||||||
|
pageNum: currentPage + 1,
|
||||||
|
type: replyType.index);
|
||||||
if (res['status']) {
|
if (res['status']) {
|
||||||
res['data'] = ReplyData.fromJson(res['data']);
|
res['data'] = ReplyData.fromJson(res['data']);
|
||||||
if (res['data'].replies.isNotEmpty) {
|
if (res['data'].replies.isNotEmpty) {
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:pilipala/common/skeleton/video_reply.dart';
|
import 'package:pilipala/common/skeleton/video_reply.dart';
|
||||||
import 'package:pilipala/common/widgets/http_error.dart';
|
import 'package:pilipala/common/widgets/http_error.dart';
|
||||||
|
import 'package:pilipala/models/common/reply_type.dart';
|
||||||
import 'package:pilipala/models/video/reply/item.dart';
|
import 'package:pilipala/models/video/reply/item.dart';
|
||||||
import 'package:pilipala/pages/video/detail/reply/widgets/reply_item.dart';
|
import 'package:pilipala/pages/video/detail/reply/widgets/reply_item.dart';
|
||||||
|
|
||||||
@ -13,6 +14,8 @@ class VideoReplyReplyPanel extends StatefulWidget {
|
|||||||
Function? closePanel;
|
Function? closePanel;
|
||||||
ReplyItemModel? firstFloor;
|
ReplyItemModel? firstFloor;
|
||||||
double? paddingTop;
|
double? paddingTop;
|
||||||
|
String? source;
|
||||||
|
ReplyType? replyType;
|
||||||
|
|
||||||
VideoReplyReplyPanel({
|
VideoReplyReplyPanel({
|
||||||
this.oid,
|
this.oid,
|
||||||
@ -20,6 +23,8 @@ class VideoReplyReplyPanel extends StatefulWidget {
|
|||||||
this.closePanel,
|
this.closePanel,
|
||||||
this.firstFloor,
|
this.firstFloor,
|
||||||
this.paddingTop,
|
this.paddingTop,
|
||||||
|
this.source,
|
||||||
|
this.replyType,
|
||||||
super.key,
|
super.key,
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -34,7 +39,8 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
_videoReplyReplyController = Get.put(
|
_videoReplyReplyController = Get.put(
|
||||||
VideoReplyReplyController(widget.oid, widget.rpid.toString()),
|
VideoReplyReplyController(
|
||||||
|
widget.oid, widget.rpid.toString(), widget.replyType!),
|
||||||
tag: widget.rpid.toString());
|
tag: widget.rpid.toString());
|
||||||
super.initState();
|
super.initState();
|
||||||
|
|
||||||
@ -62,34 +68,37 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return Container(
|
||||||
height: MediaQuery.of(context).size.height -
|
height: widget.source == 'videoDetail'
|
||||||
MediaQuery.of(context).size.width * 9 / 16 -
|
? MediaQuery.of(context).size.height -
|
||||||
widget.paddingTop!,
|
MediaQuery.of(context).size.width * 9 / 16 -
|
||||||
|
widget.paddingTop!
|
||||||
|
: null,
|
||||||
color: Theme.of(context).colorScheme.background,
|
color: Theme.of(context).colorScheme.background,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
if (widget.source == 'videoDetail')
|
||||||
height: 45,
|
Container(
|
||||||
padding: const EdgeInsets.only(left: 14, right: 14),
|
height: 45,
|
||||||
child: Row(
|
padding: const EdgeInsets.only(left: 14, right: 14),
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
child: Row(
|
||||||
children: [
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
Text(
|
children: [
|
||||||
'评论详情',
|
Text(
|
||||||
style: Theme.of(context).textTheme.titleMedium,
|
'评论详情',
|
||||||
),
|
style: Theme.of(context).textTheme.titleMedium,
|
||||||
IconButton(
|
),
|
||||||
icon: const Icon(Icons.close),
|
IconButton(
|
||||||
onPressed: () {
|
icon: const Icon(Icons.close),
|
||||||
_videoReplyReplyController.currentPage = 0;
|
onPressed: () {
|
||||||
_videoReplyReplyController.rPid = 0;
|
_videoReplyReplyController.currentPage = 0;
|
||||||
widget.closePanel!();
|
_videoReplyReplyController.rPid = 0;
|
||||||
Navigator.pop(context);
|
widget.closePanel!();
|
||||||
},
|
Navigator.pop(context);
|
||||||
),
|
},
|
||||||
],
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
Divider(
|
Divider(
|
||||||
height: 1,
|
height: 1,
|
||||||
color: Theme.of(context).dividerColor.withOpacity(0.1),
|
color: Theme.of(context).dividerColor.withOpacity(0.1),
|
||||||
@ -188,7 +197,7 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
|
|||||||
delegate:
|
delegate:
|
||||||
SliverChildBuilderDelegate((context, index) {
|
SliverChildBuilderDelegate((context, index) {
|
||||||
return const VideoReplySkeleton();
|
return const VideoReplySkeleton();
|
||||||
}, childCount: 5),
|
}, childCount: 8),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -15,6 +15,7 @@ import 'package:pilipala/pages/preview/index.dart';
|
|||||||
import 'package:pilipala/pages/search/index.dart';
|
import 'package:pilipala/pages/search/index.dart';
|
||||||
import 'package:pilipala/pages/searchResult/index.dart';
|
import 'package:pilipala/pages/searchResult/index.dart';
|
||||||
import 'package:pilipala/pages/video/detail/index.dart';
|
import 'package:pilipala/pages/video/detail/index.dart';
|
||||||
|
import 'package:pilipala/pages/video/detail/replyReply/index.dart';
|
||||||
import 'package:pilipala/pages/webview/index.dart';
|
import 'package:pilipala/pages/webview/index.dart';
|
||||||
import 'package:pilipala/pages/setting/index.dart';
|
import 'package:pilipala/pages/setting/index.dart';
|
||||||
import 'package:pilipala/pages/media/index.dart';
|
import 'package:pilipala/pages/media/index.dart';
|
||||||
@ -65,5 +66,7 @@ class Routes {
|
|||||||
GetPage(name: '/liveRoom', page: () => const LiveRoomPage()),
|
GetPage(name: '/liveRoom', page: () => const LiveRoomPage()),
|
||||||
// 用户中心
|
// 用户中心
|
||||||
GetPage(name: '/member', page: () => const MemberPage()),
|
GetPage(name: '/member', page: () => const MemberPage()),
|
||||||
|
// 二级回复
|
||||||
|
GetPage(name: '/replyReply', page: () => VideoReplyReplyPanel()),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user