logo和名称替换

This commit is contained in:
谢宇宁
2026-10-14 11:23:36 +07:00
parent 1cb514cd02
commit c5c04a7967
478 changed files with 8990 additions and 4948 deletions
@@ -1,11 +1,11 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:hgmj/hj_model/drama_media_info.dart';
import 'package:hgmj/hj_model/home/module_detail_model.dart';
import 'package:hgmj/hj_page/drama/drama_detail_page.dart';
import 'package:hgmj/tools_base/banner/ads_banner.dart';
import 'package:hgmj/tools_base/widget/card_swiper/card_swiper.dart';
import 'package:hgmj/tools_base/widget/net_image_widget.dart';
import 'package:wydj/hj_model/drama_media_info.dart';
import 'package:wydj/hj_model/home/module_detail_model.dart';
import 'package:wydj/hj_page/drama/drama_detail_page.dart';
import 'package:wydj/tools_base/banner/ads_banner.dart';
import 'package:wydj/tools_base/widget/card_swiper/card_swiper.dart';
import 'package:wydj/tools_base/widget/net_image_widget.dart';
/// AI 短剧专题 banner:轮播 + 右下角指示器,点击跳短剧详情。
class DramaBanner extends StatefulWidget {
@@ -31,7 +31,7 @@ class _DramaBannerState extends State<DramaBanner> {
@override
Widget build(BuildContext context) {
if(widget.banners.isEmpty) return SizedBox();
if (widget.banners.isEmpty) return SizedBox();
return Padding(
padding: const EdgeInsets.fromLTRB(16, 12, 16, 0),
child: ClipRRect(
@@ -84,4 +84,4 @@ class _DramaBannerState extends State<DramaBanner> {
),
);
}
}
}
@@ -3,13 +3,13 @@ import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:get/get.dart';
import 'package:hgmj/assets_tool/images.dart';
import 'package:hgmj/config/config.dart';
import 'package:hgmj/hj_model/drama_media_info.dart';
import 'package:hgmj/hj_page/drama/drama_detail_page.dart';
import 'package:hgmj/hj_page/drama/drama_tag_detail_page.dart';
import 'package:hgmj/hj_utils/free_play_manager.dart';
import 'package:hgmj/tools_base/widget/net_image_widget.dart';
import 'package:wydj/assets_tool/images.dart';
import 'package:wydj/config/config.dart';
import 'package:wydj/hj_model/drama_media_info.dart';
import 'package:wydj/hj_page/drama/drama_detail_page.dart';
import 'package:wydj/hj_page/drama/drama_tag_detail_page.dart';
import 'package:wydj/hj_utils/free_play_manager.dart';
import 'package:wydj/tools_base/widget/net_image_widget.dart';
/// AI 短剧封面卡:按 Figma「短片封面展示样式」独立绘制。
class DramaCoverCard extends StatelessWidget {
@@ -137,7 +137,8 @@ class DramaCoverCard extends StatelessWidget {
? () {
final t = mediaInfo.tagDetails!.first;
DramaTagDetailPage.to(t);
} : null,
}
: null,
child: _chip(tag),
),
),
@@ -194,19 +195,22 @@ class DramaCoverCard extends StatelessWidget {
Widget? get _badge {
if (mediaInfo.permissionIconHide == true) return null;
/// 免费
/// Config.freeMark 后端下发是否展示免费角标
/// mediaInfo.permission == 2视频为免费
/// FreePlayManager().canShowFreeBadge() 免费观看次数是否可看, 相等于 需要金币或者vip观看的,只要免费观看次数有,都为免费
if(Config.freeMark && (mediaInfo.permission == 2 || FreePlayManager().canShowFreeBadge())) {
if (Config.freeMark &&
(mediaInfo.permission == 2 || FreePlayManager().canShowFreeBadge())) {
return _cornerBadge(
'免费',
const Color(0xFF1CD302),
Colors.white,
);
}
/// Vip
if(Config.vipMark && mediaInfo.permission == 0) {
if (Config.vipMark && mediaInfo.permission == 0) {
return _cornerBadge(
'VIP',
null,
@@ -218,8 +222,9 @@ class DramaCoverCard extends StatelessWidget {
),
);
}
/// 金币
if(Config.coinMark && mediaInfo.permission == 1) {
if (Config.coinMark && mediaInfo.permission == 1) {
return _cornerBadge(
'金币',
const Color(0xFFFFCC14),
@@ -229,7 +234,8 @@ class DramaCoverCard extends StatelessWidget {
return null;
}
Widget _cornerBadge(String text, Color? color, Color textColor, {Gradient? gradient}) {
Widget _cornerBadge(String text, Color? color, Color textColor,
{Gradient? gradient}) {
return Container(
padding: const EdgeInsets.symmetric(horizontal: 6),
decoration: BoxDecoration(
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:hgmj/assets_tool/app_colors.dart';
import 'package:hgmj/tools_base/loading/loading_center_widget.dart';
import 'package:wydj/assets_tool/app_colors.dart';
import 'package:wydj/tools_base/loading/loading_center_widget.dart';
import '../../../hj_model/home/module_detail_model.dart';
import '../../../hj_utils/sliver_delegate.dart';
@@ -41,7 +41,8 @@ class GuessLikeSliver extends StatelessWidget {
minHeight: 42,
childBuildHandler: (_, offset, overlaps, child) {
return Container(
color: (offset >= 0) ? AppColors.primaryColor : Colors.transparent,
color:
(offset >= 0) ? AppColors.primaryColor : Colors.transparent,
child: child,
);
},
@@ -80,7 +81,8 @@ class GuessLikeSliver extends StatelessWidget {
childAspectRatio: 168 / 154,
),
delegate: SliverChildBuilderDelegate(
(context, index) => VideoSimpleCell(videoModel: model.allVideoInfo![index]),
(context, index) =>
VideoSimpleCell(videoModel: model.allVideoInfo![index]),
childCount: model.allVideoInfo!.length,
),
),
@@ -3,8 +3,8 @@ import 'dart:math';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:hgmj/hj_model/video_model.dart';
import 'package:hgmj/hj_utils/screen.dart';
import 'package:wydj/hj_model/video_model.dart';
import 'package:wydj/hj_utils/screen.dart';
import '../../../hj_model/home/module_detail_model.dart';
import '../../../hj_utils/api_service/vid_service.dart';
@@ -79,7 +79,8 @@ class _HomeSectionCellState extends State<HomeSectionCell> {
_body(style),
//101/102/103 底部挂「更多片源 / 更换一批」,其余样式只留间距
if (style?.canExchange == true)
Padding(padding: const EdgeInsets.only(bottom: 24), child: _exchangeBar())
Padding(
padding: const EdgeInsets.only(bottom: 24), child: _exchangeBar())
else
12.sizeBoxH,
//section 间的分割线跟着 cell 走,外面只管往列表里塞
@@ -148,12 +149,14 @@ class _HomeSectionCellState extends State<HomeSectionCell> {
Expanded(
child: _ExchangeButton(
title: '更多片源',
onTap: () => Get.to(SpecialTopicsDetailPage(section), preventDuplicates: false),
onTap: () => Get.to(SpecialTopicsDetailPage(section),
preventDuplicates: false),
),
),
16.sizeBoxW,
Expanded(
child: _ExchangeButton(title: '更换一批', loading: _exchanging, onTap: _exchange),
child: _ExchangeButton(
title: '更换一批', loading: _exchanging, onTap: _exchange),
),
],
),
@@ -168,7 +171,8 @@ class _HomeSectionCellState extends State<HomeSectionCell> {
try {
final resp = await VidService.sectionVideoExchange(id);
//请求飞行中列表可能被刷新,cell 按 index 复用后 section 已换人,结果不能再往回写
if (resp.videos?.isNotEmpty == true && section.sectionID == id) section.allVideoInfo = resp.videos;
if (resp.videos?.isNotEmpty == true && section.sectionID == id)
section.allVideoInfo = resp.videos;
} catch (e) {
debugLog(e);
}
@@ -182,7 +186,8 @@ class _ExchangeButton extends StatelessWidget {
final bool loading;
final VoidCallback onTap;
const _ExchangeButton({required this.title, required this.onTap, this.loading = false});
const _ExchangeButton(
{required this.title, required this.onTap, this.loading = false});
@override
Widget build(BuildContext context) {
@@ -199,13 +204,20 @@ class _ExchangeButton extends StatelessWidget {
children: [
//转圈占位 16、常态 4,保持文字位置不跳
if (loading)
const SizedBox(width: 16, height: 16, child: CupertinoActivityIndicator(radius: 8, color: Colors.white))
const SizedBox(
width: 16,
height: 16,
child: CupertinoActivityIndicator(
radius: 8, color: Colors.white))
else
const SizedBox(width: 4),
Text(
title,
textAlign: TextAlign.center,
style: const TextStyle(color: Color(0xE5FFFFFF), fontSize: 14, fontWeight: FontWeight.w400),
style: const TextStyle(
color: Color(0xE5FFFFFF),
fontSize: 14,
fontWeight: FontWeight.w400),
),
],
),
@@ -214,7 +226,6 @@ class _ExchangeButton extends StatelessWidget {
}
}
//一大四小
class SectionOneBigFourSmall extends StatelessWidget {
final AllSection section;
@@ -223,7 +234,8 @@ class SectionOneBigFourSmall extends StatelessWidget {
@override
Widget build(BuildContext context) {
if (section.allVideoInfo?.isNotEmpty != true) return const SizedBox.shrink();
if (section.allVideoInfo?.isNotEmpty != true)
return const SizedBox.shrink();
return Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
@@ -267,7 +279,8 @@ class SectionOneHalfFiveHor extends StatelessWidget {
@override
Widget build(BuildContext context) {
if (section.allVideoInfo?.isNotEmpty != true) return const SizedBox.shrink();
if (section.allVideoInfo?.isNotEmpty != true)
return const SizedBox.shrink();
return Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
@@ -300,11 +313,13 @@ class SectionOneHalfFiveHor extends StatelessWidget {
class SectionTwoHalfFiveHV extends StatelessWidget {
final AllSection section;
final bool isVertical; // true 竖, false 横
const SectionTwoHalfFiveHV(this.section, {super.key, this.isVertical = false});
const SectionTwoHalfFiveHV(this.section,
{super.key, this.isVertical = false});
@override
Widget build(BuildContext context) {
if (section.allVideoInfo?.isNotEmpty != true) return const SizedBox.shrink();
if (section.allVideoInfo?.isNotEmpty != true)
return const SizedBox.shrink();
return Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
@@ -363,7 +378,8 @@ class SectionGridViewHV extends StatelessWidget {
@override
Widget build(BuildContext context) {
if (section.allVideoInfo?.isNotEmpty != true) return const SizedBox.shrink();
if (section.allVideoInfo?.isNotEmpty != true)
return const SizedBox.shrink();
return Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
@@ -398,7 +414,8 @@ class SectionListView extends StatelessWidget {
@override
Widget build(BuildContext context) {
if (section.allVideoInfo?.isNotEmpty != true) return const SizedBox.shrink();
if (section.allVideoInfo?.isNotEmpty != true)
return const SizedBox.shrink();
return Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
@@ -438,7 +455,8 @@ class SectionGridViewSmall extends StatelessWidget {
@override
Widget build(BuildContext context) {
if (section.allVideoInfo?.isNotEmpty != true) return const SizedBox.shrink();
if (section.allVideoInfo?.isNotEmpty != true)
return const SizedBox.shrink();
return Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
@@ -1,7 +1,7 @@
import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';
import 'package:hgmj/assets_tool/images.dart';
import 'package:hgmj/hj_utils/screen.dart';
import 'package:wydj/assets_tool/images.dart';
import 'package:wydj/hj_utils/screen.dart';
import '../../../hj_model/home/module_detail_model.dart';
import '../special_topic_detail/special_topics_detail_page.dart';
@@ -17,7 +17,8 @@ class HomeSectionTitle extends StatelessWidget {
return Container(
padding: EdgeInsets.fromLTRB(12, 0, 12, 12),
child: GestureDetector(
onTap: () => Get.to(SpecialTopicsDetailPage(section), preventDuplicates: false),
onTap: () =>
Get.to(SpecialTopicsDetailPage(section), preventDuplicates: false),
child: Row(
children: [
Expanded(
@@ -1,8 +1,8 @@
import 'package:flutter/material.dart';
import 'package:hgmj/config/config.dart';
import 'package:hgmj/hj_utils/screen.dart';
import 'package:hgmj/routers/jump_router.dart';
import 'package:hgmj/tools_base/widget/net_image_widget.dart';
import 'package:wydj/config/config.dart';
import 'package:wydj/hj_utils/screen.dart';
import 'package:wydj/routers/jump_router.dart';
import 'package:wydj/tools_base/widget/net_image_widget.dart';
import '../../../hj_model/home/plate_model.dart';
import '../../../hj_model/splash/domain_source_model.dart';
@@ -15,7 +15,8 @@ class QuickEntryRow extends StatelessWidget {
@override
Widget build(BuildContext context) {
final dataArr = (Config.jgArea ?? []).where((e) => e.mid == tabModel?.id).toList();
final dataArr =
(Config.jgArea ?? []).where((e) => e.mid == tabModel?.id).toList();
if (dataArr.isEmpty) return const SizedBox.shrink();
return Container(
height: 62,
@@ -30,7 +31,8 @@ class QuickEntryRow extends StatelessWidget {
itemCount: dataArr.length,
padding: EdgeInsets.zero,
scrollDirection: Axis.horizontal,
itemBuilder: (context, index) => _buildItem(dataArr[index], width),
itemBuilder: (context, index) =>
_buildItem(dataArr[index], width),
),
);
},
@@ -1,12 +1,12 @@
import 'package:flutter/material.dart';
import 'package:hgmj/assets_tool/images.dart';
import 'package:hgmj/hj_utils/api_service/common_service.dart';
import 'package:hgmj/hj_utils/screen.dart';
import 'package:hgmj/routers/jump_router.dart';
import 'package:wydj/assets_tool/images.dart';
import 'package:wydj/hj_utils/api_service/common_service.dart';
import 'package:wydj/hj_utils/screen.dart';
import 'package:wydj/routers/jump_router.dart';
import '../../../hj_model/video_model.dart';
import '../../../tools_base/widget/net_image_widget.dart';
import 'package:hgmj/extension/extensions.dart';
import 'package:wydj/extension/extensions.dart';
/// 抖音样式的视频 item:封面 + 底部角标 + 标题 +(可选)标签/评论数。
/// 封面占满父级剩余高度,外层必须给约束(网格 / 固定高容器)
@@ -40,7 +40,8 @@ class TiktokSimpleCell extends StatelessWidget {
"${videoModel?.title ?? ""}\n",
maxLines: textLines,
overflow: TextOverflow.ellipsis,
style: TextStyle(color: Colors.white.withValues(alpha: 0.9), fontSize: 12),
style: TextStyle(
color: Colors.white.withValues(alpha: 0.9), fontSize: 12),
),
),
if (isShowBottom) _buildBottom(),
@@ -72,11 +73,15 @@ class TiktokSimpleCell extends StatelessWidget {
height: 30,
padding: const EdgeInsets.symmetric(horizontal: 6),
decoration: BoxDecoration(
borderRadius: const BorderRadius.vertical(bottom: Radius.circular(4)),
borderRadius:
const BorderRadius.vertical(bottom: Radius.circular(4)),
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [Colors.black.withValues(alpha: 0), Colors.black.withValues(alpha: 0.6)],
colors: [
Colors.black.withValues(alpha: 0),
Colors.black.withValues(alpha: 0.6)
],
),
),
child: _buildCoverBadge(),
@@ -96,7 +101,8 @@ class TiktokSimpleCell extends StatelessWidget {
videoModel?.playCount?.countStr ?? "0",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: const TextStyle(color: Colors.white, fontSize: 10, height: 1.6),
style:
const TextStyle(color: Colors.white, fontSize: 10, height: 1.6),
),
const Spacer(),
if (isShowTime)
@@ -133,7 +139,8 @@ class TiktokSimpleCell extends StatelessWidget {
child: tagName.isEmpty
? const SizedBox.shrink()
: Container(
padding: const EdgeInsets.symmetric(horizontal: 4, vertical: 1),
padding:
const EdgeInsets.symmetric(horizontal: 4, vertical: 1),
decoration: BoxDecoration(
color: const Color(0x0DFFFFFF),
borderRadius: BorderRadius.circular(3),
@@ -142,7 +149,8 @@ class TiktokSimpleCell extends StatelessWidget {
tagName,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: const TextStyle(color: Color(0x73FFFFFF), fontSize: 10),
style: const TextStyle(
color: Color(0x73FFFFFF), fontSize: 10),
),
),
),
@@ -1,13 +1,13 @@
import 'package:flutter/material.dart';
import 'package:hgmj/hj_utils/api_service/common_service.dart';
import 'package:hgmj/hj_utils/screen.dart';
import 'package:wydj/hj_utils/api_service/common_service.dart';
import 'package:wydj/hj_utils/screen.dart';
import '../../../hj_model/video_model.dart';
import '../../../hj_utils/free_play_manager.dart';
import '../../../routers/jump_router.dart';
import '../../../tools_base/widget/net_image_widget.dart';
import 'level_mark_chip.dart';
import 'package:hgmj/extension/extensions.dart';
import 'package:wydj/extension/extensions.dart';
/// 横版视频 item:左封面(带售卖角标) + 右标题/收藏数,用在专题的小列表样式
class VideoHorCell extends StatelessWidget {
@@ -1,13 +1,13 @@
import 'package:easy_rich_text/easy_rich_text.dart';
import 'package:flutter/material.dart';
import 'package:hgmj/assets_tool/images.dart';
import 'package:hgmj/config/config.dart';
import 'package:hgmj/extension/extensions.dart';
import 'package:hgmj/hj_utils/api_service/common_service.dart';
import 'package:hgmj/hj_utils/screen.dart';
import 'package:hgmj/routers/jump_router.dart';
import 'package:hgmj/tools_base/banner/ads_item.dart';
import 'package:hgmj/tools_base/global_store/store.dart';
import 'package:wydj/assets_tool/images.dart';
import 'package:wydj/config/config.dart';
import 'package:wydj/extension/extensions.dart';
import 'package:wydj/hj_utils/api_service/common_service.dart';
import 'package:wydj/hj_utils/screen.dart';
import 'package:wydj/routers/jump_router.dart';
import 'package:wydj/tools_base/banner/ads_item.dart';
import 'package:wydj/tools_base/global_store/store.dart';
import '../../../hj_model/splash/ads_model.dart';
import '../../../hj_model/video_model.dart';
@@ -95,7 +95,9 @@ class VideoSimpleCell extends StatelessWidget {
"${videoModel?.title ?? ""}\n",
maxLines: textLines,
overflow: TextOverflow.ellipsis,
style: TextStyle(color: Colors.white.withValues(alpha: 0.9), fontSize: titleFontSize),
style: TextStyle(
color: Colors.white.withValues(alpha: 0.9),
fontSize: titleFontSize),
),
),
if (isShowBottom) _buildBottomWidget(),
@@ -177,7 +179,8 @@ class VideoSimpleCell extends StatelessWidget {
videoModel?.playCount?.countStr ?? "0",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(color: Colors.white, fontSize: coverFontSize, height: 1.6),
style: TextStyle(
color: Colors.white, fontSize: coverFontSize, height: 1.6),
),
Spacer(),
Text(
@@ -211,7 +214,8 @@ class VideoSimpleCell extends StatelessWidget {
Widget _buildBottomWidget() {
if (isFromHY) {
final tagDesc = videoModel?.tags?.map((e) => e.name ?? "").join("·") ?? "";
final tagDesc =
videoModel?.tags?.map((e) => e.name ?? "").join("·") ?? "";
return Container(
padding: EdgeInsets.only(top: 3),
child: Text(
@@ -234,9 +238,12 @@ class VideoSimpleCell extends StatelessWidget {
Flexible(
child: videoModel?.tags?.isNotEmpty == true
? GestureDetector(
onTap: onTagTap == null ? null : () => onTagTap!(videoModel!.tags!.first),
onTap: onTagTap == null
? null
: () => onTagTap!(videoModel!.tags!.first),
child: Container(
padding: EdgeInsets.symmetric(horizontal: 4, vertical: 1),
padding:
EdgeInsets.symmetric(horizontal: 4, vertical: 1),
decoration: BoxDecoration(
color: Color(0x0DFFFFFF),
borderRadius: BorderRadius.circular(3),
@@ -295,7 +302,8 @@ class _VideoSimpleAdsCellState extends State<VideoSimpleAdsCell> {
int adIndex = 0;
List<AdsInfoModel>? get adsInfoArr => videoModel?.adsInfoArr; //?? mediaInfo?.adsInfoArr;
List<AdsInfoModel>? get adsInfoArr =>
videoModel?.adsInfoArr; //?? mediaInfo?.adsInfoArr;
AdsInfoModel? get adsModel => videoModel?.randomAdsInfo;
@@ -356,7 +364,9 @@ class _VideoSimpleAdsCellState extends State<VideoSimpleAdsCell> {
child: child,
),
child: Text(
isHor ? adsInfoArr![adIndex].title?.trim() ?? "" : "${adsInfoArr![adIndex].title?.trim() ?? ""}\n",
isHor
? adsInfoArr![adIndex].title?.trim() ?? ""
: "${adsInfoArr![adIndex].title?.trim() ?? ""}\n",
key: ValueKey(adIndex), // adIndex 变化触发切换动画
maxLines: widget.textLines,
overflow: TextOverflow.ellipsis,
@@ -436,7 +446,9 @@ class _VideoSimpleAdsCellState extends State<VideoSimpleAdsCell> {
Container(
padding: const EdgeInsets.only(top: 4),
child: Text(
isHor ? videoModel?.title ?? "" : "${videoModel?.title ?? ""}\n",
isHor
? videoModel?.title ?? ""
: "${videoModel?.title ?? ""}\n",
maxLines: widget.textLines,
overflow: TextOverflow.ellipsis,
style: TextStyle(