feat: pgc review

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-05-24 18:17:57 +08:00
parent 8e1b2be073
commit 70164fa3f7
18 changed files with 1140 additions and 108 deletions

View File

@@ -1,6 +1,9 @@
import 'package:PiliPlus/common/widgets/button/icon_button.dart';
import 'package:PiliPlus/common/widgets/scroll_physics.dart';
import 'package:PiliPlus/common/widgets/stat/stat.dart';
import 'package:PiliPlus/models/bangumi/info.dart';
import 'package:PiliPlus/pages/common/common_collapse_slide_page.dart';
import 'package:PiliPlus/pages/pgc_review/view.dart';
import 'package:PiliPlus/pages/search/widgets/search_text.dart';
import 'package:PiliPlus/utils/utils.dart';
import 'package:flutter/material.dart';
@@ -13,6 +16,7 @@ class IntroDetail extends CommonCollapseSlidePage {
const IntroDetail({
super.key,
required this.bangumiDetail,
super.enableSlide = false,
this.videoTags,
});
@@ -21,32 +25,54 @@ class IntroDetail extends CommonCollapseSlidePage {
}
class _IntroDetailState extends CommonCollapseSlidePageState<IntroDetail> {
late final _tabController = TabController(length: 2, vsync: this);
@override
void dispose() {
_tabController.dispose();
super.dispose();
}
@override
Widget buildPage(ThemeData theme) {
return Material(
color: theme.colorScheme.surface,
child: Column(
children: [
GestureDetector(
onTap: Get.back,
behavior: HitTestBehavior.opaque,
child: Container(
height: 35,
alignment: Alignment.center,
padding: const EdgeInsets.only(bottom: 2),
child: Container(
width: 32,
height: 3,
decoration: BoxDecoration(
color: theme.colorScheme.onSecondaryContainer
.withValues(alpha: 0.5),
borderRadius: const BorderRadius.all(Radius.circular(3))),
Row(
children: [
Expanded(
child: TabBar(
controller: _tabController,
dividerHeight: 0,
isScrollable: true,
tabAlignment: TabAlignment.start,
dividerColor: Colors.transparent,
tabs: const [Tab(text: '详情'), Tab(text: '点评')],
),
),
),
iconButton(
context: context,
icon: Icons.clear,
onPressed: Get.back,
iconSize: 22,
bgColor: Colors.transparent,
),
const SizedBox(width: 12),
],
),
Expanded(
child: enableSlide ? slideList(theme) : buildList(theme),
)
child: tabBarView(
controller: _tabController,
children: [
buildList(theme),
PgcReviewPage(
name: widget.bangumiDetail.title!,
mediaId: widget.bangumiDetail.mediaId,
),
],
),
),
],
),
);
@@ -64,6 +90,7 @@ class _IntroDetailState extends CommonCollapseSlidePageState<IntroDetail> {
padding: EdgeInsets.only(
left: 14,
right: 14,
top: 14,
bottom: MediaQuery.paddingOf(context).bottom + 80,
),
children: [

View File

@@ -174,7 +174,7 @@ class _NoteListPageState extends CommonSlidePageState<NoteListPage> {
if (index == response.length - 1) {
_controller.onLoadMore();
}
return _itemWidget(context, theme, response[index]);
return _itemWidget(theme, response[index]);
},
itemCount: response!.length,
separatorBuilder: (context, index) => Divider(
@@ -189,91 +189,92 @@ class _NoteListPageState extends CommonSlidePageState<NoteListPage> {
),
};
}
}
Widget _itemWidget(BuildContext context, ThemeData theme, dynamic item) {
return InkWell(
onTap: () {
if (item['web_url'] != null && item['web_url'] != '') {
PiliScheme.routePushFromUrl(item['web_url']);
}
},
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
GestureDetector(
onTap: () => Get.toNamed('/member?mid=${item['author']['mid']}'),
child: NetworkImgLayer(
height: 34,
width: 34,
src: item['author']['face'],
type: ImageType.avatar,
Widget _itemWidget(ThemeData theme, dynamic item) {
return InkWell(
onTap: () {
if (item['web_url'] != null && item['web_url'] != '') {
PiliScheme.routePushFromUrl(item['web_url']);
}
},
child: Padding(
padding: const EdgeInsets.all(12),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
GestureDetector(
onTap: () => Get.toNamed('/member?mid=${item['author']['mid']}'),
child: NetworkImgLayer(
height: 34,
width: 34,
src: item['author']['face'],
type: ImageType.avatar,
),
),
),
const SizedBox(width: 12),
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
GestureDetector(
onTap: () =>
Get.toNamed('/member?mid=${item['author']['mid']}'),
child: Row(
children: [
Text(
item['author']['name'],
style: TextStyle(
color: (item['author']?['vip_info']?['status'] ?? 0) >
0 &&
item['author']?['vip_info']?['type'] == 2
? context.vipColor
: theme.colorScheme.outline,
fontSize: 13,
const SizedBox(width: 12),
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
GestureDetector(
onTap: () =>
Get.toNamed('/member?mid=${item['author']['mid']}'),
child: Row(
children: [
Text(
item['author']['name'],
style: TextStyle(
color: (item['author']?['vip_info']?['status'] ??
0) >
0 &&
item['author']?['vip_info']?['type'] == 2
? context.vipColor
: theme.colorScheme.outline,
fontSize: 13,
),
),
),
const SizedBox(width: 6),
Image.asset(
'assets/images/lv/lv${item['author']['level']}.png',
height: 11,
),
],
),
),
const SizedBox(height: 4),
Text(
item['pubtime'],
style: TextStyle(
color: theme.colorScheme.outline,
fontSize: 12,
),
),
if (item['summary'] != null) ...[
const SizedBox(height: 5),
Text(
item['summary'],
style: TextStyle(
height: 1.75,
fontSize: theme.textTheme.bodyMedium!.fontSize,
const SizedBox(width: 6),
Image.asset(
'assets/images/lv/lv${item['author']['level']}.png',
height: 11,
),
],
),
),
if (item['web_url'] != null && item['web_url'] != '')
const SizedBox(height: 4),
Text(
item['pubtime'],
style: TextStyle(
color: theme.colorScheme.outline,
fontSize: 12,
),
),
if (item['summary'] != null) ...[
const SizedBox(height: 5),
Text(
'查看全部',
item['summary'],
style: TextStyle(
color: theme.colorScheme.primary,
height: 1.75,
fontSize: theme.textTheme.bodyMedium!.fontSize,
),
),
if (item['web_url'] != null && item['web_url'] != '')
Text(
'查看全部',
style: TextStyle(
color: theme.colorScheme.primary,
height: 1.75,
fontSize: theme.textTheme.bodyMedium!.fontSize,
),
),
],
],
],
),
),
),
],
],
),
),
),
);
);
}
}

