mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: reply2reply
This commit is contained in:
@@ -19,7 +19,7 @@ import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class BangumiIntroController extends GetxController {
|
||||
// 视频bvid
|
||||
String bvid = Get.parameters['bvid']!;
|
||||
String bvid = Get.parameters['bvid'] ?? '';
|
||||
var seasonId = Get.parameters['seasonId'] != null
|
||||
? int.parse(Get.parameters['seasonId']!)
|
||||
: null;
|
||||
@@ -294,7 +294,7 @@ class BangumiIntroController extends GetxController {
|
||||
VideoReplyController videoReplyCtr =
|
||||
Get.find<VideoReplyController>(tag: Get.arguments['heroTag']);
|
||||
videoReplyCtr.aid = aid;
|
||||
videoReplyCtr.queryData();
|
||||
videoReplyCtr.onRefresh();
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,12 +7,9 @@ import 'package:get/get.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:PiliPalaX/http/constants.dart';
|
||||
import 'package:PiliPalaX/http/video.dart';
|
||||
import 'package:PiliPalaX/models/common/reply_type.dart';
|
||||
import 'package:PiliPalaX/models/common/search_type.dart';
|
||||
import 'package:PiliPalaX/models/video/play/quality.dart';
|
||||
import 'package:PiliPalaX/models/video/play/url.dart';
|
||||
import 'package:PiliPalaX/models/video/reply/item.dart';
|
||||
import 'package:PiliPalaX/pages/video/detail/reply_reply/index.dart';
|
||||
import 'package:PiliPalaX/plugin/pl_player/index.dart';
|
||||
import 'package:PiliPalaX/utils/storage.dart';
|
||||
import 'package:PiliPalaX/utils/utils.dart';
|
||||
@@ -64,10 +61,7 @@ class VideoDetailController extends GetxController
|
||||
Box setting = GStorage.setting;
|
||||
|
||||
RxInt oid = 0.obs;
|
||||
// 评论id 请求楼中楼评论使用
|
||||
int fRpid = 0;
|
||||
|
||||
ReplyItemModel? firstFloor;
|
||||
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||||
RxString bgCover = ''.obs;
|
||||
PlPlayerController plPlayerController = PlPlayerController.getInstance();
|
||||
@@ -153,29 +147,6 @@ class VideoDetailController extends GetxController
|
||||
oid.value = IdUtils.bv2av(Get.parameters['bvid']!);
|
||||
}
|
||||
|
||||
showReplyReplyPanel(dynamic rcount) {
|
||||
replyReplyBottomSheetCtr =
|
||||
scaffoldKey.currentState?.showBottomSheet((BuildContext context) {
|
||||
// SmartDialog.show(
|
||||
// alignment: Alignment.bottomRight,
|
||||
// builder: (context) {
|
||||
return VideoReplyReplyPanel(
|
||||
rcount: rcount,
|
||||
oid: oid.value,
|
||||
rpid: fRpid,
|
||||
closePanel: () => {
|
||||
fRpid = 0,
|
||||
},
|
||||
firstFloor: firstFloor,
|
||||
replyType: ReplyType.video,
|
||||
source: 'videoDetail',
|
||||
);
|
||||
});
|
||||
replyReplyBottomSheetCtr?.closed.then((value) {
|
||||
fRpid = 0;
|
||||
});
|
||||
}
|
||||
|
||||
/// 更新画质、音质
|
||||
/// TODO 继续进度播放
|
||||
updatePlayer() {
|
||||
|
||||
@@ -488,7 +488,7 @@ class VideoIntroController extends GetxController {
|
||||
final VideoReplyController videoReplyCtr =
|
||||
Get.find<VideoReplyController>(tag: heroTag);
|
||||
videoReplyCtr.aid = aid;
|
||||
videoReplyCtr.queryData();
|
||||
videoReplyCtr.onRefresh();
|
||||
} catch (_) {}
|
||||
this.bvid = bvid;
|
||||
lastPlayCid.value = cid;
|
||||
|
||||
@@ -76,6 +76,8 @@ class _RelatedVideoPanelState extends State<RelatedVideoPanel>
|
||||
errMsg: '出错了',
|
||||
fn: _relatedController.onReload,
|
||||
)
|
||||
: loadingState is Empty
|
||||
? const SliverToBoxAdapter(child: SizedBox.shrink())
|
||||
: SliverGrid(
|
||||
gridDelegate: SliverGridDelegateWithExtentAndRatio(
|
||||
mainAxisSpacing: StyleString.safeSpace,
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import 'package:PiliPalaX/common/widgets/http_error.dart';
|
||||
import 'package:PiliPalaX/http/loading_state.dart';
|
||||
import 'package:PiliPalaX/pages/video/detail/reply_new/reply_page.dart';
|
||||
import 'package:PiliPalaX/pages/video/detail/reply_reply/view.dart';
|
||||
import 'package:easy_debounce/easy_throttle.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:PiliPalaX/common/skeleton/video_reply.dart';
|
||||
import 'package:PiliPalaX/models/common/reply_type.dart';
|
||||
import 'package:PiliPalaX/pages/video/detail/index.dart';
|
||||
import 'package:PiliPalaX/utils/feed_back.dart';
|
||||
import 'package:PiliPalaX/utils/id_utils.dart';
|
||||
import 'package:get/get_navigation/src/dialog/dialog_route.dart';
|
||||
@@ -121,14 +121,17 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
|
||||
|
||||
// 展示二级回复
|
||||
void replyReply(replyItem) {
|
||||
final VideoDetailController videoDetailCtr =
|
||||
Get.find<VideoDetailController>(tag: heroTag);
|
||||
if (replyItem != null) {
|
||||
videoDetailCtr.oid.value = replyItem.oid;
|
||||
videoDetailCtr.fRpid = replyItem.rpid!;
|
||||
videoDetailCtr.firstFloor = replyItem;
|
||||
videoDetailCtr.showReplyReplyPanel(replyItem.rcount);
|
||||
}
|
||||
showBottomSheet(
|
||||
context: context,
|
||||
builder: (context) => VideoReplyReplyPanel(
|
||||
rcount: replyItem.rcount,
|
||||
oid: replyItem.oid,
|
||||
rpid: replyItem.rpid,
|
||||
firstFloor: replyItem,
|
||||
replyType: ReplyType.video,
|
||||
source: 'videoDetail',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -311,7 +314,7 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
|
||||
replyItem: loadingState.response[index],
|
||||
showReplyRow: true,
|
||||
replyLevel: replyLevel,
|
||||
replyReply: (replyItem) => replyReply(replyItem),
|
||||
replyReply: replyReply,
|
||||
replyType: ReplyType.video,
|
||||
onReply: () {
|
||||
dynamic oid = loadingState.response[index].oid;
|
||||
|
||||
@@ -11,7 +11,6 @@ import 'package:PiliPalaX/common/widgets/badge.dart';
|
||||
import 'package:PiliPalaX/common/widgets/network_img_layer.dart';
|
||||
import 'package:PiliPalaX/models/common/reply_type.dart';
|
||||
import 'package:PiliPalaX/models/video/reply/item.dart';
|
||||
import 'package:PiliPalaX/pages/preview/index.dart';
|
||||
import 'package:PiliPalaX/pages/video/detail/index.dart';
|
||||
import 'package:PiliPalaX/utils/feed_back.dart';
|
||||
import 'package:PiliPalaX/utils/storage.dart';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'package:PiliPalaX/http/loading_state.dart';
|
||||
import 'package:PiliPalaX/pages/common/common_controller.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:PiliPalaX/http/reply.dart';
|
||||
import 'package:PiliPalaX/models/common/reply_type.dart';
|
||||
@@ -53,6 +52,12 @@ class VideoReplyReplyController extends CommonController {
|
||||
return true;
|
||||
}
|
||||
|
||||
@override
|
||||
Future queryData([bool isRefresh = true]) {
|
||||
if (noMore.value == '没有更多了') return Future.value();
|
||||
return super.queryData(isRefresh);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<LoadingState> customGetData() => ReplyHttp.replyReplyList(
|
||||
oid: aid!,
|
||||
|
||||
@@ -18,7 +18,6 @@ class VideoReplyReplyPanel extends StatefulWidget {
|
||||
this.rcount,
|
||||
this.oid,
|
||||
this.rpid,
|
||||
this.closePanel,
|
||||
this.firstFloor,
|
||||
this.source,
|
||||
this.replyType,
|
||||
@@ -27,7 +26,6 @@ class VideoReplyReplyPanel extends StatefulWidget {
|
||||
final dynamic rcount;
|
||||
final int? oid;
|
||||
final int? rpid;
|
||||
final Function? closePanel;
|
||||
final ReplyItemModel? firstFloor;
|
||||
final String? source;
|
||||
final ReplyType? replyType;
|
||||
@@ -46,7 +44,8 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
|
||||
_videoReplyReplyController = Get.put(
|
||||
VideoReplyReplyController(
|
||||
widget.oid, widget.rpid.toString(), widget.replyType!),
|
||||
tag: widget.rpid.toString());
|
||||
tag: widget.rpid.toString(),
|
||||
);
|
||||
|
||||
// 上拉加载更多
|
||||
_videoReplyReplyController.scrollController.addListener(
|
||||
@@ -64,11 +63,10 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
|
||||
);
|
||||
}
|
||||
|
||||
void replyReply(replyItem) {}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_videoReplyReplyController.scrollController.removeListener(() {});
|
||||
Get.delete<VideoReplyReplyController>(tag: widget.rpid.toString());
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@@ -91,10 +89,7 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
|
||||
IconButton(
|
||||
tooltip: '关闭',
|
||||
icon: const Icon(Icons.close, size: 20),
|
||||
onPressed: () {
|
||||
widget.closePanel!();
|
||||
Navigator.pop(context);
|
||||
},
|
||||
onPressed: Get.back,
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -123,7 +118,7 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
|
||||
// _videoReplyReplyController.replyList.add(replyItem);
|
||||
},
|
||||
replyType: widget.replyType,
|
||||
replyReply: replyReply,
|
||||
replyReply: () {},
|
||||
needDivider: false,
|
||||
onReply: () {
|
||||
_onReply(widget.firstFloor);
|
||||
@@ -209,7 +204,7 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
|
||||
// _videoReplyReplyController.replyList.add(replyItem);
|
||||
},
|
||||
replyType: widget.replyType,
|
||||
replyReply: replyReply,
|
||||
replyReply: () {},
|
||||
needDivider: false,
|
||||
onReply: () {
|
||||
_onReply(_videoReplyReplyController.root);
|
||||
|
||||
Reference in New Issue
Block a user