feat: comment can be closed
This commit is contained in:
@ -21,6 +21,7 @@ import 'package:pilipala/models/video/play/url.dart';
|
||||
import 'package:pilipala/models/video/reply/item.dart';
|
||||
import 'package:pilipala/pages/video/detail/reply_reply/index.dart';
|
||||
import 'package:pilipala/plugin/pl_player/index.dart';
|
||||
import 'package:pilipala/utils/global_data_cache.dart';
|
||||
import 'package:pilipala/utils/storage.dart';
|
||||
import 'package:pilipala/utils/utils.dart';
|
||||
import 'package:pilipala/utils/video_utils.dart';
|
||||
@ -140,8 +141,16 @@ class VideoDetailController extends GetxController
|
||||
} else if (argMap.containsKey('pic')) {
|
||||
updateCover(argMap['pic']);
|
||||
}
|
||||
|
||||
tabCtr = TabController(length: 2, vsync: this);
|
||||
tabs.value = <String>[
|
||||
'简介',
|
||||
if (videoType == SearchType.video &&
|
||||
GlobalDataCache.enableComment.contains('video'))
|
||||
'评论',
|
||||
if (videoType == SearchType.media_bangumi &&
|
||||
GlobalDataCache.enableComment.contains('bangumi'))
|
||||
'评论'
|
||||
];
|
||||
tabCtr = TabController(length: tabs.length, vsync: this);
|
||||
autoPlay.value =
|
||||
setting.get(SettingBoxKey.autoPlayEnable, defaultValue: true);
|
||||
enableHA.value = setting.get(SettingBoxKey.enableHA, defaultValue: false);
|
||||
|
||||
@ -17,6 +17,7 @@ import 'package:pilipala/pages/video/detail/controller.dart';
|
||||
import 'package:pilipala/pages/video/detail/reply/index.dart';
|
||||
import 'package:pilipala/plugin/pl_player/models/play_repeat.dart';
|
||||
import 'package:pilipala/utils/feed_back.dart';
|
||||
import 'package:pilipala/utils/global_data_cache.dart';
|
||||
import 'package:pilipala/utils/id_utils.dart';
|
||||
import 'package:pilipala/utils/storage.dart';
|
||||
import 'package:share_plus/share_plus.dart';
|
||||
@ -99,7 +100,11 @@ class VideoIntroController extends GetxController {
|
||||
}
|
||||
final VideoDetailController videoDetailCtr =
|
||||
Get.find<VideoDetailController>(tag: heroTag);
|
||||
videoDetailCtr.tabs.value = ['简介', '评论 ${result['data']?.stat?.reply}'];
|
||||
videoDetailCtr.tabs.value = [
|
||||
'简介',
|
||||
if (GlobalDataCache.enableComment.contains('video'))
|
||||
'评论 ${result['data']?.stat?.reply}'
|
||||
];
|
||||
videoDetailCtr.cover.value = cover ?? result['data'].pic ?? '';
|
||||
// 获取到粉丝数再返回
|
||||
await queryUserStat();
|
||||
@ -469,10 +474,12 @@ class VideoIntroController extends GetxController {
|
||||
// 重新请求评论
|
||||
try {
|
||||
/// 未渲染回复组件时可能异常
|
||||
final VideoReplyController videoReplyCtr =
|
||||
Get.find<VideoReplyController>(tag: heroTag);
|
||||
videoReplyCtr.aid = aid;
|
||||
videoReplyCtr.queryReplyList(type: 'init');
|
||||
if (GlobalDataCache.enableComment.contains('video')) {
|
||||
final VideoReplyController videoReplyCtr =
|
||||
Get.find<VideoReplyController>(tag: heroTag);
|
||||
videoReplyCtr.aid = aid;
|
||||
videoReplyCtr.queryReplyList(type: 'init');
|
||||
}
|
||||
} catch (_) {}
|
||||
this.bvid = bvid;
|
||||
await queryVideoIntro(cover: cover);
|
||||
|
||||
@ -24,6 +24,7 @@ import 'package:pilipala/pages/video/detail/related/index.dart';
|
||||
import 'package:pilipala/plugin/pl_player/index.dart';
|
||||
import 'package:pilipala/plugin/pl_player/models/play_repeat.dart';
|
||||
import 'package:pilipala/services/service_locator.dart';
|
||||
import 'package:pilipala/utils/global_data_cache.dart';
|
||||
import 'package:pilipala/utils/storage.dart';
|
||||
import 'package:status_bar_control/status_bar_control.dart';
|
||||
|
||||
@ -779,13 +780,20 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
);
|
||||
},
|
||||
),
|
||||
Obx(
|
||||
() => VideoReplyPanel(
|
||||
bvid: vdCtr.bvid,
|
||||
oid: vdCtr.oid.value,
|
||||
onControllerCreated: vdCtr.onControllerCreated,
|
||||
),
|
||||
)
|
||||
if ((vdCtr.videoType == SearchType.media_bangumi &&
|
||||
GlobalDataCache.enableComment
|
||||
.contains('bangumi')) ||
|
||||
(vdCtr.videoType == SearchType.video &&
|
||||
GlobalDataCache.enableComment
|
||||
.contains('video'))) ...[
|
||||
Obx(
|
||||
() => VideoReplyPanel(
|
||||
bvid: vdCtr.bvid,
|
||||
oid: vdCtr.oid.value,
|
||||
onControllerCreated: vdCtr.onControllerCreated,
|
||||
),
|
||||
)
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user