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'
|
import 'package:PiliPlus/grpc/bilibili/main/community/reply/v1.pb.dart'
|
||||||
show MainListReply, ReplyInfo;
|
show MainListReply, ReplyInfo;
|
||||||
import 'package:PiliPlus/grpc/reply.dart';
|
import 'package:PiliPlus/grpc/reply.dart';
|
||||||
|
import 'package:PiliPlus/http/dynamics.dart';
|
||||||
import 'package:PiliPlus/http/loading_state.dart';
|
import 'package:PiliPlus/http/loading_state.dart';
|
||||||
import 'package:PiliPlus/models/dynamics/result.dart';
|
import 'package:PiliPlus/models/dynamics/result.dart';
|
||||||
import 'package:PiliPlus/pages/common/reply_controller.dart';
|
import 'package:PiliPlus/pages/common/reply_controller.dart';
|
||||||
import 'package:PiliPlus/utils/id_utils.dart';
|
import 'package:PiliPlus/utils/id_utils.dart';
|
||||||
import 'package:PiliPlus/utils/storage.dart';
|
import 'package:PiliPlus/utils/storage.dart';
|
||||||
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
class DynamicDetailController extends ReplyController<MainListReply> {
|
class DynamicDetailController extends ReplyController<MainListReply> {
|
||||||
@@ -23,8 +25,27 @@ class DynamicDetailController extends ReplyController<MainListReply> {
|
|||||||
void onInit() {
|
void onInit() {
|
||||||
super.onInit();
|
super.onInit();
|
||||||
dynItem = Get.arguments['item'];
|
dynItem = Get.arguments['item'];
|
||||||
oid = int.parse(dynItem.basic!.commentIdStr!);
|
var commentType = dynItem.basic?.commentType;
|
||||||
replyType = 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();
|
queryData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -349,18 +349,21 @@ class PageUtils {
|
|||||||
feedBack();
|
feedBack();
|
||||||
|
|
||||||
void push() {
|
void push() {
|
||||||
var commentType = item.basic?.commentType;
|
if (item.basic?.commentType == 12) {
|
||||||
if (commentType != null &&
|
toDupNamed(
|
||||||
commentType != 0 &&
|
'/articlePage',
|
||||||
item.basic?.commentIdStr?.isNotEmpty == true) {
|
parameters: {
|
||||||
|
'id': item.idStr,
|
||||||
|
'type': 'opus',
|
||||||
|
},
|
||||||
|
);
|
||||||
|
} else {
|
||||||
toDupNamed(
|
toDupNamed(
|
||||||
'/dynamicDetail',
|
'/dynamicDetail',
|
||||||
arguments: {
|
arguments: {
|
||||||
'item': item,
|
'item': item,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
} else {
|
|
||||||
pushDynFromId(id: item.idStr);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -370,7 +373,7 @@ class PageUtils {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
debugPrint('pushDynDetail: ${item.type}');
|
// debugPrint('pushDynDetail: ${item.type}');
|
||||||
|
|
||||||
switch (item.type) {
|
switch (item.type) {
|
||||||
case 'DYNAMIC_TYPE_AV':
|
case 'DYNAMIC_TYPE_AV':
|
||||||
|
|||||||
Reference in New Issue
Block a user