logo和名称替换
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/hj_model/splash/domain_source_model.dart';
|
||||
import 'package:hgmj/hj_page/main_page/provider/msg_provider.dart';
|
||||
import 'package:hgmj/hj_page/mine/mine_vip/mine_charge_vip_page.dart';
|
||||
import 'package:hgmj/hj_page/mine/mine_vip/pay_order_source.dart';
|
||||
import 'package:hgmj/tools_base/widget/net_image_widget.dart';
|
||||
import 'package:wydj/hj_model/splash/domain_source_model.dart';
|
||||
import 'package:wydj/hj_page/main_page/provider/msg_provider.dart';
|
||||
import 'package:wydj/hj_page/mine/mine_vip/mine_charge_vip_page.dart';
|
||||
import 'package:wydj/hj_page/mine/mine_vip/pay_order_source.dart';
|
||||
import 'package:wydj/tools_base/widget/net_image_widget.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../../../tools_base/widget/card_swiper/src/swiper.dart';
|
||||
@@ -31,14 +31,17 @@ class HomeActivityFloat extends StatelessWidget {
|
||||
//预售浮窗:展示判断走项目统一的 canShowEnter,点击进预售页(入口图/动画由 PreSaleEntry 内部处理)
|
||||
if (presale.canShowEnter) const PreSaleEntry(),
|
||||
//支付分层浮窗:有 homePageFlot 图就展示
|
||||
if ((tier?.homePageFlot ?? '').isNotEmpty) _LayeredFloatView(config: tier!),
|
||||
if ((tier?.homePageFlot ?? '').isNotEmpty)
|
||||
_LayeredFloatView(config: tier!),
|
||||
];
|
||||
if (floats.isEmpty) return const SizedBox();
|
||||
|
||||
// 单个直接贴右下角;预售 + 分层并存则轮播
|
||||
return KeyedSubtree(
|
||||
key: homeFloatKey,
|
||||
child: floats.length == 1 ? Align(alignment: Alignment.bottomRight, child: floats.first) : _FloatCarousel(items: floats),
|
||||
child: floats.length == 1
|
||||
? Align(alignment: Alignment.bottomRight, child: floats.first)
|
||||
: _FloatCarousel(items: floats),
|
||||
);
|
||||
},
|
||||
);
|
||||
@@ -57,7 +60,8 @@ class _LayeredFloatView extends StatelessWidget {
|
||||
return InkWell(
|
||||
enableFeedback: false,
|
||||
//点击跳会员中心,vipID 让其自动选中对应卡
|
||||
onTap: () => Get.to(() => MineChargeVipPage(vipID: config.vipCard, sourcePage: PaySourcePage.homeFloatWindow)),
|
||||
onTap: () => Get.to(() => MineChargeVipPage(
|
||||
vipID: config.vipCard, sourcePage: PaySourcePage.homeFloatWindow)),
|
||||
child: SizedBox(
|
||||
width: 60,
|
||||
height: 66,
|
||||
@@ -65,7 +69,10 @@ class _LayeredFloatView extends StatelessWidget {
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
//分层海报图(后端加密图)
|
||||
NetworkImageLoader(imageUrl: config.homePageFlot ?? '', fit: BoxFit.fill, borderRadius: 0),
|
||||
NetworkImageLoader(
|
||||
imageUrl: config.homePageFlot ?? '',
|
||||
fit: BoxFit.fill,
|
||||
borderRadius: 0),
|
||||
//倒计时文字:监听 tick 每秒刷新(过期自动收起),框由后端图自带,位置不对就调 bottom
|
||||
Positioned(
|
||||
left: 0,
|
||||
@@ -77,7 +84,10 @@ class _LayeredFloatView extends StatelessWidget {
|
||||
? Center(
|
||||
child: Text(
|
||||
'${config.discountHour}:${config.discountMin}:${config.discountSec}',
|
||||
style: const TextStyle(color: Colors.white, fontSize: 8.5, fontWeight: FontWeight.w600),
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 8.5,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
)
|
||||
: const SizedBox.shrink(),
|
||||
@@ -108,7 +118,8 @@ class _FloatCarousel extends StatelessWidget {
|
||||
autoplayDelay: 4000,
|
||||
loop: true,
|
||||
itemCount: items.length,
|
||||
itemBuilder: (_, index) => Align(alignment: Alignment.bottomRight, child: items[index]),
|
||||
itemBuilder: (_, index) =>
|
||||
Align(alignment: Alignment.bottomRight, child: items[index]),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hgmj/hj_utils/date_time_util.dart';
|
||||
import 'package:wydj/hj_utils/date_time_util.dart';
|
||||
|
||||
import '../../../config/config.dart';
|
||||
import '../../../hj_model/splash/domain_source_model.dart';
|
||||
@@ -82,7 +82,8 @@ class _HomeFloatBannerState extends State<HomeFloatBanner> {
|
||||
_timer?.cancel();
|
||||
_timer = null;
|
||||
if (_isCountdownActivity) {
|
||||
_timer = Timer.periodic(const Duration(seconds: 1), (_) => _onTimerTick());
|
||||
_timer =
|
||||
Timer.periodic(const Duration(seconds: 1), (_) => _onTimerTick());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,7 +107,8 @@ class _HomeFloatBannerState extends State<HomeFloatBanner> {
|
||||
final start = _parseDate(_banner.startAt);
|
||||
_bottomText.value = switch (_activityStatus()) {
|
||||
_ActStatus.inProgress => '立即参与',
|
||||
_ActStatus.beforeStart => start == null ? '' : _formatCountdown(start.difference(DateTime.now())),
|
||||
_ActStatus.beforeStart =>
|
||||
start == null ? '' : _formatCountdown(start.difference(DateTime.now())),
|
||||
_ActStatus.ended => '',
|
||||
};
|
||||
}
|
||||
@@ -139,7 +141,8 @@ class _HomeFloatBannerState extends State<HomeFloatBanner> {
|
||||
|
||||
// 用新 banner 替换 Config.bannerJumps 里同位置同 id 的旧数据
|
||||
void _updateConfigBanner(BannerJumpEntity banner) {
|
||||
final index = Config.bannerJumps.indexWhere((e) => e.position == _banner.position && e.id == _banner.id);
|
||||
final index = Config.bannerJumps.indexWhere(
|
||||
(e) => e.position == _banner.position && e.id == _banner.id);
|
||||
if (index >= 0) {
|
||||
Config.bannerJumps[index] = banner;
|
||||
}
|
||||
@@ -147,12 +150,14 @@ class _HomeFloatBannerState extends State<HomeFloatBanner> {
|
||||
|
||||
// 活动结束且无下一场:从 Config.bannerJumps 移除当前 banner
|
||||
void _removeConfigBanner() {
|
||||
Config.bannerJumps.removeWhere((e) => e.position == _banner.position && e.id == _banner.id);
|
||||
Config.bannerJumps.removeWhere(
|
||||
(e) => e.position == _banner.position && e.id == _banner.id);
|
||||
}
|
||||
|
||||
// 解析后端时间字符串为本地时间;空值/占位(0001-01-01)/非法格式返回 null
|
||||
DateTime? _parseDate(String? date) {
|
||||
if (date == null || date.isEmpty || date.contains('0001-01-01')) return null;
|
||||
if (date == null || date.isEmpty || date.contains('0001-01-01'))
|
||||
return null;
|
||||
try {
|
||||
return DateTime.parse(date).toLocal();
|
||||
} catch (_) {
|
||||
@@ -174,7 +179,8 @@ class _HomeFloatBannerState extends State<HomeFloatBanner> {
|
||||
String _formatCountdown(Duration duration) {
|
||||
final seconds = duration.inSeconds < 0 ? 0 : duration.inSeconds;
|
||||
final days = seconds ~/ 86400;
|
||||
final time = DateTimeUtil.formatHMS(seconds % 86400, alwaysHour: true); // 当天内 HH:MM:SS
|
||||
final time = DateTimeUtil.formatHMS(seconds % 86400,
|
||||
alwaysHour: true); // 当天内 HH:MM:SS
|
||||
return days > 0 ? '$days天$time' : time;
|
||||
}
|
||||
|
||||
@@ -183,7 +189,8 @@ class _HomeFloatBannerState extends State<HomeFloatBanner> {
|
||||
return InkWell(
|
||||
enableFeedback: false,
|
||||
// 内链可配到会员/金币页,来源统一记首页浮窗
|
||||
onTap: () => pushToPageByLink(_banner.url, sourcePage: PaySourcePage.homeFloatWindow),
|
||||
onTap: () => pushToPageByLink(_banner.url,
|
||||
sourcePage: PaySourcePage.homeFloatWindow),
|
||||
child: SizedBox(
|
||||
width: widget.width,
|
||||
height: widget.height,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/tools_base/loading/loading_center_widget.dart';
|
||||
import 'package:wydj/tools_base/loading/loading_center_widget.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../../alert/aw_permission_alert.dart';
|
||||
@@ -20,7 +20,8 @@ class DarkHomePage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _DarkHomePageState extends State<DarkHomePage> {
|
||||
late final logic = HomeMainLogic(isDarkStyle: true, darkDefaultId: widget.defaultId);
|
||||
late final logic =
|
||||
HomeMainLogic(isDarkStyle: true, darkDefaultId: widget.defaultId);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/hj_model/splash/ads_model.dart';
|
||||
import 'package:hgmj/hj_page/main_page/provider/msg_provider.dart';
|
||||
import 'package:hgmj/hj_page/pre_sale/pre_sale_provider.dart';
|
||||
import 'package:hgmj/alert/vip_guide/guide_manager.dart';
|
||||
import 'package:hgmj/alert/vip_guide/timed_popup_manager.dart';
|
||||
import 'package:hgmj/tools_base/ad_manager.dart';
|
||||
import 'package:wydj/hj_model/splash/ads_model.dart';
|
||||
import 'package:wydj/hj_page/main_page/provider/msg_provider.dart';
|
||||
import 'package:wydj/hj_page/pre_sale/pre_sale_provider.dart';
|
||||
import 'package:wydj/alert/vip_guide/guide_manager.dart';
|
||||
import 'package:wydj/alert/vip_guide/timed_popup_manager.dart';
|
||||
import 'package:wydj/tools_base/ad_manager.dart';
|
||||
|
||||
import '../../alert/splash/app_center_dialog.dart';
|
||||
import '../../alert/splash/notice_image_dialog.dart';
|
||||
@@ -144,7 +144,8 @@ class HomeMainLogic extends GetxController {
|
||||
if (config == null || (config.homePage ?? '').isEmpty) return;
|
||||
final goVip = await Get.dialog<bool>(GuideHomeDialog(config: config));
|
||||
if (goVip != true) return;
|
||||
await Get.to(() => MineChargeVipPage(vipID: config.vipCard, sourcePage: PaySourcePage.homeUserSegment));
|
||||
await Get.to(() => MineChargeVipPage(
|
||||
vipID: config.vipCard, sourcePage: PaySourcePage.homeUserSegment));
|
||||
}
|
||||
|
||||
/// 首页吸底 VIP 引导:开屏弹窗链末尾弹(全链最低优先级),能不能弹由 HOME_NEW_USER / HOME_OLD_USER
|
||||
@@ -160,12 +161,17 @@ class HomeMainLogic extends GetxController {
|
||||
scene: scene,
|
||||
title: Text(
|
||||
config?.title?.isNotEmpty == true ? config!.title! : 'VIP影片免费试看',
|
||||
style: const TextStyle(color: Colors.white, fontSize: 19, fontWeight: FontWeight.w600),
|
||||
style: const TextStyle(
|
||||
color: Colors.white, fontSize: 19, fontWeight: FontWeight.w600),
|
||||
),
|
||||
subtitle: GradientText(
|
||||
config?.description?.isNotEmpty == true ? config!.description! : '开通会员 查看完整影片',
|
||||
gradient: const LinearGradient(colors: [Colors.white, Color(0xffEFD394)]),
|
||||
style: const TextStyle(color: Colors.white, fontSize: 15, fontWeight: FontWeight.w500),
|
||||
config?.description?.isNotEmpty == true
|
||||
? config!.description!
|
||||
: '开通会员 查看完整影片',
|
||||
gradient:
|
||||
const LinearGradient(colors: [Colors.white, Color(0xffEFD394)]),
|
||||
style: const TextStyle(
|
||||
color: Colors.white, fontSize: 15, fontWeight: FontWeight.w500),
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -182,7 +188,8 @@ class HomeMainLogic extends GetxController {
|
||||
Future<void> _showImageDialog() async {
|
||||
final adsList = AdManager().adsByType(46);
|
||||
for (int i = 0; i < adsList.length; i += 2) {
|
||||
await Get.dialog(SystemImagesDialog(ads: adsList.skip(i).take(2).toList()));
|
||||
await Get.dialog(
|
||||
SystemImagesDialog(ads: adsList.skip(i).take(2).toList()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,8 +198,11 @@ class HomeMainLogic extends GetxController {
|
||||
for (final wordBean in AdManager().announceList) {
|
||||
await Get.dialog(
|
||||
wordBean.type == 0
|
||||
? NoticeTextDialog(content: wordBean.content.toString(), wordBean: wordBean)
|
||||
: NoticeImageDialog(model: AdsInfoModel(cover: wordBean.cover, href: wordBean.href)),
|
||||
? NoticeTextDialog(
|
||||
content: wordBean.content.toString(), wordBean: wordBean)
|
||||
: NoticeImageDialog(
|
||||
model:
|
||||
AdsInfoModel(cover: wordBean.cover, href: wordBean.href)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
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_page/home/provider/home_update_marker_provider.dart';
|
||||
import 'package:hgmj/hj_utils/const.dart';
|
||||
import 'package:hgmj/hj_utils/screen.dart';
|
||||
import 'package:hgmj/tools_base/indicator/custom_tab_indicator.dart';
|
||||
import 'package:hgmj/tools_base/loading/loading_center_widget.dart';
|
||||
import 'package:hgmj/tools_base/widget/keep_alive_widget.dart';
|
||||
import 'package:wydj/assets_tool/images.dart';
|
||||
import 'package:wydj/hj_page/home/provider/home_update_marker_provider.dart';
|
||||
import 'package:wydj/hj_utils/const.dart';
|
||||
import 'package:wydj/hj_utils/screen.dart';
|
||||
import 'package:wydj/tools_base/indicator/custom_tab_indicator.dart';
|
||||
import 'package:wydj/tools_base/loading/loading_center_widget.dart';
|
||||
import 'package:wydj/tools_base/widget/keep_alive_widget.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../cartoon/cartoon_sub_detail_page.dart';
|
||||
@@ -39,7 +39,8 @@ class HomeMainPage extends StatelessWidget {
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
_body(logic),
|
||||
const Positioned(right: 12, bottom: 40, child: HomeFloatWidget()),
|
||||
const Positioned(
|
||||
right: 12, bottom: 40, child: HomeFloatWidget()),
|
||||
],
|
||||
),
|
||||
);
|
||||
@@ -60,7 +61,8 @@ class HomeMainPage extends StatelessWidget {
|
||||
child: CommonSearchBarView(logic: logic),
|
||||
),
|
||||
//排序变化时 tabViewKey 变,整个 TabView 连 TabController 一起重建
|
||||
Expanded(child: HomeTabView(key: ValueKey(logic.tabViewKey), logic: logic)),
|
||||
Expanded(
|
||||
child: HomeTabView(key: ValueKey(logic.tabViewKey), logic: logic)),
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -80,7 +82,8 @@ class HomeTabView extends StatefulWidget {
|
||||
State<HomeTabView> createState() => _HomeTabViewState();
|
||||
}
|
||||
|
||||
class _HomeTabViewState extends State<HomeTabView> with SingleTickerProviderStateMixin {
|
||||
class _HomeTabViewState extends State<HomeTabView>
|
||||
with SingleTickerProviderStateMixin {
|
||||
HomeMainLogic get logic => widget.logic;
|
||||
|
||||
bool get isDarkStyle => widget.isDarkStyle;
|
||||
@@ -148,19 +151,31 @@ class _HomeTabViewState extends State<HomeTabView> with SingleTickerProviderStat
|
||||
//1首页(原首页视频) 3暗网
|
||||
//showType==2 走分区聚合页,其余走排序列表页
|
||||
if (module.showType == 2) {
|
||||
return HomeTabSectionPage(index, module, isDarkStyle: isDarkStyle).keepAlive;
|
||||
return HomeTabSectionPage(index, module,
|
||||
isDarkStyle: isDarkStyle)
|
||||
.keepAlive;
|
||||
} else {
|
||||
return HomeTabSortPage(index, module, isDarkStyle: isDarkStyle).keepAlive;
|
||||
return HomeTabSortPage(index, module,
|
||||
isDarkStyle: isDarkStyle)
|
||||
.keepAlive;
|
||||
}
|
||||
} else if (module.isACG) {
|
||||
/// 动漫/漫画/小说
|
||||
return CartoonSubDetailPage(tagData: module, type: MediaStyle.Cartoon, index: index).keepAlive;
|
||||
return CartoonSubDetailPage(
|
||||
tagData: module,
|
||||
type: MediaStyle.Cartoon,
|
||||
index: index)
|
||||
.keepAlive;
|
||||
} else if (module.isDrama) {
|
||||
/// 短剧
|
||||
return HomeTabDramaPage(index, module, isDarkStyle: isDarkStyle).keepAlive;
|
||||
return HomeTabDramaPage(index, module,
|
||||
isDarkStyle: isDarkStyle)
|
||||
.keepAlive;
|
||||
} else {
|
||||
//兜底
|
||||
return HomeTabSortPage(index, module, isDarkStyle: isDarkStyle).keepAlive;
|
||||
return HomeTabSortPage(index, module,
|
||||
isDarkStyle: isDarkStyle)
|
||||
.keepAlive;
|
||||
}
|
||||
}),
|
||||
),
|
||||
@@ -181,7 +196,9 @@ class _HomeTabViewState extends State<HomeTabView> with SingleTickerProviderStat
|
||||
tabAlignment: TabAlignment.start,
|
||||
tabs: logic.tabs.map((e) {
|
||||
//「最新」有更新时右上角挂红点
|
||||
final showDot = !isDarkStyle && e.id == '-110' && marker.showHomeLatestDot;
|
||||
final showDot = !isDarkStyle &&
|
||||
e.id == '-110' &&
|
||||
marker.showHomeLatestDot;
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 14.w),
|
||||
alignment: Alignment.center,
|
||||
@@ -204,8 +221,11 @@ class _HomeTabViewState extends State<HomeTabView> with SingleTickerProviderStat
|
||||
labelPadding: EdgeInsets.zero,
|
||||
unselectedLabelStyle: const TextStyle(fontSize: 14),
|
||||
unselectedLabelColor: const Color(0x80FFFFFF),
|
||||
labelStyle: const TextStyle(fontSize: 16, fontWeight: FontWeight.w500),
|
||||
labelColor: isDarkStyle ? const Color(0xffFFC000) : const Color(0xffFFC000),
|
||||
labelStyle:
|
||||
const TextStyle(fontSize: 16, fontWeight: FontWeight.w500),
|
||||
labelColor: isDarkStyle
|
||||
? const Color(0xffFFC000)
|
||||
: const Color(0xffFFC000),
|
||||
indicator: CustomIndicator(
|
||||
height: 2,
|
||||
width: 16.w,
|
||||
@@ -230,7 +250,8 @@ class _HomeTabViewState extends State<HomeTabView> with SingleTickerProviderStat
|
||||
onTap: () => widget.logic.openEndDrawer(),
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(bottom: 4),
|
||||
child: Image.asset('acg_menu.png'.acgImgPath, width: 24, color: const Color(0xff989898)),
|
||||
child: Image.asset('acg_menu.png'.acgImgPath,
|
||||
width: 24, color: const Color(0xff989898)),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:hgmj/hj_model/drama_media_info.dart';
|
||||
import 'package:hgmj/hj_utils/api_service/acg_service.dart';
|
||||
import 'package:hgmj/tools_base/debug_log.dart';
|
||||
import 'package:wydj/hj_model/drama_media_info.dart';
|
||||
import 'package:wydj/hj_utils/api_service/acg_service.dart';
|
||||
import 'package:wydj/tools_base/debug_log.dart';
|
||||
|
||||
import '../../../hj_model/home/module_detail_model.dart';
|
||||
import '../../../hj_utils/api_service/vid_service.dart';
|
||||
@@ -9,16 +9,15 @@ import 'home_tab_base_logic.dart';
|
||||
/// AI 短剧子 tab:拉 [VidService.getModuleDetail];专题样式(5)按选中专题拉
|
||||
/// [ACGService.getPreferences],否则直接用模块 allMediaInfo。
|
||||
class HomeTabDramaLogic extends HomeTabBaseLogic {
|
||||
|
||||
HomeTabDramaLogic(super.index, super.tabModel, {super.isDarkStyle});
|
||||
|
||||
|
||||
/// 专题样式(5)才走「专题 tab + fetchTopicWorks」;否则直接用 allMediaInfo 无 tab。
|
||||
bool get hasSectionTabs => tabModel.haiJiaoStyle?.sectionStyle == 5;
|
||||
|
||||
bool get isShowMenuTab => hasSectionTabs && allSection.isNotEmpty;
|
||||
|
||||
List<SectionBannerModel> get banners => isShowMenuTab ? (allSection[selectedSection].banners ?? []) : [];
|
||||
List<SectionBannerModel> get banners =>
|
||||
isShowMenuTab ? (allSection[selectedSection].banners ?? []) : [];
|
||||
|
||||
/// 当前选中专题下标
|
||||
int selectedSection = 0;
|
||||
@@ -38,7 +37,8 @@ class HomeTabDramaLogic extends HomeTabBaseLogic {
|
||||
try {
|
||||
isInitData = true;
|
||||
update();
|
||||
dataSource = await VidService.getModuleDetail(tabModel.id ?? '', pageNumber: 1, pageSize: 10, moduleSort: 0);
|
||||
dataSource = await VidService.getModuleDetail(tabModel.id ?? '',
|
||||
pageNumber: 1, pageSize: 10, moduleSort: 0);
|
||||
_loadData(selectedSection);
|
||||
} catch (e) {
|
||||
debugLog(e);
|
||||
@@ -47,7 +47,6 @@ class HomeTabDramaLogic extends HomeTabBaseLogic {
|
||||
update();
|
||||
}
|
||||
|
||||
|
||||
void onInitListData() {
|
||||
videoList = null;
|
||||
update();
|
||||
@@ -76,23 +75,30 @@ class HomeTabDramaLogic extends HomeTabBaseLogic {
|
||||
}
|
||||
|
||||
/// 第一步:拉模块详情;完成后按样式进入第二步。
|
||||
Future<void> _loadData(int selectedIndex, {int page = 1, int pageSize = 10}) async {
|
||||
Future<void> _loadData(int selectedIndex,
|
||||
{int page = 1, int pageSize = 10}) async {
|
||||
try {
|
||||
bool hasNext = false;
|
||||
List<DramaMediaInfo> retArr = [];
|
||||
if (hasSectionTabs) {
|
||||
final sectionId = _selectedSectionId;
|
||||
final res = await ACGService.getPreferences(page, pageSize, sId: sectionId, type: null);
|
||||
if(sectionId != _selectedSectionId){
|
||||
final res = await ACGService.getPreferences(page, pageSize,
|
||||
sId: sectionId, type: null);
|
||||
if (sectionId != _selectedSectionId) {
|
||||
//切换菜单了,数据直接丢弃
|
||||
return;
|
||||
}
|
||||
retArr = res?.list?.map((e) => e.toDramaMediaInfo()).toList() ?? [];
|
||||
hasNext = res?.hasNext ?? false;
|
||||
} else {
|
||||
ModuleDetailModel? detail =
|
||||
await VidService.getModuleDetail(tabModel.id ?? '', pageNumber: page, pageSize: pageSize, moduleSort: 0);
|
||||
retArr = detail?.allMediaInfo?.map((e) => e.toDramaMediaInfo()).toList() ?? [];
|
||||
ModuleDetailModel? detail = await VidService.getModuleDetail(
|
||||
tabModel.id ?? '',
|
||||
pageNumber: page,
|
||||
pageSize: pageSize,
|
||||
moduleSort: 0);
|
||||
retArr =
|
||||
detail?.allMediaInfo?.map((e) => e.toDramaMediaInfo()).toList() ??
|
||||
[];
|
||||
hasNext = detail?.hasNext ?? false;
|
||||
}
|
||||
videoList ??= [];
|
||||
@@ -114,5 +120,4 @@ class HomeTabDramaLogic extends HomeTabBaseLogic {
|
||||
}
|
||||
update();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/hj_model/home/plate_model.dart';
|
||||
import 'package:hgmj/hj_page/home/home_cell_style/drama_banner.dart';
|
||||
import 'package:hgmj/hj_page/home/home_cell_style/drama_cover_card.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/hj_model/home/plate_model.dart';
|
||||
import 'package:wydj/hj_page/home/home_cell_style/drama_banner.dart';
|
||||
import 'package:wydj/hj_page/home/home_cell_style/drama_cover_card.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 'home_tab_drama_logic.dart';
|
||||
|
||||
@@ -26,11 +26,13 @@ class HomeTabDramaPage extends StatefulWidget {
|
||||
State<HomeTabDramaPage> createState() => _HomeTabDramaPageState();
|
||||
}
|
||||
|
||||
class _HomeTabDramaPageState extends State<HomeTabDramaPage> with UniqueTagMixin {
|
||||
class _HomeTabDramaPageState extends State<HomeTabDramaPage>
|
||||
with UniqueTagMixin {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<HomeTabDramaLogic>(
|
||||
init: HomeTabDramaLogic(widget.tabIndex, widget.tabModel, isDarkStyle: widget.isDarkStyle),
|
||||
init: HomeTabDramaLogic(widget.tabIndex, widget.tabModel,
|
||||
isDarkStyle: widget.isDarkStyle),
|
||||
tag: uniqueTag,
|
||||
builder: (logic) {
|
||||
if (logic.isInitData) {
|
||||
@@ -99,10 +101,13 @@ class _HomeTabDramaPageState extends State<HomeTabDramaPage> with UniqueTagMixin
|
||||
return GestureDetector(
|
||||
onTap: () => logic.selectSection(i),
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: selected ? 12 : 8, vertical: 4),
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: selected ? 12 : 8, vertical: 4),
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
color: selected ? const Color(0xFFFFC000) : const Color(0x0DFFFFFF),
|
||||
color: selected
|
||||
? const Color(0xFFFFC000)
|
||||
: const Color(0x0DFFFFFF),
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
child: Text(
|
||||
@@ -111,7 +116,9 @@ class _HomeTabDramaPageState extends State<HomeTabDramaPage> with UniqueTagMixin
|
||||
fontSize: 12,
|
||||
height: 18 / 12,
|
||||
fontWeight: selected ? FontWeight.w500 : FontWeight.w400,
|
||||
color: selected ? const Color(0xFF292929) : const Color(0x8CFFFFFF),
|
||||
color: selected
|
||||
? const Color(0xFF292929)
|
||||
: const Color(0x8CFFFFFF),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'package:hgmj/tools_base/ad_manager.dart';
|
||||
import 'package:wydj/tools_base/ad_manager.dart';
|
||||
|
||||
import '../../../hj_model/home/module_detail_model.dart';
|
||||
import '../../../hj_utils/api_service/vid_service.dart';
|
||||
@@ -57,10 +57,14 @@ class HomeTabSectionLogic extends HomeTabBaseLogic {
|
||||
|
||||
void _loadData({int page = 1, int size = 5}) async {
|
||||
try {
|
||||
ModuleDetailModel? retResp = await VidService.getModuleDetail(tabModel.id ?? '', pageNumber: page, pageSize: size);
|
||||
ModuleDetailModel? retResp = await VidService.getModuleDetail(
|
||||
tabModel.id ?? '',
|
||||
pageNumber: page,
|
||||
pageSize: size);
|
||||
|
||||
currentPage = page;
|
||||
retResp?.allSection?.removeWhere((element) => element.allVideoInfo?.isEmpty ?? true);
|
||||
retResp?.allSection
|
||||
?.removeWhere((element) => element.allVideoInfo?.isEmpty ?? true);
|
||||
if (currentPage == 1) {
|
||||
dataSource = retResp;
|
||||
} else {
|
||||
@@ -109,7 +113,8 @@ class HomeTabSectionLogic extends HomeTabBaseLogic {
|
||||
try {
|
||||
AllSection lastSection = allSection.last;
|
||||
int sortValue = gLikeSortParam[sortType];
|
||||
AllSection? retModel = await VidService.getGuessLike(page, size, tabModel.id ?? "", sortValue);
|
||||
AllSection? retModel = await VidService.getGuessLike(
|
||||
page, size, tabModel.id ?? "", sortValue);
|
||||
if (sortType != guessLikeSortType) {
|
||||
return;
|
||||
}
|
||||
@@ -119,7 +124,9 @@ class HomeTabSectionLogic extends HomeTabBaseLogic {
|
||||
lastSection.allVideoInfo?.clear();
|
||||
}
|
||||
lastSection.allVideoInfo?.addAll(retModel?.allVideoInfo ?? []);
|
||||
retModel?.hasNext == false ? refreshCtr?.loadNoData() : refreshCtr?.loadComplete();
|
||||
retModel?.hasNext == false
|
||||
? refreshCtr?.loadNoData()
|
||||
: refreshCtr?.loadComplete();
|
||||
} catch (e) {
|
||||
refreshCtr?.loadComplete();
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/tools_base/loading/loading_center_widget.dart';
|
||||
import 'package:wydj/tools_base/loading/loading_center_widget.dart';
|
||||
|
||||
import '../../../hj_model/home/plate_model.dart';
|
||||
import '../../../hj_model/home/module_detail_model.dart';
|
||||
import '../../../tools_base/banner/ads_grid_view.dart';
|
||||
import '../../../tools_base/refresh/pull_refresh.dart';
|
||||
import 'package:hgmj/tools_base/unique_tag_mixin.dart';
|
||||
import 'package:wydj/tools_base/unique_tag_mixin.dart';
|
||||
import '../home_cell_style/guess_like_sliver.dart';
|
||||
import '../home_cell_style/quick_entry_row.dart';
|
||||
import '../home_cell_style/home_section_cell.dart';
|
||||
@@ -29,11 +29,13 @@ class HomeTabSectionPage extends StatefulWidget {
|
||||
State<HomeTabSectionPage> createState() => _HomeTabSectionPageState();
|
||||
}
|
||||
|
||||
class _HomeTabSectionPageState extends State<HomeTabSectionPage> with UniqueTagMixin {
|
||||
class _HomeTabSectionPageState extends State<HomeTabSectionPage>
|
||||
with UniqueTagMixin {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<HomeTabSectionLogic>(
|
||||
init: HomeTabSectionLogic(widget.tabIndex, widget.tabModel, isDarkStyle: widget.isDarkStyle),
|
||||
init: HomeTabSectionLogic(widget.tabIndex, widget.tabModel,
|
||||
isDarkStyle: widget.isDarkStyle),
|
||||
tag: uniqueTag,
|
||||
builder: (logic) {
|
||||
return Container(
|
||||
@@ -91,7 +93,8 @@ class _HomeTabSectionPageState extends State<HomeTabSectionPage> with UniqueTagM
|
||||
ads: section.adsInfoArr ?? [],
|
||||
padding: EdgeInsets.fromLTRB(12, 0, 12, 16),
|
||||
);
|
||||
} else if (logic.lastIsGuessLike && index == logic.allSection.length - 1) {
|
||||
} else if (logic.lastIsGuessLike &&
|
||||
index == logic.allSection.length - 1) {
|
||||
return SizedBox(); // 最后一个猜你喜欢列表单独处理
|
||||
} else if (section.allVideoInfo?.isNotEmpty == true) {
|
||||
//换一批、间距、分割线都在 HomeSectionCell 里
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/hj_model/home/video_list_model.dart';
|
||||
import 'package:hgmj/hj_page/home/provider/home_update_marker_provider.dart';
|
||||
import 'package:hgmj/hj_utils/const.dart';
|
||||
import 'package:wydj/hj_model/home/video_list_model.dart';
|
||||
import 'package:wydj/hj_page/home/provider/home_update_marker_provider.dart';
|
||||
import 'package:wydj/hj_utils/const.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
|
||||
import '../../../hj_model/home/module_detail_model.dart';
|
||||
@@ -37,7 +37,8 @@ class HomeTabSortLogic extends HomeTabBaseLogic {
|
||||
SortTab('本月最热', 4),
|
||||
SortTab('年度最热', 5),
|
||||
];
|
||||
List<String> get lastestSortTitles => _lastestSortTabs.map((e) => e.name).toList();
|
||||
List<String> get lastestSortTitles =>
|
||||
_lastestSortTabs.map((e) => e.name).toList();
|
||||
int lastestModuleSort = 1;
|
||||
|
||||
// 一排几个:haiJiaoStyle.defaultShow 0-一排两个(网格) 1-一排一个(单列),缺省按网格
|
||||
@@ -99,12 +100,18 @@ class HomeTabSortLogic extends HomeTabBaseLogic {
|
||||
}
|
||||
|
||||
void loadMoreData() {
|
||||
_loadData(page: currentPage + 1, sortValue: isNewestStyle ? lastestModuleSort : moduleSort);
|
||||
_loadData(
|
||||
page: currentPage + 1,
|
||||
sortValue: isNewestStyle ? lastestModuleSort : moduleSort);
|
||||
}
|
||||
|
||||
// 每页固定 30:随机刷新接口也传同一个 size,分页偏移才对齐不重叠
|
||||
// [refreshToken] 非空 = 走热门随机刷新接口,只换视频列表
|
||||
void _loadData({int page = 1, int size = 30, int sortValue = 0, String? refreshToken}) async {
|
||||
void _loadData(
|
||||
{int page = 1,
|
||||
int size = 30,
|
||||
int sortValue = 0,
|
||||
String? refreshToken}) async {
|
||||
final seq = ++_reqSeq;
|
||||
try {
|
||||
bool hasNext = false;
|
||||
@@ -142,8 +149,11 @@ class HomeTabSortLogic extends HomeTabBaseLogic {
|
||||
currentPage = 1; // 刷新成功才重置页码,下次上拉从 pageNumber=2 开始
|
||||
}
|
||||
} else {
|
||||
ModuleDetailModel? retResp =
|
||||
await VidService.getModuleDetail(tabModel.id ?? '', moduleSort: sortValue, pageNumber: page, pageSize: size);
|
||||
ModuleDetailModel? retResp = await VidService.getModuleDetail(
|
||||
tabModel.id ?? '',
|
||||
moduleSort: sortValue,
|
||||
pageNumber: page,
|
||||
pageSize: size);
|
||||
if (seq != _reqSeq) return; // 已被更新的请求取代,本次结果作废
|
||||
|
||||
currentPage = page;
|
||||
@@ -159,7 +169,9 @@ class HomeTabSortLogic extends HomeTabBaseLogic {
|
||||
globalStore.filterShowType(dataSource?.allVideoInfo ?? []);
|
||||
dataSource?.allVideoInfo?.removeWhere((element) => element.isRandomAd());
|
||||
if (isShowAd) {
|
||||
AdManager().insertGroupAds(dataSource?.allVideoInfo ?? [], AdManager().adsByType(11), adGap: 6);
|
||||
AdManager().insertGroupAds(
|
||||
dataSource?.allVideoInfo ?? [], AdManager().adsByType(11),
|
||||
adGap: 6);
|
||||
}
|
||||
hasNext ? refreshCtr?.loadComplete() : refreshCtr?.loadNoData();
|
||||
} catch (e) {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/assets_tool/images.dart';
|
||||
import 'package:hgmj/hj_utils/screen.dart';
|
||||
import 'package:hgmj/routers/jump_router.dart';
|
||||
import 'package:hgmj/tools_base/loading/loading_center_widget.dart';
|
||||
import 'package:hgmj/tools_base/unique_tag_mixin.dart';
|
||||
import 'package:wydj/assets_tool/images.dart';
|
||||
import 'package:wydj/hj_utils/screen.dart';
|
||||
import 'package:wydj/routers/jump_router.dart';
|
||||
import 'package:wydj/tools_base/loading/loading_center_widget.dart';
|
||||
import 'package:wydj/tools_base/unique_tag_mixin.dart';
|
||||
|
||||
import '../../../hj_model/cartoon_media_info.dart';
|
||||
import '../../../hj_model/home/plate_model.dart';
|
||||
@@ -40,7 +40,8 @@ class _HomeTabSortPageState extends State<HomeTabSortPage> with UniqueTagMixin {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<HomeTabSortLogic>(
|
||||
init: HomeTabSortLogic(widget.tabIndex, widget.tabModel, isDarkStyle: widget.isDarkStyle),
|
||||
init: HomeTabSortLogic(widget.tabIndex, widget.tabModel,
|
||||
isDarkStyle: widget.isDarkStyle),
|
||||
tag: uniqueTag,
|
||||
builder: (logic) {
|
||||
return Stack(
|
||||
@@ -71,7 +72,8 @@ class _HomeTabSortPageState extends State<HomeTabSortPage> with UniqueTagMixin {
|
||||
isDarkStyle: widget.isDarkStyle,
|
||||
),
|
||||
),
|
||||
if (widget.tabModel.haiJiaoStyle?.sortShow == 1 || logic.isNewestStyle)
|
||||
if (widget.tabModel.haiJiaoStyle?.sortShow == 1 ||
|
||||
logic.isNewestStyle)
|
||||
SliverPersistentHeader(
|
||||
pinned: true,
|
||||
delegate: MySliverDelegate(
|
||||
@@ -79,12 +81,14 @@ class _HomeTabSortPageState extends State<HomeTabSortPage> with UniqueTagMixin {
|
||||
minHeight: 42,
|
||||
callTop: (shrinkOffset) {
|
||||
if (shrinkOffset > 0) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
|
||||
WidgetsBinding.instance
|
||||
.addPostFrameCallback((timeStamp) {
|
||||
logic.isSortMenuInTop.value = false;
|
||||
});
|
||||
}
|
||||
if (shrinkOffset <= 0) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
|
||||
WidgetsBinding.instance
|
||||
.addPostFrameCallback((timeStamp) {
|
||||
logic.isSortMenuInTop.value = true;
|
||||
});
|
||||
}
|
||||
@@ -103,11 +107,16 @@ class _HomeTabSortPageState extends State<HomeTabSortPage> with UniqueTagMixin {
|
||||
}
|
||||
return HomeSortHeader(
|
||||
isLatest: logic.isNewestStyle,
|
||||
labelPadding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
tabs: logic.isNewestStyle ? logic.lastestSortTitles : logic.sortTitles,
|
||||
labelPadding:
|
||||
const EdgeInsets.symmetric(horizontal: 10),
|
||||
tabs: logic.isNewestStyle
|
||||
? logic.lastestSortTitles
|
||||
: logic.sortTitles,
|
||||
bgColor: bgColor,
|
||||
onSort: logic.sortMenuEvent,
|
||||
rightWidget: logic.isNewestStyle ? null : _buildSortStyleMenu(logic),
|
||||
rightWidget: logic.isNewestStyle
|
||||
? null
|
||||
: _buildSortStyleMenu(logic),
|
||||
);
|
||||
},
|
||||
),
|
||||
@@ -143,9 +152,12 @@ class _HomeTabSortPageState extends State<HomeTabSortPage> with UniqueTagMixin {
|
||||
2.sizeBoxW,
|
||||
AnimatedSwitcher(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
transitionBuilder: (child, anim) => ScaleTransition(scale: anim, child: child),
|
||||
transitionBuilder: (child, anim) =>
|
||||
ScaleTransition(scale: anim, child: child),
|
||||
child: Image.asset(
|
||||
logic.isGridStyle.value ? 'list_style.webp'.homePath : 'grid_style.webp'.homePath,
|
||||
logic.isGridStyle.value
|
||||
? 'list_style.webp'.homePath
|
||||
: 'grid_style.webp'.homePath,
|
||||
key: ValueKey(logic.isGridStyle.value),
|
||||
width: 18,
|
||||
),
|
||||
@@ -206,7 +218,8 @@ class _HomeTabSortPageState extends State<HomeTabSortPage> with UniqueTagMixin {
|
||||
crossAxisCount: logic.isGridStyle.value ? 2 : 1,
|
||||
mainAxisSpacing: logic.isGridStyle.value ? 12 : 14,
|
||||
crossAxisSpacing: 7,
|
||||
childAspectRatio: logic.isGridStyle.value ? 168 / 134 : 340 / 215, //子控件宽高比
|
||||
childAspectRatio:
|
||||
logic.isGridStyle.value ? 168 / 134 : 340 / 215, //子控件宽高比
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
(context, index) {
|
||||
@@ -237,7 +250,8 @@ class _HomeTabSortPageState extends State<HomeTabSortPage> with UniqueTagMixin {
|
||||
int leftCount = logic.allVideo.length % gapValue;
|
||||
int insertIndex = 0;
|
||||
for (int i = 0; i < allIndex; i++) {
|
||||
List<VideoModel> subList = logic.allVideo.sublist(i * gapValue, i * gapValue + gapValue);
|
||||
List<VideoModel> subList =
|
||||
logic.allVideo.sublist(i * gapValue, i * gapValue + gapValue);
|
||||
slivers.add(SliverPadding(
|
||||
padding: EdgeInsets.only(bottom: 12),
|
||||
sliver: SliverGrid(
|
||||
@@ -245,7 +259,8 @@ class _HomeTabSortPageState extends State<HomeTabSortPage> with UniqueTagMixin {
|
||||
crossAxisCount: logic.isGridStyle.value ? 2 : 1,
|
||||
mainAxisSpacing: logic.isGridStyle.value ? 10 : 12,
|
||||
crossAxisSpacing: 7,
|
||||
childAspectRatio: logic.isGridStyle.value ? 168 / 134 : 343 / 215, //子控件宽高比
|
||||
childAspectRatio:
|
||||
logic.isGridStyle.value ? 168 / 134 : 343 / 215, //子控件宽高比
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
(context, index) {
|
||||
@@ -281,7 +296,8 @@ class _HomeTabSortPageState extends State<HomeTabSortPage> with UniqueTagMixin {
|
||||
crossAxisCount: logic.isGridStyle.value ? 2 : 1,
|
||||
mainAxisSpacing: logic.isGridStyle.value ? 10 : 12,
|
||||
crossAxisSpacing: 7,
|
||||
childAspectRatio: logic.isGridStyle.value ? 168 / 134 : 343 / 215, //子控件宽高比
|
||||
childAspectRatio:
|
||||
logic.isGridStyle.value ? 168 / 134 : 343 / 215, //子控件宽高比
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
(context, index) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hgmj/assets_tool/app_colors.dart';
|
||||
import 'package:hgmj/hj_page/home/provider/home_update_marker_provider.dart';
|
||||
import 'package:wydj/assets_tool/app_colors.dart';
|
||||
import 'package:wydj/hj_page/home/provider/home_update_marker_provider.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
/// 首页模块的排序切换栏(热门推荐 / 最新上架 / ...)
|
||||
@@ -27,9 +27,12 @@ class HomeSortHeader extends StatefulWidget {
|
||||
State<HomeSortHeader> createState() => _HomeSortHeaderState();
|
||||
}
|
||||
|
||||
class _HomeSortHeaderState extends State<HomeSortHeader> with SingleTickerProviderStateMixin {
|
||||
late final List<String> tabs = widget.tabs ?? const ['热门推荐', '最新上架', '最新热评', '最多收藏'];
|
||||
late final TabController tabCtr = TabController(length: tabs.length, vsync: this);
|
||||
class _HomeSortHeaderState extends State<HomeSortHeader>
|
||||
with SingleTickerProviderStateMixin {
|
||||
late final List<String> tabs =
|
||||
widget.tabs ?? const ['热门推荐', '最新上架', '最新热评', '最多收藏'];
|
||||
late final TabController tabCtr =
|
||||
TabController(length: tabs.length, vsync: this);
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
@@ -41,7 +44,7 @@ class _HomeSortHeaderState extends State<HomeSortHeader> with SingleTickerProvid
|
||||
Widget build(BuildContext context) {
|
||||
if (widget.isLatest) {
|
||||
return _buildNewsetsStyle();
|
||||
}else {
|
||||
} else {
|
||||
return Container(
|
||||
height: 38,
|
||||
color: widget.bgColor ?? Theme.of(context).scaffoldBackgroundColor,
|
||||
@@ -60,13 +63,15 @@ class _HomeSortHeaderState extends State<HomeSortHeader> with SingleTickerProvid
|
||||
onTap: widget.onSort,
|
||||
indicatorWeight: 0,
|
||||
indicator: const BoxDecoration(),
|
||||
labelPadding: widget.labelPadding ?? const EdgeInsets.symmetric(horizontal: 8),
|
||||
labelPadding:
|
||||
widget.labelPadding ?? const EdgeInsets.symmetric(horizontal: 8),
|
||||
labelStyle: const TextStyle(
|
||||
color: Color(0xE5FFFFFF),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
unselectedLabelStyle: const TextStyle(color: Color(0x8CFFFFFF), fontSize: 14),
|
||||
unselectedLabelStyle:
|
||||
const TextStyle(color: Color(0x8CFFFFFF), fontSize: 14),
|
||||
tabs: List.generate(tabs.length, (i) => Text(tabs[i])),
|
||||
);
|
||||
}
|
||||
@@ -82,20 +87,21 @@ class _HomeSortHeaderState extends State<HomeSortHeader> with SingleTickerProvid
|
||||
tabAlignment: TabAlignment.center,
|
||||
onTap: widget.onSort,
|
||||
indicatorWeight: 0,
|
||||
indicator: BoxDecoration(color: AppColors.actionRed, borderRadius: BorderRadius.circular(3)),
|
||||
indicator: BoxDecoration(
|
||||
color: AppColors.actionRed, borderRadius: BorderRadius.circular(3)),
|
||||
labelPadding: const EdgeInsets.symmetric(horizontal: 6),
|
||||
labelStyle: const TextStyle(
|
||||
color: Color(0xff1F2029),
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
unselectedLabelStyle: const TextStyle(color: Color(0x8CFFFFFF), fontSize: 12),
|
||||
unselectedLabelStyle:
|
||||
const TextStyle(color: Color(0x8CFFFFFF), fontSize: 12),
|
||||
tabs: List.generate(tabs.length, (i) => _latestTab(i, tabs[i])),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/// 红点只落在「最新」页首个 tab,只让它订阅 provider
|
||||
Widget _latestTab(int index, String label) {
|
||||
final text = Padding(
|
||||
@@ -109,7 +115,10 @@ class _HomeSortHeaderState extends State<HomeSortHeader> with SingleTickerProvid
|
||||
children: [
|
||||
text,
|
||||
if (marker.showTodayLatestDot)
|
||||
Positioned(right: 4, top: 0, child: HomeUpdateMarkerProvider.buildRedDot()),
|
||||
Positioned(
|
||||
right: 4,
|
||||
top: 0,
|
||||
child: HomeUpdateMarkerProvider.buildRedDot()),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/assets_tool/images.dart';
|
||||
import 'package:hgmj/hj_model/home/plate_model.dart';
|
||||
import 'package:hgmj/hj_model/home/module_detail_model.dart';
|
||||
import 'package:hgmj/hj_utils/screen.dart';
|
||||
import 'package:hgmj/tools_base/refresh/horizontal_load_more.dart';
|
||||
import 'package:wydj/assets_tool/images.dart';
|
||||
import 'package:wydj/hj_model/home/plate_model.dart';
|
||||
import 'package:wydj/hj_model/home/module_detail_model.dart';
|
||||
import 'package:wydj/hj_utils/screen.dart';
|
||||
import 'package:wydj/tools_base/refresh/horizontal_load_more.dart';
|
||||
|
||||
import '../../../../tools_base/widget/net_image_widget.dart';
|
||||
import '../../../cartoon/cartoon_sectionlist_page.dart';
|
||||
@@ -55,7 +55,8 @@ class SpecialTopicsView extends StatelessWidget {
|
||||
/// 注:原创达人区不走这里,它固定进专题详情(见 [_actressSection])
|
||||
void _onTap(AllSection model) {
|
||||
if (module?.isACG == true) {
|
||||
Get.to(CartoonSectionListPage(sectionID: model.sectionID, tagName: model.sectionName));
|
||||
Get.to(CartoonSectionListPage(
|
||||
sectionID: model.sectionID, tagName: model.sectionName));
|
||||
} else {
|
||||
Get.to(SpecialTopicsDetailPage(model), preventDuplicates: false);
|
||||
}
|
||||
@@ -63,7 +64,8 @@ class SpecialTopicsView extends StatelessWidget {
|
||||
|
||||
// ========== 样式 1 / 5:圆头像横滑 ==========
|
||||
|
||||
Widget _avatarRow(List<AllSection> list, {required double height, required double imgSize}) {
|
||||
Widget _avatarRow(List<AllSection> list,
|
||||
{required double height, required double imgSize}) {
|
||||
return Container(
|
||||
margin: padding,
|
||||
height: height,
|
||||
@@ -111,7 +113,10 @@ class SpecialTopicsView extends StatelessWidget {
|
||||
Text(
|
||||
list.first.sectionName ?? "",
|
||||
maxLines: 1,
|
||||
style: const TextStyle(color: Color(0xE5FFFFFF), fontSize: 18, fontWeight: FontWeight.w500),
|
||||
style: const TextStyle(
|
||||
color: Color(0xE5FFFFFF),
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w500),
|
||||
),
|
||||
_avatarRow(list, height: 84, imgSize: 55),
|
||||
],
|
||||
@@ -143,21 +148,31 @@ class SpecialTopicsView extends StatelessWidget {
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: isDarkStyle ? const Color(0x4D810906) : const Color(0x0DFFFFFF),
|
||||
color:
|
||||
isDarkStyle ? const Color(0x4D810906) : const Color(0x0DFFFFFF),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(2)),
|
||||
),
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
if (isDarkStyle) Positioned(top: 0, child: Image.asset("aw_tag.webp".homePath, height: 13)),
|
||||
if (isDarkStyle)
|
||||
Positioned(
|
||||
top: 0,
|
||||
child: Image.asset("aw_tag.webp".homePath, height: 13)),
|
||||
Text(
|
||||
"${model.sectionName}",
|
||||
style: const TextStyle(color: Color(0xE5FFFFFF), fontSize: 12, fontWeight: FontWeight.w500),
|
||||
style: const TextStyle(
|
||||
color: Color(0xE5FFFFFF),
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w500),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
if (model.hot == true)
|
||||
Positioned(top: 0, right: 0, child: Image.asset("home_hot.webp".homePath, height: 20)),
|
||||
Positioned(
|
||||
top: 0,
|
||||
right: 0,
|
||||
child: Image.asset("home_hot.webp".homePath, height: 20)),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -182,11 +197,16 @@ class SpecialTopicsView extends StatelessWidget {
|
||||
child: Text(
|
||||
'原创达人',
|
||||
maxLines: 1,
|
||||
style: TextStyle(color: Color(0xE5FFFFFF), fontSize: 18, fontWeight: FontWeight.w600),
|
||||
style: TextStyle(
|
||||
color: Color(0xE5FFFFFF),
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
),
|
||||
10.sizeBoxW,
|
||||
const Text('更多', maxLines: 1, style: TextStyle(color: Color(0x59FFFFFF), fontSize: 12)),
|
||||
const Text('更多',
|
||||
maxLines: 1,
|
||||
style: TextStyle(color: Color(0x59FFFFFF), fontSize: 12)),
|
||||
Image.asset("arrow_right_grey.webp".commonImgPath, width: 18),
|
||||
],
|
||||
),
|
||||
@@ -221,7 +241,8 @@ class SpecialTopicsView extends StatelessWidget {
|
||||
Widget _actressItem(AllSection model, double itemW) {
|
||||
return GestureDetector(
|
||||
//达人固定进专题详情,不走 _onTap 的漫画分支
|
||||
onTap: () => Get.to(SpecialTopicsDetailPage(model), preventDuplicates: false),
|
||||
onTap: () =>
|
||||
Get.to(SpecialTopicsDetailPage(model), preventDuplicates: false),
|
||||
child: SizedBox(
|
||||
height: double.infinity,
|
||||
width: itemW,
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hgmj/config/config.dart';
|
||||
import 'package:hgmj/hj_model/home/update_marker_model.dart';
|
||||
import 'package:hgmj/hj_utils/api_service/common_service.dart';
|
||||
import 'package:hgmj/hj_utils/light_model.dart';
|
||||
import 'package:hgmj/hj_utils/store_keys.dart';
|
||||
import 'package:hgmj/tools_base/debug_log.dart';
|
||||
import 'package:hgmj/tools_base/global_store/store.dart';
|
||||
import 'package:wydj/config/config.dart';
|
||||
import 'package:wydj/hj_model/home/update_marker_model.dart';
|
||||
import 'package:wydj/hj_utils/api_service/common_service.dart';
|
||||
import 'package:wydj/hj_utils/light_model.dart';
|
||||
import 'package:wydj/hj_utils/store_keys.dart';
|
||||
import 'package:wydj/tools_base/debug_log.dart';
|
||||
import 'package:wydj/tools_base/global_store/store.dart';
|
||||
|
||||
/// 首页「最新 / 今日最新」等内容更新红点
|
||||
class HomeUpdateMarkerProvider with ChangeNotifier {
|
||||
static final HomeUpdateMarkerProvider _instance = HomeUpdateMarkerProvider._();
|
||||
static final HomeUpdateMarkerProvider _instance =
|
||||
HomeUpdateMarkerProvider._();
|
||||
HomeUpdateMarkerProvider._();
|
||||
factory HomeUpdateMarkerProvider() => _instance;
|
||||
|
||||
@@ -18,9 +19,11 @@ class HomeUpdateMarkerProvider with ChangeNotifier {
|
||||
String? _lastViewTodayLatestAt;
|
||||
final Map<String, String> _lastViewModuleAt = {};
|
||||
|
||||
bool get showHomeLatestDot => _isNewer(_markers?.homeLatestAt, _lastViewHomeLatestAt);
|
||||
bool get showHomeLatestDot =>
|
||||
_isNewer(_markers?.homeLatestAt, _lastViewHomeLatestAt);
|
||||
|
||||
bool get showTodayLatestDot => _isNewer(_markers?.todayLatestAt, _lastViewTodayLatestAt);
|
||||
bool get showTodayLatestDot =>
|
||||
_isNewer(_markers?.todayLatestAt, _lastViewTodayLatestAt);
|
||||
|
||||
bool showModuleDot(String? moduleId) {
|
||||
if (moduleId == null || moduleId.isEmpty) return false;
|
||||
@@ -101,8 +104,10 @@ class HomeUpdateMarkerProvider with ChangeNotifier {
|
||||
}
|
||||
|
||||
Future<void> _loadLocalLastViewed() async {
|
||||
_lastViewHomeLatestAt = await lightKV.getString(StoreKeys.HOME_LATEST_LAST_VIEW_AT);
|
||||
_lastViewTodayLatestAt = await lightKV.getString(StoreKeys.HOME_TODAY_LATEST_LAST_VIEW_AT);
|
||||
_lastViewHomeLatestAt =
|
||||
await lightKV.getString(StoreKeys.HOME_LATEST_LAST_VIEW_AT);
|
||||
_lastViewTodayLatestAt =
|
||||
await lightKV.getString(StoreKeys.HOME_TODAY_LATEST_LAST_VIEW_AT);
|
||||
_lastViewModuleAt.clear();
|
||||
for (final m in _markers?.modules ?? const <HomeModuleUpdateMarker>[]) {
|
||||
final id = m.moduleId;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/hj_utils/const.dart';
|
||||
import 'package:hgmj/hj_utils/history_util.dart';
|
||||
import 'package:wydj/hj_utils/const.dart';
|
||||
import 'package:wydj/hj_utils/history_util.dart';
|
||||
|
||||
import 'search_result_page/search_result_main_page.dart';
|
||||
|
||||
@@ -51,7 +51,8 @@ class SearchMainLogic extends GetxController {
|
||||
Future<void> onSubmitted(String text) async {
|
||||
searchTextCtr.text = text;
|
||||
HistoryUtil.addSearch(text); //不 await:落盘不该挡住跳转,返回时早已写完
|
||||
await Get.to(() => SearchResultMainPage(text, initialType: initialResultType));
|
||||
await Get.to(
|
||||
() => SearchResultMainPage(text, initialType: initialResultType));
|
||||
loadHistories();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/hj_utils/const.dart';
|
||||
import 'package:hgmj/tools_base/banner/ads_grid_view.dart';
|
||||
import 'package:wydj/hj_utils/const.dart';
|
||||
import 'package:wydj/tools_base/banner/ads_grid_view.dart';
|
||||
|
||||
import '../../find/rank_module/rank_main_page.dart';
|
||||
import '../../find/rank_module/rank_sub_page.dart';
|
||||
@@ -39,7 +39,8 @@ class SearchMainPage extends StatelessWidget {
|
||||
Expanded(
|
||||
child: NestedScrollView(
|
||||
headerSliverBuilder: (_, __) => _headerSlivers(logic),
|
||||
body: const RankSubPage(pageType: MediaStyle.Video, sortType: 2), // 2 = 周榜
|
||||
body: const RankSubPage(
|
||||
pageType: MediaStyle.Video, sortType: 2), // 2 = 周榜
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -71,7 +72,8 @@ class SearchMainPage extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
//热搜词
|
||||
SliverToBoxAdapter(child: SearchHotTagView(onTagClick: logic.onSubmitted)),
|
||||
SliverToBoxAdapter(
|
||||
child: SearchHotTagView(onTagClick: logic.onSubmitted)),
|
||||
//「热门排行」标题行,右侧跳完整排行榜页
|
||||
SliverToBoxAdapter(
|
||||
child: Padding(
|
||||
@@ -80,12 +82,16 @@ class SearchMainPage extends StatelessWidget {
|
||||
children: [
|
||||
const Text(
|
||||
'热门排行',
|
||||
style: TextStyle(color: Color(0xE5FFFFFF), fontSize: 18, fontWeight: FontWeight.w600),
|
||||
style: TextStyle(
|
||||
color: Color(0xE5FFFFFF),
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
const Spacer(),
|
||||
InkWell(
|
||||
enableFeedback: false,
|
||||
onTap: () => Get.to(() => const RankMainPage(), preventDuplicates: false),
|
||||
onTap: () => Get.to(() => const RankMainPage(),
|
||||
preventDuplicates: false),
|
||||
child: Container(
|
||||
width: 54,
|
||||
height: 18,
|
||||
@@ -93,8 +99,13 @@ class SearchMainPage extends StatelessWidget {
|
||||
margin: const EdgeInsets.only(left: 8),
|
||||
child: Row(
|
||||
children: [
|
||||
Text('更多', style: TextStyle(color: Colors.white.withValues(alpha: 0.55), fontSize: 14)),
|
||||
Icon(Icons.navigate_next, size: 22, color: Colors.white.withValues(alpha: 0.55)),
|
||||
Text('更多',
|
||||
style: TextStyle(
|
||||
color: Colors.white.withValues(alpha: 0.55),
|
||||
fontSize: 14)),
|
||||
Icon(Icons.navigate_next,
|
||||
size: 22,
|
||||
color: Colors.white.withValues(alpha: 0.55)),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hgmj/hj_utils/api_service/acg_service.dart';
|
||||
import 'package:hgmj/hj_utils/const.dart';
|
||||
import 'package:hgmj/tools_base/debug_log.dart';
|
||||
import 'package:hgmj/tools_base/loading/loading_center_widget.dart';
|
||||
import 'package:wydj/hj_utils/api_service/acg_service.dart';
|
||||
import 'package:wydj/hj_utils/const.dart';
|
||||
import 'package:wydj/tools_base/debug_log.dart';
|
||||
import 'package:wydj/tools_base/loading/loading_center_widget.dart';
|
||||
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||
|
||||
import '../../../../hj_model/acg/cartoon_more_list.dart';
|
||||
@@ -40,15 +40,20 @@ class _SearchACGResultPageState extends State<SearchACGResultPage> {
|
||||
|
||||
_loadData({int page = 1, int size = 12}) async {
|
||||
try {
|
||||
MediaSearchListModel? retResp =
|
||||
await ACGService.mediaSearch(keyword: widget.keywords, page: page, size: size, kind: widget.type.searchKind);
|
||||
MediaSearchListModel? retResp = await ACGService.mediaSearch(
|
||||
keyword: widget.keywords,
|
||||
page: page,
|
||||
size: size,
|
||||
kind: widget.type.searchKind);
|
||||
pageNumber = page;
|
||||
videoList ??= [];
|
||||
if (page == 1) {
|
||||
videoList?.clear();
|
||||
}
|
||||
videoList?.addAll(retResp?.list ?? []);
|
||||
retResp?.hasNext == false ? refreshController?.loadNoData() : refreshController?.loadComplete();
|
||||
retResp?.hasNext == false
|
||||
? refreshController?.loadNoData()
|
||||
: refreshController?.loadComplete();
|
||||
} catch (e) {
|
||||
refreshController?.loadComplete();
|
||||
debugLog(e);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hgmj/hj_utils/const.dart';
|
||||
import 'package:hgmj/hj_utils/history_util.dart';
|
||||
import 'package:hgmj/tools_base/widget/keep_alive_widget.dart';
|
||||
import 'package:wydj/hj_utils/const.dart';
|
||||
import 'package:wydj/hj_utils/history_util.dart';
|
||||
import 'package:wydj/tools_base/widget/keep_alive_widget.dart';
|
||||
|
||||
import '../../../../tools_base/indicator/custom_tab_indicator.dart';
|
||||
import '../widget/search_app_bar.dart';
|
||||
@@ -22,7 +22,8 @@ class SearchResultMainPage extends StatefulWidget {
|
||||
}
|
||||
}
|
||||
|
||||
class _SearchResultMainPageState extends State<SearchResultMainPage> with SingleTickerProviderStateMixin {
|
||||
class _SearchResultMainPageState extends State<SearchResultMainPage>
|
||||
with SingleTickerProviderStateMixin {
|
||||
final typeList = ['影片', '短剧', '抖音', '漫画', '动漫', '帖子', '图集'];
|
||||
|
||||
late final TabController tabCtr;
|
||||
@@ -86,20 +87,49 @@ class _SearchResultMainPageState extends State<SearchResultMainPage> with Single
|
||||
padding: EdgeInsets.zero,
|
||||
isScrollable: false,
|
||||
labelPadding: EdgeInsets.zero,
|
||||
indicator: const CustomIndicator(height: 4, width: 16, isGradient: true, offsetY: 4),
|
||||
indicator: const CustomIndicator(
|
||||
height: 4, width: 16, isGradient: true, offsetY: 4),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: TabBarView(
|
||||
controller: tabCtr,
|
||||
children: [
|
||||
SearchVideoResultPage(key: ValueKey("0$keywords"), keywords: keywords, type: MediaStyle.Video).keepAlive,
|
||||
SearchVideoResultPage(key: ValueKey("1$keywords"), keywords: keywords, type: MediaStyle.Drama).keepAlive,
|
||||
SearchVideoResultPage(key: ValueKey("2$keywords"), keywords: keywords, type: MediaStyle.ShortVideo).keepAlive,
|
||||
SearchACGResultPage(key: ValueKey("3$keywords"), keywords: keywords, type: MediaStyle.Comics).keepAlive,
|
||||
SearchACGResultPage(key: ValueKey("4$keywords"), keywords: keywords, type: MediaStyle.Cartoon).keepAlive,
|
||||
SearchVideoResultPage(key: ValueKey("5$keywords"), keywords: keywords, type: MediaStyle.Community).keepAlive,
|
||||
SearchVideoResultPage(key: ValueKey("6$keywords"), keywords: keywords, type: MediaStyle.Pic).keepAlive,
|
||||
SearchVideoResultPage(
|
||||
key: ValueKey("0$keywords"),
|
||||
keywords: keywords,
|
||||
type: MediaStyle.Video)
|
||||
.keepAlive,
|
||||
SearchVideoResultPage(
|
||||
key: ValueKey("1$keywords"),
|
||||
keywords: keywords,
|
||||
type: MediaStyle.Drama)
|
||||
.keepAlive,
|
||||
SearchVideoResultPage(
|
||||
key: ValueKey("2$keywords"),
|
||||
keywords: keywords,
|
||||
type: MediaStyle.ShortVideo)
|
||||
.keepAlive,
|
||||
SearchACGResultPage(
|
||||
key: ValueKey("3$keywords"),
|
||||
keywords: keywords,
|
||||
type: MediaStyle.Comics)
|
||||
.keepAlive,
|
||||
SearchACGResultPage(
|
||||
key: ValueKey("4$keywords"),
|
||||
keywords: keywords,
|
||||
type: MediaStyle.Cartoon)
|
||||
.keepAlive,
|
||||
SearchVideoResultPage(
|
||||
key: ValueKey("5$keywords"),
|
||||
keywords: keywords,
|
||||
type: MediaStyle.Community)
|
||||
.keepAlive,
|
||||
SearchVideoResultPage(
|
||||
key: ValueKey("6$keywords"),
|
||||
keywords: keywords,
|
||||
type: MediaStyle.Pic)
|
||||
.keepAlive,
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -2,14 +2,14 @@ import 'dart:math';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/hj_model/video_model.dart';
|
||||
import 'package:hgmj/hj_page/drama/drama_tag_detail_page.dart';
|
||||
import 'package:hgmj/hj_utils/api_service/drama_service.dart';
|
||||
import 'package:hgmj/hj_utils/api_service/search_service.dart';
|
||||
import 'package:hgmj/hj_utils/const.dart';
|
||||
import 'package:hgmj/hj_utils/screen.dart';
|
||||
import 'package:hgmj/tools_base/debug_log.dart';
|
||||
import 'package:hgmj/tools_base/loading/loading_center_widget.dart';
|
||||
import 'package:wydj/hj_model/video_model.dart';
|
||||
import 'package:wydj/hj_page/drama/drama_tag_detail_page.dart';
|
||||
import 'package:wydj/hj_utils/api_service/drama_service.dart';
|
||||
import 'package:wydj/hj_utils/api_service/search_service.dart';
|
||||
import 'package:wydj/hj_utils/const.dart';
|
||||
import 'package:wydj/hj_utils/screen.dart';
|
||||
import 'package:wydj/tools_base/debug_log.dart';
|
||||
import 'package:wydj/tools_base/loading/loading_center_widget.dart';
|
||||
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||
|
||||
import '../../../../hj_model/home/video_list_model.dart';
|
||||
@@ -73,18 +73,26 @@ class _SearchVideoResultPageState extends State<SearchVideoResultPage> {
|
||||
pageNumber = page;
|
||||
if (page == 1) {
|
||||
videoList = [];
|
||||
tagVidList = retResp?.tagMediaList.map((e) => e.toVideoModel(null)).toList() ?? [];
|
||||
tagVidList =
|
||||
retResp?.tagMediaList.map((e) => e.toVideoModel(null)).toList() ??
|
||||
[];
|
||||
tagID = retResp?.tagID;
|
||||
}
|
||||
videoList ??= [];
|
||||
videoList?.addAll(retResp?.list.map((e) => e.toVideoModel(null)) ?? []);
|
||||
retResp?.hasNext != true ? refreshController?.loadNoData() : refreshController?.loadComplete();
|
||||
retResp?.hasNext != true
|
||||
? refreshController?.loadNoData()
|
||||
: refreshController?.loadComplete();
|
||||
} else {
|
||||
VideoListResp? retResp = await SearchService.searchMedia(widget.keywords,
|
||||
pageNumber: page, pageSize: size, realm: widget.type.searchRealm, sortType: sortValue);
|
||||
VideoListResp? retResp = await SearchService.searchMedia(
|
||||
widget.keywords,
|
||||
pageNumber: page,
|
||||
pageSize: size,
|
||||
realm: widget.type.searchRealm,
|
||||
sortType: sortValue);
|
||||
pageNumber = page;
|
||||
videoList ??= [];
|
||||
if(page == 1) {
|
||||
if (page == 1) {
|
||||
videoList?.clear();
|
||||
}
|
||||
videoList?.addAll(retResp?.videos ?? []);
|
||||
@@ -92,7 +100,9 @@ class _SearchVideoResultPageState extends State<SearchVideoResultPage> {
|
||||
tagVidList = retResp?.tagVidList ?? [];
|
||||
tagID = retResp?.tagID;
|
||||
}
|
||||
retResp?.hasNext == false ? refreshController?.loadNoData() : refreshController?.loadComplete();
|
||||
retResp?.hasNext == false
|
||||
? refreshController?.loadNoData()
|
||||
: refreshController?.loadComplete();
|
||||
}
|
||||
} catch (e) {
|
||||
refreshController?.loadComplete();
|
||||
@@ -128,7 +138,8 @@ class _SearchVideoResultPageState extends State<SearchVideoResultPage> {
|
||||
},
|
||||
body: Column(
|
||||
children: [
|
||||
if (widget.type == MediaStyle.Video || widget.type == MediaStyle.ShortVideo)
|
||||
if (widget.type == MediaStyle.Video ||
|
||||
widget.type == MediaStyle.ShortVideo)
|
||||
DividerTabBar(
|
||||
_sortTabs.map((e) => e.name).toList(),
|
||||
selectIndex: sortIndex,
|
||||
@@ -187,7 +198,8 @@ class _SearchVideoResultPageState extends State<SearchVideoResultPage> {
|
||||
},
|
||||
);
|
||||
}
|
||||
if (widget.type == MediaStyle.Video || widget.type == MediaStyle.ShortVideo) {
|
||||
if (widget.type == MediaStyle.Video ||
|
||||
widget.type == MediaStyle.ShortVideo) {
|
||||
bool isShort = widget.type == MediaStyle.ShortVideo;
|
||||
return GridView.builder(
|
||||
padding: EdgeInsets.only(left: 12, right: 12),
|
||||
@@ -267,7 +279,8 @@ class _SearchVideoResultPageState extends State<SearchVideoResultPage> {
|
||||
if (tagID?.isNotEmpty == true) ...[
|
||||
const SizedBox(height: 12),
|
||||
GestureDetector(
|
||||
onTap: () => DramaTagDetailPage.to(TagsBean(id: tagID, name: widget.keywords)),
|
||||
onTap: () => DramaTagDetailPage.to(
|
||||
TagsBean(id: tagID, name: widget.keywords)),
|
||||
child: Container(
|
||||
height: 40,
|
||||
alignment: Alignment.center,
|
||||
@@ -278,9 +291,12 @@ class _SearchVideoResultPageState extends State<SearchVideoResultPage> {
|
||||
child: const Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text('查看更多', style: TextStyle(color: Color(0xffFFFFFF), fontSize: 14)),
|
||||
Text('查看更多',
|
||||
style: TextStyle(
|
||||
color: Color(0xffFFFFFF), fontSize: 14)),
|
||||
SizedBox(width: 6),
|
||||
Icon(Icons.keyboard_arrow_right, color: Color(0xffFFFFFF), size: 18),
|
||||
Icon(Icons.keyboard_arrow_right,
|
||||
color: Color(0xffFFFFFF), size: 18),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -291,7 +307,8 @@ class _SearchVideoResultPageState extends State<SearchVideoResultPage> {
|
||||
),
|
||||
);
|
||||
}
|
||||
if (widget.type == MediaStyle.Video || widget.type == MediaStyle.ShortVideo) {
|
||||
if (widget.type == MediaStyle.Video ||
|
||||
widget.type == MediaStyle.ShortVideo) {
|
||||
bool isShort = widget.type == MediaStyle.ShortVideo;
|
||||
return Container(
|
||||
padding: EdgeInsets.fromLTRB(12, 12, 12, 0),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/assets_tool/app_colors.dart';
|
||||
import 'package:hgmj/hj_model/cartoon_media_info.dart';
|
||||
import 'package:wydj/assets_tool/app_colors.dart';
|
||||
import 'package:wydj/hj_model/cartoon_media_info.dart';
|
||||
import 'package:waterfall_flow/waterfall_flow.dart';
|
||||
|
||||
import '../../../hj_model/home/video_library_model.dart';
|
||||
@@ -73,8 +73,12 @@ class _VideoAllTypePageState extends State<VideoAllTypePage> {
|
||||
SliverToBoxAdapter(
|
||||
child: Column(
|
||||
children: [
|
||||
_buildItemMenuWidget("分类", logic.homeVideoLibrary?.canvas, logic.firstSelectedType, (data) {
|
||||
if (logic.firstSelectedType?.isACG != data.isACG) {
|
||||
_buildItemMenuWidget(
|
||||
"分类",
|
||||
logic.homeVideoLibrary?.canvas,
|
||||
logic.firstSelectedType, (data) {
|
||||
if (logic.firstSelectedType?.isACG !=
|
||||
data.isACG) {
|
||||
logic.thirdSelectedType = null;
|
||||
}
|
||||
if (logic.firstSelectedType != data) {
|
||||
@@ -85,7 +89,10 @@ class _VideoAllTypePageState extends State<VideoAllTypePage> {
|
||||
logic.searchVideoList?.clear();
|
||||
logic.menuExchangeEvent();
|
||||
}),
|
||||
_buildItemMenuWidget("排序", logic.homeVideoLibrary?.orderBy, logic.secondSelectedType, (data) {
|
||||
_buildItemMenuWidget(
|
||||
"排序",
|
||||
logic.homeVideoLibrary?.orderBy,
|
||||
logic.secondSelectedType, (data) {
|
||||
if (logic.secondSelectedType != data) {
|
||||
logic.secondSelectedType = data;
|
||||
} else {
|
||||
@@ -93,7 +100,9 @@ class _VideoAllTypePageState extends State<VideoAllTypePage> {
|
||||
}
|
||||
logic.menuExchangeEvent();
|
||||
}),
|
||||
_buildTagMenuWidget("标签", logic.tags, logic.thirdSelectedType, (data) {
|
||||
_buildTagMenuWidget(
|
||||
"标签", logic.tags, logic.thirdSelectedType,
|
||||
(data) {
|
||||
if (logic.thirdSelectedType != data) {
|
||||
logic.thirdSelectedType = data;
|
||||
} else {
|
||||
@@ -101,7 +110,10 @@ class _VideoAllTypePageState extends State<VideoAllTypePage> {
|
||||
}
|
||||
logic.menuExchangeEvent();
|
||||
}),
|
||||
_buildItemMenuWidget("时间", logic.homeVideoLibrary?.timeType, logic.fivthSelectedType, (data) {
|
||||
_buildItemMenuWidget(
|
||||
"时间",
|
||||
logic.homeVideoLibrary?.timeType,
|
||||
logic.fivthSelectedType, (data) {
|
||||
if (logic.fivthSelectedType != data) {
|
||||
logic.fivthSelectedType = data;
|
||||
} else {
|
||||
@@ -208,7 +220,8 @@ class _VideoAllTypePageState extends State<VideoAllTypePage> {
|
||||
child: LoadingCenterWidget(),
|
||||
),
|
||||
);
|
||||
} else if (logic.searchVideoList?.isNotEmpty != true && logic.searchACGList?.isNotEmpty != true) {
|
||||
} else if (logic.searchVideoList?.isNotEmpty != true &&
|
||||
logic.searchACGList?.isNotEmpty != true) {
|
||||
return SliverToBoxAdapter(
|
||||
child: SizedBox(
|
||||
height: 300,
|
||||
@@ -235,10 +248,14 @@ class _VideoAllTypePageState extends State<VideoAllTypePage> {
|
||||
);
|
||||
}
|
||||
if (typeName == "图集") {
|
||||
return _buildWaterfall(logic, (vm) => PhotoGalleryItem(videoModel: vm, textline: 1));
|
||||
return _buildWaterfall(
|
||||
logic, (vm) => PhotoGalleryItem(videoModel: vm, textline: 1));
|
||||
}
|
||||
if (typeName == "抖音" || logic.firstSelectedType?.key == "sp") {
|
||||
return _buildWaterfall(logic, (vm) => VideoSimpleCell(videoModel: vm, textLines: 1, isShort: true));
|
||||
return _buildWaterfall(
|
||||
logic,
|
||||
(vm) =>
|
||||
VideoSimpleCell(videoModel: vm, textLines: 1, isShort: true));
|
||||
} else if (typeName == "动漫" || typeName == "漫画") {
|
||||
bool isCartoon = typeName == "动漫";
|
||||
return SliverPadding(
|
||||
@@ -285,7 +302,8 @@ class _VideoAllTypePageState extends State<VideoAllTypePage> {
|
||||
}
|
||||
|
||||
//图集/抖音共用的 3 列瀑布流(仅 item 构建不同)
|
||||
Widget _buildWaterfall(VideoAllTypeLogic logic, Widget Function(VideoModel vm) itemBuilder) {
|
||||
Widget _buildWaterfall(
|
||||
VideoAllTypeLogic logic, Widget Function(VideoModel vm) itemBuilder) {
|
||||
return SliverPadding(
|
||||
padding: const EdgeInsets.fromLTRB(12, 12, 12, 0),
|
||||
sliver: SliverWaterfallFlow(
|
||||
@@ -305,7 +323,8 @@ class _VideoAllTypePageState extends State<VideoAllTypePage> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildItemMenuWidget(String typeName, List<TimeType>? listData, TimeType? selectType, Function(TimeType timeType) callBack) {
|
||||
Widget _buildItemMenuWidget(String typeName, List<TimeType>? listData,
|
||||
TimeType? selectType, Function(TimeType timeType) callBack) {
|
||||
selectType ??= listData?[0];
|
||||
return Container(
|
||||
height: 40,
|
||||
@@ -322,7 +341,8 @@ class _VideoAllTypePageState extends State<VideoAllTypePage> {
|
||||
itemBuilder: (context, index) {
|
||||
TimeType data = listData![index];
|
||||
bool isSelected = selectType?.name == data.name;
|
||||
return InkWell(enableFeedback: false,
|
||||
return InkWell(
|
||||
enableFeedback: false,
|
||||
onTap: () async {
|
||||
callBack.call(data);
|
||||
},
|
||||
@@ -336,7 +356,8 @@ class _VideoAllTypePageState extends State<VideoAllTypePage> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildTagMenuWidget(String typeName, List<Tags>? listData, Tags? selectType, Function(Tags timeType) callBack) {
|
||||
Widget _buildTagMenuWidget(String typeName, List<Tags>? listData,
|
||||
Tags? selectType, Function(Tags timeType) callBack) {
|
||||
selectType ??= listData?[0];
|
||||
return Container(
|
||||
height: 40,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/assets_tool/images.dart';
|
||||
import 'package:hgmj/config/config.dart';
|
||||
import 'package:hgmj/hj_utils/screen.dart';
|
||||
import 'package:wydj/assets_tool/images.dart';
|
||||
import 'package:wydj/config/config.dart';
|
||||
import 'package:wydj/hj_utils/screen.dart';
|
||||
|
||||
import '../../../../tools_base/widget/marquee_widget.dart';
|
||||
import '../../../../tools_base/widget/net_image_widget.dart';
|
||||
@@ -69,7 +69,7 @@ class _CommonSearchBarViewState extends State<CommonSearchBarView> {
|
||||
child: Image.asset('nav_logo.webp'.homePath, width: 28, height: 28),
|
||||
),
|
||||
6.sizeBoxW,
|
||||
const Text('黄果漫剧', style: _titleStyle),
|
||||
const Text('51短剧', style: _titleStyle),
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -89,18 +89,22 @@ class _CommonSearchBarViewState extends State<CommonSearchBarView> {
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Image.asset('search_icon.png'.commonImgPath, width: 18, height: 18, color: Colors.white),
|
||||
Image.asset('search_icon.png'.commonImgPath,
|
||||
width: 18, height: 18, color: Colors.white),
|
||||
8.sizeBoxW,
|
||||
Expanded(
|
||||
child: Config.searchHints.isEmpty
|
||||
? Text('请输入关键字', style: _hintStyle)
|
||||
: MarqueeWidget(
|
||||
count: Config.searchHints.length,
|
||||
onIndexChanged: (index) => _searchText = Config.searchHints[index],
|
||||
onIndexChanged: (index) =>
|
||||
_searchText = Config.searchHints[index],
|
||||
itemBuilder: (_, index) => Container(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(Config.searchHints[index],
|
||||
style: _hintStyle, maxLines: 1, overflow: TextOverflow.ellipsis),
|
||||
style: _hintStyle,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/assets_tool/images.dart';
|
||||
import 'package:hgmj/hj_utils/screen.dart';
|
||||
import 'package:hgmj/tools_base/toast.dart';
|
||||
import 'package:wydj/assets_tool/images.dart';
|
||||
import 'package:wydj/hj_utils/screen.dart';
|
||||
import 'package:wydj/tools_base/toast.dart';
|
||||
|
||||
import '../video_all_type_page.dart';
|
||||
|
||||
@@ -76,7 +76,9 @@ class _SearchAppBarState extends State<SearchAppBar> {
|
||||
height: 32,
|
||||
padding: EdgeInsets.symmetric(horizontal: 10),
|
||||
alignment: Alignment.centerLeft,
|
||||
decoration: BoxDecoration(color: Color(0x11FFFFFF), borderRadius: BorderRadius.circular(20)),
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0x11FFFFFF),
|
||||
borderRadius: BorderRadius.circular(20)),
|
||||
child: Row(
|
||||
children: [
|
||||
InkWell(
|
||||
@@ -87,7 +89,8 @@ class _SearchAppBarState extends State<SearchAppBar> {
|
||||
child: Row(
|
||||
children: [
|
||||
2.sizeBoxW,
|
||||
Image.asset('libary_search.webp'.homePath, width: 20, color: Color(0xFFFFC000)),
|
||||
Image.asset('libary_search.webp'.homePath,
|
||||
width: 20, color: Color(0xFFFFC000)),
|
||||
6.sizeBoxW,
|
||||
Text(
|
||||
'片库',
|
||||
@@ -109,7 +112,10 @@ class _SearchAppBarState extends State<SearchAppBar> {
|
||||
Expanded(
|
||||
child: TextField(
|
||||
controller: searchTextCtr,
|
||||
style: TextStyle(color: Colors.white.withValues(alpha: .8), fontSize: 14, height: 1),
|
||||
style: TextStyle(
|
||||
color: Colors.white.withValues(alpha: .8),
|
||||
fontSize: 14,
|
||||
height: 1),
|
||||
onSubmitted: (value) => widget.onSubmitted(value),
|
||||
onChanged: (value) {
|
||||
if (value.isNotEmpty == true) {
|
||||
@@ -125,7 +131,10 @@ class _SearchAppBarState extends State<SearchAppBar> {
|
||||
textInputAction: TextInputAction.search,
|
||||
decoration: InputDecoration(
|
||||
hintText: '搜索关键词',
|
||||
hintStyle: TextStyle(color: Colors.white.withValues(alpha: .55), fontSize: 14, height: 1),
|
||||
hintStyle: TextStyle(
|
||||
color: Colors.white.withValues(alpha: .55),
|
||||
fontSize: 14,
|
||||
height: 1),
|
||||
border: InputBorder.none,
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.zero,
|
||||
@@ -142,7 +151,8 @@ class _SearchAppBarState extends State<SearchAppBar> {
|
||||
showDeleteIcon = false;
|
||||
});
|
||||
},
|
||||
child: Image.asset('search_close.webp'.homePath, width: 18),
|
||||
child: Image.asset('search_close.webp'.homePath,
|
||||
width: 18),
|
||||
),
|
||||
)
|
||||
],
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:flutter/material.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';
|
||||
|
||||
/// 搜索历史区:纯展示,数据与增删由 SearchMainLogic 持有
|
||||
class SearchHistoryView extends StatefulWidget {
|
||||
@@ -57,7 +57,8 @@ class _SearchHistoryViewState extends State<SearchHistoryView> {
|
||||
onTap: widget.onClearAll,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(1),
|
||||
child: Image.asset("history_delete.webp".homePath, width: 18, height: 18),
|
||||
child: Image.asset("history_delete.webp".homePath,
|
||||
width: 18, height: 18),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -74,7 +75,8 @@ class _SearchHistoryViewState extends State<SearchHistoryView> {
|
||||
mainAxisSpacing: 12,
|
||||
crossAxisSpacing: 12,
|
||||
),
|
||||
itemBuilder: (_, index) => _buildHistoryItem(widget.histories[index]),
|
||||
itemBuilder: (_, index) =>
|
||||
_buildHistoryItem(widget.histories[index]),
|
||||
),
|
||||
_buildMoreRecord(),
|
||||
],
|
||||
@@ -108,7 +110,8 @@ class _SearchHistoryViewState extends State<SearchHistoryView> {
|
||||
return Container(
|
||||
padding: const EdgeInsets.only(top: 12),
|
||||
alignment: Alignment.topCenter,
|
||||
child: InkWell(enableFeedback: false,
|
||||
child: InkWell(
|
||||
enableFeedback: false,
|
||||
onTap: () => setState(() => isExpandData = !isExpandData),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:hgmj/config/config.dart';
|
||||
import 'package:hgmj/hj_utils/screen.dart';
|
||||
|
||||
import 'package:wydj/config/config.dart';
|
||||
import 'package:wydj/hj_utils/screen.dart';
|
||||
|
||||
class SearchHotTagView extends StatelessWidget {
|
||||
final Function(String keyword) onTagClick;
|
||||
|
||||
@@ -1,20 +1,21 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/assets_tool/app_colors.dart';
|
||||
import 'package:hgmj/hj_model/video_model.dart';
|
||||
import 'package:hgmj/hj_utils/screen.dart';
|
||||
import 'package:hgmj/tools_base/widget/net_image_widget.dart';
|
||||
import 'package:wydj/assets_tool/app_colors.dart';
|
||||
import 'package:wydj/hj_model/video_model.dart';
|
||||
import 'package:wydj/hj_utils/screen.dart';
|
||||
import 'package:wydj/tools_base/widget/net_image_widget.dart';
|
||||
|
||||
import '../../../community/community_tag_page/community_tag_page.dart';
|
||||
import 'package:hgmj/extension/extensions.dart';
|
||||
import 'package:wydj/extension/extensions.dart';
|
||||
|
||||
class TopicItem extends StatelessWidget {
|
||||
final TagsBean model;
|
||||
final bool isSelect;
|
||||
final Function()? onTap;
|
||||
|
||||
const TopicItem({super.key, required this.model, this.onTap, this.isSelect = false});
|
||||
const TopicItem(
|
||||
{super.key, required this.model, this.onTap, this.isSelect = false});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -50,7 +51,10 @@ class TopicItem extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
'#${model.name}',
|
||||
style: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'package:hgmj/tools_base/base_list_controller.dart';
|
||||
import 'package:wydj/tools_base/base_list_controller.dart';
|
||||
|
||||
import '../../../hj_model/home/module_detail_model.dart';
|
||||
import '../../../hj_utils/api_service/vid_service.dart';
|
||||
@@ -24,7 +24,8 @@ class SectionAllLogic extends ListBaseLogic<AllSection> {
|
||||
}
|
||||
|
||||
Future<(List<AllSection>?, bool)> _fetch(int page) async {
|
||||
final resp = await VidService.fetchSectionAll(id, pageNumber: page, pageSize: 20);
|
||||
final resp =
|
||||
await VidService.fetchSectionAll(id, pageNumber: page, pageSize: 20);
|
||||
//hasNext 为 null 时按"有更多"处理(保持原 == false 判断语义)
|
||||
return (resp?.list, resp?.hasNext != false);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/hj_utils/screen.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/widget/net_image_widget.dart';
|
||||
import 'package:wydj/hj_utils/screen.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/widget/net_image_widget.dart';
|
||||
|
||||
import '../../../hj_model/home/module_detail_model.dart';
|
||||
import '../special_topic_detail/special_topics_detail_page.dart';
|
||||
@@ -39,9 +39,11 @@ class SectionAllPage extends StatelessWidget {
|
||||
itemCount: list.length,
|
||||
itemBuilder: (context, index) {
|
||||
AllSection model = list[index];
|
||||
return InkWell(enableFeedback: false,
|
||||
return InkWell(
|
||||
enableFeedback: false,
|
||||
onTap: () {
|
||||
Get.to(SpecialTopicsDetailPage(model), preventDuplicates: false);
|
||||
Get.to(SpecialTopicsDetailPage(model),
|
||||
preventDuplicates: false);
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(bottom: 12),
|
||||
@@ -67,7 +69,8 @@ class SectionAllPage extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
12.sizeBoxW,
|
||||
Icon(Icons.keyboard_arrow_right, color: Colors.white, size: 16),
|
||||
Icon(Icons.keyboard_arrow_right,
|
||||
color: Colors.white, size: 16),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hgmj/hj_model/home/module_detail_model.dart';
|
||||
import 'package:hgmj/hj_model/splash/ads_model.dart';
|
||||
import 'package:hgmj/hj_model/video_model.dart';
|
||||
import 'package:hgmj/hj_utils/api_service/vid_service.dart';
|
||||
import 'package:hgmj/hj_utils/const.dart';
|
||||
import 'package:hgmj/tools_base/base_list_controller.dart';
|
||||
import 'package:hgmj/tools_base/ad_manager.dart';
|
||||
import 'package:wydj/hj_model/home/module_detail_model.dart';
|
||||
import 'package:wydj/hj_model/splash/ads_model.dart';
|
||||
import 'package:wydj/hj_model/video_model.dart';
|
||||
import 'package:wydj/hj_utils/api_service/vid_service.dart';
|
||||
import 'package:wydj/hj_utils/const.dart';
|
||||
import 'package:wydj/tools_base/base_list_controller.dart';
|
||||
import 'package:wydj/tools_base/ad_manager.dart';
|
||||
|
||||
import '../home_cell_style/home_section_cell.dart';
|
||||
|
||||
@@ -40,7 +40,8 @@ class SpecialTopicsLogic extends ListBaseLogic<VideoModel> {
|
||||
final List<AdsInfoModel> _adsList = [];
|
||||
|
||||
// ========== Controllers ==========
|
||||
late final TabController tabCtr = TabController(length: _sortTabs.length, vsync: this);
|
||||
late final TabController tabCtr =
|
||||
TabController(length: _sortTabs.length, vsync: this);
|
||||
|
||||
// ========== 派生 getter ==========
|
||||
String get title => originModel?.sectionName ?? '';
|
||||
@@ -74,7 +75,8 @@ class SpecialTopicsLogic extends ListBaseLogic<VideoModel> {
|
||||
// ========== 公开方法 ==========
|
||||
/// [isRefresh] 刷新(回第 1 页并清空)/ 加载更多;[showLoading] 切排序时先转圈
|
||||
/// 广告要等基类把新页并入 dataList 后再按全量列表重排,所以 await 完再插
|
||||
Future<void> loadData({bool isRefresh = true, bool showLoading = false}) async {
|
||||
Future<void> loadData(
|
||||
{bool isRefresh = true, bool showLoading = false}) async {
|
||||
if (showLoading) {
|
||||
dataList = null; // 置空即 isLoading
|
||||
update();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/tools_base/loading/loading_center_widget.dart';
|
||||
import 'package:hgmj/tools_base/refresh/pull_refresh.dart';
|
||||
import 'package:wydj/tools_base/loading/loading_center_widget.dart';
|
||||
import 'package:wydj/tools_base/refresh/pull_refresh.dart';
|
||||
|
||||
import '../../../hj_model/home/module_detail_model.dart';
|
||||
import '../home_cell_style/video_simple_cell.dart';
|
||||
@@ -56,7 +56,8 @@ class SpecialTopicsDetailPage extends StatelessWidget {
|
||||
logic.loadData(showLoading: true);
|
||||
},
|
||||
tabs: [
|
||||
for (var i = 0; i < titles.length; i++) _sortTab(titles[i], isLast: i == titles.length - 1),
|
||||
for (var i = 0; i < titles.length; i++)
|
||||
_sortTab(titles[i], isLast: i == titles.length - 1),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/hj_model/video_model.dart';
|
||||
import 'package:hgmj/hj_utils/api_service/acg_service.dart';
|
||||
import 'package:hgmj/hj_utils/const.dart';
|
||||
import 'package:wydj/hj_model/video_model.dart';
|
||||
import 'package:wydj/hj_utils/api_service/acg_service.dart';
|
||||
import 'package:wydj/hj_utils/const.dart';
|
||||
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||
|
||||
import '../../../hj_model/cartoon_media_info.dart';
|
||||
@@ -29,7 +29,8 @@ class CartoonTagLogic extends GetxController {
|
||||
RefreshController? refreshController;
|
||||
List<CartoonMediaInfo> dataSource = [];
|
||||
int sortIndex = 0;
|
||||
List<SortTab<int>> get _sortTabs => isSection ? _sectionSortTabs : _normalSortTabs;
|
||||
List<SortTab<int>> get _sortTabs =>
|
||||
isSection ? _sectionSortTabs : _normalSortTabs;
|
||||
List<String> get sorts => _sortTabs.map((e) => e.name).toList();
|
||||
|
||||
@override
|
||||
@@ -46,12 +47,15 @@ class CartoonTagLogic extends GetxController {
|
||||
isLoading = true;
|
||||
update();
|
||||
}
|
||||
final res = await ACGService.getMoreCartoon(page, 12, _sortTabs[sortIndex].sort, sId ?? '');
|
||||
final res = await ACGService.getMoreCartoon(
|
||||
page, 12, _sortTabs[sortIndex].sort, sId ?? '');
|
||||
if (isRefresh) {
|
||||
refreshController?.refreshCompleted();
|
||||
dataSource.clear();
|
||||
}
|
||||
res?.hasNext ?? false ? refreshController?.loadComplete() : refreshController?.loadNoData();
|
||||
res?.hasNext ?? false
|
||||
? refreshController?.loadComplete()
|
||||
: refreshController?.loadNoData();
|
||||
dataSource.addAll(res?.list ?? []);
|
||||
page += 1;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.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/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 '../../cartoon/acg_widget_item.dart';
|
||||
import '../home_cell_style/divider_tab_bar.dart';
|
||||
@@ -65,7 +65,8 @@ class _CartoonTagPageState extends State<CartoonTagPage> with UniqueTagMixin {
|
||||
),
|
||||
itemCount: controller.dataSource.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return AcgItemWidget(info: controller.dataSource[index]);
|
||||
return AcgItemWidget(
|
||||
info: controller.dataSource[index]);
|
||||
},
|
||||
);
|
||||
}(),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:hgmj/hj_model/video_model.dart';
|
||||
import 'package:hgmj/hj_utils/api_service/tag_service.dart';
|
||||
import 'package:hgmj/hj_utils/const.dart';
|
||||
import 'package:hgmj/tools_base/base_list_controller.dart';
|
||||
import 'package:wydj/hj_model/video_model.dart';
|
||||
import 'package:wydj/hj_utils/api_service/tag_service.dart';
|
||||
import 'package:wydj/hj_utils/const.dart';
|
||||
import 'package:wydj/tools_base/base_list_controller.dart';
|
||||
|
||||
//视频标签页排序 tab(标题与接口 sortType 绑定)
|
||||
const _sortTabs = [
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/config/config.dart';
|
||||
import 'package:hgmj/hj_model/video_model.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/config/config.dart';
|
||||
import 'package:wydj/hj_model/video_model.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 '../../../routers/jump_router.dart';
|
||||
import '../../../tools_base/global_store/store.dart';
|
||||
@@ -68,14 +68,16 @@ class _VideoTagPageState extends State<VideoTagPage> with UniqueTagMixin {
|
||||
crossAxisSpacing: 6,
|
||||
mainAxisSpacing: 12,
|
||||
crossAxisCount: 2,
|
||||
childAspectRatio: widget.isShortStyle ? 168 / 266 : 168 / 136,
|
||||
childAspectRatio:
|
||||
widget.isShortStyle ? 168 / 266 : 168 / 136,
|
||||
),
|
||||
itemCount: list.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
VideoModel model = list[index];
|
||||
return VideoSimpleCell(
|
||||
videoModel: model,
|
||||
textLines: (widget.isShortStyle || widget.isHYStyle) ? 1 : 2,
|
||||
textLines:
|
||||
(widget.isShortStyle || widget.isHYStyle) ? 1 : 2,
|
||||
isFromHY: widget.isHYStyle,
|
||||
isFromSearch: widget.isFromSearch,
|
||||
isShort: widget.isShortStyle,
|
||||
@@ -83,7 +85,10 @@ class _VideoTagPageState extends State<VideoTagPage> with UniqueTagMixin {
|
||||
if (model.isDarkTag && !globalStore.isAWVIP) {
|
||||
pushToWalletPage(vipId: Config.darkWebVipId);
|
||||
} else {
|
||||
pushToVideoPage(videoModel: model, videoArr: list, isShort: widget.isShortStyle);
|
||||
pushToVideoPage(
|
||||
videoModel: model,
|
||||
videoArr: list,
|
||||
isShort: widget.isShortStyle);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
@@ -2,9 +2,9 @@ import 'dart:async';
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:hgmj/hj_model/video_model.dart';
|
||||
import 'package:hgmj/tools_base/event_bus/event_bus_util.dart';
|
||||
import 'package:hgmj/tools_base/event_bus/events.dart';
|
||||
import 'package:wydj/hj_model/video_model.dart';
|
||||
import 'package:wydj/tools_base/event_bus/event_bus_util.dart';
|
||||
import 'package:wydj/tools_base/event_bus/events.dart';
|
||||
|
||||
import '../../../hj_model/acg/cartoon_more_list.dart';
|
||||
import '../../../hj_model/cartoon_media_info.dart';
|
||||
@@ -60,7 +60,10 @@ class _CollectStatusWrapperState extends State<CollectStatusWrapper> {
|
||||
}
|
||||
|
||||
void _listenCallback(CollectStatusModel model) {
|
||||
String? obId = widget.allMediaInfo?.id ?? widget.mediaInfo?.id ?? widget.videoModel?.id ?? widget.tagModel?.id;
|
||||
String? obId = widget.allMediaInfo?.id ??
|
||||
widget.mediaInfo?.id ??
|
||||
widget.videoModel?.id ??
|
||||
widget.tagModel?.id;
|
||||
//收藏和点赞逻辑
|
||||
if (obId == model.id && obId?.isNotEmpty == true) {
|
||||
if (model.isCollected != null) {
|
||||
@@ -77,7 +80,8 @@ class _CollectStatusWrapperState extends State<CollectStatusWrapper> {
|
||||
} else {}
|
||||
}
|
||||
// 用户关注逻辑
|
||||
if (model.isFollowed != null && model.uid == widget.videoModel?.publisher?.uid) {
|
||||
if (model.isFollowed != null &&
|
||||
model.uid == widget.videoModel?.publisher?.uid) {
|
||||
widget.videoModel?.publisher?.hasFollowed = model.isFollowed;
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
@@ -5,10 +5,10 @@ import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/assets_tool/images.dart';
|
||||
import 'package:hgmj/config/config.dart';
|
||||
import 'package:hgmj/hj_model/splash/domain_source_model.dart';
|
||||
import 'package:hgmj/hj_utils/screen.dart';
|
||||
import 'package:wydj/assets_tool/images.dart';
|
||||
import 'package:wydj/config/config.dart';
|
||||
import 'package:wydj/hj_model/splash/domain_source_model.dart';
|
||||
import 'package:wydj/hj_utils/screen.dart';
|
||||
|
||||
import '../../../hj_utils/api_service/vid_service.dart';
|
||||
import '../../../routers/jump_router.dart';
|
||||
@@ -44,7 +44,8 @@ class HomeTxtMarQuee extends StatefulWidget {
|
||||
}
|
||||
}
|
||||
|
||||
class HomeTxtMarQueeState extends State<HomeTxtMarQuee> with SingleTickerProviderStateMixin {
|
||||
class HomeTxtMarQueeState extends State<HomeTxtMarQuee>
|
||||
with SingleTickerProviderStateMixin {
|
||||
List<MarqueeModel>? marquees;
|
||||
|
||||
bool isShow = true;
|
||||
@@ -100,14 +101,16 @@ class HomeTxtMarQueeState extends State<HomeTxtMarQuee> with SingleTickerProvide
|
||||
height: widget.height ?? 36,
|
||||
alignment: Alignment.centerLeft,
|
||||
margin: widget.margin,
|
||||
padding: widget.padding ?? EdgeInsets.only(left: 14, right: 14, top: 8, bottom: 8),
|
||||
padding: widget.padding ??
|
||||
EdgeInsets.only(left: 14, right: 14, top: 8, bottom: 8),
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xCC000000),
|
||||
borderRadius: BorderRadius.circular(widget.borderRadius),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Image.asset("icon_broadcast.png".commonImgPath, width: widget.iconSize ?? 20),
|
||||
Image.asset("icon_broadcast.png".commonImgPath,
|
||||
width: widget.iconSize ?? 20),
|
||||
6.sizeBoxW,
|
||||
Expanded(
|
||||
child: InfiniteMarquee(
|
||||
@@ -122,7 +125,10 @@ class HomeTxtMarQueeState extends State<HomeTxtMarQuee> with SingleTickerProvide
|
||||
},
|
||||
child: Text(
|
||||
model.content ?? '',
|
||||
style: TextStyle(color: Color(0xE5FFFFFF), fontSize: widget.fontSize ?? 12, height: 1.4),
|
||||
style: TextStyle(
|
||||
color: Color(0xE5FFFFFF),
|
||||
fontSize: widget.fontSize ?? 12,
|
||||
height: 1.4),
|
||||
),
|
||||
);
|
||||
},
|
||||
@@ -149,7 +155,8 @@ class InfiniteMarquee extends StatefulWidget {
|
||||
/// 自定义内容
|
||||
final IndexedWidgetBuilder itemBuilder;
|
||||
|
||||
InfiniteMarquee({super.key,
|
||||
InfiniteMarquee({
|
||||
super.key,
|
||||
this.stepOffset = 0.5,
|
||||
required this.itemBuilder,
|
||||
});
|
||||
@@ -212,7 +219,8 @@ class _InfiniteMarqueeState extends State<InfiniteMarquee> {
|
||||
controller: _controller,
|
||||
itemBuilder: widget.itemBuilder,
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
separatorBuilder: (BuildContext context, int index) => SizedBox(width: Get.width - 100),
|
||||
separatorBuilder: (BuildContext context, int index) =>
|
||||
SizedBox(width: Get.width - 100),
|
||||
anchor: 0,
|
||||
);
|
||||
}
|
||||
@@ -239,7 +247,7 @@ class InfiniteListView extends StatefulWidget {
|
||||
this.keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual,
|
||||
this.restorationId,
|
||||
this.clipBehavior = Clip.hardEdge,
|
||||
}) : separatorBuilder = null;
|
||||
}) : separatorBuilder = null;
|
||||
|
||||
/// See [ListView.separated]
|
||||
const InfiniteListView.separated({
|
||||
@@ -261,7 +269,7 @@ class InfiniteListView extends StatefulWidget {
|
||||
this.keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual,
|
||||
this.restorationId,
|
||||
this.clipBehavior = Clip.hardEdge,
|
||||
}) : itemExtent = null;
|
||||
}) : itemExtent = null;
|
||||
|
||||
/// See: [ScrollView.scrollDirection]
|
||||
final Axis scrollDirection;
|
||||
@@ -324,7 +332,8 @@ class InfiniteListView extends StatefulWidget {
|
||||
class _InfiniteListViewState extends State<InfiniteListView> {
|
||||
InfiniteScrollController? _controller;
|
||||
|
||||
InfiniteScrollController get _effectiveController => widget.controller ?? _controller!;
|
||||
InfiniteScrollController get _effectiveController =>
|
||||
widget.controller ?? _controller!;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -356,7 +365,8 @@ class _InfiniteListViewState extends State<InfiniteListView> {
|
||||
final List<Widget> slivers = _buildSlivers(context, negative: false);
|
||||
final List<Widget> negativeSlivers = _buildSlivers(context, negative: true);
|
||||
final AxisDirection axisDirection = _getDirection(context);
|
||||
final scrollPhysics = widget.physics ?? const AlwaysScrollableScrollPhysics();
|
||||
final scrollPhysics =
|
||||
widget.physics ?? const AlwaysScrollableScrollPhysics();
|
||||
return Scrollable(
|
||||
axisDirection: axisDirection,
|
||||
controller: _effectiveController,
|
||||
@@ -403,7 +413,8 @@ class _InfiniteListViewState extends State<InfiniteListView> {
|
||||
}
|
||||
|
||||
AxisDirection _getDirection(BuildContext context) {
|
||||
return getAxisDirectionFromAxisReverseAndDirectionality(context, widget.scrollDirection, widget.reverse);
|
||||
return getAxisDirectionFromAxisReverseAndDirectionality(
|
||||
context, widget.scrollDirection, widget.reverse);
|
||||
}
|
||||
|
||||
List<Widget> _buildSlivers(BuildContext context, {bool negative = false}) {
|
||||
@@ -411,14 +422,20 @@ class _InfiniteListViewState extends State<InfiniteListView> {
|
||||
final padding = widget.padding ?? EdgeInsets.zero;
|
||||
return <Widget>[
|
||||
SliverPadding(
|
||||
padding: negative ? padding - EdgeInsets.only(bottom: padding.bottom) : padding - EdgeInsets.only(top: padding.top),
|
||||
padding: negative
|
||||
? padding - EdgeInsets.only(bottom: padding.bottom)
|
||||
: padding - EdgeInsets.only(top: padding.top),
|
||||
sliver: (itemExtent != null)
|
||||
? SliverFixedExtentList(
|
||||
delegate: negative ? negativeChildrenDelegate : positiveChildrenDelegate,
|
||||
delegate: negative
|
||||
? negativeChildrenDelegate
|
||||
: positiveChildrenDelegate,
|
||||
itemExtent: itemExtent,
|
||||
)
|
||||
: SliverList(
|
||||
delegate: negative ? negativeChildrenDelegate : positiveChildrenDelegate,
|
||||
delegate: negative
|
||||
? negativeChildrenDelegate
|
||||
: positiveChildrenDelegate,
|
||||
),
|
||||
)
|
||||
];
|
||||
@@ -430,7 +447,9 @@ class _InfiniteListViewState extends State<InfiniteListView> {
|
||||
final separatorBuilder = widget.separatorBuilder;
|
||||
if (separatorBuilder != null) {
|
||||
final itemIndex = (-1 - index) ~/ 2;
|
||||
return index.isOdd ? widget.itemBuilder(context, itemIndex) : separatorBuilder(context, itemIndex);
|
||||
return index.isOdd
|
||||
? widget.itemBuilder(context, itemIndex)
|
||||
: separatorBuilder(context, itemIndex);
|
||||
} else {
|
||||
return widget.itemBuilder(context, -1 - index);
|
||||
}
|
||||
@@ -448,10 +467,14 @@ class _InfiniteListViewState extends State<InfiniteListView> {
|
||||
(separatorBuilder != null)
|
||||
? (BuildContext context, int index) {
|
||||
final itemIndex = index ~/ 2;
|
||||
return index.isEven ? widget.itemBuilder(context, itemIndex) : separatorBuilder(context, itemIndex);
|
||||
return index.isEven
|
||||
? widget.itemBuilder(context, itemIndex)
|
||||
: separatorBuilder(context, itemIndex);
|
||||
}
|
||||
: widget.itemBuilder,
|
||||
childCount: separatorBuilder == null ? itemCount : (itemCount != null ? max(0, itemCount * 2 - 1) : null),
|
||||
childCount: separatorBuilder == null
|
||||
? itemCount
|
||||
: (itemCount != null ? max(0, itemCount * 2 - 1) : null),
|
||||
addAutomaticKeepAlives: widget.addAutomaticKeepAlives,
|
||||
addRepaintBoundaries: widget.addRepaintBoundaries,
|
||||
);
|
||||
@@ -460,13 +483,22 @@ class _InfiniteListViewState extends State<InfiniteListView> {
|
||||
@override
|
||||
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
|
||||
super.debugFillProperties(properties);
|
||||
properties.add(EnumProperty<Axis>('scrollDirection', widget.scrollDirection));
|
||||
properties.add(FlagProperty('reverse', value: widget.reverse, ifTrue: 'reversed', showName: true));
|
||||
properties.add(DiagnosticsProperty<ScrollController>('controller', widget.controller, showName: false, defaultValue: null));
|
||||
properties.add(DiagnosticsProperty<ScrollPhysics>('physics', widget.physics, showName: false, defaultValue: null));
|
||||
properties.add(DiagnosticsProperty<EdgeInsetsGeometry>('padding', widget.padding, defaultValue: null));
|
||||
properties.add(DoubleProperty('itemExtent', widget.itemExtent, defaultValue: null));
|
||||
properties.add(DoubleProperty('cacheExtent', widget.cacheExtent, defaultValue: null));
|
||||
properties
|
||||
.add(EnumProperty<Axis>('scrollDirection', widget.scrollDirection));
|
||||
properties.add(FlagProperty('reverse',
|
||||
value: widget.reverse, ifTrue: 'reversed', showName: true));
|
||||
properties.add(DiagnosticsProperty<ScrollController>(
|
||||
'controller', widget.controller,
|
||||
showName: false, defaultValue: null));
|
||||
properties.add(DiagnosticsProperty<ScrollPhysics>('physics', widget.physics,
|
||||
showName: false, defaultValue: null));
|
||||
properties.add(DiagnosticsProperty<EdgeInsetsGeometry>(
|
||||
'padding', widget.padding,
|
||||
defaultValue: null));
|
||||
properties.add(
|
||||
DoubleProperty('itemExtent', widget.itemExtent, defaultValue: null));
|
||||
properties.add(
|
||||
DoubleProperty('cacheExtent', widget.cacheExtent, defaultValue: null));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -480,7 +512,8 @@ class InfiniteScrollController extends ScrollController {
|
||||
});
|
||||
|
||||
@override
|
||||
ScrollPosition createScrollPosition(ScrollPhysics physics, ScrollContext context, ScrollPosition? oldPosition) {
|
||||
ScrollPosition createScrollPosition(ScrollPhysics physics,
|
||||
ScrollContext context, ScrollPosition? oldPosition) {
|
||||
return _InfiniteScrollPosition(
|
||||
physics: physics,
|
||||
context: context,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.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/screen.dart'; // sizeBoxH/sizeBoxW 扩展
|
||||
import 'package:hgmj/tools_base/widget/sheet_handle_bar.dart';
|
||||
import 'package:wydj/assets_tool/app_colors.dart';
|
||||
import 'package:wydj/assets_tool/images.dart';
|
||||
import 'package:wydj/hj_utils/screen.dart'; // sizeBoxH/sizeBoxW 扩展
|
||||
import 'package:wydj/tools_base/widget/sheet_handle_bar.dart';
|
||||
|
||||
import '../../community/publish_page/publish_page.dart';
|
||||
|
||||
@@ -27,7 +27,8 @@ class PublishButton extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () => Get.bottomSheet(CommunityPublishBottomSheet(), isScrollControlled: true, isDismissible: true),
|
||||
onTap: () => Get.bottomSheet(CommunityPublishBottomSheet(),
|
||||
isScrollControlled: true, isDismissible: true),
|
||||
child: Image.asset(
|
||||
entry.realPath(),
|
||||
width: entry.width.w,
|
||||
@@ -44,8 +45,14 @@ class CommunityPublishBottomSheet extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
// 底部加系统安全区,避免手势导航条遮住按钮(如 vivo iQOO 13)
|
||||
padding: EdgeInsets.only(left: 18.w, right: 18.w, top: 18, bottom: 18 + Get.mediaQuery.padding.bottom),
|
||||
decoration: BoxDecoration(color: AppColors.primaryColor, borderRadius: BorderRadius.vertical(top: Radius.circular(13))),
|
||||
padding: EdgeInsets.only(
|
||||
left: 18.w,
|
||||
right: 18.w,
|
||||
top: 18,
|
||||
bottom: 18 + Get.mediaQuery.padding.bottom),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.primaryColor,
|
||||
borderRadius: BorderRadius.vertical(top: Radius.circular(13))),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
@@ -53,7 +60,10 @@ class CommunityPublishBottomSheet extends StatelessWidget {
|
||||
18.sizeBoxH,
|
||||
Text(
|
||||
'选择发布类型',
|
||||
style: TextStyle(color: Colors.white, fontSize: 20.sp, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 20.sp,
|
||||
fontWeight: FontWeight.w500),
|
||||
),
|
||||
18.h.sizeBoxH,
|
||||
Row(
|
||||
@@ -63,7 +73,8 @@ class CommunityPublishBottomSheet extends StatelessWidget {
|
||||
40.sizeBoxW,
|
||||
_publishItem('publish_video.webp', '视频', PublishType.homeVideo),
|
||||
40.sizeBoxW,
|
||||
_publishItem('publish_img_text.webp', '图文', PublishType.homeImgText),
|
||||
_publishItem(
|
||||
'publish_img_text.webp', '图文', PublishType.homeImgText),
|
||||
],
|
||||
),
|
||||
],
|
||||
@@ -83,7 +94,9 @@ class CommunityPublishBottomSheet extends StatelessWidget {
|
||||
children: [
|
||||
Image.asset(img.communityPath, width: 45.w, height: 45.w),
|
||||
4.sizeBoxH,
|
||||
Text(label, style: TextStyle(color: const Color(0xffa3a2a2), fontSize: 18.sp)),
|
||||
Text(label,
|
||||
style:
|
||||
TextStyle(color: const Color(0xffa3a2a2), fontSize: 18.sp)),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@@ -2,9 +2,9 @@ import 'dart:math';
|
||||
|
||||
import 'package:easy_rich_text/easy_rich_text.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hgmj/assets_tool/images.dart';
|
||||
import 'package:hgmj/hj_model/comment/comment_list_res.dart';
|
||||
import 'package:hgmj/routers/jump_router.dart';
|
||||
import 'package:wydj/assets_tool/images.dart';
|
||||
import 'package:wydj/hj_model/comment/comment_list_res.dart';
|
||||
import 'package:wydj/routers/jump_router.dart';
|
||||
|
||||
class QuickSearchView extends StatefulWidget {
|
||||
final List<CommentLink> dataSource;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
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/screen.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/screen.dart';
|
||||
import 'package:wydj/tools_base/global_store/store.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../../mine/mine_vip/mine_charge_coin_page.dart';
|
||||
@@ -33,7 +33,9 @@ class _SupportUPAlertState extends State<SupportUPAlert> {
|
||||
});
|
||||
selectValue.value = widget.selectCoin;
|
||||
final contain = coins.contains(widget.selectCoin.toString());
|
||||
if (!contain) textEidtCtr.text = widget.selectCoin == null ? '' : widget.selectCoin.toString();
|
||||
if (!contain)
|
||||
textEidtCtr.text =
|
||||
widget.selectCoin == null ? '' : widget.selectCoin.toString();
|
||||
checkEnable();
|
||||
}
|
||||
|
||||
@@ -83,7 +85,10 @@ class _SupportUPAlertState extends State<SupportUPAlert> {
|
||||
),
|
||||
Text(
|
||||
widget.isPublish ? '设置价格' : '为喜欢的UP主加油',
|
||||
style: TextStyle(color: Colors.white.withValues(alpha: .9), fontSize: 20, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
color: Colors.white.withValues(alpha: .9),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w500),
|
||||
),
|
||||
18.sizeBoxH,
|
||||
Container(
|
||||
@@ -96,7 +101,8 @@ class _SupportUPAlertState extends State<SupportUPAlert> {
|
||||
return Wrap(
|
||||
spacing: 12,
|
||||
runSpacing: 12,
|
||||
children: ['10', '20', '30', '40', '50', '60', '70', '80'].map(
|
||||
children:
|
||||
['10', '20', '30', '40', '50', '60', '70', '80'].map(
|
||||
(e) {
|
||||
final gold = int.tryParse(e);
|
||||
return Obx(() {
|
||||
@@ -113,7 +119,9 @@ class _SupportUPAlertState extends State<SupportUPAlert> {
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
color: (gold != null && select) ? AppColors.actionRed : Color(0x0DFFFFFF),
|
||||
color: (gold != null && select)
|
||||
? AppColors.actionRed
|
||||
: Color(0x0DFFFFFF),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
border: (gold != null && select)
|
||||
? Border.all(color: AppColors.actionRed)
|
||||
@@ -138,10 +146,15 @@ class _SupportUPAlertState extends State<SupportUPAlert> {
|
||||
),
|
||||
gradient: LinearGradient(
|
||||
colors: select
|
||||
? [Color(0xffFFE8BE), Color(0xffE6B764)]
|
||||
? [
|
||||
Color(0xffFFE8BE),
|
||||
Color(0xffE6B764)
|
||||
]
|
||||
: [
|
||||
Colors.white.withValues(alpha: .55),
|
||||
Colors.white.withValues(alpha: .55),
|
||||
Colors.white
|
||||
.withValues(alpha: .55),
|
||||
Colors.white
|
||||
.withValues(alpha: .55),
|
||||
],
|
||||
),
|
||||
)
|
||||
@@ -163,7 +176,9 @@ class _SupportUPAlertState extends State<SupportUPAlert> {
|
||||
Container(
|
||||
margin: EdgeInsets.symmetric(horizontal: 5, vertical: 0),
|
||||
width: 60,
|
||||
decoration: BoxDecoration(color: Color(0x33FFFFFF), borderRadius: BorderRadius.circular(6)),
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0x33FFFFFF),
|
||||
borderRadius: BorderRadius.circular(6)),
|
||||
child: TextField(
|
||||
controller: textEidtCtr,
|
||||
focusNode: focusN,
|
||||
@@ -174,15 +189,22 @@ class _SupportUPAlertState extends State<SupportUPAlert> {
|
||||
},
|
||||
keyboardType: TextInputType.number,
|
||||
maxLength: 4,
|
||||
inputFormatters: [FilteringTextInputFormatter.allow(RegExp('[0-9]'))],
|
||||
style: TextStyle(color: Colors.white, fontSize: 14, fontWeight: FontWeight.w500),
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.allow(RegExp('[0-9]'))
|
||||
],
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500),
|
||||
decoration: InputDecoration(
|
||||
border: InputBorder.none,
|
||||
counterText: '',
|
||||
hintText: '100',
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.zero,
|
||||
hintStyle: TextStyle(color: Colors.white.withValues(alpha: .6), fontSize: 12),
|
||||
hintStyle: TextStyle(
|
||||
color: Colors.white.withValues(alpha: .6),
|
||||
fontSize: 12),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -197,7 +219,10 @@ class _SupportUPAlertState extends State<SupportUPAlert> {
|
||||
if (!widget.isPublish) ...[
|
||||
Text(
|
||||
'钱包余额:${store.wallet?.amount ?? 0}',
|
||||
style: TextStyle(color: Colors.white.withValues(alpha: .6), fontSize: 12, height: 14 / 12),
|
||||
style: TextStyle(
|
||||
color: Colors.white.withValues(alpha: .6),
|
||||
fontSize: 12,
|
||||
height: 14 / 12),
|
||||
),
|
||||
16.sizeBoxH,
|
||||
],
|
||||
@@ -207,7 +232,8 @@ class _SupportUPAlertState extends State<SupportUPAlert> {
|
||||
children: [
|
||||
Expanded(
|
||||
child: GestureDetector(
|
||||
onTap: () => Get.back(result: selectValue.value),
|
||||
onTap: () =>
|
||||
Get.back(result: selectValue.value),
|
||||
child: Container(
|
||||
height: 54,
|
||||
alignment: Alignment.center,
|
||||
@@ -217,7 +243,10 @@ class _SupportUPAlertState extends State<SupportUPAlert> {
|
||||
),
|
||||
child: Text(
|
||||
widget.isPublish ? '确定设置' : '立即打赏',
|
||||
style: TextStyle(color: Colors.black, fontSize: 18, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w500),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -231,10 +260,15 @@ class _SupportUPAlertState extends State<SupportUPAlert> {
|
||||
height: 38,
|
||||
margin: EdgeInsets.symmetric(horizontal: 20),
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(color: AppColors.actionRed, borderRadius: BorderRadius.circular(3)),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.actionRed,
|
||||
borderRadius: BorderRadius.circular(3)),
|
||||
child: Text(
|
||||
'余额不足 前往充值',
|
||||
style: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/hj_model/video_model.dart';
|
||||
import 'package:hgmj/hj_page/user_center_page/user_center_page.dart';
|
||||
import 'package:hgmj/tools_base/widget/net_image_widget.dart';
|
||||
import 'package:wydj/hj_model/video_model.dart';
|
||||
import 'package:wydj/hj_page/user_center_page/user_center_page.dart';
|
||||
import 'package:wydj/tools_base/widget/net_image_widget.dart';
|
||||
|
||||
class UserAvatar extends StatelessWidget {
|
||||
final double size;
|
||||
@@ -39,7 +39,8 @@ class UserAvatar extends StatelessWidget {
|
||||
GestureDetector(
|
||||
onTap: onTap ??
|
||||
() {
|
||||
Get.to(() => UserCenterPage(uid: model?.uid ?? 0), preventDuplicates: false);
|
||||
Get.to(() => UserCenterPage(uid: model?.uid ?? 0),
|
||||
preventDuplicates: false);
|
||||
},
|
||||
child: NetworkImageLoader(
|
||||
imageUrl: model?.portrait ?? '',
|
||||
|
||||
Reference in New Issue
Block a user