View File

@@ -94,24 +94,23 @@ class _ZanButtonGrpcState extends State<ZanButtonGrpc> {
}
}
ButtonStyle get _style => TextButton.styleFrom(
padding: EdgeInsets.zero,
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
visualDensity: VisualDensity.compact,
);
@override
Widget build(BuildContext context) {
final ThemeData theme = Theme.of(context);
final Color color = theme.colorScheme.outline;
final Color primary = theme.colorScheme.primary;
final ButtonStyle style = TextButton.styleFrom(
padding: EdgeInsets.zero,
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
visualDensity: VisualDensity.compact,
);
return Row(
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(
height: 32,
child: TextButton(
style: _style,
style: style,
onPressed: () => handleState(onHateReply),
child: Icon(
isDislike
@@ -126,7 +125,7 @@ class _ZanButtonGrpcState extends State<ZanButtonGrpc> {
SizedBox(
height: 32,
child: TextButton(
style: _style,
style: style,
onPressed: () => handleState(onLikeReply),
child: Row(
children: [

View File

@@ -2071,7 +2071,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
);
}
void showIntroDetail(videoDetail, videoTags) {
void showIntroDetail(bangumi.BangumiInfoModel videoDetail, videoTags) {
videoDetailController.childKey.currentState?.showBottomSheet(
backgroundColor: Colors.transparent,
(context) => bangumi.IntroDetail(