logo和名称替换

This commit is contained in:
谢宇宁
2026-10-14 11:23:36 +07:00
parent 1cb514cd02
commit c5c04a7967
478 changed files with 8990 additions and 4948 deletions
+24 -11
View File
@@ -1,5 +1,5 @@
import 'package:hgmj/hj_model/splash/ads_model.dart';
import 'package:hgmj/hj_utils/date_time_util.dart';
import 'package:wydj/hj_model/splash/ads_model.dart';
import 'package:wydj/hj_utils/date_time_util.dart';
import '../config/address.dart';
import '../tools_base/global_store/store.dart';
@@ -186,10 +186,12 @@ class VideoModel {
.toList();
title = map['title'];
via = map['via'];
comment = map.containsKey("comment") ? CommentBean.fromMap(map['comment']) : null;
comment =
map.containsKey("comment") ? CommentBean.fromMap(map['comment']) : null;
vidStatus = VidStatus.fromMap(map['vidStatus']);
if (map['seriesCover'] is List) {
seriesCover = (map['seriesCover'] as List).map((e) => e.toString()).toList();
seriesCover =
(map['seriesCover'] as List).map((e) => e.toString()).toList();
}
newsType = map['newsType'];
reason = map['reason'];
@@ -302,7 +304,9 @@ class VideoModel {
/// 拼 m3u8 完整播放链接:各播放源共用同一套 host / token / cdn 参数。
/// 后端偶尔直接下发完整链接(265、短剧下载授权地址),那种别再往前面拼一遍 host
String _m3u8(String? path) {
if (path != null && (path.startsWith('http://') || path.startsWith('https://'))) return path;
if (path != null &&
(path.startsWith('http://') || path.startsWith('https://')))
return path;
return "${Address.baseApiPath}/vid/h5/m3u8/$path?token=${Address.token}&c=${Address.cdnAddress}";
}
@@ -332,8 +336,10 @@ class VideoModel {
/// - 普通源:[useH265] 且有 265 地址 → 265(省带宽),否则 264(兜底)
/// [useH265] 由调用方算好传入(设备硬解能力 + 本条是否已运行时回退),model 不依赖 CodecSupport
String realPlayUrl({required bool canPlayPreview, required bool useH265}) {
if (playContentStyle == 2 && chineseLink?.isNotEmpty == true) return realChineseUrl;
if (playContentStyle == 3 && codelessLink?.isNotEmpty == true) return realUncodeUrl;
if (playContentStyle == 2 && chineseLink?.isNotEmpty == true)
return realChineseUrl;
if (playContentStyle == 3 && codelessLink?.isNotEmpty == true)
return realUncodeUrl;
if (canPlayPreview) return realPreviewUrl;
if (useH265 && realH265Url.isNotEmpty) return realH265Url;
return realVideoUrl;
@@ -343,7 +349,8 @@ class VideoModel {
/// 展示用创建时间:createdAt 为空或后端占位值时退回审核通过时间
String? get realCreateAt {
if (createdAt?.contains("0001-01-01") == true || createdAt?.isNotEmpty != true) {
if (createdAt?.contains("0001-01-01") == true ||
createdAt?.isNotEmpty != true) {
return reviewAt;
}
return createdAt;
@@ -356,7 +363,8 @@ class VideoModel {
return sec >= start && sec < end;
}
bool get isDarkTag => tags?.any((e) => e.name?.contains("暗网") == true) ?? false;
bool get isDarkTag =>
tags?.any((e) => e.name?.contains("暗网") == true) ?? false;
String get allTags => tags?.map((e) => e.name).join(' ') ?? '';
@@ -448,14 +456,19 @@ extension LockType on VideoModel {
/// 帖子流相关的判断与封面取值扩展(社区/个人主页等场景使用)
extension Post on VideoModel {
bool isVideo() {
return newsType == 'SP' || newsType == 'MOVIE' || newsType == 'SHORT' || newsType == 'COVER';
return newsType == 'SP' ||
newsType == 'MOVIE' ||
newsType == 'SHORT' ||
newsType == 'COVER';
}
//埋点专用
String get contentType => newsType == 'SP' ? 'video' : 'short_video';
bool isSeedPost() {
return newsType == 'ADULT_GAME' || (seedLink?.isNotEmpty ?? false) || newsType == 'SEED_LINK';
return newsType == 'ADULT_GAME' ||
(seedLink?.isNotEmpty ?? false) ||
newsType == 'SEED_LINK';
}
}