mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
refa: opus (#762)
* feat: opus * fix * fix * fix * fix * . * fix * remove * wbi sign * fix * opus content null check Co-authored-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
committed by
GitHub
parent
3722ff1f33
commit
bd3c76ef43
@@ -2,7 +2,6 @@ import 'package:PiliPlus/grpc/app/main/community/reply/v1/reply.pb.dart';
|
||||
import 'package:PiliPlus/http/dynamics.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/models/common/reply_type.dart';
|
||||
import 'package:PiliPlus/models/dynamics/opus_detail/data.dart';
|
||||
import 'package:PiliPlus/models/dynamics/result.dart';
|
||||
import 'package:PiliPlus/pages/common/reply_controller.dart';
|
||||
import 'package:PiliPlus/utils/id_utils.dart';
|
||||
@@ -31,7 +30,7 @@ class DynamicDetailController extends ReplyController<MainListReply> {
|
||||
item = Get.arguments['item'];
|
||||
floor = Get.arguments['floor'];
|
||||
if (floor == 1) {
|
||||
count.value = int.parse(item.modules!.moduleStat!.comment!.count ?? '0');
|
||||
count.value = item.modules.moduleStat?.comment?.count ?? 0;
|
||||
}
|
||||
|
||||
if (oid != 0) {
|
||||
@@ -41,10 +40,10 @@ class DynamicDetailController extends ReplyController<MainListReply> {
|
||||
|
||||
getCommentParams(int id) async {
|
||||
var res = await DynamicsHttp.opusDetail(opusId: id);
|
||||
if (res['status']) {
|
||||
OpusData data = res['data'];
|
||||
type = data.item!.basic!.commentType!;
|
||||
oid = int.parse(data.item!.basic!.commentIdStr!);
|
||||
if (res is Success) {
|
||||
final data = (res as Success<DynamicItemModel>).response;
|
||||
type = data.basic!.commentType!;
|
||||
oid = int.parse(data.basic!.commentIdStr!);
|
||||
queryData();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,14 +118,15 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
||||
// 楼层
|
||||
int floor = args['floor'];
|
||||
// 评论类型
|
||||
int commentType = args['item'].basic!['comment_type'] ?? 11;
|
||||
final item = args['item'] as DynamicItemModel;
|
||||
int commentType = item.basic?.commentType ?? 11;
|
||||
replyType = (commentType == 0) ? 11 : commentType;
|
||||
|
||||
if (floor == 1) {
|
||||
oid = int.parse(args['item'].basic!['comment_id_str']);
|
||||
oid = int.parse(item.basic!.commentIdStr!);
|
||||
} else {
|
||||
try {
|
||||
ModuleDynamicModel moduleDynamic = args['item'].modules.moduleDynamic;
|
||||
final moduleDynamic = item.modules.moduleDynamic!;
|
||||
String majorType = moduleDynamic.major!.type!;
|
||||
|
||||
if (majorType == 'MAJOR_TYPE_OPUS') {
|
||||
@@ -528,32 +529,31 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
||||
item: _dynamicDetailController
|
||||
.item,
|
||||
callback: () {
|
||||
int count = int.tryParse(
|
||||
_dynamicDetailController
|
||||
.item
|
||||
.modules
|
||||
?.moduleStat
|
||||
?.forward
|
||||
?.count ??
|
||||
'0') ??
|
||||
0;
|
||||
int count =
|
||||
_dynamicDetailController
|
||||
.item
|
||||
.modules
|
||||
.moduleStat
|
||||
?.forward
|
||||
?.count ??
|
||||
0;
|
||||
_dynamicDetailController
|
||||
.item
|
||||
.modules
|
||||
?.moduleStat ??=
|
||||
.moduleStat ??=
|
||||
ModuleStatModel();
|
||||
_dynamicDetailController
|
||||
.item
|
||||
.modules!
|
||||
.moduleStat
|
||||
?.forward ??= ForWard();
|
||||
_dynamicDetailController
|
||||
.item
|
||||
.modules!
|
||||
.moduleStat!
|
||||
.forward!
|
||||
.count =
|
||||
(count + 1).toString();
|
||||
.modules
|
||||
.moduleStat
|
||||
?.forward ??=
|
||||
DynamicStat();
|
||||
_dynamicDetailController
|
||||
.item
|
||||
.modules
|
||||
.moduleStat!
|
||||
.forward!
|
||||
.count = count + 1;
|
||||
if (btnContext.mounted) {
|
||||
(btnContext as Element?)
|
||||
?.markNeedsBuild();
|
||||
@@ -581,14 +581,14 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
||||
_dynamicDetailController
|
||||
.item
|
||||
.modules
|
||||
?.moduleStat
|
||||
.moduleStat
|
||||
?.forward
|
||||
?.count !=
|
||||
null
|
||||
? Utils.numFormat(
|
||||
_dynamicDetailController
|
||||
.item
|
||||
.modules!
|
||||
.modules
|
||||
.moduleStat!
|
||||
.forward!
|
||||
.count)
|
||||
@@ -638,7 +638,7 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
||||
_dynamicDetailController
|
||||
.item
|
||||
.modules
|
||||
?.moduleStat
|
||||
.moduleStat
|
||||
?.like
|
||||
?.status ==
|
||||
true
|
||||
@@ -648,7 +648,7 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
||||
color: _dynamicDetailController
|
||||
.item
|
||||
.modules
|
||||
?.moduleStat
|
||||
.moduleStat
|
||||
?.like
|
||||
?.status ==
|
||||
true
|
||||
@@ -662,7 +662,7 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
||||
_dynamicDetailController
|
||||
.item
|
||||
.modules
|
||||
?.moduleStat
|
||||
.moduleStat
|
||||
?.like
|
||||
?.status ==
|
||||
true
|
||||
@@ -689,14 +689,14 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
||||
_dynamicDetailController
|
||||
.item
|
||||
.modules
|
||||
?.moduleStat
|
||||
.moduleStat
|
||||
?.like
|
||||
?.count !=
|
||||
null
|
||||
? Utils.numFormat(
|
||||
_dynamicDetailController
|
||||
.item
|
||||
.modules!
|
||||
.modules
|
||||
.moduleStat!
|
||||
.like!
|
||||
.count)
|
||||
@@ -705,7 +705,7 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
||||
color: _dynamicDetailController
|
||||
.item
|
||||
.modules
|
||||
?.moduleStat
|
||||
.moduleStat
|
||||
?.like
|
||||
?.status ==
|
||||
true
|
||||
|
||||
Reference in New Issue
Block a user