feat(player): 点赞与评论改为按集

This commit is contained in:
Zhou Weidong committed 2026-10-21 16:15:29 +08:00
1 parent e6f34977f5
commit 83822a0cbb
25 files changed
+337 -69

No files matched your search

+18 -9
View File
@@ -15,6 +15,8 @@ class Episode {
this.videoUrl = '',
this.durationSec = 0,
this.locked = false,
this.likeCount,
this.commentCount,
});
final String id;
@@ -28,16 +30,21 @@ class Episode {
/// 后端判定需要解锁;解锁能力(金币/VIP)在 M3 接入。
final bool locked;
final int? likeCount;
final int? commentCount;
Episode withVideoUrl(String url) => Episode(
id: id,
number: number,
title: title,
isFree: isFree,
videoUrl: url,
durationSec: durationSec,
locked: locked,
);
Episode withVideoUrl(String url, {int? likeCount, int? commentCount}) =>
Episode(
id: id,
number: number,
title: title,
isFree: isFree,
videoUrl: url,
durationSec: durationSec,
locked: locked,
likeCount: likeCount ?? this.likeCount,
commentCount: commentCount ?? this.commentCount,
);
factory Episode.fromJson(Map<String, dynamic> json) {
return Episode(
@@ -48,6 +55,8 @@ class Episode {
durationSec: (json['durationSec'] as num?)?.toInt() ?? 0,
locked: json['locked'] == true,
videoUrl: json['playUrl'] as String? ?? '',
likeCount: _optionalInt(json['likeCount']),
commentCount: _optionalInt(json['commentCount']),
);
}
}