@ -19,6 +19,7 @@ import 'package:pilipala/utils/utils.dart';
|
||||
import 'package:pilipala/utils/video_utils.dart';
|
||||
import 'package:screen_brightness/screen_brightness.dart';
|
||||
|
||||
import '../../../utils/id_utils.dart';
|
||||
import 'widgets/header_control.dart';
|
||||
|
||||
class VideoDetailController extends GetxController
|
||||
@ -61,7 +62,7 @@ class VideoDetailController extends GetxController
|
||||
Box localCache = GStrorage.localCache;
|
||||
Box setting = GStrorage.setting;
|
||||
|
||||
int oid = 0;
|
||||
RxInt oid = 0.obs;
|
||||
// 评论id 请求楼中楼评论使用
|
||||
int fRpid = 0;
|
||||
|
||||
@ -135,13 +136,14 @@ class VideoDetailController extends GetxController
|
||||
defaultValue: VideoDecodeFormats.values.last.code);
|
||||
cacheAudioQa = setting.get(SettingBoxKey.defaultAudioQa,
|
||||
defaultValue: AudioQuality.hiRes.code);
|
||||
oid.value = IdUtils.bv2av(Get.parameters['bvid']!);
|
||||
}
|
||||
|
||||
showReplyReplyPanel() {
|
||||
PersistentBottomSheetController? ctr =
|
||||
scaffoldKey.currentState?.showBottomSheet((BuildContext context) {
|
||||
return VideoReplyReplyPanel(
|
||||
oid: oid,
|
||||
oid: oid.value,
|
||||
rpid: fRpid,
|
||||
closePanel: () => {
|
||||
fRpid = 0,
|
||||
|
@ -476,6 +476,7 @@ class VideoIntroController extends GetxController {
|
||||
final VideoDetailController videoDetailCtr =
|
||||
Get.find<VideoDetailController>(tag: heroTag);
|
||||
videoDetailCtr.bvid = bvid;
|
||||
videoDetailCtr.oid.value = aid;
|
||||
videoDetailCtr.cid.value = cid;
|
||||
videoDetailCtr.danmakuCid.value = cid;
|
||||
videoDetailCtr.queryVideoUrl();
|
||||
|
@ -59,6 +59,7 @@ class VideoReplyController extends GetxController {
|
||||
isLoadingMore = true;
|
||||
if (type == 'init') {
|
||||
currentPage = 0;
|
||||
noMore.value = '';
|
||||
}
|
||||
if (noMore.value == '没有更多了') {
|
||||
return;
|
||||
|
@ -16,11 +16,13 @@ import 'widgets/reply_item.dart';
|
||||
|
||||
class VideoReplyPanel extends StatefulWidget {
|
||||
final String? bvid;
|
||||
final int? oid;
|
||||
final int rpid;
|
||||
final String? replyLevel;
|
||||
|
||||
const VideoReplyPanel({
|
||||
this.bvid,
|
||||
this.oid,
|
||||
this.rpid = 0,
|
||||
this.replyLevel,
|
||||
super.key,
|
||||
@ -48,16 +50,17 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
int oid = widget.bvid != null ? IdUtils.bv2av(widget.bvid!) : 0;
|
||||
// int oid = widget.bvid != null ? IdUtils.bv2av(widget.bvid!) : 0;
|
||||
heroTag = Get.arguments['heroTag'];
|
||||
replyLevel = widget.replyLevel ?? '1';
|
||||
if (replyLevel == '2') {
|
||||
_videoReplyController = Get.put(
|
||||
VideoReplyController(oid, widget.rpid.toString(), replyLevel),
|
||||
VideoReplyController(widget.oid, widget.rpid.toString(), replyLevel),
|
||||
tag: widget.rpid.toString());
|
||||
} else {
|
||||
_videoReplyController =
|
||||
Get.put(VideoReplyController(oid, '', replyLevel), tag: heroTag);
|
||||
_videoReplyController = Get.put(
|
||||
VideoReplyController(widget.oid, '', replyLevel),
|
||||
tag: heroTag);
|
||||
}
|
||||
|
||||
fabAnimationCtr = AnimationController(
|
||||
|
@ -570,8 +570,11 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
);
|
||||
},
|
||||
),
|
||||
VideoReplyPanel(
|
||||
Obx(
|
||||
() => VideoReplyPanel(
|
||||
bvid: videoDetailController.bvid,
|
||||
oid: videoDetailController.oid.value,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
Reference in New Issue
Block a user