mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-26 04:10:14 +08:00
deprecate replytype
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -8,7 +8,6 @@ import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/http/login.dart';
|
||||
import 'package:PiliPlus/models/bangumi/pgc_rank/pgc_rank_item_model.dart';
|
||||
import 'package:PiliPlus/models/common/account_type.dart';
|
||||
import 'package:PiliPlus/models/common/reply/reply_type.dart';
|
||||
import 'package:PiliPlus/models/home/rcmd/result.dart';
|
||||
import 'package:PiliPlus/models/member/article.dart';
|
||||
import 'package:PiliPlus/models/model_hot_video_item.dart';
|
||||
@@ -643,7 +642,7 @@ class VideoHttp {
|
||||
// message str 发送评论内容 必要 最大1000字符
|
||||
// plat num 发送平台标识 非必要 1:web端 2:安卓客户端 3:ios客户端 4:wp客户端
|
||||
static Future replyAdd({
|
||||
required ReplyType type,
|
||||
required int type,
|
||||
required int oid,
|
||||
required String message,
|
||||
int? root,
|
||||
@@ -655,7 +654,7 @@ class VideoHttp {
|
||||
return {'status': false, 'msg': '请输入评论内容'};
|
||||
}
|
||||
Map<String, dynamic> data = {
|
||||
'type': type.index,
|
||||
'type': type,
|
||||
'oid': oid,
|
||||
if (root != null && root != 0) 'root': root,
|
||||
if (parent != null && parent != 0) 'parent': parent,
|
||||
|
||||
@@ -1,49 +1,49 @@
|
||||
enum ReplyType {
|
||||
unset,
|
||||
// 视频
|
||||
video,
|
||||
// 话题
|
||||
topic,
|
||||
//
|
||||
unset2,
|
||||
// 活动
|
||||
activity,
|
||||
// 小视频
|
||||
videoS,
|
||||
// 小黑屋封禁信息
|
||||
blockMsg,
|
||||
// 公告信息
|
||||
publicMsg,
|
||||
// 直播活动
|
||||
liveActivity,
|
||||
// 活动稿件
|
||||
activityFile,
|
||||
// 直播公告
|
||||
livePublic,
|
||||
// 相簿
|
||||
album,
|
||||
// 专栏
|
||||
column,
|
||||
// 票务
|
||||
ticket,
|
||||
// 音频
|
||||
audio,
|
||||
// 风纪委员会
|
||||
unset3,
|
||||
// 点评
|
||||
comment,
|
||||
// 动态
|
||||
dynamics,
|
||||
// 播单
|
||||
playList,
|
||||
// 音乐播单
|
||||
musicPlayList,
|
||||
// 漫画
|
||||
comics1,
|
||||
// 漫画
|
||||
comics2,
|
||||
// 漫画
|
||||
comics3,
|
||||
// 课程
|
||||
course,
|
||||
}
|
||||
// enum ReplyType {
|
||||
// unset,
|
||||
// // 视频
|
||||
// video,
|
||||
// // 话题
|
||||
// topic,
|
||||
// //
|
||||
// unset2,
|
||||
// // 活动
|
||||
// activity,
|
||||
// // 小视频
|
||||
// videoS,
|
||||
// // 小黑屋封禁信息
|
||||
// blockMsg,
|
||||
// // 公告信息
|
||||
// publicMsg,
|
||||
// // 直播活动
|
||||
// liveActivity,
|
||||
// // 活动稿件
|
||||
// activityFile,
|
||||
// // 直播公告
|
||||
// livePublic,
|
||||
// // 相簿
|
||||
// album,
|
||||
// // 专栏
|
||||
// column,
|
||||
// // 票务
|
||||
// ticket,
|
||||
// // 音频
|
||||
// audio,
|
||||
// // 风纪委员会
|
||||
// unset3,
|
||||
// // 点评
|
||||
// comment,
|
||||
// // 动态
|
||||
// dynamics,
|
||||
// // 播单
|
||||
// playList,
|
||||
// // 音乐播单
|
||||
// musicPlayList,
|
||||
// // 漫画
|
||||
// comics1,
|
||||
// // 漫画
|
||||
// comics2,
|
||||
// // 漫画
|
||||
// comics3,
|
||||
// // 课程
|
||||
// course,
|
||||
// }
|
||||
|
||||
@@ -14,7 +14,6 @@ import 'package:PiliPlus/models/common/badge_type.dart';
|
||||
import 'package:PiliPlus/models/common/image_preview_type.dart';
|
||||
import 'package:PiliPlus/models/common/image_type.dart';
|
||||
import 'package:PiliPlus/models/common/reply/reply_sort_type.dart';
|
||||
import 'package:PiliPlus/models/common/reply/reply_type.dart';
|
||||
import 'package:PiliPlus/models/dynamics/result.dart' show DynamicStat;
|
||||
import 'package:PiliPlus/pages/article/controller.dart';
|
||||
import 'package:PiliPlus/pages/article/widgets/html_render.dart';
|
||||
@@ -195,7 +194,7 @@ class _ArticlePageState extends State<ArticlePage>
|
||||
oid: oid,
|
||||
rpid: rpid,
|
||||
source: 'dynamic',
|
||||
replyType: ReplyType.values[_articleCtr.commentType],
|
||||
replyType: _articleCtr.commentType,
|
||||
firstFloor: replyItem,
|
||||
onDispose: onDispose,
|
||||
),
|
||||
@@ -813,7 +812,7 @@ class _ArticlePageState extends State<ArticlePage>
|
||||
_articleCtr.onReply(
|
||||
context,
|
||||
oid: _articleCtr.commentId,
|
||||
replyType: ReplyType.values[_articleCtr.commentType],
|
||||
replyType: _articleCtr.commentType,
|
||||
);
|
||||
},
|
||||
tooltip: '评论动态',
|
||||
|
||||
@@ -4,7 +4,6 @@ import 'package:PiliPlus/grpc/bilibili/pagination.pb.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/http/reply.dart';
|
||||
import 'package:PiliPlus/models/common/reply/reply_sort_type.dart';
|
||||
import 'package:PiliPlus/models/common/reply/reply_type.dart';
|
||||
import 'package:PiliPlus/pages/common/common_list_controller.dart';
|
||||
import 'package:PiliPlus/pages/video/reply_new/view.dart';
|
||||
import 'package:PiliPlus/utils/feed_back.dart';
|
||||
@@ -111,11 +110,12 @@ abstract class ReplyController<R> extends CommonListController<R, ReplyInfo> {
|
||||
|
||||
void onReply(
|
||||
BuildContext context, {
|
||||
dynamic oid,
|
||||
dynamic replyItem,
|
||||
int? oid,
|
||||
ReplyInfo? replyItem,
|
||||
int index = 0,
|
||||
ReplyType? replyType,
|
||||
int? replyType,
|
||||
}) {
|
||||
assert(replyItem != null || (oid != null && replyType != null));
|
||||
String? hint;
|
||||
try {
|
||||
if (loadingState.value is Success) {
|
||||
@@ -128,18 +128,16 @@ abstract class ReplyController<R> extends CommonListController<R, ReplyInfo> {
|
||||
}
|
||||
}
|
||||
} catch (_) {}
|
||||
dynamic key = oid ?? replyItem.oid + replyItem.id;
|
||||
dynamic key = oid ?? replyItem!.oid + replyItem.id;
|
||||
Navigator.of(context)
|
||||
.push(
|
||||
GetDialogRoute(
|
||||
pageBuilder: (buildContext, animation, secondaryAnimation) {
|
||||
return ReplyPage(
|
||||
oid: oid ?? replyItem.oid.toInt(),
|
||||
root: oid != null ? 0 : replyItem.id.toInt(),
|
||||
parent: oid != null ? 0 : replyItem.id.toInt(),
|
||||
replyType: replyItem != null
|
||||
? ReplyType.values[replyItem.type.toInt()]
|
||||
: replyType,
|
||||
oid: oid ?? replyItem!.oid.toInt(),
|
||||
root: oid != null ? 0 : replyItem!.id.toInt(),
|
||||
parent: oid != null ? 0 : replyItem!.id.toInt(),
|
||||
replyType: replyItem?.type.toInt() ?? replyType!,
|
||||
replyItem: replyItem,
|
||||
initialValue: savedReplies[key],
|
||||
onSave: (reply) {
|
||||
|
||||
@@ -3,7 +3,6 @@ import 'package:PiliPlus/grpc/bilibili/main/community/reply/v1.pb.dart'
|
||||
import 'package:PiliPlus/grpc/reply.dart';
|
||||
import 'package:PiliPlus/http/dynamics.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/models/common/reply/reply_type.dart';
|
||||
import 'package:PiliPlus/models/dynamics/result.dart';
|
||||
import 'package:PiliPlus/pages/common/reply_controller.dart';
|
||||
import 'package:PiliPlus/utils/id_utils.dart';
|
||||
@@ -21,8 +20,7 @@ class DynamicDetailController extends ReplyController<MainListReply> {
|
||||
late final showDynActionBar = GStorage.showDynActionBar;
|
||||
|
||||
@override
|
||||
dynamic get sourceId =>
|
||||
type == ReplyType.video.index ? IdUtils.av2bv(oid) : oid;
|
||||
dynamic get sourceId => type == 1 ? IdUtils.av2bv(oid) : oid;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
|
||||
@@ -10,7 +10,6 @@ import 'package:PiliPlus/grpc/bilibili/main/community/reply/v1.pb.dart'
|
||||
import 'package:PiliPlus/http/constants.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/models/common/reply/reply_sort_type.dart';
|
||||
import 'package:PiliPlus/models/common/reply/reply_type.dart';
|
||||
import 'package:PiliPlus/models/dynamics/result.dart';
|
||||
import 'package:PiliPlus/pages/dynamics/widgets/author_panel.dart';
|
||||
import 'package:PiliPlus/pages/dynamics/widgets/dynamic_panel.dart';
|
||||
@@ -190,7 +189,7 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
||||
oid: oid,
|
||||
rpid: rpid,
|
||||
source: 'dynamic',
|
||||
replyType: ReplyType.values[replyType],
|
||||
replyType: replyType,
|
||||
firstFloor: replyItem,
|
||||
onDispose: onDispose,
|
||||
),
|
||||
@@ -477,7 +476,7 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
||||
_dynamicDetailController.onReply(
|
||||
context,
|
||||
oid: _dynamicDetailController.oid,
|
||||
replyType: ReplyType.values[replyType],
|
||||
replyType: replyType,
|
||||
);
|
||||
},
|
||||
tooltip: '评论动态',
|
||||
|
||||
@@ -6,7 +6,6 @@ import 'package:PiliPlus/grpc/bilibili/main/community/reply/v1.pb.dart'
|
||||
show ReplyInfo;
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/models/common/reply/reply_sort_type.dart';
|
||||
import 'package:PiliPlus/models/common/reply/reply_type.dart';
|
||||
import 'package:PiliPlus/pages/video/reply/controller.dart';
|
||||
import 'package:PiliPlus/pages/video/reply/widgets/reply_item_grpc.dart';
|
||||
import 'package:PiliPlus/utils/feed_back.dart';
|
||||
@@ -175,7 +174,7 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
|
||||
_videoReplyController.onReply(
|
||||
context,
|
||||
oid: _videoReplyController.aid,
|
||||
replyType: ReplyType.video,
|
||||
replyType: 1,
|
||||
);
|
||||
},
|
||||
tooltip: '发表评论',
|
||||
@@ -239,7 +238,7 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
|
||||
_videoReplyController.onToggleTop(
|
||||
index,
|
||||
_videoReplyController.aid,
|
||||
ReplyType.video.index,
|
||||
1,
|
||||
isUpTop,
|
||||
rpid,
|
||||
),
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:PiliPlus/common/widgets/button/toolbar_icon_button.dart';
|
||||
import 'package:PiliPlus/grpc/bilibili/main/community/reply/v1.pb.dart'
|
||||
show ReplyInfo;
|
||||
import 'package:PiliPlus/http/video.dart';
|
||||
import 'package:PiliPlus/main.dart';
|
||||
import 'package:PiliPlus/models/common/publish_panel_type.dart';
|
||||
import 'package:PiliPlus/models/common/reply/reply_type.dart';
|
||||
import 'package:PiliPlus/pages/common/common_publish_page.dart';
|
||||
import 'package:PiliPlus/pages/emote/view.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
@@ -13,11 +14,11 @@ import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class ReplyPage extends CommonPublishPage {
|
||||
final int? oid;
|
||||
final int? root;
|
||||
final int? parent;
|
||||
final ReplyType? replyType;
|
||||
final dynamic replyItem;
|
||||
final int oid;
|
||||
final int root;
|
||||
final int parent;
|
||||
final int replyType;
|
||||
final ReplyInfo? replyItem;
|
||||
final String? hint;
|
||||
|
||||
const ReplyPage({
|
||||
@@ -25,10 +26,10 @@ class ReplyPage extends CommonPublishPage {
|
||||
super.initialValue,
|
||||
super.imageLengthLimit,
|
||||
super.onSave,
|
||||
this.oid,
|
||||
this.root,
|
||||
this.parent,
|
||||
this.replyType,
|
||||
required this.oid,
|
||||
required this.root,
|
||||
required this.parent,
|
||||
required this.replyType,
|
||||
this.replyItem,
|
||||
this.hint,
|
||||
});
|
||||
@@ -243,12 +244,12 @@ class _ReplyPageState extends CommonPublishPageState<ReplyPage> {
|
||||
Future<void> onCustomPublish(
|
||||
{required String message, List? pictures}) async {
|
||||
var result = await VideoHttp.replyAdd(
|
||||
type: widget.replyType ?? ReplyType.video,
|
||||
oid: widget.oid!,
|
||||
root: widget.root!,
|
||||
parent: widget.parent!,
|
||||
message: widget.replyItem != null && widget.replyItem.root != 0
|
||||
? ' 回复 @${widget.replyItem.member.name} : $message'
|
||||
type: widget.replyType,
|
||||
oid: widget.oid,
|
||||
root: widget.root,
|
||||
parent: widget.parent,
|
||||
message: widget.replyItem != null && widget.replyItem!.root != 0
|
||||
? ' 回复 @${widget.replyItem!.member.name} : $message'
|
||||
: message,
|
||||
pictures: pictures,
|
||||
syncToDynamic: _syncToDynamic.value,
|
||||
|
||||
@@ -2,7 +2,6 @@ import 'package:PiliPlus/grpc/bilibili/main/community/reply/v1.pb.dart'
|
||||
show ReplyInfo, DetailListReply, Mode;
|
||||
import 'package:PiliPlus/grpc/reply.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/models/common/reply/reply_type.dart';
|
||||
import 'package:PiliPlus/pages/common/reply_controller.dart';
|
||||
import 'package:PiliPlus/utils/id_utils.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
@@ -30,7 +29,7 @@ class VideoReplyReplyController extends ReplyController
|
||||
int oid;
|
||||
// rpid 请求楼中楼回复
|
||||
int rpid;
|
||||
ReplyType replyType; // = ReplyType.video;
|
||||
int replyType; // = ReplyType.video;
|
||||
|
||||
ReplyInfo? firstFloor;
|
||||
|
||||
@@ -40,8 +39,7 @@ class VideoReplyReplyController extends ReplyController
|
||||
late final horizontalPreview = GStorage.horizontalPreview;
|
||||
|
||||
@override
|
||||
dynamic get sourceId =>
|
||||
replyType == ReplyType.video ? IdUtils.av2bv(oid) : oid;
|
||||
dynamic get sourceId => replyType == 1 ? IdUtils.av2bv(oid) : oid;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
@@ -108,7 +106,7 @@ class VideoReplyReplyController extends ReplyController
|
||||
@override
|
||||
Future<LoadingState> customGetData() => isDialogue
|
||||
? ReplyGrpc.dialogList(
|
||||
type: replyType.index,
|
||||
type: replyType,
|
||||
oid: oid,
|
||||
root: rpid,
|
||||
dialog: dialog!,
|
||||
@@ -116,7 +114,7 @@ class VideoReplyReplyController extends ReplyController
|
||||
antiGoodsReply: antiGoodsReply,
|
||||
)
|
||||
: ReplyGrpc.detailList(
|
||||
type: replyType.index,
|
||||
type: replyType,
|
||||
oid: oid,
|
||||
root: rpid,
|
||||
rpid: id ?? 0,
|
||||
|
||||
@@ -4,7 +4,6 @@ import 'package:PiliPlus/common/widgets/refresh_indicator.dart';
|
||||
import 'package:PiliPlus/grpc/bilibili/main/community/reply/v1.pb.dart'
|
||||
show ReplyInfo, Mode;
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/models/common/reply/reply_type.dart';
|
||||
import 'package:PiliPlus/pages/common/common_slide_page.dart';
|
||||
import 'package:PiliPlus/pages/video/reply/widgets/reply_item_grpc.dart';
|
||||
import 'package:PiliPlus/pages/video/reply_new/view.dart';
|
||||
@@ -39,7 +38,7 @@ class VideoReplyReplyPanel extends CommonSlidePage {
|
||||
final int? dialog;
|
||||
final ReplyInfo? firstFloor;
|
||||
final String? source;
|
||||
final ReplyType replyType;
|
||||
final int replyType;
|
||||
final bool isDialogue;
|
||||
final VoidCallback? onViewImage;
|
||||
final ValueChanged<int>? onDismissed;
|
||||
@@ -194,7 +193,7 @@ class _VideoReplyReplyPanelState
|
||||
_videoReplyReplyController.onToggleTop(
|
||||
index,
|
||||
_videoReplyReplyController.oid,
|
||||
_videoReplyReplyController.replyType.index,
|
||||
_videoReplyReplyController.replyType,
|
||||
isUpTop,
|
||||
rpid,
|
||||
),
|
||||
@@ -457,7 +456,7 @@ class _VideoReplyReplyPanelState
|
||||
onToggleTop: (isUpTop, rpid) => _videoReplyReplyController.onToggleTop(
|
||||
index,
|
||||
_videoReplyReplyController.oid,
|
||||
_videoReplyReplyController.replyType.index,
|
||||
_videoReplyReplyController.replyType,
|
||||
isUpTop,
|
||||
rpid,
|
||||
),
|
||||
|
||||
@@ -12,7 +12,6 @@ import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/main.dart';
|
||||
import 'package:PiliPlus/models/bangumi/info.dart' as bangumi;
|
||||
import 'package:PiliPlus/models/common/episode_panel_type.dart';
|
||||
import 'package:PiliPlus/models/common/reply/reply_type.dart';
|
||||
import 'package:PiliPlus/models/common/search_type.dart';
|
||||
import 'package:PiliPlus/models/video_detail_res.dart' as video;
|
||||
import 'package:PiliPlus/pages/danmaku/view.dart';
|
||||
@@ -2060,7 +2059,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
oid: oid,
|
||||
rpid: rpid,
|
||||
firstFloor: replyItem,
|
||||
replyType: ReplyType.video,
|
||||
replyType: 1,
|
||||
source: 'videoDetail',
|
||||
onViewImage: videoDetailController.onViewImage,
|
||||
onDismissed: videoDetailController.onDismissed,
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:PiliPlus/http/search.dart';
|
||||
import 'package:PiliPlus/models/common/reply/reply_type.dart';
|
||||
import 'package:PiliPlus/pages/video/reply_reply/view.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:PiliPlus/utils/id_utils.dart';
|
||||
@@ -114,7 +113,7 @@ class PiliScheme {
|
||||
arguments: {
|
||||
'oid': oid,
|
||||
'rpid': rpid,
|
||||
'type': ReplyType.video.index,
|
||||
'type': 1,
|
||||
'id': queryParameters['comment_secondary_id'],
|
||||
},
|
||||
() => Scaffold(
|
||||
@@ -141,7 +140,7 @@ class PiliScheme {
|
||||
oid: int.parse(oid),
|
||||
rpid: rpid,
|
||||
source: 'routePush',
|
||||
replyType: ReplyType.video,
|
||||
replyType: 1,
|
||||
firstFloor: null,
|
||||
id: queryParameters['comment_secondary_id'] != null
|
||||
? int.tryParse(
|
||||
@@ -285,7 +284,7 @@ class PiliScheme {
|
||||
rpid: rootId,
|
||||
id: rpId,
|
||||
source: 'routePush',
|
||||
replyType: ReplyType.values[type],
|
||||
replyType: type,
|
||||
firstFloor: null,
|
||||
),
|
||||
),
|
||||
@@ -335,7 +334,7 @@ class PiliScheme {
|
||||
oid: oid,
|
||||
rpid: rpId,
|
||||
source: 'routePush',
|
||||
replyType: ReplyType.values[type],
|
||||
replyType: type,
|
||||
firstFloor: null,
|
||||
),
|
||||
),
|
||||
@@ -375,7 +374,7 @@ class PiliScheme {
|
||||
arguments: {
|
||||
'oid': oid ?? dynId,
|
||||
'rpid': rpid,
|
||||
'type': businessId ?? ReplyType.dynamics.index,
|
||||
'type': businessId ?? 17,
|
||||
'id': queryParameters['comment_secondary_id'],
|
||||
},
|
||||
() => Scaffold(
|
||||
@@ -400,9 +399,7 @@ class PiliScheme {
|
||||
oid: oid ?? int.parse(dynId),
|
||||
rpid: rpid,
|
||||
source: 'routePush',
|
||||
replyType: businessId != null
|
||||
? ReplyType.values[businessId]
|
||||
: ReplyType.dynamics,
|
||||
replyType: businessId ?? 17,
|
||||
firstFloor: null,
|
||||
id: queryParameters['comment_secondary_id'] != null
|
||||
? int.tryParse(
|
||||
|
||||
Reference in New Issue
Block a user