Merge branch 'main' into feature-minePage

This commit is contained in:
guozhigq
2024-10-16 14:17:24 +08:00
parent 676b2f18eb
commit 174eff7151
62 changed files with 1738 additions and 1371 deletions

View File

@ -4,9 +4,12 @@ enum FullScreenGestureMode {
/// 从下滑到上
fromBottomtoTop,
/// 关闭手势
none,
}
extension FullScreenGestureModeExtension on FullScreenGestureMode {
String get values => ['fromToptoBottom', 'fromBottomtoTop'][index];
String get labels => ['从上往下滑进入全屏', '从下往上滑进入全屏'][index];
String get values => ['fromToptoBottom', 'fromBottomtoTop', 'none'][index];
String get labels => ['从上往下滑进入全屏', '从下往上滑进入全屏', '关闭手势'][index];
}

View File

@ -28,7 +28,7 @@ extension SearchTypeExtension on SearchType {
String get label => ['视频', '番剧', '直播间', '用户', '专栏'][index];
}
// 搜索类型为视频、专栏及相簿
// 搜索类型为视频时
enum ArchiveFilterType {
totalrank,
click,
@ -44,3 +44,21 @@ extension ArchiveFilterTypeExtension on ArchiveFilterType {
String get description =>
['默认排序', '播放多', '新发布', '弹幕多', '收藏多', '评论多', '最多喜欢'][index];
}
// 搜索类型为专栏时
enum ArticleFilterType {
// 综合排序
totalrank,
// 最新发布
pubdate,
// 最多点击
click,
// 最多喜欢
attention,
// 最多评论
scores,
}
extension ArticleFilterTypeExtension on ArticleFilterType {
String get description => ['综合排序', '最新发布', '最多点击', '最多喜欢', '最多评论'][index];
}

View File

@ -1,6 +1,7 @@
class MediaVideoItemModel {
MediaVideoItemModel({
this.id,
this.aid,
this.offset,
this.index,
this.intro,
@ -14,12 +15,13 @@ class MediaVideoItemModel {
this.likeState,
this.favState,
this.page,
this.cid,
this.pages,
this.title,
this.type,
this.upper,
this.link,
this.bvId,
this.bvid,
this.shortLink,
this.rights,
this.elecInfo,
@ -32,6 +34,7 @@ class MediaVideoItemModel {
});
int? id;
int? aid;
int? offset;
int? index;
String? intro;
@ -45,12 +48,13 @@ class MediaVideoItemModel {
int? likeState;
int? favState;
int? page;
int? cid;
List<Page>? pages;
String? title;
int? type;
Upper? upper;
String? link;
String? bvId;
String? bvid;
String? shortLink;
Rights? rights;
dynamic elecInfo;
@ -64,6 +68,7 @@ class MediaVideoItemModel {
factory MediaVideoItemModel.fromJson(Map<String, dynamic> json) =>
MediaVideoItemModel(
id: json["id"],
aid: json["id"],
offset: json["offset"],
index: json["index"],
intro: json["intro"],
@ -77,6 +82,7 @@ class MediaVideoItemModel {
likeState: json["like_state"],
favState: json["fav_state"],
page: json["page"],
cid: json["pages"] == null ? -1 : json["pages"].first['id'],
// json["pages"] 可能为null
pages: json["pages"] == null
? []
@ -85,7 +91,7 @@ class MediaVideoItemModel {
type: json["type"],
upper: Upper.fromJson(json["upper"]),
link: json["link"],
bvId: json["bv_id"],
bvid: json["bv_id"],
shortLink: json["short_link"],
rights: Rights.fromJson(json["rights"]),
elecInfo: json["elec_info"],