mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-01 08:38:18 +08:00
feat: bili comm antifraud
Closes #275 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -4,25 +4,21 @@ import 'package:PiliPlus/models/common/reply_type.dart';
|
||||
import 'package:PiliPlus/pages/common/reply_controller.dart';
|
||||
import 'package:PiliPlus/http/reply.dart';
|
||||
import 'package:PiliPlus/utils/global_data.dart';
|
||||
import 'package:PiliPlus/utils/id_utils.dart';
|
||||
import 'package:fixnum/fixnum.dart' as $fixnum;
|
||||
|
||||
class VideoReplyController extends ReplyController {
|
||||
VideoReplyController(
|
||||
this.aid,
|
||||
this.rpid,
|
||||
this.replyLevel,
|
||||
);
|
||||
VideoReplyController({required this.aid});
|
||||
// 视频aid 请求时使用的oid
|
||||
int? aid;
|
||||
// 层级 2为楼中楼
|
||||
String? replyLevel;
|
||||
// rpid 请求楼中楼回复
|
||||
String? rpid;
|
||||
int aid;
|
||||
|
||||
@override
|
||||
dynamic get sourceId => IdUtils.av2bv(aid);
|
||||
|
||||
@override
|
||||
Future<LoadingState> customGetData() => GlobalData().grpcReply
|
||||
? ReplyHttp.replyListGrpc(
|
||||
oid: aid!,
|
||||
oid: aid,
|
||||
cursor: CursorReq(
|
||||
next: cursor?.next ?? $fixnum.Int64(0),
|
||||
mode: mode.value,
|
||||
@@ -32,7 +28,7 @@ class VideoReplyController extends ReplyController {
|
||||
)
|
||||
: ReplyHttp.replyList(
|
||||
isLogin: isLogin,
|
||||
oid: aid!,
|
||||
oid: aid,
|
||||
nextOffset: nextOffset,
|
||||
type: ReplyType.video.index,
|
||||
sort: sortType.value.index,
|
||||
|
||||
@@ -14,12 +14,11 @@ import 'package:get/get.dart';
|
||||
import 'package:PiliPlus/common/skeleton/video_reply.dart';
|
||||
import 'package:PiliPlus/models/common/reply_type.dart';
|
||||
import 'package:PiliPlus/utils/feed_back.dart';
|
||||
import 'package:PiliPlus/utils/id_utils.dart';
|
||||
import 'controller.dart';
|
||||
|
||||
class VideoReplyPanel extends StatefulWidget {
|
||||
final String? bvid;
|
||||
final int? oid;
|
||||
final int oid;
|
||||
final int rpid;
|
||||
final String? replyLevel;
|
||||
final String heroTag;
|
||||
@@ -31,7 +30,7 @@ class VideoReplyPanel extends StatefulWidget {
|
||||
const VideoReplyPanel({
|
||||
super.key,
|
||||
this.bvid,
|
||||
this.oid,
|
||||
required this.oid,
|
||||
this.rpid = 0,
|
||||
this.replyLevel,
|
||||
required this.heroTag,
|
||||
@@ -65,13 +64,7 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
|
||||
// heroTag = Get.arguments['heroTag'];
|
||||
heroTag = widget.heroTag;
|
||||
replyLevel = widget.replyLevel ?? '1';
|
||||
if (replyLevel == '2') {
|
||||
_videoReplyController = Get.put(
|
||||
VideoReplyController(widget.oid, widget.rpid.toString(), replyLevel),
|
||||
tag: widget.rpid.toString());
|
||||
} else {
|
||||
_videoReplyController = Get.find<VideoReplyController>(tag: heroTag);
|
||||
}
|
||||
_videoReplyController = Get.find<VideoReplyController>(tag: heroTag);
|
||||
|
||||
fabAnimationCtr = AnimationController(
|
||||
vsync: this, duration: const Duration(milliseconds: 100));
|
||||
@@ -196,11 +189,9 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
|
||||
heroTag: null,
|
||||
onPressed: () {
|
||||
feedBack();
|
||||
dynamic oid = _videoReplyController.aid ??
|
||||
IdUtils.bv2av(Get.parameters['bvid']!);
|
||||
_videoReplyController.onReply(
|
||||
context,
|
||||
oid: oid,
|
||||
oid: _videoReplyController.aid,
|
||||
replyType: ReplyType.video,
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user