logo和名称替换
This commit is contained in:
+45
-21
@@ -3,16 +3,16 @@ import 'dart:ui';
|
||||
import 'package:easy_rich_text/easy_rich_text.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/assets_tool/images.dart';
|
||||
import 'package:hgmj/hj_model/video_model.dart';
|
||||
import 'package:hgmj/hj_page/video/video_player_alert.dart';
|
||||
import 'package:hgmj/hj_utils/pay/pay_manager.dart';
|
||||
import 'package:hgmj/hj_utils/buy_util.dart';
|
||||
import 'package:hgmj/hj_utils/screen.dart';
|
||||
import 'package:hgmj/hj_utils/widget_util.dart';
|
||||
import 'package:hgmj/tools_base/global_store/store.dart';
|
||||
import 'package:hgmj/tools_base/widget/net_image_widget.dart';
|
||||
import 'package:hgmj/tools_base/widget/image_browser_page.dart';
|
||||
import 'package:wydj/assets_tool/images.dart';
|
||||
import 'package:wydj/hj_model/video_model.dart';
|
||||
import 'package:wydj/hj_page/video/video_player_alert.dart';
|
||||
import 'package:wydj/hj_utils/pay/pay_manager.dart';
|
||||
import 'package:wydj/hj_utils/buy_util.dart';
|
||||
import 'package:wydj/hj_utils/screen.dart';
|
||||
import 'package:wydj/hj_utils/widget_util.dart';
|
||||
import 'package:wydj/tools_base/global_store/store.dart';
|
||||
import 'package:wydj/tools_base/widget/net_image_widget.dart';
|
||||
import 'package:wydj/tools_base/widget/image_browser_page.dart';
|
||||
|
||||
import '../../../../alert/video/vip_acg_dialog.dart';
|
||||
import '../../../../assets_tool/app_colors.dart';
|
||||
@@ -34,7 +34,8 @@ class _PostDetailVideoContentState extends State<PostDetailVideoContent> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isPlayable = model.isVideo() || model.isSeedPost();
|
||||
if (!isPlayable || model.sourceURL?.isNotEmpty != true) return const SizedBox.shrink();
|
||||
if (!isPlayable || model.sourceURL?.isNotEmpty != true)
|
||||
return const SizedBox.shrink();
|
||||
|
||||
final isLocked = needPostCoin(model);
|
||||
//非免费区的金币帖走金币解锁,其余走 VIP 解锁
|
||||
@@ -54,8 +55,12 @@ class _PostDetailVideoContentState extends State<PostDetailVideoContent> {
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
NetworkImageLoader(imageUrl: model.cover ?? '', width: double.infinity, height: double.infinity),
|
||||
Image.asset('circle_play.webp'.videoPath, width: 30, height: 30),
|
||||
NetworkImageLoader(
|
||||
imageUrl: model.cover ?? '',
|
||||
width: double.infinity,
|
||||
height: double.infinity),
|
||||
Image.asset('circle_play.webp'.videoPath,
|
||||
width: 30, height: 30),
|
||||
//未解锁蒙层
|
||||
if (isLocked)
|
||||
Positioned.fill(
|
||||
@@ -89,11 +94,17 @@ class _PostDetailVideoContentState extends State<PostDetailVideoContent> {
|
||||
'你只需花费 $coins 金币',
|
||||
defaultStyle: textStyle(16, Colors.white, FontWeight.w400),
|
||||
patternList: [
|
||||
EasyRichTextPattern(targetString: '$coins', style: textStyle(16, AppColors.actionRed, FontWeight.w400)),
|
||||
EasyRichTextPattern(
|
||||
targetString: '$coins',
|
||||
style: textStyle(16, AppColors.actionRed, FontWeight.w400)),
|
||||
],
|
||||
),
|
||||
16.sizeBoxH,
|
||||
const Text('即可解锁继续查看', style: TextStyle(color: Colors.white, fontSize: 12, fontWeight: FontWeight.w400)),
|
||||
const Text('即可解锁继续查看',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w400)),
|
||||
16.sizeBoxH,
|
||||
_btn(
|
||||
'立即解锁',
|
||||
@@ -120,7 +131,11 @@ class _PostDetailVideoContentState extends State<PostDetailVideoContent> {
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Text('本视频需开通VIP免费观看', style: TextStyle(color: Colors.white, fontSize: 12, fontWeight: FontWeight.w400)),
|
||||
const Text('本视频需开通VIP免费观看',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w400)),
|
||||
16.sizeBoxH,
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
@@ -160,7 +175,9 @@ class _PostDetailVideoContentState extends State<PostDetailVideoContent> {
|
||||
width: width,
|
||||
height: 30,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(gradient: LinearGradient(colors: colors), borderRadius: BorderRadius.circular(15)),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(colors: colors),
|
||||
borderRadius: BorderRadius.circular(15)),
|
||||
child: Text(text, style: textStyle(12, textColor, FontWeight.w400)),
|
||||
),
|
||||
);
|
||||
@@ -192,7 +209,8 @@ class PostDetailCoverContent extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
//有视频源时封面已在视频区展示,这里剔除避免重复
|
||||
if (model.sourceURL?.isNotEmpty == true) model.seriesCover?.remove(model.cover);
|
||||
if (model.sourceURL?.isNotEmpty == true)
|
||||
model.seriesCover?.remove(model.cover);
|
||||
final covers = model.seriesCover ?? [];
|
||||
return Column(
|
||||
children: [
|
||||
@@ -206,7 +224,11 @@ class PostDetailCoverContent extends StatelessWidget {
|
||||
onTap: () => ImageBrowserPage.open(covers, index: index),
|
||||
child: ClipRRect(
|
||||
borderRadius: _radius(index, covers.length),
|
||||
child: NetworkImageLoader(imageUrl: url, width: double.infinity, fit: BoxFit.fill, borderRadius: 0),
|
||||
child: NetworkImageLoader(
|
||||
imageUrl: url,
|
||||
width: double.infinity,
|
||||
fit: BoxFit.fill,
|
||||
borderRadius: 0),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -219,8 +241,10 @@ class PostDetailCoverContent extends StatelessWidget {
|
||||
BorderRadius _radius(int index, int total) {
|
||||
const radius = Radius.circular(12);
|
||||
if (total == 1) return const BorderRadius.all(radius);
|
||||
if (index == 0) return const BorderRadius.only(topLeft: radius, topRight: radius);
|
||||
if (index == total - 1) return const BorderRadius.only(bottomLeft: radius, bottomRight: radius);
|
||||
if (index == 0)
|
||||
return const BorderRadius.only(topLeft: radius, topRight: radius);
|
||||
if (index == total - 1)
|
||||
return const BorderRadius.only(bottomLeft: radius, bottomRight: radius);
|
||||
return BorderRadius.zero;
|
||||
}
|
||||
}
|
||||
|
||||
+14
-9
@@ -3,14 +3,14 @@ import 'dart:math';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/assets_tool/images.dart';
|
||||
import 'package:hgmj/hj_model/video_model.dart';
|
||||
import 'package:hgmj/hj_utils/api_service/common_service.dart';
|
||||
import 'package:hgmj/hj_utils/screen.dart';
|
||||
import 'package:wydj/assets_tool/images.dart';
|
||||
import 'package:wydj/hj_model/video_model.dart';
|
||||
import 'package:wydj/hj_utils/api_service/common_service.dart';
|
||||
import 'package:wydj/hj_utils/screen.dart';
|
||||
|
||||
import '../../../../alert/video/share_media_dialog.dart';
|
||||
import '../../../mine/collec_history_buy/col_his_buy_sub_page.dart';
|
||||
import 'package:hgmj/extension/extensions.dart';
|
||||
import 'package:wydj/extension/extensions.dart';
|
||||
|
||||
/// 帖子详情操作栏:浏览量 / 点赞 / 评论 / 分享
|
||||
class PostDetailOperationView extends StatefulWidget {
|
||||
@@ -19,7 +19,8 @@ class PostDetailOperationView extends StatefulWidget {
|
||||
const PostDetailOperationView({super.key, required this.model});
|
||||
|
||||
@override
|
||||
State<PostDetailOperationView> createState() => _PostDetailOperationViewState();
|
||||
State<PostDetailOperationView> createState() =>
|
||||
_PostDetailOperationViewState();
|
||||
}
|
||||
|
||||
class _PostDetailOperationViewState extends State<PostDetailOperationView> {
|
||||
@@ -46,7 +47,9 @@ class _PostDetailOperationViewState extends State<PostDetailOperationView> {
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onTap: _toggleLike,
|
||||
child: _iconLabel(
|
||||
icon: model.vidStatus?.hasLiked == true ? "like_red.png".commonImgPath : "like_empty_gray.png".communityPath,
|
||||
icon: model.vidStatus?.hasLiked == true
|
||||
? "like_red.png".commonImgPath
|
||||
: "like_empty_gray.png".communityPath,
|
||||
gap: 5.w,
|
||||
text: model.likeCount?.countOr("喜欢") ?? '',
|
||||
fontSize: 12.sp,
|
||||
@@ -103,8 +106,10 @@ class _PostDetailOperationViewState extends State<PostDetailOperationView> {
|
||||
final wasLiked = model.vidStatus?.hasLiked ?? false;
|
||||
final count = model.likeCount ?? 0;
|
||||
final res = wasLiked
|
||||
? await CommonService.cancelLike(model.id ?? '', LoadDataType.post.apiType)
|
||||
: await CommonService.sendLike(model.id ?? '', LoadDataType.post.apiType);
|
||||
? await CommonService.cancelLike(
|
||||
model.id ?? '', LoadDataType.post.apiType)
|
||||
: await CommonService.sendLike(
|
||||
model.id ?? '', LoadDataType.post.apiType);
|
||||
if (!res || !mounted) return;
|
||||
model.vidStatus?.hasLiked = !wasLiked;
|
||||
model.likeCount = max(0, count + (wasLiked ? -1 : 1));
|
||||
|
||||
+14
-7
@@ -1,9 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/assets_tool/images.dart';
|
||||
import 'package:hgmj/hj_model/video_model.dart';
|
||||
import 'package:hgmj/hj_utils/pay/pay_manager.dart';
|
||||
import 'package:hgmj/tools_base/global_store/store.dart';
|
||||
import 'package:wydj/assets_tool/images.dart';
|
||||
import 'package:wydj/hj_model/video_model.dart';
|
||||
import 'package:wydj/hj_utils/pay/pay_manager.dart';
|
||||
import 'package:wydj/tools_base/global_store/store.dart';
|
||||
|
||||
/// 帖子金币解锁弹窗:解锁成功回传 true,点空白关闭交给 barrier
|
||||
class PostDetailUnlockDialog extends StatelessWidget {
|
||||
@@ -32,7 +32,10 @@ class PostDetailUnlockDialog extends StatelessWidget {
|
||||
decoration: const BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(30)),
|
||||
gradient: LinearGradient(
|
||||
colors: [Color.fromRGBO(255, 238, 220, 1), Color.fromRGBO(249, 219, 191, 1)],
|
||||
colors: [
|
||||
Color.fromRGBO(255, 238, 220, 1),
|
||||
Color.fromRGBO(249, 219, 191, 1)
|
||||
],
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
),
|
||||
@@ -40,10 +43,14 @@ class PostDetailUnlockDialog extends StatelessWidget {
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Image.asset('post_detail_coin.png'.communityPath, width: 30, height: 30),
|
||||
Image.asset('post_detail_coin.png'.communityPath,
|
||||
width: 30, height: 30),
|
||||
Text(
|
||||
'${model.videoCoin()}金币解锁继续',
|
||||
style: const TextStyle(color: Color(0xff370000), fontSize: 14, fontWeight: FontWeight.w400),
|
||||
style: const TextStyle(
|
||||
color: Color(0xff370000),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w400),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
+20
-10
@@ -1,10 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/hj_model/video_model.dart';
|
||||
import 'package:hgmj/hj_utils/screen.dart';
|
||||
import 'package:hgmj/routers/jump_router.dart';
|
||||
import 'package:hgmj/tools_base/widget/image_browser_page.dart';
|
||||
import 'package:wydj/hj_model/video_model.dart';
|
||||
import 'package:wydj/hj_utils/screen.dart';
|
||||
import 'package:wydj/routers/jump_router.dart';
|
||||
import 'package:wydj/tools_base/widget/image_browser_page.dart';
|
||||
|
||||
import '../../../../tools_base/richTextParsing/html_parser.dart';
|
||||
import '../../../../tools_base/widget/shrink_wrap.dart';
|
||||
@@ -24,7 +24,8 @@ class GameDetailWordContent extends StatelessWidget {
|
||||
children: [
|
||||
const Text('游戏介绍', style: TextStyle(color: Colors.white, fontSize: 16)),
|
||||
18.sizeBoxH,
|
||||
Text(model.content ?? '', style: const TextStyle(color: Colors.white, fontSize: 16)),
|
||||
Text(model.content ?? '',
|
||||
style: const TextStyle(color: Colors.white, fontSize: 16)),
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -39,14 +40,17 @@ class PostDetailWordContent extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (model.newsType == 'ADULT_GAME') return const SizedBox.shrink();
|
||||
final contentStyle = TextStyle(color: const Color(0xFFDCDCDC), fontSize: 14.sp);
|
||||
final contentStyle =
|
||||
TextStyle(color: const Color(0xFFDCDCDC), fontSize: 14.sp);
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
14.sizeBoxH,
|
||||
//标题
|
||||
if (model.title?.isNotEmpty == true)
|
||||
Padding(padding: EdgeInsets.only(bottom: 1.h), child: Text(model.title ?? '', style: contentStyle)),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(bottom: 1.h),
|
||||
child: Text(model.title ?? '', style: contentStyle)),
|
||||
//标签
|
||||
_tags(),
|
||||
12.h.sizeBoxH,
|
||||
@@ -56,7 +60,9 @@ class PostDetailWordContent extends StatelessWidget {
|
||||
if (model.richText?.isNotEmpty == true)
|
||||
_richText()
|
||||
else if (model.content?.isNotEmpty == true)
|
||||
Padding(padding: EdgeInsets.only(bottom: 18.h), child: Text(model.content ?? '', style: contentStyle)),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(bottom: 18.h),
|
||||
child: Text(model.content ?? '', style: contentStyle)),
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -91,8 +97,12 @@ class PostDetailWordContent extends StatelessWidget {
|
||||
child: Container(
|
||||
padding: const EdgeInsets.fromLTRB(8, 3, 8, 3),
|
||||
margin: const EdgeInsets.only(right: 6),
|
||||
decoration: BoxDecoration(color: const Color(0x0DFFFFFF), borderRadius: BorderRadius.circular(3)),
|
||||
child: Text('#${e.name}', style: const TextStyle(color: Color(0x8CFFFFFF), fontSize: 12)),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0x0DFFFFFF),
|
||||
borderRadius: BorderRadius.circular(3)),
|
||||
child: Text('#${e.name}',
|
||||
style: const TextStyle(
|
||||
color: Color(0x8CFFFFFF), fontSize: 12)),
|
||||
),
|
||||
))
|
||||
.toList(),
|
||||
|
||||
+28
-16
@@ -1,15 +1,15 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/assets_tool/app_colors.dart';
|
||||
import 'package:hgmj/assets_tool/images.dart';
|
||||
import 'package:hgmj/hj_utils/date_time_util.dart';
|
||||
import 'package:hgmj/hj_utils/screen.dart';
|
||||
import 'package:hgmj/routers/jump_router.dart';
|
||||
import 'package:hgmj/tools_base/global_store/store.dart';
|
||||
import 'package:wydj/assets_tool/app_colors.dart';
|
||||
import 'package:wydj/assets_tool/images.dart';
|
||||
import 'package:wydj/hj_utils/date_time_util.dart';
|
||||
import 'package:wydj/hj_utils/screen.dart';
|
||||
import 'package:wydj/routers/jump_router.dart';
|
||||
import 'package:wydj/tools_base/global_store/store.dart';
|
||||
|
||||
import '../../../../hj_model/video_model.dart';
|
||||
import 'package:hgmj/tools_base/toast.dart';
|
||||
import 'package:wydj/tools_base/toast.dart';
|
||||
import 'post_detail_unlock_dialog.dart';
|
||||
|
||||
/// 种子帖 / 黄游帖的资源信息与下载入口
|
||||
@@ -31,28 +31,36 @@ class _PostResourceInfoWidgetState extends State<PostResourceInfoWidget> {
|
||||
final me = globalStore.meInfo;
|
||||
//金币视频限免期内:全场免费 或 50 金币以内免费
|
||||
final isFreeTime = DateTimeUtil.calTime3(me?.goldVideoFreeExpire) > 0;
|
||||
if (isFreeTime && (me?.allGoldVideoFree == true || (model.coins ?? 0) < 50)) return false;
|
||||
return model.isCoinVideo() && !globalStore.isMe(model.publisher?.uid) && !(model.vidStatus?.hasPaid ?? false);
|
||||
if (isFreeTime && (me?.allGoldVideoFree == true || (model.coins ?? 0) < 50))
|
||||
return false;
|
||||
return model.isCoinVideo() &&
|
||||
!globalStore.isMe(model.publisher?.uid) &&
|
||||
!(model.vidStatus?.hasPaid ?? false);
|
||||
}
|
||||
|
||||
String get _buyDesc => _needLock ? '${model.realCoins ?? 0}金币解锁 即可下载种子' : '开通VIP 即可下载种子';
|
||||
String get _buyDesc =>
|
||||
_needLock ? '${model.realCoins ?? 0}金币解锁 即可下载种子' : '开通VIP 即可下载种子';
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isSeed = model.newsType == 'SEED_LINK';
|
||||
if (!isSeed && model.newsType != 'ADULT_GAME') return const SizedBox();
|
||||
|
||||
const descStyle = TextStyle(color: Color(0xff999999), fontSize: 14, height: 1.5);
|
||||
const descStyle =
|
||||
TextStyle(color: Color(0xff999999), fontSize: 14, height: 1.5);
|
||||
//未解锁、或非 VIP 的非免费区内容,都只能看解锁入口
|
||||
final isLocked = _needLock || (!globalStore.isVIP && model.freeArea != true);
|
||||
final isLocked =
|
||||
_needLock || (!globalStore.isVIP && model.freeArea != true);
|
||||
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
//种子帖的影片信息与下载说明
|
||||
if (isSeed) ...[
|
||||
if ((model.seedSize ?? 0) > 0) Text('[影片大小]:${model.seedSizeDesc}', style: descStyle),
|
||||
if ((model.seedPlayTime ?? 0) > 0) Text('[影片时长]:${model.seedPlayTimeDesc}', style: descStyle),
|
||||
if ((model.seedSize ?? 0) > 0)
|
||||
Text('[影片大小]:${model.seedSizeDesc}', style: descStyle),
|
||||
if ((model.seedPlayTime ?? 0) > 0)
|
||||
Text('[影片时长]:${model.seedPlayTimeDesc}', style: descStyle),
|
||||
const Text(
|
||||
'[下载说明]:解锁后请复制种子的下载链接到手机自带浏览器(谷歌/UC/夸克/火狐 等)打开!或使用BT软件(迅雷/Vuze/uTorrent/BitTorrent 等)进行下载.',
|
||||
style: descStyle,
|
||||
@@ -68,13 +76,17 @@ class _PostResourceInfoWidgetState extends State<PostResourceInfoWidget> {
|
||||
onTap: _showUnlock,
|
||||
child: Text(
|
||||
_buyDesc,
|
||||
style: const TextStyle(fontSize: 16, color: AppColors.primaryHighColor, fontWeight: FontWeight.w500),
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
color: AppColors.primaryHighColor,
|
||||
fontWeight: FontWeight.w500),
|
||||
),
|
||||
)
|
||||
: InkWell(
|
||||
enableFeedback: false,
|
||||
onTap: _copyLink,
|
||||
child: Image.asset('link_copy_icon.webp'.communityPath, width: 180, height: 32),
|
||||
child: Image.asset('link_copy_icon.webp'.communityPath,
|
||||
width: 180, height: 32),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/hj_model/video_model.dart';
|
||||
import 'package:hgmj/hj_page/comment/comment_mixin.dart';
|
||||
import 'package:hgmj/hj_utils/api_service/vid_service.dart';
|
||||
import 'package:hgmj/hj_utils/const.dart';
|
||||
import 'package:wydj/hj_model/video_model.dart';
|
||||
import 'package:wydj/hj_page/comment/comment_mixin.dart';
|
||||
import 'package:wydj/hj_utils/api_service/vid_service.dart';
|
||||
import 'package:wydj/hj_utils/const.dart';
|
||||
|
||||
import '../../../hj_utils/history_util.dart';
|
||||
import 'post_detail_page.dart';
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/extension/extensions.dart';
|
||||
import 'package:hgmj/hj_model/video_model.dart';
|
||||
import 'package:hgmj/hj_page/comment/cell/comment_item.dart';
|
||||
import 'package:hgmj/hj_utils/screen.dart';
|
||||
import 'package:hgmj/tools_base/banner/ads_grid_view.dart';
|
||||
import 'package:hgmj/tools_base/loading/loading_center_widget.dart';
|
||||
import 'package:hgmj/tools_base/refresh/pull_refresh.dart';
|
||||
import 'package:hgmj/tools_base/unique_tag_mixin.dart';
|
||||
import 'package:wydj/extension/extensions.dart';
|
||||
import 'package:wydj/hj_model/video_model.dart';
|
||||
import 'package:wydj/hj_page/comment/cell/comment_item.dart';
|
||||
import 'package:wydj/hj_utils/screen.dart';
|
||||
import 'package:wydj/tools_base/banner/ads_grid_view.dart';
|
||||
import 'package:wydj/tools_base/loading/loading_center_widget.dart';
|
||||
import 'package:wydj/tools_base/refresh/pull_refresh.dart';
|
||||
import 'package:wydj/tools_base/unique_tag_mixin.dart';
|
||||
|
||||
import '../../comment/widget/comment_foot_view.dart';
|
||||
import '../../home/widget/quick_search_view.dart';
|
||||
@@ -21,18 +21,20 @@ import 'post_detail_logic.dart';
|
||||
|
||||
/// 过滤掉广告位,只留真实帖子
|
||||
List<VideoModel>? _filters(List<VideoModel>? videoModel) {
|
||||
return (videoModel ?? []).where((e) => !e.isRandomAd() && !e.isAdsArr()).toList();
|
||||
return (videoModel ?? [])
|
||||
.where((e) => !e.isRandomAd() && !e.isAdsArr())
|
||||
.toList();
|
||||
}
|
||||
|
||||
class PostDetailPageArgument {
|
||||
final List<VideoModel>? videoModels;
|
||||
String? id;
|
||||
|
||||
PostDetailPageArgument({List<VideoModel>? models, this.id}) : videoModels = _filters(models);
|
||||
PostDetailPageArgument({List<VideoModel>? models, this.id})
|
||||
: videoModels = _filters(models);
|
||||
}
|
||||
|
||||
class PostDetailPage extends StatefulWidget {
|
||||
|
||||
final PostDetailPageArgument argument;
|
||||
|
||||
const PostDetailPage({super.key, required this.argument});
|
||||
@@ -55,7 +57,10 @@ class _PostDetailPageState extends State<PostDetailPage> with UniqueTagMixin {
|
||||
final topIndex = logic.topPinnedCommentIndex;
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: AppBar(titleSpacing: 18.w, automaticallyImplyLeading: false, title: _titleView(logic)),
|
||||
appBar: AppBar(
|
||||
titleSpacing: 18.w,
|
||||
automaticallyImplyLeading: false,
|
||||
title: _titleView(logic)),
|
||||
body: logic.isLoading || model == null
|
||||
? SizedBox(height: 300, child: LoadingCenterWidget())
|
||||
: Column(
|
||||
@@ -66,24 +71,35 @@ class _PostDetailPageState extends State<PostDetailPage> with UniqueTagMixin {
|
||||
child: pullYsRefresh(
|
||||
enablePullDown: false,
|
||||
onInit: (refreshCtr) => logic.refreshCtr = refreshCtr,
|
||||
onLoading: (_) => logic.fetchComments(logic.args.id ?? ''),
|
||||
onLoading: (_) =>
|
||||
logic.fetchComments(logic.args.id ?? ''),
|
||||
child: CustomScrollView(
|
||||
controller: logic.scrollCtr,
|
||||
slivers: [
|
||||
SliverToBoxAdapter(child: 14.h.sizeBoxH),
|
||||
//发帖人信息
|
||||
SliverToBoxAdapter(child: PostUserInfoView(model: model, isDetailStyle: true)),
|
||||
SliverToBoxAdapter(
|
||||
child: PostUserInfoView(
|
||||
model: model, isDetailStyle: true)),
|
||||
//正文
|
||||
SliverToBoxAdapter(child: PostDetailWordContent(model: model)),
|
||||
SliverToBoxAdapter(
|
||||
child: PostDetailWordContent(model: model)),
|
||||
//富文本帖自带图,不再单独铺封面
|
||||
if (model.richText?.isNotEmpty != true)
|
||||
SliverToBoxAdapter(child: PostDetailCoverContent(model: model)),
|
||||
SliverToBoxAdapter(child: GameDetailWordContent(model: model)),
|
||||
SliverToBoxAdapter(child: PostDetailVideoContent(model: model)),
|
||||
SliverToBoxAdapter(child: PostResourceInfoWidget(videoModel: model)),
|
||||
SliverToBoxAdapter(
|
||||
child:
|
||||
PostDetailCoverContent(model: model)),
|
||||
SliverToBoxAdapter(
|
||||
child: GameDetailWordContent(model: model)),
|
||||
SliverToBoxAdapter(
|
||||
child: PostDetailVideoContent(model: model)),
|
||||
SliverToBoxAdapter(
|
||||
child: PostResourceInfoWidget(
|
||||
videoModel: model)),
|
||||
SliverToBoxAdapter(child: 16.sizeBoxH),
|
||||
//点赞/收藏/分享
|
||||
SliverToBoxAdapter(child: PostDetailOperationView(model: model)),
|
||||
SliverToBoxAdapter(
|
||||
child: PostDetailOperationView(model: model)),
|
||||
SliverToBoxAdapter(
|
||||
child: AdsGridView(
|
||||
7,
|
||||
@@ -98,15 +114,23 @@ class _PostDetailPageState extends State<PostDetailPage> with UniqueTagMixin {
|
||||
Text(
|
||||
'${model.commentCount?.countStr}条评论',
|
||||
style: TextStyle(
|
||||
fontSize: 14, fontWeight: FontWeight.w400, color: Colors.white.withValues(alpha: 0.9)),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Colors.white
|
||||
.withValues(alpha: 0.9)),
|
||||
),
|
||||
if (logic.quickSearchList.isNotEmpty) ...[18.sizeBoxH, QuickSearchView(logic.quickSearchList)]
|
||||
if (logic.quickSearchList.isNotEmpty) ...[
|
||||
18.sizeBoxH,
|
||||
QuickSearchView(logic.quickSearchList)
|
||||
]
|
||||
],
|
||||
).paddingOnly(bottom: 14),
|
||||
),
|
||||
//评论列表
|
||||
if (logic.comments.isEmpty)
|
||||
SliverToBoxAdapter(child: SizedBox(height: 220, child: CErrorWidget()))
|
||||
SliverToBoxAdapter(
|
||||
child: SizedBox(
|
||||
height: 220, child: CErrorWidget()))
|
||||
else
|
||||
SliverList.builder(
|
||||
itemCount: logic.comments.length,
|
||||
@@ -114,8 +138,13 @@ class _PostDetailPageState extends State<PostDetailPage> with UniqueTagMixin {
|
||||
logic.comments[index],
|
||||
objId: model.id ?? '',
|
||||
//置顶那条上方插一组 Banner
|
||||
topBanners: index == topIndex && logic.commentTopBanners.isNotEmpty ? logic.commentTopBanners : null,
|
||||
replyHandler: (comment, {reply}) => logic.readyReplyComment(comment, replyModel: reply),
|
||||
topBanners: index == topIndex &&
|
||||
logic.commentTopBanners.isNotEmpty
|
||||
? logic.commentTopBanners
|
||||
: null,
|
||||
replyHandler: (comment, {reply}) =>
|
||||
logic.readyReplyComment(comment,
|
||||
replyModel: reply),
|
||||
),
|
||||
)
|
||||
],
|
||||
@@ -128,11 +157,13 @@ class _PostDetailPageState extends State<PostDetailPage> with UniqueTagMixin {
|
||||
() => CommentFootView(
|
||||
video: model,
|
||||
showCollect: true,
|
||||
onComment: (isSend) => logic.readyReplyComment(null, isSend: isSend),
|
||||
onComment: (isSend) =>
|
||||
logic.readyReplyComment(null, isSend: isSend),
|
||||
isSending: logic.isSendingMsg.value,
|
||||
textCtr: logic.commentController,
|
||||
imgPath: logic.selectedImagePath.value,
|
||||
onImgChange: (value) => logic.selectedImagePath.value = value,
|
||||
onImgChange: (value) =>
|
||||
logic.selectedImagePath.value = value,
|
||||
),
|
||||
)
|
||||
],
|
||||
@@ -168,7 +199,9 @@ class _PostDetailPageState extends State<PostDetailPage> with UniqueTagMixin {
|
||||
children: [
|
||||
_backBtn(),
|
||||
4.sizeBoxW,
|
||||
Expanded(child: PostUserInfoView(model: logic.model!, isDetailStyle: true, avatarSize: 30)),
|
||||
Expanded(
|
||||
child: PostUserInfoView(
|
||||
model: logic.model!, isDetailStyle: true, avatarSize: 30)),
|
||||
],
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user