mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-19 00:26:18 +08:00
@@ -1,11 +1,13 @@
|
||||
import 'package:PiliPlus/grpc/bilibili/main/community/reply/v1.pb.dart'
|
||||
show MainListReply, ReplyInfo;
|
||||
import 'package:PiliPlus/grpc/reply.dart';
|
||||
import 'package:PiliPlus/http/dynamics.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/models/dynamics/result.dart';
|
||||
import 'package:PiliPlus/pages/common/reply_controller.dart';
|
||||
import 'package:PiliPlus/utils/id_utils.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class DynamicDetailController extends ReplyController<MainListReply> {
|
||||
@@ -23,8 +25,27 @@ class DynamicDetailController extends ReplyController<MainListReply> {
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
dynItem = Get.arguments['item'];
|
||||
oid = int.parse(dynItem.basic!.commentIdStr!);
|
||||
replyType = dynItem.basic!.commentType!;
|
||||
var commentType = dynItem.basic?.commentType;
|
||||
var commentIdStr = dynItem.basic?.commentIdStr;
|
||||
if (commentType != null &&
|
||||
commentType != 0 &&
|
||||
commentIdStr?.isNotEmpty == true) {
|
||||
_init(commentIdStr!, commentType);
|
||||
} else {
|
||||
DynamicsHttp.dynamicDetail(id: dynItem.idStr).then((res) {
|
||||
if (res['status']) {
|
||||
DynamicItemModel data = res['data'];
|
||||
_init(data.basic!.commentIdStr!, data.basic!.commentType!);
|
||||
} else {
|
||||
SmartDialog.showToast(res['msg']);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void _init(String commentIdStr, int commentType) {
|
||||
oid = int.parse(commentIdStr);
|
||||
replyType = commentType;
|
||||
queryData();
|
||||
}
|
||||
|
||||
|
||||
@@ -349,18 +349,21 @@ class PageUtils {
|
||||
feedBack();
|
||||
|
||||
void push() {
|
||||
var commentType = item.basic?.commentType;
|
||||
if (commentType != null &&
|
||||
commentType != 0 &&
|
||||
item.basic?.commentIdStr?.isNotEmpty == true) {
|
||||
if (item.basic?.commentType == 12) {
|
||||
toDupNamed(
|
||||
'/articlePage',
|
||||
parameters: {
|
||||
'id': item.idStr,
|
||||
'type': 'opus',
|
||||
},
|
||||
);
|
||||
} else {
|
||||
toDupNamed(
|
||||
'/dynamicDetail',
|
||||
arguments: {
|
||||
'item': item,
|
||||
},
|
||||
);
|
||||
} else {
|
||||
pushDynFromId(id: item.idStr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -370,7 +373,7 @@ class PageUtils {
|
||||
return;
|
||||
}
|
||||
|
||||
debugPrint('pushDynDetail: ${item.type}');
|
||||
// debugPrint('pushDynDetail: ${item.type}');
|
||||
|
||||
switch (item.type) {
|
||||
case 'DYNAMIC_TYPE_AV':
|
||||
|
||||
Reference in New Issue
Block a user