mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-26 20:16:26 +08:00
fix: view forwarded dyn
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'package:PiliPlus/grpc/app/main/community/reply/v1/reply.pb.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/global_data.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
@@ -12,7 +13,7 @@ class DynamicDetailController extends ReplyController {
|
||||
DynamicDetailController(this.oid, this.type);
|
||||
int? oid;
|
||||
int? type;
|
||||
dynamic item;
|
||||
late DynamicItemModel item;
|
||||
int? floor;
|
||||
|
||||
late final horizontalPreview = GStorage.horizontalPreview;
|
||||
|
||||
@@ -474,15 +474,19 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
||||
_dynamicDetailController
|
||||
.item
|
||||
.modules
|
||||
.moduleStat
|
||||
.forward
|
||||
?.moduleStat
|
||||
?.forward
|
||||
?.count ??
|
||||
'0') ??
|
||||
0;
|
||||
_dynamicDetailController.item.modules
|
||||
?.moduleStat ??= ModuleStatModel();
|
||||
_dynamicDetailController.item.modules!
|
||||
.moduleStat?.forward ??= ForWard();
|
||||
_dynamicDetailController
|
||||
.item
|
||||
.modules
|
||||
.moduleStat
|
||||
.modules!
|
||||
.moduleStat!
|
||||
.forward!
|
||||
.count = (count + 1).toString();
|
||||
if (btnContext.mounted) {
|
||||
@@ -507,12 +511,12 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
||||
),
|
||||
label: Text(
|
||||
_dynamicDetailController.item.modules
|
||||
.moduleStat.forward!.count !=
|
||||
?.moduleStat?.forward?.count !=
|
||||
null
|
||||
? Utils.numFormat(_dynamicDetailController
|
||||
.item
|
||||
.modules
|
||||
.moduleStat
|
||||
.modules!
|
||||
.moduleStat!
|
||||
.forward!
|
||||
.count)
|
||||
: '转发',
|
||||
@@ -553,17 +557,24 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
||||
},
|
||||
),
|
||||
icon: Icon(
|
||||
_dynamicDetailController
|
||||
.item.modules.moduleStat.like!.status!
|
||||
_dynamicDetailController.item.modules
|
||||
?.moduleStat?.like?.status ==
|
||||
true
|
||||
? FontAwesomeIcons.solidThumbsUp
|
||||
: FontAwesomeIcons.thumbsUp,
|
||||
size: 16,
|
||||
color: _dynamicDetailController
|
||||
.item.modules.moduleStat.like!.status!
|
||||
color: _dynamicDetailController.item.modules
|
||||
?.moduleStat?.like?.status ==
|
||||
true
|
||||
? Theme.of(context).colorScheme.primary
|
||||
: Theme.of(context).colorScheme.outline,
|
||||
semanticLabel: _dynamicDetailController
|
||||
.item.modules.moduleStat.like!.status!
|
||||
.item
|
||||
.modules
|
||||
?.moduleStat
|
||||
?.like
|
||||
?.status ==
|
||||
true
|
||||
? "已赞"
|
||||
: "点赞",
|
||||
),
|
||||
@@ -582,15 +593,24 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
||||
},
|
||||
child: Text(
|
||||
_dynamicDetailController.item.modules
|
||||
.moduleStat.like!.count !=
|
||||
?.moduleStat?.like?.count !=
|
||||
null
|
||||
? Utils.numFormat(
|
||||
_dynamicDetailController.item
|
||||
.modules.moduleStat.like!.count)
|
||||
_dynamicDetailController
|
||||
.item
|
||||
.modules!
|
||||
.moduleStat!
|
||||
.like!
|
||||
.count)
|
||||
: '点赞',
|
||||
style: TextStyle(
|
||||
color: _dynamicDetailController.item
|
||||
.modules.moduleStat.like!.status!
|
||||
color: _dynamicDetailController
|
||||
.item
|
||||
.modules
|
||||
?.moduleStat
|
||||
?.like
|
||||
?.status ==
|
||||
true
|
||||
? Theme.of(context)
|
||||
.colorScheme
|
||||
.primary
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'package:PiliPlus/common/widgets/radio_widget.dart';
|
||||
import 'package:PiliPlus/http/index.dart';
|
||||
import 'package:PiliPlus/models/dynamics/result.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
@@ -98,7 +97,7 @@ class AuthorPanel extends StatelessWidget {
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Text(item is ItemOrigModel
|
||||
Text(item.isForwarded == true
|
||||
? Utils.dateFormat(item.modules.moduleAuthor.pubTs)
|
||||
: item.modules.moduleAuthor.pubTime),
|
||||
if (item.modules.moduleAuthor.pubTime != '' &&
|
||||
|
||||
@@ -162,37 +162,38 @@ Widget forWard(item, context, source, callback, {floor = 1}) {
|
||||
// 文章
|
||||
case 'DYNAMIC_TYPE_ARTICLE':
|
||||
return switch (item) {
|
||||
ItemOrigModel() => articlePanel(item, context, callback, floor: floor),
|
||||
DynamicItemModel() => item.modules?.moduleDynamic?.major?.blocked !=
|
||||
null
|
||||
? Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (item.modules?.moduleDynamic?.major?.blocked?['title'] !=
|
||||
null)
|
||||
Text(
|
||||
'${item.modules?.moduleDynamic?.major?.blocked!['title']}',
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
),
|
||||
),
|
||||
if (item.modules?.moduleDynamic?.major
|
||||
?.blocked?['hint_message'] !=
|
||||
null)
|
||||
Text(
|
||||
'${item.modules?.moduleDynamic?.major?.blocked!['hint_message']}',
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Theme.of(context).colorScheme.outline,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
: const SizedBox.shrink(),
|
||||
DynamicItemModel() => item.isForwarded == true
|
||||
? articlePanel(item, context, callback, floor: floor)
|
||||
: item.modules?.moduleDynamic?.major?.blocked != null
|
||||
? Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (item.modules?.moduleDynamic?.major
|
||||
?.blocked?['title'] !=
|
||||
null)
|
||||
Text(
|
||||
'${item.modules?.moduleDynamic?.major?.blocked!['title']}',
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
),
|
||||
),
|
||||
if (item.modules?.moduleDynamic?.major
|
||||
?.blocked?['hint_message'] !=
|
||||
null)
|
||||
Text(
|
||||
'${item.modules?.moduleDynamic?.major?.blocked!['hint_message']}',
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Theme.of(context).colorScheme.outline,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
: const SizedBox.shrink(),
|
||||
_ => const SizedBox.shrink(),
|
||||
};
|
||||
// return Container(
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// 视频or合集
|
||||
import 'package:PiliPlus/models/dynamics/result.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:PiliPlus/common/constants.dart';
|
||||
@@ -159,7 +158,7 @@ Widget videoSeasonWidget(item, context, type, {floor = 1}) {
|
||||
if (richNodes != null) Text.rich(richNodes),
|
||||
const SizedBox(height: 6),
|
||||
],
|
||||
if (item is ItemOrigModel)
|
||||
if (item.isForwarded == true)
|
||||
buildCover()
|
||||
else
|
||||
Padding(
|
||||
|
||||
Reference in New Issue
Block a user