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