logo和名称替换
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user