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
+34 -14
View File
@@ -1,8 +1,8 @@
import 'package:hgmj/hj_model/actress_info.dart';
import 'package:hgmj/hj_model/video_model.dart';
import 'package:wydj/hj_model/actress_info.dart';
import 'package:wydj/hj_model/video_model.dart';
import '../cartoon_media_info.dart';
import 'package:hgmj/hj_utils/text_util.dart';
import 'package:wydj/hj_utils/text_util.dart';
class AllMediaInfo {
List<Content>? contents;
@@ -21,11 +21,15 @@ class AllMediaInfo {
List<ActressInfo>? allActress;
String? get coverH {
return (horizontalCover?.isNotEmpty == true) ? horizontalCover : verticalCover;
return (horizontalCover?.isNotEmpty == true)
? horizontalCover
: verticalCover;
}
String? get coverV {
return (verticalCover?.isNotEmpty == true) ? verticalCover : horizontalCover;
return (verticalCover?.isNotEmpty == true)
? verticalCover
: horizontalCover;
}
String? id;
@@ -117,7 +121,9 @@ class AllMediaInfo {
}
AllMediaInfo.fromJson(Map<String, dynamic> json) {
contents = json["contents"] == null ? [] : List<Content>.from(json["contents"]!.map((x) => Content.fromJson(x)));
contents = json["contents"] == null
? []
: List<Content>.from(json["contents"]!.map((x) => Content.fromJson(x)));
countBrowse = json["countBrowse"];
countCollect = json["countCollect"];
countComment = json["countComment"];
@@ -130,11 +136,16 @@ class AllMediaInfo {
freeTime = json["freeTime"];
hasFollow = json["hasFollow"];
horizontalCover = json["horizontalCover"];
allActress = json["actresses"] == null ? [] : List<ActressInfo>.from(json["actresses"]!.map((x) => ActressInfo.fromJson(x)));
allActress = json["actresses"] == null
? []
: List<ActressInfo>.from(
json["actresses"]!.map((x) => ActressInfo.fromJson(x)));
id = json["id"];
kind = json["kind"];
mId = json["mId"];
mediaStatus = json["mediaStatus"] == null ? null : VidStatus.fromMap(json["mediaStatus"]);
mediaStatus = json["mediaStatus"] == null
? null
: VidStatus.fromMap(json["mediaStatus"]);
mediaType = json["mediaType"];
moduleName = json["moduleName"];
number = json["number"];
@@ -148,7 +159,10 @@ class AllMediaInfo {
sortCode = json["sortCode"];
status = json["status"];
summary = json["summary"];
tagDetails = json["tagDetails"] == null ? [] : List<TagsBean>.from(json["tagDetails"]!.map((x) => TagsBean.fromMap(x)));
tagDetails = json["tagDetails"] == null
? []
: List<TagsBean>.from(
json["tagDetails"]!.map((x) => TagsBean.fromMap(x)));
tags = parseStringList(json["tags"]);
title = json["title"];
totalEpisode = json["totalEpisode"];
@@ -230,7 +244,9 @@ class Content {
md5 = json["md5"];
mediaId = json["mediaId"];
mediaSize = json["mediaSize"];
mediaStatus = json["mediaStatus"] == null ? null : VidStatus.fromMap(json["mediaStatus"]);
mediaStatus = json["mediaStatus"] == null
? null
: VidStatus.fromMap(json["mediaStatus"]);
name = json["name"];
playTime = json["playTime"];
price = json["price"];
@@ -265,7 +281,8 @@ class Content {
"ratio": ratio,
"text": text,
"updateTime": updateTime,
"urlSet": urlSet == null ? [] : List<dynamic>.from(urlSet!.map((x) => x)),
"urlSet":
urlSet == null ? [] : List<dynamic>.from(urlSet!.map((x) => x)),
"videoUrl": videoUrl,
"weight": weight,
};
@@ -282,8 +299,12 @@ class MediaSearchListModel {
MediaSearchListModel.fromJson(dynamic json) {
hasNext = json['hasNext'];
list = (json['list'] as List?)?.map((v) => CartoonMediaInfo.fromJson(v)).toList();
tagMedia = (json['tagMedia'] as List?)?.map((v) => CartoonMediaInfo.fromJson(v)).toList();
list = (json['list'] as List?)
?.map((v) => CartoonMediaInfo.fromJson(v))
.toList();
tagMedia = (json['tagMedia'] as List?)
?.map((v) => CartoonMediaInfo.fromJson(v))
.toList();
tagId = json['tagId'];
total = json['total'];
}
@@ -298,4 +319,3 @@ class MediaSearchListModel {
return map;
}
}
+1 -1
View File
@@ -1,5 +1,5 @@
//漫画章节
import 'package:hgmj/config/address.dart' as address;
import 'package:wydj/config/address.dart' as address;
import 'package:path/path.dart' as path;
import '../media_content.dart';
+1 -2
View File
@@ -1,5 +1,4 @@
import 'package:hgmj/hj_utils/text_util.dart';
import 'package:wydj/hj_utils/text_util.dart';
class ActressInfo {
String? age;
+1 -1
View File
@@ -1,4 +1,4 @@
import 'package:hgmj/hj_model/actress_info.dart';
import 'package:wydj/hj_model/actress_info.dart';
class ActressModel {
ActressModel({
+65 -56
View File
@@ -1,9 +1,9 @@
import 'package:flutter/material.dart';
import 'package:hgmj/assets_tool/app_colors.dart';
import 'package:hgmj/hj_model/drama_media_info.dart';
import 'package:hgmj/hj_model/splash/ads_model.dart';
import 'package:hgmj/hj_model/video_model.dart';
import 'package:hgmj/tools_base/global_store/store.dart';
import 'package:wydj/assets_tool/app_colors.dart';
import 'package:wydj/hj_model/drama_media_info.dart';
import 'package:wydj/hj_model/splash/ads_model.dart';
import 'package:wydj/hj_model/video_model.dart';
import 'package:wydj/tools_base/global_store/store.dart';
import 'acg/comic_chapters_model.dart';
import 'actress_info.dart';
@@ -30,7 +30,8 @@ class CartoonMediaInfo {
int? totalEpisode; //总集数
int? currentEpisode; //当前集数
int? freeEpisode; //免费集数
bool isCartoonFreeEpisode = false; //当前播放集是否属于免费集(前 freeEpisode 集):运行时按当前集号计算,命中则不拦播、进度可全程拖
bool isCartoonFreeEpisode =
false; //当前播放集是否属于免费集(前 freeEpisode 集):运行时按当前集号计算,命中则不拦播、进度可全程拖
int? updateStatus; //更新状态 0 默认 1、更新中 2、已完结
String? updateTime; //文档更新时间
String? createdAt; //文档创建时间
@@ -86,16 +87,19 @@ class CartoonMediaInfo {
bool isSelected = false; // 是否选中
String? heroTag; //本地字段,用于传递hero动画tag 随机数
String? get coverH => horizontalCover?.isNotEmpty == true ? horizontalCover : verticalCover;
String? get coverH =>
horizontalCover?.isNotEmpty == true ? horizontalCover : verticalCover;
String? get coverV => verticalCover?.isNotEmpty == true ? verticalCover : horizontalCover;
String? get coverV =>
verticalCover?.isNotEmpty == true ? verticalCover : horizontalCover;
String get unit => mediaType == 'image' ? '话' : '章';
//更新状态
String get updateDesc => updateStatus == 1 ? '连载中' : '已完结';
String get tagIds => tagDetails?.map((e) => e.id).toList().join(',') ?? '';
String get tagNames => tagDetails?.map((e) => e.name).toList().join(',') ?? '';
String get tagNames =>
tagDetails?.map((e) => e.name).toList().join(',') ?? '';
//更新状态
String get getDetailUpdateString {
@@ -237,50 +241,51 @@ class CartoonMediaInfo {
globalStore.isSuperUp;
}
CartoonMediaInfo(
{this.contents,
this.choiceSort,
this.countBrowse,
this.countCollect,
this.countComment,
this.countLike,
this.countPurchases,
this.countPurchasesRate,
this.countView,
this.createdAt,
this.direction,
this.freeTime,
this.horizontalCover,
this.id,
this.isDelete,
this.kind,
this.mId,
this.mediaType,
this.moduleName,
this.permission,
this.permissionIconHide,
this.price,
this.sId,
this.discountPrice,
this.sectionName,
this.sectionSort,
this.sortCode,
this.status,
this.summary,
this.tagDetails,
this.title,
this.totalEpisode,
this.currentEpisode,
this.updateStatus,
this.updateTime,
this.updatedAct,
this.verticalCover,
this.author,
this.freeEpisode,
this.contentsPrice,
this.mediaSubType,
this.actress,
this.hot,});
CartoonMediaInfo({
this.contents,
this.choiceSort,
this.countBrowse,
this.countCollect,
this.countComment,
this.countLike,
this.countPurchases,
this.countPurchasesRate,
this.countView,
this.createdAt,
this.direction,
this.freeTime,
this.horizontalCover,
this.id,
this.isDelete,
this.kind,
this.mId,
this.mediaType,
this.moduleName,
this.permission,
this.permissionIconHide,
this.price,
this.sId,
this.discountPrice,
this.sectionName,
this.sectionSort,
this.sortCode,
this.status,
this.summary,
this.tagDetails,
this.title,
this.totalEpisode,
this.currentEpisode,
this.updateStatus,
this.updateTime,
this.updatedAct,
this.verticalCover,
this.author,
this.freeEpisode,
this.contentsPrice,
this.mediaSubType,
this.actress,
this.hot,
});
CartoonMediaInfo.fromJson(dynamic json) {
freeEpisode = json['freeEpisode'];
@@ -321,11 +326,15 @@ class CartoonMediaInfo {
status = json['status'];
summary = json['summary'];
lsjId = json['lsjId'];
actress = json["actress"] == null ? null : ActressInfo.fromJson(json["actress"]);
allActress = json["actresses"] == null ? [] : List<ActressInfo>.from(json["actresses"]!.map((x) => ActressInfo.fromJson(x)));
actress =
json["actress"] == null ? null : ActressInfo.fromJson(json["actress"]);
allActress = json["actresses"] == null
? []
: List<ActressInfo>.from(
json["actresses"]!.map((x) => ActressInfo.fromJson(x)));
hasFollow = json['hasFollow'];
final hot = json['hot'];
if(hot is int) {
if (hot is int) {
this.hot = hot;
}
if (json['tagDetails'] != null) {
+1 -1
View File
@@ -1,4 +1,4 @@
import 'package:hgmj/hj_model/comment/comment_model.dart';
import 'package:wydj/hj_model/comment/comment_model.dart';
///评论列表返回信息
class CommentListRes {
+1 -1
View File
@@ -1,4 +1,4 @@
import 'package:hgmj/hj_model/comment/reply_model.dart';
import 'package:wydj/hj_model/comment/reply_model.dart';
class CommentModel {
String? id;
+26 -12
View File
@@ -1,5 +1,5 @@
import 'package:hgmj/hj_model/drama_media_info.dart';
import 'package:hgmj/hj_model/media_content.dart';
import 'package:wydj/hj_model/drama_media_info.dart';
import 'package:wydj/hj_model/media_content.dart';
/// 一条短剧观看记录:续播位置 + 列表展示用的剧信息快照。本地记录,不走后端,见 [DramaResumeStore]。
/// 落库时整条存成 model_data,所以 [mediaId] 必须写进 json——
@@ -29,7 +29,9 @@ class DramaResume {
: mediaId = json?['mediaId'] ?? '',
contentId = json?['contentId'] ?? '',
progressSeconds = json?['progressSeconds'] ?? 0,
drama = json?['drama'] == null ? null : DramaMediaInfo.fromJson(json['drama']),
drama = json?['drama'] == null
? null
: DramaMediaInfo.fromJson(json['drama']),
watchedAt = json?['watchedAt'] ?? 0;
Map<String, dynamic> toJson() => {
@@ -62,9 +64,12 @@ class DramaPaywall {
String get titleUI => title?.isNotEmpty == true ? title! : '更多精彩解锁即享';
String get coinButtonUI => coinButtonText?.isNotEmpty == true ? coinButtonText! : '${unlockCoin ?? 0}金币解锁';
String get coinButtonUI => coinButtonText?.isNotEmpty == true
? coinButtonText!
: '${unlockCoin ?? 0}金币解锁';
String get cardButtonUI => cardButtonText?.isNotEmpty == true ? cardButtonText! : '开通短剧卡免费看';
String get cardButtonUI =>
cardButtonText?.isNotEmpty == true ? cardButtonText! : '开通短剧卡免费看';
}
/// AI短剧 Feed 的一条:某部剧 + 该剧第一集。整页走 ListBaseModel<DramaFeedItem>
@@ -76,7 +81,8 @@ class DramaFeedItem {
json ??= {};
//缺 media 就不造空模型,上层按 null 过滤掉这条,别让信息流多出一个没剧名没地址的空位
if (json['media'] != null) media = DramaMediaInfo.fromJson(json['media']);
if (json['content'] != null) content = MediaContent.fromJson(json['content']);
if (json['content'] != null)
content = MediaContent.fromJson(json['content']);
}
}
@@ -104,9 +110,12 @@ class DramaTopic {
name = json['name']?.toString();
topicType = json['topicType']?.toString();
systemKey = json['systemKey']?.toString();
sort = json['sort'] is int ? json['sort'] as int : int.tryParse('${json['sort'] ?? ''}');
workCount =
json['workCount'] is int ? json['workCount'] as int : int.tryParse('${json['workCount'] ?? ''}');
sort = json['sort'] is int
? json['sort'] as int
: int.tryParse('${json['sort'] ?? ''}');
workCount = json['workCount'] is int
? json['workCount'] as int
: int.tryParse('${json['workCount'] ?? ''}');
}
}
@@ -121,9 +130,14 @@ class DramaSearchResult {
json ??= {};
hasNext = json['hasNext'] == true;
tagID = json['tagID']?.toString();
list = (json['list'] as List?)?.map((e) => DramaMediaInfo.fromJson(e)).toList() ?? [];
tagMediaList =
(json['tagMediaList'] as List?)?.map((e) => DramaMediaInfo.fromJson(e)).toList() ?? [];
list = (json['list'] as List?)
?.map((e) => DramaMediaInfo.fromJson(e))
.toList() ??
[];
tagMediaList = (json['tagMediaList'] as List?)
?.map((e) => DramaMediaInfo.fromJson(e))
.toList() ??
[];
}
}
+14 -9
View File
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:hgmj/assets_tool/app_colors.dart';
import 'package:hgmj/hj_model/media_content.dart';
import 'package:hgmj/hj_model/video_model.dart';
import 'package:wydj/assets_tool/app_colors.dart';
import 'package:wydj/hj_model/media_content.dart';
import 'package:wydj/hj_model/video_model.dart';
/// 短剧作品信息(接口 DramaInfo:一部剧 + 一堆分集)
/// 单集播放数据用 [toVideoModel] 转成 VideoModel 交给短视频播放器
@@ -72,9 +72,11 @@ class DramaMediaInfo {
bool haxNextEpisode = true; //是否还有下一页
bool isSelected = false; //是否选中
String? get coverH => horizontalCover?.isNotEmpty == true ? horizontalCover : verticalCover;
String? get coverH =>
horizontalCover?.isNotEmpty == true ? horizontalCover : verticalCover;
String? get coverV => verticalCover?.isNotEmpty == true ? verticalCover : horizontalCover;
String? get coverV =>
verticalCover?.isNotEmpty == true ? verticalCover : horizontalCover;
String get unit => '集';
@@ -83,9 +85,11 @@ class DramaMediaInfo {
String get tagIds => tagDetails?.map((e) => e.id).toList().join(',') ?? '';
String get tagNames => tagDetails?.map((e) => e.name).toList().join(',') ?? '';
String get tagNames =>
tagDetails?.map((e) => e.name).toList().join(',') ?? '';
Color get updateDescColor => updateStatus == 1 ? AppColors.actionRed : const Color(0xff989898);
Color get updateDescColor =>
updateStatus == 1 ? AppColors.actionRed : const Color(0xff989898);
//集数状态描述
String get episodeNumberStatus {
@@ -172,13 +176,14 @@ class DramaMediaInfo {
countView = json['countView'];
hasFollow = json['hasFollow'];
final hot = json['hot'];
if(hot is int) {
if (hot is int) {
this.hot = hot;
}
direction = json['direction'];
freeTime = json['freeTime'];
mediaStatus = VidStatus.fromMap(json['mediaStatus']);
tagDetails = (json['tagDetails'] as List?)?.map((e) => TagsBean.fromMap(e)).toList();
tagDetails =
(json['tagDetails'] as List?)?.map((e) => TagsBean.fromMap(e)).toList();
}
/// 落本地观看记录用(见 [DramaResume.drama])。只序列化后端字段,
+13 -5
View File
@@ -1,5 +1,5 @@
import 'package:collection/collection.dart';
import 'package:hgmj/hj_utils/const.dart';
import 'package:wydj/hj_utils/const.dart';
//亚模块模型
class ModuleData {
@@ -41,6 +41,7 @@ class ModuleData {
bool get isACG => type == 4 || type == 5 || type == 6;
//短剧
bool get isDrama => type == 12;
/// 展示用的排序项:top=true 的置顶,最多 4 个。
/// 标题、sort 值、随机刷新配置一律从这份派生——分头各排一次,遇到同名/同值 remove 会删错元素,两边就对不上了。
/// haiJiaoStyle 解析完就不再变,算一次存起来,别每个 getter 各构造一遍
@@ -53,10 +54,13 @@ class ModuleData {
/// 排序 tab(标题 + sort 值),为空返回 null 让调用方退回默认值。
/// 标题和 sort 值必须一起产出:拆成两个并行数组时,后端只下发其中一个就会静默错位
List<SortTab<int>>? get sortTabs => _sortedRules.isEmpty ? null : _sortedRules.map((e) => SortTab(e.name ?? '', e.val ?? -1)).toList();
List<SortTab<int>>? get sortTabs => _sortedRules.isEmpty
? null
: _sortedRules.map((e) => SortTab(e.name ?? '', e.val ?? -1)).toList();
/// 按 sort 值取对应的排序规则(用于判断该排序项是否走随机刷新接口)
SortRuleModel? sortRuleOf(int? val) => _sortedRules.firstWhereOrNull((e) => e.val == val);
SortRuleModel? sortRuleOf(int? val) =>
_sortedRules.firstWhereOrNull((e) => e.val == val);
}
class HaiJiaoStyle {
@@ -73,7 +77,8 @@ class HaiJiaoStyle {
showChosenVideo = json['showChosenVideo'];
sortShow = json['sortShow'];
final rules = json['sortRules'];
if (rules is List) sortRules = rules.map((e) => SortRuleModel.fromJson(e)).toList();
if (rules is List)
sortRules = rules.map((e) => SortRuleModel.fromJson(e)).toList();
}
}
@@ -129,5 +134,8 @@ class HomePlateModel {
}
//字段缺失或类型不对(后端偶发下发非数组)都退化成空列表,别让首页解析整个抛掉
static List<ModuleData> _modules(dynamic list) => (list is List ? list : const []).map((e) => ModuleData.fromJson(e)).toList();
static List<ModuleData> _modules(dynamic list) =>
(list is List ? list : const [])
.map((e) => ModuleData.fromJson(e))
.toList();
}
+15 -6
View File
@@ -1,5 +1,5 @@
import 'package:hgmj/hj_model/home/module_detail_model.dart';
import 'package:hgmj/hj_model/video_model.dart';
import 'package:wydj/hj_model/home/module_detail_model.dart';
import 'package:wydj/hj_model/video_model.dart';
//注意⚠️ VideoListResp 只用于兼容不同业务服务端返回的视频列表 key 不一致的情况
//注意⚠️ 请勿添加其他类型的数据list,如需添加请单独另外创建新的类
@@ -15,14 +15,24 @@ class VideoListResp {
json ??= {};
hasNext = json['hasNext'];
//各业务的视频列表 key 不一样,逐个匹配(后命中的覆盖先命中的)
for (final key in ['videos', 'vInfos', 'searchVideo', 'list', 'data', 'searchTag']) {
for (final key in [
'videos',
'vInfos',
'searchVideo',
'list',
'data',
'searchTag'
]) {
if (json[key] is List) {
videos = (json[key] as List).map((e) => VideoModel.fromJson(e)).toList();
videos =
(json[key] as List).map((e) => VideoModel.fromJson(e)).toList();
}
}
tagID = json['tagID'] ?? json['libraryTag']?['id'];
if (json['tagVidList'] is List) {
tagVidList = (json['tagVidList'] as List).map((e) => VideoModel.fromJson(e)).toList();
tagVidList = (json['tagVidList'] as List)
.map((e) => VideoModel.fromJson(e))
.toList();
}
}
}
@@ -41,4 +51,3 @@ class SectionListResp {
}
}
}
+14 -14
View File
@@ -1,17 +1,17 @@
import 'package:hgmj/hj_model/acg/comic_chapters_model.dart';
import 'package:hgmj/hj_model/actress_model.dart';
import 'package:hgmj/hj_model/cartoon_media_info.dart';
import 'package:hgmj/hj_model/drama/drama_models.dart';
import 'package:hgmj/hj_model/drama_media_info.dart';
import 'package:hgmj/hj_model/comment/reply_model.dart';
import 'package:hgmj/hj_model/comment/user_comment_res.dart';
import 'package:hgmj/hj_model/home/collection_model.dart';
import 'package:hgmj/hj_model/media_content.dart';
import 'package:hgmj/hj_model/message/message_dynamic_list.dart';
import 'package:hgmj/hj_model/mine/exchange/bill_item_model.dart';
import 'package:hgmj/hj_model/mine/follow_user_list_model.dart';
import 'package:hgmj/hj_model/mine/promotion_record.dart';
import 'package:hgmj/hj_model/video_model.dart';
import 'package:wydj/hj_model/acg/comic_chapters_model.dart';
import 'package:wydj/hj_model/actress_model.dart';
import 'package:wydj/hj_model/cartoon_media_info.dart';
import 'package:wydj/hj_model/drama/drama_models.dart';
import 'package:wydj/hj_model/drama_media_info.dart';
import 'package:wydj/hj_model/comment/reply_model.dart';
import 'package:wydj/hj_model/comment/user_comment_res.dart';
import 'package:wydj/hj_model/home/collection_model.dart';
import 'package:wydj/hj_model/media_content.dart';
import 'package:wydj/hj_model/message/message_dynamic_list.dart';
import 'package:wydj/hj_model/mine/exchange/bill_item_model.dart';
import 'package:wydj/hj_model/mine/follow_user_list_model.dart';
import 'package:wydj/hj_model/mine/promotion_record.dart';
import 'package:wydj/hj_model/video_model.dart';
import '../hj_page/ai/models/ai_change_face_video_model.dart';
import '../hj_page/ai/models/ai_record_model.dart';
+13 -7
View File
@@ -1,6 +1,6 @@
import 'package:hgmj/config/address.dart' as address;
import 'package:hgmj/hj_model/drama/drama_models.dart';
import 'package:hgmj/hj_model/video_model.dart';
import 'package:wydj/config/address.dart' as address;
import 'package:wydj/hj_model/drama/drama_models.dart';
import 'package:wydj/hj_model/video_model.dart';
import 'package:path/path.dart' as path;
/// 作品的「一集」:漫画一话 / 小说一章 / 有声一集 / 短剧一集 共用这一个模型,
@@ -73,7 +73,8 @@ class MediaContent {
audioUrl = json['audioUrl'];
//用 is List 判而不是 as List:下发 null 或非数组时硬 cast 会抛,整条分集就解析不出来
final rawUrlSet = json['urlSet'];
urlSet = rawUrlSet is List ? rawUrlSet.map((e) => e.toString()).toList() : [];
urlSet =
rawUrlSet is List ? rawUrlSet.map((e) => e.toString()).toList() : [];
text = json['text'];
md5 = json['md5'];
playTime = json['playTime'];
@@ -82,7 +83,9 @@ class MediaContent {
weight = json['weight'];
//数字直接转;后端也可能下发字符串("1.5"),那时才走 parse,脏值落 null
final rawRatio = json['ratio'];
ratio = rawRatio is num ? rawRatio.toDouble() : double.tryParse(rawRatio?.toString() ?? '');
ratio = rawRatio is num
? rawRatio.toDouble()
: double.tryParse(rawRatio?.toString() ?? '');
listenPermission = json['listenPermission'];
price = json['price'];
@@ -90,7 +93,8 @@ class MediaContent {
isFree = json['isFree'];
canPlay = json['canPlay'];
accessType = json['accessType'];
paywall = json['paywall'] != null ? DramaPaywall.fromJson(json['paywall']) : null;
paywall =
json['paywall'] != null ? DramaPaywall.fromJson(json['paywall']) : null;
isActive = json['isActive'];
previewEnabled = json['previewEnabled'];
@@ -105,7 +109,9 @@ class MediaContent {
countDisLike = json['countDisLike'];
countLike = json['countLike'];
countPurchases = json['countPurchases'];
mediaStatus = json['mediaStatus'] != null ? VidStatus.fromMap(json['mediaStatus']) : null;
mediaStatus = json['mediaStatus'] != null
? VidStatus.fromMap(json['mediaStatus'])
: null;
createdAt = json['createdAt'];
updateTime = json['updateTime'];
@@ -1,4 +1,4 @@
import 'package:hgmj/hj_model/mine/exchange/recharge_type_list_model.dart';
import 'package:wydj/hj_model/mine/exchange/recharge_type_list_model.dart';
import 'dc_model.dart';
@@ -11,6 +11,8 @@ class RechargeListModel {
json ??= {};
daichong = DCModel.fromJson(json['daichong']);
//代充数据挂在上级,逐条塞给档位,档位内部才能拼出代充支付方式
list = (json['list'] as List?)?.map((e) => RechargeTypeModel.fromJson(e)..daichong = daichong).toList();
list = (json['list'] as List?)
?.map((e) => RechargeTypeModel.fromJson(e)..daichong = daichong)
.toList();
}
}
+1 -1
View File
@@ -1,4 +1,4 @@
import 'package:hgmj/hj_model/splash/ads_model.dart';
import 'package:wydj/hj_model/splash/ads_model.dart';
class AdGroup {
final List<AdsInfoModel>? items;
+99 -30
View File
@@ -1,4 +1,4 @@
import 'package:hgmj/assets_tool/images.dart';
import 'package:wydj/assets_tool/images.dart';
import '../../alert/vip_guide/guide_manager.dart';
import '../../config/config.dart';
@@ -20,7 +20,9 @@ class AdvanceStatus {
balancePayment = json['balancePayment'];
activityPopUp = json['activityPopUp'];
oid = json['oid'];
privilegeLimit = json['privilegeLimit'] != null ? PrivilegeLimit.fromJson(json['privilegeLimit']) : null;
privilegeLimit = json['privilegeLimit'] != null
? PrivilegeLimit.fromJson(json['privilegeLimit'])
: null;
}
}
@@ -43,7 +45,10 @@ class Remain {
int? todayCoinVideoCount; //今日剩余金币视频观看次数
int? todayDownloadCount; //今日剩余下载次数
Remain({this.todayAiUndressCount, this.todayCoinVideoCount, this.todayDownloadCount});
Remain(
{this.todayAiUndressCount,
this.todayCoinVideoCount,
this.todayDownloadCount});
Remain.fromJson(Map<String, dynamic> json) {
todayAiUndressCount = json['todayAiUndressCount'];
@@ -63,7 +68,8 @@ class BannerJump {
BannerJump({this.additionalProp});
BannerJump.fromJson(Map<String, dynamic> json, {String key = '1'}) {
additionalProp = json[key] != null ? AdditionalProp.fromJson(json[key]) : null;
additionalProp =
json[key] != null ? AdditionalProp.fromJson(json[key]) : null;
}
}
@@ -77,7 +83,15 @@ class AdditionalProp {
String? endAt; //结束时间
int? countdownType;
AdditionalProp({this.id, this.banner, this.endAt, this.position, this.startAt, this.title, this.url, this.countdownType});
AdditionalProp(
{this.id,
this.banner,
this.endAt,
this.position,
this.startAt,
this.title,
this.url,
this.countdownType});
AdditionalProp.fromJson(Map<String, dynamic> json) {
id = json['id'];
@@ -159,15 +173,23 @@ class DomainSourceModel {
Config.darkWebIcon = map['darkWebIcon'];
Config.darkWebIconName = map['darkWebIconName'];
Config.mineBg = map['personalCenterBackground'];
Config.entryPopupEnabled = map['shortDramaEntryPopupEnabled'] ?? true; //短剧引导气泡,字段缺失当开启
Config.isDramaEntry = map['defaultEntryPage'] == 'drama'; //默认进哪个 tab,缺字段/其它值都按主页
MineMsgProvider().payTier = PayTierModel.fromJson(map); //支付状态分层(各展示位图片/卡ID/倒计时)
Config.entryPopupEnabled =
map['shortDramaEntryPopupEnabled'] ?? true; //短剧引导气泡,字段缺失当开启
Config.isDramaEntry =
map['defaultEntryPage'] == 'drama'; //默认进哪个 tab,缺字段/其它值都按主页
MineMsgProvider().payTier =
PayTierModel.fromJson(map); //支付状态分层(各展示位图片/卡ID/倒计时)
GuideManager().update(map['paymentGuide']); //付费引导各场景开关(弹窗一律读缓存,不再临时查接口)
if (map['aiSwitchConf'] is List) {
Config.aiTypes = (map['aiSwitchConf'] as List).map((e) => AISwitchConf.fromJson(e)).toList();
Config.aiTypes = (map['aiSwitchConf'] as List)
.map((e) => AISwitchConf.fromJson(e))
.toList();
}
if (map.containsKey('bannerJumpList')) {
Config.bannerJumps = (map['bannerJumpList'] as List?)?.map((o) => BannerJumpEntity.fromJson(o)).toList() ?? [];
Config.bannerJumps = (map['bannerJumpList'] as List?)
?.map((o) => BannerJumpEntity.fromJson(o))
.toList() ??
[];
}
// 域名 / 线路 / 版本
@@ -175,10 +197,14 @@ class DomainSourceModel {
info.domain = (map['domain'] as List?)?.map((o) => o.toString()).toList();
}
if (map.containsKey('sourceList')) {
info.sourceList = (map['sourceList'] as List?)?.map((o) => Sourcelist.fromJson(o)).toList();
info.sourceList = (map['sourceList'] as List?)
?.map((o) => Sourcelist.fromJson(o))
.toList();
}
if (map.containsKey('ver')) {
info.ver = (map['ver'] as List?)?.map((o) => CheckVersionInfo.fromMap(o)).toList();
info.ver = (map['ver'] as List?)
?.map((o) => CheckVersionInfo.fromMap(o))
.toList();
}
// 广告
@@ -199,8 +225,12 @@ class DomainSourceModel {
if (map.containsKey('advanceStatus')) {
info.advanceStatus = AdvanceStatus.fromJson(map['advanceStatus']);
}
info.bannerJump = map['bannerJump'] != null ? BannerJump.fromJson(map['bannerJump']) : null;
info.proxyBannerJump = map['bannerJump'] != null ? BannerJump.fromJson(map['bannerJump'], key: '2') : null;
info.bannerJump = map['bannerJump'] != null
? BannerJump.fromJson(map['bannerJump'])
: null;
info.proxyBannerJump = map['bannerJump'] != null
? BannerJump.fromJson(map['bannerJump'], key: '2')
: null;
info.festivalUi = map['festivalUi'];
if (info.festivalUi?.isNotEmpty != true) info.festivalUi = '默认';
@@ -210,10 +240,12 @@ class DomainSourceModel {
// 搜索
if (map['hotSearchTerms'] is List) {
info.hotSearchTerms = (map['hotSearchTerms'] as List).map((e) => e.toString()).toList();
info.hotSearchTerms =
(map['hotSearchTerms'] as List).map((e) => e.toString()).toList();
}
if (map['searchHintWord'] is List) {
info.searchHintWord = (map['searchHintWord'] as List).map((e) => e.toString()).toList();
info.searchHintWord =
(map['searchHintWord'] as List).map((e) => e.toString()).toList();
}
// 暗网 VIP
@@ -221,7 +253,8 @@ class DomainSourceModel {
info.darkWebVipName = map['darkWebVipName'];
info.shortDramaCardId = map['shortDramaCardId'];
if (map['recommendVipIds'] is List) {
info.recommendVipIds = (map['recommendVipIds'] as List).map((e) => e.toString()).toList();
info.recommendVipIds =
(map['recommendVipIds'] as List).map((e) => e.toString()).toList();
}
// 其他
@@ -229,7 +262,9 @@ class DomainSourceModel {
info.broadcast = map['broadcast'] ?? false;
info.storeIsOpen = map['storeIsOpen'];
if (map['jgArea'] is List) {
info.jgArea = (map['jgArea'] as List?)?.map((e) => JGAreaModel.fromJson(e)).toList();
info.jgArea = (map['jgArea'] as List?)
?.map((e) => JGAreaModel.fromJson(e))
.toList();
}
return info;
}
@@ -292,9 +327,15 @@ class AdsBean {
static AdsBean fromMap(Map<String, dynamic>? map) {
map ??= {};
return AdsBean()
..announInfo = (map['announInfo'] as List?)?.map((o) => AnnounceInfoBean.fromJson(o)).toList()
..announList = (map['announList'] as List?)?.map((o) => AnnounceInfoBean.fromJson(o)).toList()
..adsInfoList = (map['adsInfoList'] as List?)?.map((o) => AdsInfoModel.fromMap(o)).toList();
..announInfo = (map['announInfo'] as List?)
?.map((o) => AnnounceInfoBean.fromJson(o))
.toList()
..announList = (map['announList'] as List?)
?.map((o) => AnnounceInfoBean.fromJson(o))
.toList()
..adsInfoList = (map['adsInfoList'] as List?)
?.map((o) => AdsInfoModel.fromMap(o))
.toList();
}
Map toJson() => {
@@ -313,7 +354,15 @@ class JGAreaModel {
String? linkUrl;
String? mid;
JGAreaModel({this.id, this.name, this.img, this.desc, this.linkType, this.linkUrl, this.type, this.mid});
JGAreaModel(
{this.id,
this.name,
this.img,
this.desc,
this.linkType,
this.linkUrl,
this.type,
this.mid});
factory JGAreaModel.fromJson(Map<String, dynamic> json) => JGAreaModel(
id: json["id"],
@@ -348,7 +397,8 @@ class Sourcelist {
factory Sourcelist.fromJson(Map<String, dynamic> json) => Sourcelist(
id: json["id"],
domain: List<Domain>.from(json["domain"].map((x) => Domain.fromJson(x))),
domain:
List<Domain>.from(json["domain"].map((x) => Domain.fromJson(x))),
isActive: json["isActive"],
type: json["type"],
);
@@ -436,7 +486,15 @@ class BannerJumpEntity {
String? endAt;
int? countdownType;
BannerJumpEntity({this.title, this.id, this.position, this.url, this.startAt, this.banner, this.endAt, this.countdownType});
BannerJumpEntity(
{this.title,
this.id,
this.position,
this.url,
this.startAt,
this.banner,
this.endAt,
this.countdownType});
BannerJumpEntity.fromJson(dynamic json) {
id = json['id'];
@@ -455,7 +513,8 @@ enum PayTier {
newUnpay('new_unpay'), //新用户:注册≤1天且从未付费 → 推新人200卡(新人价+首购引导+紧迫感)
under7DayUnpay('under_7_day_unpay'), //未付费·注册1~7天 → 推300卡(限时优惠+紧迫感)
over7DayUnpay('over_7_day_unpay'), //未付费·注册>7天 → 推300卡(永久卡唤醒需求+信任背书)
over7DayNeedUpgrade('over_7_day_need_upgrade'), //低级会员需续费:注册>7天且已付费、未达最高等级(<5) → 推500至尊卡
over7DayNeedUpgrade(
'over_7_day_need_upgrade'), //低级会员需续费:注册>7天且已付费、未达最高等级(<5) → 推500至尊卡
normal('normal'), //正常用户:无特殊弹窗
unregistered('unregistered'); //未注册(未登录)
@@ -496,7 +555,13 @@ class PayTierConfig {
String? vipCard; //点击跳转的会员卡 ID
int? lastDiscountTime; //优惠截止 Unix 时间戳(秒),早于当前则不展示倒计时
PayTierConfig({this.homePage, this.homePageFlot, this.playPage, this.meTab, this.vipCard, this.lastDiscountTime});
PayTierConfig(
{this.homePage,
this.homePageFlot,
this.playPage,
this.meTab,
this.vipCard,
this.lastDiscountTime});
PayTierConfig.fromJson(Map<String, dynamic>? json) {
json ??= {};
@@ -508,7 +573,8 @@ class PayTierConfig {
lastDiscountTime = _parseEpochSec(json['lastDiscountTime']);
}
static const _minValidEpochSec = 946684800; //2000-01-01,用于挡掉后端零值时间 0001-01-01T00:00:00Z
static const _minValidEpochSec =
946684800; //2000-01-01,用于挡掉后端零值时间 0001-01-01T00:00:00Z
//兼容 Unix 秒(int) / 数字字符串 / ISO 字符串(带 Z 或 +08:00 时区);零值哨兵一律归 null,避免负 epoch 流入业务
static int? _parseEpochSec(dynamic v) {
@@ -519,7 +585,8 @@ class PayTierConfig {
} else if (v is String) {
final s = v.trim();
if (s.isEmpty) return null;
sec = int.tryParse(s) ?? (DateTime.tryParse(s)?.millisecondsSinceEpoch ?? 0) ~/ 1000;
sec = int.tryParse(s) ??
(DateTime.tryParse(s)?.millisecondsSinceEpoch ?? 0) ~/ 1000;
}
return (sec != null && sec >= _minValidEpochSec) ? sec : null;
}
@@ -535,9 +602,11 @@ class PayTierConfig {
bool get hasDiscountCountdown => discountRemainSec > 0;
String get discountHour => (discountRemainSec ~/ 3600).toString().padLeft(2, '0');
String get discountHour =>
(discountRemainSec ~/ 3600).toString().padLeft(2, '0');
String get discountMin => ((discountRemainSec ~/ 60) % 60).toString().padLeft(2, '0');
String get discountMin =>
((discountRemainSec ~/ 60) % 60).toString().padLeft(2, '0');
String get discountSec => (discountRemainSec % 60).toString().padLeft(2, '0');
}
+8 -4
View File
@@ -1,4 +1,4 @@
import 'package:hgmj/assets_tool/images.dart';
import 'package:wydj/assets_tool/images.dart';
/// 用户信息
class UserInfoModel {
@@ -54,7 +54,8 @@ class UserInfoModel {
// ============ 计算属性 ============
/// 观影券总数量
int get couponCount => (goldVideoCoupon ?? []).fold(0, (sum, e) => sum + (e.count ?? 0));
int get couponCount =>
(goldVideoCoupon ?? []).fold(0, (sum, e) => sum + (e.count ?? 0));
/// 可解锁该金币视频的观影券面额:券面额需 >= 视频金币,都不够就退回第一张
int? couponGold(int? originCoins) {
@@ -66,7 +67,8 @@ class UserInfoModel {
}
/// 作品总数(视频上传 + 封面上传)
int get totalWorkCount => totalWorks ?? 0 ; //(vidUploadCount ?? 0) + (coverUploadCount ?? 0);
int get totalWorkCount =>
totalWorks ?? 0; //(vidUploadCount ?? 0) + (coverUploadCount ?? 0);
/// 会员等级对应的角标图片;等级 1~4,0 级(含推广会员)无角标
String get vipImageName {
@@ -111,7 +113,9 @@ class UserInfoModel {
allGoldVideoFree = map['allGoldVideoFree'] ?? false;
goldVideoFreeExpire = map['goldVideoFreeExpire'];
goldVideoCoupon = (map['goldVideoCoupon'] as List?)?.map((o) => MyCoupon.fromJson(o)).toList();
goldVideoCoupon = (map['goldVideoCoupon'] as List?)
?.map((o) => MyCoupon.fromJson(o))
.toList();
broadcastExpire = map['broadcastExpire'];
dramaExpire = map['dramaExpire'];
payVidDiscount = map['payVidDiscount'];
+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';
}
}