mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-18 08:06:21 +08:00
@@ -202,7 +202,7 @@ class Api {
|
|||||||
// https://api.bilibili.com/x/v3/fav/folder/created/list?pn=1&ps=10&up_mid=17340771
|
// https://api.bilibili.com/x/v3/fav/folder/created/list?pn=1&ps=10&up_mid=17340771
|
||||||
static const String userFavFolder = '/x/v3/fav/folder/created/list';
|
static const String userFavFolder = '/x/v3/fav/folder/created/list';
|
||||||
|
|
||||||
static const String folderInfo = '/x/v3/fav/folder/info';
|
static const String favFolderInfo = '/x/v3/fav/folder/info';
|
||||||
|
|
||||||
static const String addFolder = '/x/v3/fav/folder/add';
|
static const String addFolder = '/x/v3/fav/folder/add';
|
||||||
|
|
||||||
|
|||||||
@@ -4,12 +4,11 @@ import 'package:PiliPlus/http/init.dart';
|
|||||||
import 'package:PiliPlus/http/loading_state.dart';
|
import 'package:PiliPlus/http/loading_state.dart';
|
||||||
import 'package:PiliPlus/models_new/fav/fav_article/data.dart';
|
import 'package:PiliPlus/models_new/fav/fav_article/data.dart';
|
||||||
import 'package:PiliPlus/models_new/fav/fav_detail/data.dart';
|
import 'package:PiliPlus/models_new/fav/fav_detail/data.dart';
|
||||||
import 'package:PiliPlus/models_new/fav/fav_folder_info/data.dart';
|
import 'package:PiliPlus/models_new/fav/fav_folder/data.dart';
|
||||||
|
import 'package:PiliPlus/models_new/fav/fav_folder/list.dart';
|
||||||
import 'package:PiliPlus/models_new/fav/fav_note/list.dart';
|
import 'package:PiliPlus/models_new/fav/fav_note/list.dart';
|
||||||
import 'package:PiliPlus/models_new/fav/fav_pgc/data.dart';
|
import 'package:PiliPlus/models_new/fav/fav_pgc/data.dart';
|
||||||
import 'package:PiliPlus/models_new/fav/fav_topic/data.dart';
|
import 'package:PiliPlus/models_new/fav/fav_topic/data.dart';
|
||||||
import 'package:PiliPlus/models_new/fav/fav_video/data.dart';
|
|
||||||
import 'package:PiliPlus/models_new/fav/fav_video/list.dart';
|
|
||||||
import 'package:PiliPlus/models_new/space/space_fav/data.dart';
|
import 'package:PiliPlus/models_new/space/space_fav/data.dart';
|
||||||
import 'package:PiliPlus/models_new/sub/sub_detail/data.dart';
|
import 'package:PiliPlus/models_new/sub/sub_detail/data.dart';
|
||||||
import 'package:PiliPlus/utils/storage.dart' show Accounts;
|
import 'package:PiliPlus/utils/storage.dart' show Accounts;
|
||||||
@@ -353,7 +352,7 @@ class FavHttp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 收藏夹
|
// 收藏夹
|
||||||
static Future<LoadingState<FavVideoData>> userfavFolder({
|
static Future<LoadingState<FavFolderData>> userfavFolder({
|
||||||
required int pn,
|
required int pn,
|
||||||
required int ps,
|
required int ps,
|
||||||
required dynamic mid,
|
required dynamic mid,
|
||||||
@@ -367,7 +366,7 @@ class FavHttp {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (res.data['code'] == 0) {
|
if (res.data['code'] == 0) {
|
||||||
return Success(FavVideoData.fromJson(res.data['data']));
|
return Success(FavFolderData.fromJson(res.data['data']));
|
||||||
} else {
|
} else {
|
||||||
return Error(res.data['message'] ?? '账号未登录');
|
return Error(res.data['message'] ?? '账号未登录');
|
||||||
}
|
}
|
||||||
@@ -480,26 +479,23 @@ class FavHttp {
|
|||||||
contentType: Headers.formUrlEncodedContentType,
|
contentType: Headers.formUrlEncodedContentType,
|
||||||
));
|
));
|
||||||
if (res.data['code'] == 0) {
|
if (res.data['code'] == 0) {
|
||||||
return {
|
return {'status': true, 'data': FavFolderInfo.fromJson(res.data['data'])};
|
||||||
'status': true,
|
|
||||||
'data': FavVideoItemModel.fromJson(res.data['data'])
|
|
||||||
};
|
|
||||||
} else {
|
} else {
|
||||||
return {'status': false, 'msg': res.data['message']};
|
return {'status': false, 'msg': res.data['message']};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future folderInfo({
|
static Future favFolderInfo({
|
||||||
dynamic mediaId,
|
dynamic mediaId,
|
||||||
}) async {
|
}) async {
|
||||||
var res = await Request().get(
|
var res = await Request().get(
|
||||||
Api.folderInfo,
|
Api.favFolderInfo,
|
||||||
queryParameters: {
|
queryParameters: {
|
||||||
'media_id': mediaId,
|
'media_id': mediaId,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (res.data['code'] == 0) {
|
if (res.data['code'] == 0) {
|
||||||
return {'status': true, 'data': FolderInfo.fromJson(res.data['data'])};
|
return {'status': true, 'data': FavFolderInfo.fromJson(res.data['data'])};
|
||||||
} else {
|
} else {
|
||||||
return {'status': false, 'msg': res.data['message']};
|
return {'status': false, 'msg': res.data['message']};
|
||||||
}
|
}
|
||||||
@@ -674,7 +670,7 @@ class FavHttp {
|
|||||||
queryParameters: {'up_mid': mid},
|
queryParameters: {'up_mid': mid},
|
||||||
);
|
);
|
||||||
if (res.data['code'] == 0) {
|
if (res.data['code'] == 0) {
|
||||||
return {'status': true, 'data': FavVideoData.fromJson(res.data['data'])};
|
return {'status': true, 'data': FavFolderData.fromJson(res.data['data'])};
|
||||||
} else {
|
} else {
|
||||||
return {'status': false, 'msg': res.data['message']};
|
return {'status': false, 'msg': res.data['message']};
|
||||||
}
|
}
|
||||||
@@ -695,7 +691,7 @@ class FavHttp {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (res.data['code'] == 0) {
|
if (res.data['code'] == 0) {
|
||||||
return {'status': true, 'data': FavVideoData.fromJson(res.data['data'])};
|
return {'status': true, 'data': FavFolderData.fromJson(res.data['data'])};
|
||||||
} else {
|
} else {
|
||||||
return {'status': false, 'msg': res.data['message']};
|
return {'status': false, 'msg': res.data['message']};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,22 +2,40 @@ class CntInfo {
|
|||||||
int? collect;
|
int? collect;
|
||||||
int? play;
|
int? play;
|
||||||
int? thumbUp;
|
int? thumbUp;
|
||||||
|
int? thumbDown;
|
||||||
int? share;
|
int? share;
|
||||||
|
int? reply;
|
||||||
int? danmaku;
|
int? danmaku;
|
||||||
|
int? coin;
|
||||||
|
int? vt;
|
||||||
|
int? playSwitch;
|
||||||
|
String? viewText1;
|
||||||
|
|
||||||
CntInfo({
|
CntInfo({
|
||||||
this.collect,
|
this.collect,
|
||||||
this.play,
|
this.play,
|
||||||
this.thumbUp,
|
this.thumbUp,
|
||||||
|
this.thumbDown,
|
||||||
this.share,
|
this.share,
|
||||||
|
this.reply,
|
||||||
this.danmaku,
|
this.danmaku,
|
||||||
|
this.coin,
|
||||||
|
this.vt,
|
||||||
|
this.playSwitch,
|
||||||
|
this.viewText1,
|
||||||
});
|
});
|
||||||
|
|
||||||
factory CntInfo.fromJson(Map<String, dynamic> json) => CntInfo(
|
factory CntInfo.fromJson(Map<String, dynamic> json) => CntInfo(
|
||||||
collect: json['collect'] as int?,
|
collect: json['collect'] as int?,
|
||||||
play: json['play'] as int?,
|
play: json['play'] as int?,
|
||||||
thumbUp: json['thumb_up'] as int?,
|
thumbUp: json['thumb_up'] as int?,
|
||||||
|
thumbDown: json['thumb_down'] as int?,
|
||||||
share: json['share'] as int?,
|
share: json['share'] as int?,
|
||||||
|
reply: json['reply'] as int?,
|
||||||
danmaku: json['danmaku'] as int?,
|
danmaku: json['danmaku'] as int?,
|
||||||
|
coin: json['coin'] as int?,
|
||||||
|
vt: json['vt'] as int?,
|
||||||
|
playSwitch: json['play_switch'] as int?,
|
||||||
|
viewText1: json['view_text_1'] as String?,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import 'package:PiliPlus/models_new/fav/fav_detail/media.dart';
|
import 'package:PiliPlus/models_new/fav/fav_detail/media.dart';
|
||||||
import 'package:PiliPlus/models_new/fav/fav_video/list.dart';
|
import 'package:PiliPlus/models_new/fav/fav_folder/list.dart';
|
||||||
|
|
||||||
class FavDetailData {
|
class FavDetailData {
|
||||||
FavVideoItemModel? info;
|
FavFolderInfo? info;
|
||||||
List<FavDetailItemModel>? medias;
|
List<FavDetailItemModel>? medias;
|
||||||
bool? hasMore;
|
bool? hasMore;
|
||||||
int? ttl;
|
int? ttl;
|
||||||
@@ -12,7 +12,7 @@ class FavDetailData {
|
|||||||
factory FavDetailData.fromJson(Map<String, dynamic> json) => FavDetailData(
|
factory FavDetailData.fromJson(Map<String, dynamic> json) => FavDetailData(
|
||||||
info: json['info'] == null
|
info: json['info'] == null
|
||||||
? null
|
? null
|
||||||
: FavVideoItemModel.fromJson(json['info'] as Map<String, dynamic>),
|
: FavFolderInfo.fromJson(json['info'] as Map<String, dynamic>),
|
||||||
medias: (json['medias'] as List<dynamic>?)
|
medias: (json['medias'] as List<dynamic>?)
|
||||||
?.map((e) => FavDetailItemModel.fromJson(e as Map<String, dynamic>))
|
?.map((e) => FavDetailItemModel.fromJson(e as Map<String, dynamic>))
|
||||||
.toList(),
|
.toList(),
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
import 'package:PiliPlus/models/model_owner.dart';
|
||||||
import 'package:PiliPlus/models_new/fav/fav_detail/cnt_info.dart';
|
import 'package:PiliPlus/models_new/fav/fav_detail/cnt_info.dart';
|
||||||
import 'package:PiliPlus/models_new/fav/fav_detail/upper.dart';
|
|
||||||
|
|
||||||
class FavDetailInfo {
|
class FavDetailInfo {
|
||||||
int? id;
|
int? id;
|
||||||
@@ -8,7 +8,7 @@ class FavDetailInfo {
|
|||||||
int? attr;
|
int? attr;
|
||||||
String? title;
|
String? title;
|
||||||
String? cover;
|
String? cover;
|
||||||
Upper? upper;
|
Owner? upper;
|
||||||
int? coverType;
|
int? coverType;
|
||||||
CntInfo? cntInfo;
|
CntInfo? cntInfo;
|
||||||
int? type;
|
int? type;
|
||||||
@@ -51,7 +51,7 @@ class FavDetailInfo {
|
|||||||
cover: json['cover'] as String?,
|
cover: json['cover'] as String?,
|
||||||
upper: json['upper'] == null
|
upper: json['upper'] == null
|
||||||
? null
|
? null
|
||||||
: Upper.fromJson(json['upper'] as Map<String, dynamic>),
|
: Owner.fromJson(json['upper'] as Map<String, dynamic>),
|
||||||
coverType: json['cover_type'] as int?,
|
coverType: json['cover_type'] as int?,
|
||||||
cntInfo: json['cnt_info'] == null
|
cntInfo: json['cnt_info'] == null
|
||||||
? null
|
? null
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
import 'package:PiliPlus/models/model_owner.dart';
|
||||||
import 'package:PiliPlus/models_new/fav/fav_detail/cnt_info.dart';
|
import 'package:PiliPlus/models_new/fav/fav_detail/cnt_info.dart';
|
||||||
import 'package:PiliPlus/models_new/fav/fav_detail/ogv.dart';
|
import 'package:PiliPlus/models_new/fav/fav_detail/ogv.dart';
|
||||||
import 'package:PiliPlus/models_new/fav/fav_detail/ugc.dart';
|
import 'package:PiliPlus/models_new/fav/fav_detail/ugc.dart';
|
||||||
import 'package:PiliPlus/models_new/fav/fav_detail/upper.dart';
|
|
||||||
import 'package:PiliPlus/pages/common/multi_select_controller.dart';
|
import 'package:PiliPlus/pages/common/multi_select_controller.dart';
|
||||||
|
|
||||||
class FavDetailItemModel with MultiSelectData {
|
class FavDetailItemModel with MultiSelectData {
|
||||||
@@ -12,7 +12,7 @@ class FavDetailItemModel with MultiSelectData {
|
|||||||
String? intro;
|
String? intro;
|
||||||
int? page;
|
int? page;
|
||||||
int? duration;
|
int? duration;
|
||||||
Upper? upper;
|
Owner? upper;
|
||||||
int? attr;
|
int? attr;
|
||||||
CntInfo? cntInfo;
|
CntInfo? cntInfo;
|
||||||
String? link;
|
String? link;
|
||||||
@@ -56,7 +56,7 @@ class FavDetailItemModel with MultiSelectData {
|
|||||||
duration: json['duration'] as int?,
|
duration: json['duration'] as int?,
|
||||||
upper: json['upper'] == null
|
upper: json['upper'] == null
|
||||||
? null
|
? null
|
||||||
: Upper.fromJson(json['upper'] as Map<String, dynamic>),
|
: Owner.fromJson(json['upper'] as Map<String, dynamic>),
|
||||||
attr: json['attr'] as int?,
|
attr: json['attr'] as int?,
|
||||||
cntInfo: json['cnt_info'] == null
|
cntInfo: json['cnt_info'] == null
|
||||||
? null
|
? null
|
||||||
|
|||||||
@@ -1,26 +0,0 @@
|
|||||||
class Upper {
|
|
||||||
int? mid;
|
|
||||||
String? name;
|
|
||||||
String? face;
|
|
||||||
bool? followed;
|
|
||||||
int? vipType;
|
|
||||||
int? vipStatue;
|
|
||||||
|
|
||||||
Upper({
|
|
||||||
this.mid,
|
|
||||||
this.name,
|
|
||||||
this.face,
|
|
||||||
this.followed,
|
|
||||||
this.vipType,
|
|
||||||
this.vipStatue,
|
|
||||||
});
|
|
||||||
|
|
||||||
factory Upper.fromJson(Map<String, dynamic> json) => Upper(
|
|
||||||
mid: json['mid'] as int?,
|
|
||||||
name: json['name'] as String?,
|
|
||||||
face: json['face'] as String?,
|
|
||||||
followed: json['followed'] as bool?,
|
|
||||||
vipType: json['vip_type'] as int?,
|
|
||||||
vipStatue: json['vip_statue'] as int?,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
17
lib/models_new/fav/fav_folder/data.dart
Normal file
17
lib/models_new/fav/fav_folder/data.dart
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import 'package:PiliPlus/models_new/fav/fav_folder/list.dart';
|
||||||
|
|
||||||
|
class FavFolderData {
|
||||||
|
int? count;
|
||||||
|
List<FavFolderInfo>? list;
|
||||||
|
bool? hasMore;
|
||||||
|
|
||||||
|
FavFolderData({this.count, this.list, this.hasMore});
|
||||||
|
|
||||||
|
factory FavFolderData.fromJson(Map<String, dynamic> json) => FavFolderData(
|
||||||
|
count: json['count'] as int?,
|
||||||
|
list: (json['list'] as List<dynamic>?)
|
||||||
|
?.map((e) => FavFolderInfo.fromJson(e as Map<String, dynamic>))
|
||||||
|
.toList(),
|
||||||
|
hasMore: json['has_more'] as bool?,
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,21 +1,21 @@
|
|||||||
import 'package:PiliPlus/models_new/fav/fav_video/upper.dart';
|
import 'package:PiliPlus/models/model_owner.dart';
|
||||||
|
|
||||||
class FavVideoItemModel {
|
class FavFolderInfo {
|
||||||
int? id;
|
int id;
|
||||||
int? fid;
|
int? fid;
|
||||||
int? mid;
|
int mid;
|
||||||
int? attr;
|
int attr;
|
||||||
String? attrDesc;
|
String? attrDesc;
|
||||||
String? title;
|
String title;
|
||||||
String? cover;
|
String cover;
|
||||||
Upper? upper;
|
Owner? upper;
|
||||||
int? coverType;
|
int? coverType;
|
||||||
String? intro;
|
String? intro;
|
||||||
int? ctime;
|
int? ctime;
|
||||||
int? mtime;
|
int? mtime;
|
||||||
int? state;
|
int? state;
|
||||||
int? favState;
|
int? favState;
|
||||||
int? mediaCount;
|
int mediaCount;
|
||||||
int? viewCount;
|
int? viewCount;
|
||||||
int? vt;
|
int? vt;
|
||||||
bool? isTop;
|
bool? isTop;
|
||||||
@@ -25,14 +25,14 @@ class FavVideoItemModel {
|
|||||||
String? link;
|
String? link;
|
||||||
String? bvid;
|
String? bvid;
|
||||||
|
|
||||||
FavVideoItemModel({
|
FavFolderInfo({
|
||||||
this.id,
|
this.id = 0,
|
||||||
this.fid,
|
this.fid,
|
||||||
this.mid,
|
this.mid = 0,
|
||||||
this.attr,
|
this.attr = -1,
|
||||||
this.attrDesc,
|
this.attrDesc,
|
||||||
this.title,
|
this.title = '',
|
||||||
this.cover,
|
this.cover = '',
|
||||||
this.upper,
|
this.upper,
|
||||||
this.coverType,
|
this.coverType,
|
||||||
this.intro,
|
this.intro,
|
||||||
@@ -40,7 +40,7 @@ class FavVideoItemModel {
|
|||||||
this.mtime,
|
this.mtime,
|
||||||
this.state,
|
this.state,
|
||||||
this.favState,
|
this.favState,
|
||||||
this.mediaCount,
|
this.mediaCount = 0,
|
||||||
this.viewCount,
|
this.viewCount,
|
||||||
this.vt,
|
this.vt,
|
||||||
this.isTop,
|
this.isTop,
|
||||||
@@ -51,25 +51,24 @@ class FavVideoItemModel {
|
|||||||
this.bvid,
|
this.bvid,
|
||||||
});
|
});
|
||||||
|
|
||||||
factory FavVideoItemModel.fromJson(Map<String, dynamic> json) =>
|
factory FavFolderInfo.fromJson(Map<String, dynamic> json) => FavFolderInfo(
|
||||||
FavVideoItemModel(
|
id: json['id'] as int? ?? 0,
|
||||||
id: json['id'] as int?,
|
|
||||||
fid: json['fid'] as int?,
|
fid: json['fid'] as int?,
|
||||||
mid: json['mid'] as int?,
|
mid: json['mid'] as int? ?? 0,
|
||||||
attr: json['attr'] as int?,
|
attr: json['attr'] as int? ?? 0,
|
||||||
attrDesc: json['attr_desc'] as String?,
|
attrDesc: json['attr_desc'] as String?,
|
||||||
title: json['title'] as String?,
|
title: json['title'] as String? ?? '',
|
||||||
cover: json['cover'] as String?,
|
cover: json['cover'] as String? ?? '',
|
||||||
upper: json['upper'] == null
|
upper: json['upper'] == null
|
||||||
? null
|
? null
|
||||||
: Upper.fromJson(json['upper'] as Map<String, dynamic>),
|
: Owner.fromJson(json['upper'] as Map<String, dynamic>),
|
||||||
coverType: json['cover_type'] as int?,
|
coverType: json['cover_type'] as int?,
|
||||||
intro: json['intro'] as String?,
|
intro: json['intro'] as String?,
|
||||||
ctime: json['ctime'] as int?,
|
ctime: json['ctime'] as int?,
|
||||||
mtime: json['mtime'] as int?,
|
mtime: json['mtime'] as int?,
|
||||||
state: json['state'] as int?,
|
state: json['state'] as int?,
|
||||||
favState: json['fav_state'] as int?,
|
favState: json['fav_state'] as int?,
|
||||||
mediaCount: json['media_count'] as int?,
|
mediaCount: json['media_count'] as int? ?? 0,
|
||||||
viewCount: json['view_count'] as int?,
|
viewCount: json['view_count'] as int?,
|
||||||
vt: json['vt'] as int?,
|
vt: json['vt'] as int?,
|
||||||
isTop: json['is_top'] as bool?,
|
isTop: json['is_top'] as bool?,
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
class CntInfo {
|
|
||||||
int? collect;
|
|
||||||
int? play;
|
|
||||||
int? thumbUp;
|
|
||||||
int? share;
|
|
||||||
|
|
||||||
CntInfo({this.collect, this.play, this.thumbUp, this.share});
|
|
||||||
|
|
||||||
factory CntInfo.fromJson(Map<String, dynamic> json) => CntInfo(
|
|
||||||
collect: json['collect'] as int?,
|
|
||||||
play: json['play'] as int?,
|
|
||||||
thumbUp: json['thumb_up'] as int?,
|
|
||||||
share: json['share'] as int?,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
import 'package:PiliPlus/models_new/fav/fav_folder_info/cnt_info.dart';
|
|
||||||
import 'package:PiliPlus/models_new/fav/fav_folder_info/upper.dart';
|
|
||||||
|
|
||||||
class FolderInfo {
|
|
||||||
int? id;
|
|
||||||
int? fid;
|
|
||||||
int? mid;
|
|
||||||
int? attr;
|
|
||||||
String? title;
|
|
||||||
String? cover;
|
|
||||||
Upper? upper;
|
|
||||||
int? coverType;
|
|
||||||
CntInfo? cntInfo;
|
|
||||||
int? type;
|
|
||||||
String? intro;
|
|
||||||
int? ctime;
|
|
||||||
int? mtime;
|
|
||||||
int? state;
|
|
||||||
int? favState;
|
|
||||||
int? likeState;
|
|
||||||
int? mediaCount;
|
|
||||||
bool? isTop;
|
|
||||||
|
|
||||||
FolderInfo({
|
|
||||||
this.id,
|
|
||||||
this.fid,
|
|
||||||
this.mid,
|
|
||||||
this.attr,
|
|
||||||
this.title,
|
|
||||||
this.cover,
|
|
||||||
this.upper,
|
|
||||||
this.coverType,
|
|
||||||
this.cntInfo,
|
|
||||||
this.type,
|
|
||||||
this.intro,
|
|
||||||
this.ctime,
|
|
||||||
this.mtime,
|
|
||||||
this.state,
|
|
||||||
this.favState,
|
|
||||||
this.likeState,
|
|
||||||
this.mediaCount,
|
|
||||||
this.isTop,
|
|
||||||
});
|
|
||||||
|
|
||||||
factory FolderInfo.fromJson(Map<String, dynamic> json) => FolderInfo(
|
|
||||||
id: json['id'] as int?,
|
|
||||||
fid: json['fid'] as int?,
|
|
||||||
mid: json['mid'] as int?,
|
|
||||||
attr: json['attr'] as int?,
|
|
||||||
title: json['title'] as String?,
|
|
||||||
cover: json['cover'] as String?,
|
|
||||||
upper: json['upper'] == null
|
|
||||||
? null
|
|
||||||
: Upper.fromJson(json['upper'] as Map<String, dynamic>),
|
|
||||||
coverType: json['cover_type'] as int?,
|
|
||||||
cntInfo: json['cnt_info'] == null
|
|
||||||
? null
|
|
||||||
: CntInfo.fromJson(json['cnt_info'] as Map<String, dynamic>),
|
|
||||||
type: json['type'] as int?,
|
|
||||||
intro: json['intro'] as String?,
|
|
||||||
ctime: json['ctime'] as int?,
|
|
||||||
mtime: json['mtime'] as int?,
|
|
||||||
state: json['state'] as int?,
|
|
||||||
favState: json['fav_state'] as int?,
|
|
||||||
likeState: json['like_state'] as int?,
|
|
||||||
mediaCount: json['media_count'] as int?,
|
|
||||||
isTop: json['is_top'] as bool?,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
class Upper {
|
|
||||||
int? mid;
|
|
||||||
String? name;
|
|
||||||
String? face;
|
|
||||||
bool? followed;
|
|
||||||
int? vipType;
|
|
||||||
int? vipStatue;
|
|
||||||
|
|
||||||
Upper({
|
|
||||||
this.mid,
|
|
||||||
this.name,
|
|
||||||
this.face,
|
|
||||||
this.followed,
|
|
||||||
this.vipType,
|
|
||||||
this.vipStatue,
|
|
||||||
});
|
|
||||||
|
|
||||||
factory Upper.fromJson(Map<String, dynamic> json) => Upper(
|
|
||||||
mid: json['mid'] as int?,
|
|
||||||
name: json['name'] as String?,
|
|
||||||
face: json['face'] as String?,
|
|
||||||
followed: json['followed'] as bool?,
|
|
||||||
vipType: json['vip_type'] as int?,
|
|
||||||
vipStatue: json['vip_statue'] as int?,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
import 'package:PiliPlus/models_new/fav/fav_video/list.dart';
|
|
||||||
|
|
||||||
class FavVideoData {
|
|
||||||
int? count;
|
|
||||||
List<FavVideoItemModel>? list;
|
|
||||||
bool? hasMore;
|
|
||||||
|
|
||||||
FavVideoData({this.count, this.list, this.hasMore});
|
|
||||||
|
|
||||||
factory FavVideoData.fromJson(Map<String, dynamic> json) => FavVideoData(
|
|
||||||
count: json['count'] as int?,
|
|
||||||
list: (json['list'] as List<dynamic>?)
|
|
||||||
?.map((e) => FavVideoItemModel.fromJson(e as Map<String, dynamic>))
|
|
||||||
.toList(),
|
|
||||||
hasMore: json['has_more'] as bool?,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
class Upper {
|
|
||||||
int? mid;
|
|
||||||
String? name;
|
|
||||||
String? face;
|
|
||||||
String? jumpLink;
|
|
||||||
|
|
||||||
Upper({this.mid, this.name, this.face, this.jumpLink});
|
|
||||||
|
|
||||||
factory Upper.fromJson(Map<String, dynamic> json) => Upper(
|
|
||||||
mid: json['mid'] as int?,
|
|
||||||
name: json['name'] as String?,
|
|
||||||
face: json['face'] as String?,
|
|
||||||
jumpLink: json['jump_link'] as String?,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
class CntInfo {
|
|
||||||
int? collect;
|
|
||||||
int? play;
|
|
||||||
int? thumbUp;
|
|
||||||
int? thumbDown;
|
|
||||||
int? share;
|
|
||||||
int? reply;
|
|
||||||
int? danmaku;
|
|
||||||
int? coin;
|
|
||||||
int? vt;
|
|
||||||
int? playSwitch;
|
|
||||||
String? viewText1;
|
|
||||||
|
|
||||||
CntInfo({
|
|
||||||
this.collect,
|
|
||||||
this.play,
|
|
||||||
this.thumbUp,
|
|
||||||
this.thumbDown,
|
|
||||||
this.share,
|
|
||||||
this.reply,
|
|
||||||
this.danmaku,
|
|
||||||
this.coin,
|
|
||||||
this.vt,
|
|
||||||
this.playSwitch,
|
|
||||||
this.viewText1,
|
|
||||||
});
|
|
||||||
|
|
||||||
factory CntInfo.fromJson(Map<String, dynamic> json) => CntInfo(
|
|
||||||
collect: json['collect'] as int?,
|
|
||||||
play: json['play'] as int?,
|
|
||||||
thumbUp: json['thumb_up'] as int?,
|
|
||||||
thumbDown: json['thumb_down'] as int?,
|
|
||||||
share: json['share'] as int?,
|
|
||||||
reply: json['reply'] as int?,
|
|
||||||
danmaku: json['danmaku'] as int?,
|
|
||||||
coin: json['coin'] as int?,
|
|
||||||
vt: json['vt'] as int?,
|
|
||||||
playSwitch: json['play_switch'] as int?,
|
|
||||||
viewText1: json['view_text_1'] as String?,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
|
import 'package:PiliPlus/models/model_owner.dart';
|
||||||
|
import 'package:PiliPlus/models_new/fav/fav_detail/cnt_info.dart';
|
||||||
import 'package:PiliPlus/models_new/media_list/badge.dart';
|
import 'package:PiliPlus/models_new/media_list/badge.dart';
|
||||||
import 'package:PiliPlus/models_new/media_list/cnt_info.dart';
|
|
||||||
import 'package:PiliPlus/models_new/media_list/coin.dart';
|
import 'package:PiliPlus/models_new/media_list/coin.dart';
|
||||||
import 'package:PiliPlus/models_new/media_list/ogv_info.dart';
|
import 'package:PiliPlus/models_new/media_list/ogv_info.dart';
|
||||||
import 'package:PiliPlus/models_new/media_list/page.dart';
|
import 'package:PiliPlus/models_new/media_list/page.dart';
|
||||||
import 'package:PiliPlus/models_new/media_list/rights.dart';
|
import 'package:PiliPlus/models_new/media_list/rights.dart';
|
||||||
import 'package:PiliPlus/models_new/media_list/upper.dart';
|
|
||||||
import 'package:PiliPlus/utils/extension.dart';
|
import 'package:PiliPlus/utils/extension.dart';
|
||||||
|
|
||||||
class MediaListItemModel {
|
class MediaListItemModel {
|
||||||
@@ -26,7 +26,7 @@ class MediaListItemModel {
|
|||||||
List<Page>? pages;
|
List<Page>? pages;
|
||||||
String? title;
|
String? title;
|
||||||
int? type;
|
int? type;
|
||||||
Upper? upper;
|
Owner? upper;
|
||||||
String? link;
|
String? link;
|
||||||
String? bvid;
|
String? bvid;
|
||||||
String? shortLink;
|
String? shortLink;
|
||||||
@@ -94,7 +94,7 @@ class MediaListItemModel {
|
|||||||
pages = (json['pages'] as List?)?.map((e) => Page.fromJson(e)).toList();
|
pages = (json['pages'] as List?)?.map((e) => Page.fromJson(e)).toList();
|
||||||
title = json['title'] as String?;
|
title = json['title'] as String?;
|
||||||
type = json['type'] as int?;
|
type = json['type'] as int?;
|
||||||
upper = json['upper'] == null ? null : Upper.fromJson(json['upper']);
|
upper = json['upper'] == null ? null : Owner.fromJson(json['upper']);
|
||||||
link = json['link'] as String?;
|
link = json['link'] as String?;
|
||||||
bvid = json['bv_id'] as String?;
|
bvid = json['bv_id'] as String?;
|
||||||
shortLink = json['short_link'] as String?;
|
shortLink = json['short_link'] as String?;
|
||||||
|
|||||||
@@ -1,47 +0,0 @@
|
|||||||
class Upper {
|
|
||||||
int? mid;
|
|
||||||
String? name;
|
|
||||||
String? face;
|
|
||||||
int? followed;
|
|
||||||
int? fans;
|
|
||||||
int? vipType;
|
|
||||||
int? vipStatue;
|
|
||||||
int? vipDueDate;
|
|
||||||
int? vipPayType;
|
|
||||||
int? officialRole;
|
|
||||||
String? officialTitle;
|
|
||||||
String? officialDesc;
|
|
||||||
String? displayName;
|
|
||||||
|
|
||||||
Upper({
|
|
||||||
this.mid,
|
|
||||||
this.name,
|
|
||||||
this.face,
|
|
||||||
this.followed,
|
|
||||||
this.fans,
|
|
||||||
this.vipType,
|
|
||||||
this.vipStatue,
|
|
||||||
this.vipDueDate,
|
|
||||||
this.vipPayType,
|
|
||||||
this.officialRole,
|
|
||||||
this.officialTitle,
|
|
||||||
this.officialDesc,
|
|
||||||
this.displayName,
|
|
||||||
});
|
|
||||||
|
|
||||||
factory Upper.fromJson(Map<String, dynamic> json) => Upper(
|
|
||||||
mid: json['mid'] as int?,
|
|
||||||
name: json['name'] as String?,
|
|
||||||
face: json['face'] as String?,
|
|
||||||
followed: json['followed'] as int?,
|
|
||||||
fans: json['fans'] as int?,
|
|
||||||
vipType: json['vip_type'] as int?,
|
|
||||||
vipStatue: json['vip_statue'] as int?,
|
|
||||||
vipDueDate: json['vip_due_date'] as int?,
|
|
||||||
vipPayType: json['vip_pay_type'] as int?,
|
|
||||||
officialRole: json['official_role'] as int?,
|
|
||||||
officialTitle: json['official_title'] as String?,
|
|
||||||
officialDesc: json['official_desc'] as String?,
|
|
||||||
displayName: json['display_name'] as String?,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import 'package:PiliPlus/models_new/space/space_fav/upper.dart';
|
import 'package:PiliPlus/models/model_owner.dart';
|
||||||
|
|
||||||
class SpaceFavItemModel {
|
class SpaceFavItemModel {
|
||||||
int? id;
|
int? id;
|
||||||
@@ -11,7 +11,7 @@ class SpaceFavItemModel {
|
|||||||
String? attrDesc;
|
String? attrDesc;
|
||||||
String? title;
|
String? title;
|
||||||
String? cover;
|
String? cover;
|
||||||
Upper? upper;
|
Owner? upper;
|
||||||
int? coverType;
|
int? coverType;
|
||||||
String? intro;
|
String? intro;
|
||||||
int? ctime;
|
int? ctime;
|
||||||
@@ -71,7 +71,7 @@ class SpaceFavItemModel {
|
|||||||
cover: json['cover'] as String?,
|
cover: json['cover'] as String?,
|
||||||
upper: json['upper'] == null
|
upper: json['upper'] == null
|
||||||
? null
|
? null
|
||||||
: Upper.fromJson(json['upper'] as Map<String, dynamic>),
|
: Owner.fromJson(json['upper'] as Map<String, dynamic>),
|
||||||
coverType: json['cover_type'] as int?,
|
coverType: json['cover_type'] as int?,
|
||||||
intro: json['intro'] as String?,
|
intro: json['intro'] as String?,
|
||||||
ctime: json['ctime'] as int?,
|
ctime: json['ctime'] as int?,
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
class Upper {
|
|
||||||
int? mid;
|
|
||||||
String? name;
|
|
||||||
String? face;
|
|
||||||
String? jumpLink;
|
|
||||||
|
|
||||||
Upper({this.mid, this.name, this.face, this.jumpLink});
|
|
||||||
|
|
||||||
factory Upper.fromJson(Map<String, dynamic> json) => Upper(
|
|
||||||
mid: json['mid'] as int?,
|
|
||||||
name: json['name'] as String?,
|
|
||||||
face: json['face'] as String?,
|
|
||||||
jumpLink: json['jump_link'] as String?,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import 'package:PiliPlus/models_new/sub/sub/upper.dart';
|
import 'package:PiliPlus/models/model_owner.dart';
|
||||||
|
|
||||||
class SubItemModel {
|
class SubItemModel {
|
||||||
int? id;
|
int? id;
|
||||||
@@ -8,7 +8,7 @@ class SubItemModel {
|
|||||||
String? attrDesc;
|
String? attrDesc;
|
||||||
String? title;
|
String? title;
|
||||||
String? cover;
|
String? cover;
|
||||||
Upper? upper;
|
Owner? upper;
|
||||||
int? coverType;
|
int? coverType;
|
||||||
String? intro;
|
String? intro;
|
||||||
int? ctime;
|
int? ctime;
|
||||||
@@ -61,7 +61,7 @@ class SubItemModel {
|
|||||||
cover: json['cover'] as String?,
|
cover: json['cover'] as String?,
|
||||||
upper: json['upper'] == null
|
upper: json['upper'] == null
|
||||||
? null
|
? null
|
||||||
: Upper.fromJson(json['upper'] as Map<String, dynamic>),
|
: Owner.fromJson(json['upper'] as Map<String, dynamic>),
|
||||||
coverType: json['cover_type'] as int?,
|
coverType: json['cover_type'] as int?,
|
||||||
intro: json['intro'] as String?,
|
intro: json['intro'] as String?,
|
||||||
ctime: json['ctime'] as int?,
|
ctime: json['ctime'] as int?,
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
class Upper {
|
|
||||||
int? mid;
|
|
||||||
String? name;
|
|
||||||
String? face;
|
|
||||||
String? jumpLink;
|
|
||||||
|
|
||||||
Upper({this.mid, this.name, this.face, this.jumpLink});
|
|
||||||
|
|
||||||
factory Upper.fromJson(Map<String, dynamic> json) => Upper(
|
|
||||||
mid: json['mid'] as int?,
|
|
||||||
name: json['name'] as String?,
|
|
||||||
face: json['face'] as String?,
|
|
||||||
jumpLink: json['jump_link'] as String?,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
class CntInfo {
|
|
||||||
int? collect;
|
|
||||||
int? play;
|
|
||||||
int? danmaku;
|
|
||||||
int? vt;
|
|
||||||
|
|
||||||
CntInfo({this.collect, this.play, this.danmaku, this.vt});
|
|
||||||
|
|
||||||
factory CntInfo.fromJson(Map<String, dynamic> json) => CntInfo(
|
|
||||||
collect: json['collect'] as int?,
|
|
||||||
play: json['play'] as int?,
|
|
||||||
danmaku: json['danmaku'] as int?,
|
|
||||||
vt: json['vt'] as int?,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
import 'package:PiliPlus/models_new/sub/sub_detail/cnt_info.dart';
|
import 'package:PiliPlus/models/model_owner.dart';
|
||||||
import 'package:PiliPlus/models_new/sub/sub_detail/upper.dart';
|
import 'package:PiliPlus/models_new/fav/fav_detail/cnt_info.dart';
|
||||||
|
|
||||||
class Info {
|
class Info {
|
||||||
int? id;
|
int? id;
|
||||||
int? seasonType;
|
int? seasonType;
|
||||||
String? title;
|
String? title;
|
||||||
String? cover;
|
String? cover;
|
||||||
Upper? upper;
|
Owner? upper;
|
||||||
CntInfo? cntInfo;
|
CntInfo? cntInfo;
|
||||||
int? mediaCount;
|
int? mediaCount;
|
||||||
String? intro;
|
String? intro;
|
||||||
@@ -31,7 +31,7 @@ class Info {
|
|||||||
cover: json['cover'] as String?,
|
cover: json['cover'] as String?,
|
||||||
upper: json['upper'] == null
|
upper: json['upper'] == null
|
||||||
? null
|
? null
|
||||||
: Upper.fromJson(json['upper'] as Map<String, dynamic>),
|
: Owner.fromJson(json['upper'] as Map<String, dynamic>),
|
||||||
cntInfo: json['cnt_info'] == null
|
cntInfo: json['cnt_info'] == null
|
||||||
? null
|
? null
|
||||||
: CntInfo.fromJson(json['cnt_info'] as Map<String, dynamic>),
|
: CntInfo.fromJson(json['cnt_info'] as Map<String, dynamic>),
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import 'package:PiliPlus/models_new/sub/sub_detail/cnt_info.dart';
|
import 'package:PiliPlus/models/model_owner.dart';
|
||||||
import 'package:PiliPlus/models_new/sub/sub_detail/upper.dart';
|
import 'package:PiliPlus/models_new/fav/fav_detail/cnt_info.dart';
|
||||||
|
|
||||||
class SubDetailItemModel {
|
class SubDetailItemModel {
|
||||||
int? id;
|
int? id;
|
||||||
@@ -8,7 +8,7 @@ class SubDetailItemModel {
|
|||||||
int? duration;
|
int? duration;
|
||||||
int? pubtime;
|
int? pubtime;
|
||||||
String? bvid;
|
String? bvid;
|
||||||
Upper? upper;
|
Owner? upper;
|
||||||
CntInfo? cntInfo;
|
CntInfo? cntInfo;
|
||||||
int? enableVt;
|
int? enableVt;
|
||||||
String? vtDisplay;
|
String? vtDisplay;
|
||||||
@@ -38,7 +38,7 @@ class SubDetailItemModel {
|
|||||||
bvid: json['bvid'] as String?,
|
bvid: json['bvid'] as String?,
|
||||||
upper: json['upper'] == null
|
upper: json['upper'] == null
|
||||||
? null
|
? null
|
||||||
: Upper.fromJson(json['upper'] as Map<String, dynamic>),
|
: Owner.fromJson(json['upper'] as Map<String, dynamic>),
|
||||||
cntInfo: json['cnt_info'] == null
|
cntInfo: json['cnt_info'] == null
|
||||||
? null
|
? null
|
||||||
: CntInfo.fromJson(json['cnt_info'] as Map<String, dynamic>),
|
: CntInfo.fromJson(json['cnt_info'] as Map<String, dynamic>),
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
class Upper {
|
|
||||||
int? mid;
|
|
||||||
String? name;
|
|
||||||
|
|
||||||
Upper({this.mid, this.name});
|
|
||||||
|
|
||||||
factory Upper.fromJson(Map<String, dynamic> json) => Upper(
|
|
||||||
mid: json['mid'] as int?,
|
|
||||||
name: json['name'] as String?,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,13 +1,12 @@
|
|||||||
import 'package:PiliPlus/http/fav.dart';
|
import 'package:PiliPlus/http/fav.dart';
|
||||||
import 'package:PiliPlus/http/loading_state.dart';
|
import 'package:PiliPlus/http/loading_state.dart';
|
||||||
import 'package:PiliPlus/models_new/fav/fav_video/data.dart';
|
import 'package:PiliPlus/models_new/fav/fav_folder/data.dart';
|
||||||
import 'package:PiliPlus/models_new/fav/fav_video/list.dart';
|
import 'package:PiliPlus/models_new/fav/fav_folder/list.dart';
|
||||||
import 'package:PiliPlus/pages/common/common_list_controller.dart';
|
import 'package:PiliPlus/pages/common/common_list_controller.dart';
|
||||||
import 'package:PiliPlus/services/account_service.dart';
|
import 'package:PiliPlus/services/account_service.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
class FavController
|
class FavController extends CommonListController<FavFolderData, FavFolderInfo> {
|
||||||
extends CommonListController<FavVideoData, FavVideoItemModel> {
|
|
||||||
AccountService accountService = Get.find<AccountService>();
|
AccountService accountService = Get.find<AccountService>();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -26,12 +25,12 @@ class FavController
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<FavVideoItemModel>? getDataList(FavVideoData response) {
|
List<FavFolderInfo>? getDataList(FavFolderData response) {
|
||||||
return response.list;
|
return response.list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool customHandleResponse(bool isRefresh, Success<FavVideoData> response) {
|
bool customHandleResponse(bool isRefresh, Success<FavFolderData> response) {
|
||||||
if (response.response.hasMore == false) {
|
if (response.response.hasMore == false) {
|
||||||
isEnd = true;
|
isEnd = true;
|
||||||
}
|
}
|
||||||
@@ -39,7 +38,7 @@ class FavController
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<LoadingState<FavVideoData>> customGetData() => FavHttp.userfavFolder(
|
Future<LoadingState<FavFolderData>> customGetData() => FavHttp.userfavFolder(
|
||||||
pn: page,
|
pn: page,
|
||||||
ps: 20,
|
ps: 20,
|
||||||
mid: accountService.mid,
|
mid: accountService.mid,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import 'package:PiliPlus/common/skeleton/video_card_h.dart';
|
|||||||
import 'package:PiliPlus/common/widgets/loading_widget/http_error.dart';
|
import 'package:PiliPlus/common/widgets/loading_widget/http_error.dart';
|
||||||
import 'package:PiliPlus/common/widgets/refresh_indicator.dart';
|
import 'package:PiliPlus/common/widgets/refresh_indicator.dart';
|
||||||
import 'package:PiliPlus/http/loading_state.dart';
|
import 'package:PiliPlus/http/loading_state.dart';
|
||||||
import 'package:PiliPlus/models_new/fav/fav_video/list.dart';
|
import 'package:PiliPlus/models_new/fav/fav_folder/list.dart';
|
||||||
import 'package:PiliPlus/pages/fav/video/controller.dart';
|
import 'package:PiliPlus/pages/fav/video/controller.dart';
|
||||||
import 'package:PiliPlus/pages/fav/video/widgets/item.dart';
|
import 'package:PiliPlus/pages/fav/video/widgets/item.dart';
|
||||||
import 'package:PiliPlus/utils/grid.dart';
|
import 'package:PiliPlus/utils/grid.dart';
|
||||||
@@ -48,7 +48,7 @@ class _FavVideoPageState extends State<FavVideoPage>
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildBody(LoadingState<List<FavVideoItemModel>?> loadingState) {
|
Widget _buildBody(LoadingState<List<FavFolderInfo>?> loadingState) {
|
||||||
return switch (loadingState) {
|
return switch (loadingState) {
|
||||||
Loading() => SliverGrid(
|
Loading() => SliverGrid(
|
||||||
gridDelegate: Grid.videoCardHDelegate(context),
|
gridDelegate: Grid.videoCardHDelegate(context),
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import 'package:PiliPlus/common/constants.dart';
|
import 'package:PiliPlus/common/constants.dart';
|
||||||
import 'package:PiliPlus/common/widgets/image/image_save.dart';
|
import 'package:PiliPlus/common/widgets/image/image_save.dart';
|
||||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||||
import 'package:PiliPlus/models_new/fav/fav_video/list.dart';
|
import 'package:PiliPlus/models_new/fav/fav_folder/list.dart';
|
||||||
import 'package:PiliPlus/utils/utils.dart';
|
import 'package:PiliPlus/utils/utils.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class FavVideoItem extends StatelessWidget {
|
class FavVideoItem extends StatelessWidget {
|
||||||
final String heroTag;
|
final String heroTag;
|
||||||
final FavVideoItemModel item;
|
final FavFolderInfo item;
|
||||||
final VoidCallback? onTap;
|
final VoidCallback? onTap;
|
||||||
final VoidCallback? onLongPress;
|
final VoidCallback? onLongPress;
|
||||||
|
|
||||||
@@ -68,7 +68,7 @@ class FavVideoItem extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
item.title!,
|
item.title,
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
letterSpacing: 0.3,
|
letterSpacing: 0.3,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import 'package:PiliPlus/common/widgets/scroll_physics.dart';
|
import 'package:PiliPlus/common/widgets/scroll_physics.dart';
|
||||||
import 'package:PiliPlus/http/loading_state.dart';
|
import 'package:PiliPlus/http/loading_state.dart';
|
||||||
import 'package:PiliPlus/models/common/fav_type.dart';
|
import 'package:PiliPlus/models/common/fav_type.dart';
|
||||||
import 'package:PiliPlus/models_new/fav/fav_video/list.dart';
|
import 'package:PiliPlus/models_new/fav/fav_folder/list.dart';
|
||||||
import 'package:PiliPlus/pages/fav/article/controller.dart';
|
import 'package:PiliPlus/pages/fav/article/controller.dart';
|
||||||
import 'package:PiliPlus/pages/fav/topic/controller.dart';
|
import 'package:PiliPlus/pages/fav/topic/controller.dart';
|
||||||
import 'package:PiliPlus/pages/fav/video/controller.dart';
|
import 'package:PiliPlus/pages/fav/video/controller.dart';
|
||||||
@@ -60,7 +60,7 @@ class _FavPageState extends State<FavPage> with SingleTickerProviderStateMixin {
|
|||||||
onPressed: () => Get.toNamed('/createFav')?.then(
|
onPressed: () => Get.toNamed('/createFav')?.then(
|
||||||
(data) {
|
(data) {
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
List<FavVideoItemModel>? list =
|
List<FavFolderInfo>? list =
|
||||||
_favController.loadingState.value.isSuccess
|
_favController.loadingState.value.isSuccess
|
||||||
? _favController.loadingState.value.data
|
? _favController.loadingState.value.data
|
||||||
: null;
|
: null;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import 'package:PiliPlus/common/widgets/loading_widget/http_error.dart';
|
import 'package:PiliPlus/common/widgets/loading_widget/http_error.dart';
|
||||||
import 'package:PiliPlus/http/fav.dart';
|
import 'package:PiliPlus/http/fav.dart';
|
||||||
import 'package:PiliPlus/http/msg.dart';
|
import 'package:PiliPlus/http/msg.dart';
|
||||||
import 'package:PiliPlus/models_new/fav/fav_folder_info/data.dart';
|
import 'package:PiliPlus/models_new/fav/fav_folder/list.dart';
|
||||||
import 'package:PiliPlus/utils/utils.dart';
|
import 'package:PiliPlus/utils/utils.dart';
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
import 'package:easy_debounce/easy_throttle.dart';
|
import 'package:easy_debounce/easy_throttle.dart';
|
||||||
@@ -40,12 +40,12 @@ class _CreateFavPageState extends State<CreateFavPage> {
|
|||||||
|
|
||||||
void _getFolderInfo() {
|
void _getFolderInfo() {
|
||||||
_errMsg = null;
|
_errMsg = null;
|
||||||
FavHttp.folderInfo(mediaId: _mediaId).then((res) {
|
FavHttp.favFolderInfo(mediaId: _mediaId).then((res) {
|
||||||
if (res['status']) {
|
if (res['status']) {
|
||||||
FolderInfo data = res['data'];
|
FavFolderInfo data = res['data'];
|
||||||
_titleController.text = data.title!;
|
_titleController.text = data.title;
|
||||||
_introController.text = data.intro ?? '';
|
_introController.text = data.intro ?? '';
|
||||||
_isPublic = Utils.isPublicFav(data.attr!);
|
_isPublic = Utils.isPublicFav(data.attr);
|
||||||
_cover = data.cover;
|
_cover = data.cover;
|
||||||
_attr = data.attr;
|
_attr = data.attr;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import 'package:PiliPlus/http/fav.dart';
|
|||||||
import 'package:PiliPlus/http/loading_state.dart';
|
import 'package:PiliPlus/http/loading_state.dart';
|
||||||
import 'package:PiliPlus/models_new/fav/fav_detail/data.dart';
|
import 'package:PiliPlus/models_new/fav/fav_detail/data.dart';
|
||||||
import 'package:PiliPlus/models_new/fav/fav_detail/media.dart';
|
import 'package:PiliPlus/models_new/fav/fav_detail/media.dart';
|
||||||
import 'package:PiliPlus/models_new/fav/fav_video/list.dart';
|
import 'package:PiliPlus/models_new/fav/fav_folder/list.dart';
|
||||||
import 'package:PiliPlus/pages/common/multi_select_controller.dart';
|
import 'package:PiliPlus/pages/common/multi_select_controller.dart';
|
||||||
import 'package:PiliPlus/pages/fav_sort/view.dart';
|
import 'package:PiliPlus/pages/fav_sort/view.dart';
|
||||||
import 'package:PiliPlus/services/account_service.dart';
|
import 'package:PiliPlus/services/account_service.dart';
|
||||||
@@ -17,7 +17,7 @@ class FavDetailController
|
|||||||
extends MultiSelectController<FavDetailData, FavDetailItemModel> {
|
extends MultiSelectController<FavDetailData, FavDetailItemModel> {
|
||||||
late int mediaId;
|
late int mediaId;
|
||||||
late String heroTag;
|
late String heroTag;
|
||||||
final Rx<FavVideoItemModel> item = FavVideoItemModel().obs;
|
final Rx<FavFolderInfo> folderInfo = FavFolderInfo().obs;
|
||||||
final Rx<bool?> isOwner = Rx<bool?>(null);
|
final Rx<bool?> isOwner = Rx<bool?>(null);
|
||||||
|
|
||||||
AccountService accountService = Get.find<AccountService>();
|
AccountService accountService = Get.find<AccountService>();
|
||||||
@@ -42,7 +42,7 @@ class FavDetailController
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void checkIsEnd(int length) {
|
void checkIsEnd(int length) {
|
||||||
if (item.value.mediaCount != null && length >= item.value.mediaCount!) {
|
if (length >= folderInfo.value.mediaCount) {
|
||||||
isEnd = true;
|
isEnd = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -51,7 +51,7 @@ class FavDetailController
|
|||||||
bool customHandleResponse(bool isRefresh, Success<FavDetailData> response) {
|
bool customHandleResponse(bool isRefresh, Success<FavDetailData> response) {
|
||||||
FavDetailData data = response.response;
|
FavDetailData data = response.response;
|
||||||
if (isRefresh) {
|
if (isRefresh) {
|
||||||
item.value = data.info ?? FavVideoItemModel();
|
folderInfo.value = data.info!;
|
||||||
isOwner.value = data.info?.mid == accountService.mid;
|
isOwner.value = data.info?.mid == accountService.mid;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -63,11 +63,12 @@ class FavDetailController
|
|||||||
delIds: mediaId.toString(),
|
delIds: mediaId.toString(),
|
||||||
);
|
);
|
||||||
if (result['status']) {
|
if (result['status']) {
|
||||||
List<FavDetailItemModel> dataList = loadingState.value.data!;
|
folderInfo
|
||||||
item.value.mediaCount = item.value.mediaCount! - 1;
|
..value.mediaCount -= 1
|
||||||
item.refresh();
|
..refresh();
|
||||||
dataList.removeAt(index);
|
loadingState
|
||||||
loadingState.refresh();
|
..value.data!.removeAt(index)
|
||||||
|
..refresh();
|
||||||
SmartDialog.showToast('取消收藏');
|
SmartDialog.showToast('取消收藏');
|
||||||
} else {
|
} else {
|
||||||
SmartDialog.showToast(result['msg']);
|
SmartDialog.showToast(result['msg']);
|
||||||
@@ -113,8 +114,9 @@ class FavDetailController
|
|||||||
List<FavDetailItemModel> dataList = loadingState.value.data!;
|
List<FavDetailItemModel> dataList = loadingState.value.data!;
|
||||||
List<FavDetailItemModel> remainList =
|
List<FavDetailItemModel> remainList =
|
||||||
dataList.toSet().difference(list.toSet()).toList();
|
dataList.toSet().difference(list.toSet()).toList();
|
||||||
item.value.mediaCount = item.value.mediaCount! - list.length;
|
folderInfo
|
||||||
item.refresh();
|
..value.mediaCount -= list.length
|
||||||
|
..refresh();
|
||||||
if (remainList.isNotEmpty) {
|
if (remainList.isNotEmpty) {
|
||||||
loadingState.value = Success(remainList);
|
loadingState.value = Success(remainList);
|
||||||
} else {
|
} else {
|
||||||
@@ -153,10 +155,10 @@ class FavDetailController
|
|||||||
'videoItem': element,
|
'videoItem': element,
|
||||||
'heroTag': Utils.makeHeroTag(element.bvid),
|
'heroTag': Utils.makeHeroTag(element.bvid),
|
||||||
'sourceType': 'fav',
|
'sourceType': 'fav',
|
||||||
'mediaId': item.value.id,
|
'mediaId': folderInfo.value.id,
|
||||||
'oid': element.id,
|
'oid': element.id,
|
||||||
'favTitle': item.value.title,
|
'favTitle': folderInfo.value.title,
|
||||||
'count': item.value.mediaCount,
|
'count': folderInfo.value.mediaCount,
|
||||||
'desc': true,
|
'desc': true,
|
||||||
'isOwner': isOwner.value ?? false,
|
'isOwner': isOwner.value ?? false,
|
||||||
},
|
},
|
||||||
@@ -183,7 +185,7 @@ class FavDetailController
|
|||||||
: await FavHttp.favFavFolder(mediaId);
|
: await FavHttp.favFavFolder(mediaId);
|
||||||
|
|
||||||
if (res['status']) {
|
if (res['status']) {
|
||||||
item
|
folderInfo
|
||||||
..value.favState = isFav ? 0 : 1
|
..value.favState = isFav ? 0 : 1
|
||||||
..refresh();
|
..refresh();
|
||||||
}
|
}
|
||||||
@@ -205,7 +207,7 @@ class FavDetailController
|
|||||||
void onSort() {
|
void onSort() {
|
||||||
if (loadingState.value.isSuccess &&
|
if (loadingState.value.isSuccess &&
|
||||||
loadingState.value.data?.isNotEmpty == true) {
|
loadingState.value.data?.isNotEmpty == true) {
|
||||||
if ((item.value.mediaCount ?? 0) > 1000) {
|
if (folderInfo.value.mediaCount > 1000) {
|
||||||
SmartDialog.showToast('内容太多啦!超过1000不支持排序');
|
SmartDialog.showToast('内容太多啦!超过1000不支持排序');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import 'package:PiliPlus/http/fav.dart';
|
|||||||
import 'package:PiliPlus/http/loading_state.dart';
|
import 'package:PiliPlus/http/loading_state.dart';
|
||||||
import 'package:PiliPlus/models_new/fav/fav_detail/data.dart';
|
import 'package:PiliPlus/models_new/fav/fav_detail/data.dart';
|
||||||
import 'package:PiliPlus/models_new/fav/fav_detail/media.dart';
|
import 'package:PiliPlus/models_new/fav/fav_detail/media.dart';
|
||||||
import 'package:PiliPlus/models_new/fav/fav_video/list.dart';
|
import 'package:PiliPlus/models_new/fav/fav_folder/list.dart';
|
||||||
import 'package:PiliPlus/pages/dynamics_repost/view.dart';
|
import 'package:PiliPlus/pages/dynamics_repost/view.dart';
|
||||||
import 'package:PiliPlus/pages/fav_detail/controller.dart';
|
import 'package:PiliPlus/pages/fav_detail/controller.dart';
|
||||||
import 'package:PiliPlus/pages/fav_detail/widget/fav_video_card.dart';
|
import 'package:PiliPlus/pages/fav_detail/widget/fav_video_card.dart';
|
||||||
@@ -53,7 +53,7 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
|||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
resizeToAvoidBottomInset: false,
|
resizeToAvoidBottomInset: false,
|
||||||
floatingActionButton: Obx(
|
floatingActionButton: Obx(
|
||||||
() => (_favDetailController.item.value.mediaCount ?? -1) > 0
|
() => _favDetailController.folderInfo.value.mediaCount > 0
|
||||||
? FloatingActionButton.extended(
|
? FloatingActionButton.extended(
|
||||||
onPressed: _favDetailController.toViewPlayAll,
|
onPressed: _favDetailController.toViewPlayAll,
|
||||||
label: const Text('播放全部'),
|
label: const Text('播放全部'),
|
||||||
@@ -112,11 +112,11 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
_favDetailController.item.value.title ?? '',
|
_favDetailController.folderInfo.value.title,
|
||||||
style: theme.textTheme.titleMedium,
|
style: theme.textTheme.titleMedium,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
'共${_favDetailController.item.value.mediaCount}条视频',
|
'共${_favDetailController.folderInfo.value.mediaCount}条视频',
|
||||||
style: theme.textTheme.labelMedium,
|
style: theme.textTheme.labelMedium,
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
@@ -128,35 +128,42 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Widget> _actions(ThemeData theme) => [
|
List<Widget> _actions(ThemeData theme) {
|
||||||
IconButton(
|
return [
|
||||||
tooltip: '搜索',
|
IconButton(
|
||||||
onPressed: () => Get.toNamed(
|
tooltip: '搜索',
|
||||||
|
onPressed: () {
|
||||||
|
final folderInfo = _favDetailController.folderInfo.value;
|
||||||
|
Get.toNamed(
|
||||||
'/favSearch',
|
'/favSearch',
|
||||||
arguments: {
|
arguments: {
|
||||||
'type': 0,
|
'type': 0,
|
||||||
'mediaId': int.parse(mediaId),
|
'mediaId': int.parse(mediaId),
|
||||||
'title': _favDetailController.item.value.title,
|
'title': folderInfo.title,
|
||||||
'count': _favDetailController.item.value.mediaCount,
|
'count': folderInfo.mediaCount,
|
||||||
'isOwner': _favDetailController.isOwner.value ?? false,
|
'isOwner': _favDetailController.isOwner.value ?? false,
|
||||||
},
|
},
|
||||||
),
|
);
|
||||||
icon: const Icon(Icons.search_outlined),
|
},
|
||||||
),
|
icon: const Icon(Icons.search_outlined),
|
||||||
Obx(
|
),
|
||||||
() => _favDetailController.item.value.attr == null ||
|
Obx(() {
|
||||||
!Utils.isPublicFav(_favDetailController.item.value.attr!)
|
final attr = _favDetailController.folderInfo.value.attr;
|
||||||
? const SizedBox.shrink()
|
return attr == -1 || !Utils.isPublicFav(attr)
|
||||||
: IconButton(
|
? const SizedBox.shrink()
|
||||||
iconSize: 22,
|
: IconButton(
|
||||||
onPressed: () => Utils.shareText(
|
iconSize: 22,
|
||||||
'https://www.bilibili.com/medialist/detail/ml${_favDetailController.mediaId}'),
|
tooltip: '分享',
|
||||||
icon: const Icon(Icons.share),
|
onPressed: () => Utils.shareText(
|
||||||
),
|
'https://www.bilibili.com/medialist/detail/ml${_favDetailController.mediaId}'),
|
||||||
),
|
icon: const Icon(Icons.share),
|
||||||
PopupMenuButton(
|
);
|
||||||
icon: const Icon(Icons.more_vert),
|
}),
|
||||||
itemBuilder: (context) => [
|
PopupMenuButton(
|
||||||
|
icon: const Icon(Icons.more_vert),
|
||||||
|
itemBuilder: (context) {
|
||||||
|
final folderInfo = _favDetailController.folderInfo.value;
|
||||||
|
return [
|
||||||
if (_favDetailController.isOwner.value == true) ...[
|
if (_favDetailController.isOwner.value == true) ...[
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
onTap: _favDetailController.onSort,
|
onTap: _favDetailController.onSort,
|
||||||
@@ -167,20 +174,19 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
|||||||
'/createFav',
|
'/createFav',
|
||||||
parameters: {'mediaId': mediaId},
|
parameters: {'mediaId': mediaId},
|
||||||
)?.then((res) {
|
)?.then((res) {
|
||||||
if (res is FavVideoItemModel) {
|
if (res is FavFolderInfo) {
|
||||||
_favDetailController.item.value = res;
|
_favDetailController.folderInfo.value = res;
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
child: const Text('编辑信息'),
|
child: const Text('编辑信息'),
|
||||||
),
|
),
|
||||||
] else
|
] else
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
onTap: () => _favDetailController
|
onTap: () =>
|
||||||
.onFav(_favDetailController.item.value.favState == 1),
|
_favDetailController.onFav(folderInfo.favState == 1),
|
||||||
child: Text(
|
child: Text('${folderInfo.favState == 1 ? '取消' : ''}收藏'),
|
||||||
'${_favDetailController.item.value.favState == 1 ? '取消' : ''}收藏'),
|
|
||||||
),
|
),
|
||||||
if (Utils.isPublicFav(_favDetailController.item.value.attr ?? 0))
|
if (Utils.isPublicFav(folderInfo.attr))
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
onTap: () => showModalBottomSheet(
|
onTap: () => showModalBottomSheet(
|
||||||
context: context,
|
context: context,
|
||||||
@@ -189,9 +195,9 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
|||||||
builder: (context) => RepostPanel(
|
builder: (context) => RepostPanel(
|
||||||
rid: _favDetailController.mediaId,
|
rid: _favDetailController.mediaId,
|
||||||
dynType: 4300,
|
dynType: 4300,
|
||||||
pic: _favDetailController.item.value.cover,
|
pic: folderInfo.cover,
|
||||||
title: _favDetailController.item.value.title,
|
title: folderInfo.title,
|
||||||
uname: _favDetailController.item.value.upper?.name,
|
uname: folderInfo.upper?.name,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: const Text('分享至动态'),
|
child: const Text('分享至动态'),
|
||||||
@@ -201,8 +207,7 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
|||||||
onTap: _favDetailController.cleanFav,
|
onTap: _favDetailController.cleanFav,
|
||||||
child: const Text('清除失效内容'),
|
child: const Text('清除失效内容'),
|
||||||
),
|
),
|
||||||
if (!Utils.isDefaultFav(
|
if (!Utils.isDefaultFav(folderInfo.attr)) ...[
|
||||||
_favDetailController.item.value.attr)) ...[
|
|
||||||
const PopupMenuDivider(height: 12),
|
const PopupMenuDivider(height: 12),
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
onTap: () => showConfirmDialog(
|
onTap: () => showConfirmDialog(
|
||||||
@@ -227,10 +232,12 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
];
|
||||||
),
|
},
|
||||||
const SizedBox(width: 10),
|
),
|
||||||
];
|
const SizedBox(width: 10),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
List<Widget> _selectActions(ThemeData theme) => [
|
List<Widget> _selectActions(ThemeData theme) => [
|
||||||
TextButton(
|
TextButton(
|
||||||
@@ -308,7 +315,7 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
|||||||
height: 110,
|
height: 110,
|
||||||
child: Obx(
|
child: Obx(
|
||||||
() {
|
() {
|
||||||
final item = _favDetailController.item.value;
|
final folderInfo = _favDetailController.folderInfo.value;
|
||||||
return Row(
|
return Row(
|
||||||
spacing: 12,
|
spacing: 12,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
@@ -321,7 +328,7 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
|||||||
child: NetworkImgLayer(
|
child: NetworkImgLayer(
|
||||||
width: 176,
|
width: 176,
|
||||||
height: 110,
|
height: 110,
|
||||||
src: item.cover,
|
src: folderInfo.cover,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Positioned(
|
Positioned(
|
||||||
@@ -331,8 +338,7 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
|||||||
if (_favDetailController.isOwner.value != false) {
|
if (_favDetailController.isOwner.value != false) {
|
||||||
return const SizedBox.shrink();
|
return const SizedBox.shrink();
|
||||||
}
|
}
|
||||||
bool isFav =
|
bool isFav = folderInfo.favState == 1;
|
||||||
_favDetailController.item.value.favState == 1;
|
|
||||||
return iconButton(
|
return iconButton(
|
||||||
context: context,
|
context: context,
|
||||||
size: 28,
|
size: 28,
|
||||||
@@ -352,55 +358,49 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
|||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
if (item.title != null)
|
if (folderInfo.title.isNotEmpty)
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
spacing: 4,
|
spacing: 4,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
item.title!,
|
folderInfo.title,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: theme.textTheme.titleMedium!.fontSize,
|
fontSize: theme.textTheme.titleMedium!.fontSize,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () =>
|
onTap: () => Get.toNamed(
|
||||||
Get.toNamed('/member?mid=${item.upper!.mid}'),
|
'/member?mid=${folderInfo.upper!.mid}'),
|
||||||
child: Text(
|
child: Text(
|
||||||
item.upper!.name!,
|
folderInfo.upper!.name!,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: theme.colorScheme.primary,
|
color: theme.colorScheme.primary,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (item.intro?.isNotEmpty == true)
|
if (folderInfo.intro?.isNotEmpty == true)
|
||||||
Text(
|
Text(
|
||||||
item.intro!,
|
folderInfo.intro!,
|
||||||
style: style,
|
style: style,
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
if (item.attr != null) ...[
|
Expanded(
|
||||||
Expanded(
|
child: Align(
|
||||||
child: Align(
|
alignment: Alignment.bottomLeft,
|
||||||
alignment: Alignment.bottomLeft,
|
child: Text(
|
||||||
child: Text(
|
'共${folderInfo.mediaCount}条视频 · ${Utils.isPublicFavText(folderInfo.attr)}',
|
||||||
'共${item.mediaCount}条视频 · ${Utils.isPublicFavText(item.attr)}',
|
textAlign: TextAlign.end,
|
||||||
textAlign: TextAlign.end,
|
style: style,
|
||||||
style: style,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
else
|
|
||||||
SizedBox.shrink(
|
|
||||||
key: ValueKey(_favDetailController.item.value),
|
|
||||||
)
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@@ -455,23 +455,26 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
|||||||
item.type!,
|
item.type!,
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
onViewFav: () => PageUtils.toVideoPage(
|
onViewFav: () {
|
||||||
'bvid=${item.bvid}&cid=${item.ugc?.firstCid}',
|
final folderInfo =
|
||||||
arguments: {
|
_favDetailController.folderInfo.value;
|
||||||
'videoItem': item,
|
PageUtils.toVideoPage(
|
||||||
'heroTag': Utils.makeHeroTag(item.bvid),
|
'bvid=${item.bvid}&cid=${item.ugc?.firstCid}',
|
||||||
'sourceType': 'fav',
|
arguments: {
|
||||||
'mediaId': _favDetailController.item.value.id,
|
'videoItem': item,
|
||||||
'oid': item.id,
|
'heroTag': Utils.makeHeroTag(item.bvid),
|
||||||
'favTitle': _favDetailController.item.value.title,
|
'sourceType': 'fav',
|
||||||
'count':
|
'mediaId': folderInfo.id,
|
||||||
_favDetailController.item.value.mediaCount,
|
'oid': item.id,
|
||||||
'desc': true,
|
'favTitle': folderInfo.title,
|
||||||
'isContinuePlaying': index != 0,
|
'count': folderInfo.mediaCount,
|
||||||
'isOwner':
|
'desc': true,
|
||||||
_favDetailController.isOwner.value ?? false,
|
'isContinuePlaying': index != 0,
|
||||||
},
|
'isOwner':
|
||||||
),
|
_favDetailController.isOwner.value ?? false,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
onTap: _favDetailController.enableMultiSelect.value
|
onTap: _favDetailController.enableMultiSelect.value
|
||||||
? () => _favDetailController.onSelect(index)
|
? () => _favDetailController.onSelect(index)
|
||||||
: null,
|
: null,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import 'package:PiliPlus/http/fav.dart';
|
import 'package:PiliPlus/http/fav.dart';
|
||||||
import 'package:PiliPlus/http/loading_state.dart';
|
import 'package:PiliPlus/http/loading_state.dart';
|
||||||
import 'package:PiliPlus/models_new/fav/fav_video/list.dart';
|
import 'package:PiliPlus/models_new/fav/fav_folder/list.dart';
|
||||||
import 'package:PiliPlus/pages/fav/video/controller.dart';
|
import 'package:PiliPlus/pages/fav/video/controller.dart';
|
||||||
import 'package:PiliPlus/pages/fav/video/widgets/item.dart';
|
import 'package:PiliPlus/pages/fav/video/widgets/item.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -20,8 +20,8 @@ class _FavFolderSortPageState extends State<FavFolderSortPage> {
|
|||||||
FavController get _favController => widget.favController;
|
FavController get _favController => widget.favController;
|
||||||
|
|
||||||
final GlobalKey _key = GlobalKey();
|
final GlobalKey _key = GlobalKey();
|
||||||
late List<FavVideoItemModel> sortList =
|
late List<FavFolderInfo> sortList =
|
||||||
List<FavVideoItemModel>.from(_favController.loadingState.value.data!);
|
List<FavFolderInfo>.from(_favController.loadingState.value.data!);
|
||||||
|
|
||||||
final ScrollController _scrollController = ScrollController();
|
final ScrollController _scrollController = ScrollController();
|
||||||
|
|
||||||
@@ -34,8 +34,7 @@ class _FavFolderSortPageState extends State<FavFolderSortPage> {
|
|||||||
_favController.onLoadMore().whenComplete(() {
|
_favController.onLoadMore().whenComplete(() {
|
||||||
try {
|
try {
|
||||||
if (_favController.loadingState.value.isSuccess) {
|
if (_favController.loadingState.value.isSuccess) {
|
||||||
List<FavVideoItemModel> list =
|
List<FavFolderInfo> list = _favController.loadingState.value.data!;
|
||||||
_favController.loadingState.value.data!;
|
|
||||||
sortList.addAll(list.sublist(sortList.length));
|
sortList.addAll(list.sublist(sortList.length));
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
setState(() {});
|
setState(() {});
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import 'package:PiliPlus/common/widgets/loading_widget/http_error.dart';
|
import 'package:PiliPlus/common/widgets/loading_widget/http_error.dart';
|
||||||
import 'package:PiliPlus/models_new/fav/fav_video/data.dart';
|
import 'package:PiliPlus/models_new/fav/fav_folder/data.dart';
|
||||||
import 'package:PiliPlus/utils/feed_back.dart';
|
import 'package:PiliPlus/utils/feed_back.dart';
|
||||||
import 'package:PiliPlus/utils/utils.dart';
|
import 'package:PiliPlus/utils/utils.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -45,7 +45,7 @@ class _FavPanelState extends State<FavPanel> {
|
|||||||
TextButton.icon(
|
TextButton.icon(
|
||||||
onPressed: () => Get.toNamed('/createFav')?.then((data) {
|
onPressed: () => Get.toNamed('/createFav')?.then((data) {
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
(widget.ctr?.favFolderData as Rx<FavVideoData>)
|
(widget.ctr?.favFolderData as Rx<FavFolderData>)
|
||||||
..value.list?.insert(1, data)
|
..value.list?.insert(1, data)
|
||||||
..refresh();
|
..refresh();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ class _FavSortPageState extends State<FavSortPage> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Text('排序: ${_favDetailController.item.value.title}'),
|
title: Text('排序: ${_favDetailController.folderInfo.value.title}'),
|
||||||
actions: [
|
actions: [
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
import 'package:PiliPlus/http/fav.dart';
|
import 'package:PiliPlus/http/fav.dart';
|
||||||
import 'package:PiliPlus/http/loading_state.dart';
|
import 'package:PiliPlus/http/loading_state.dart';
|
||||||
import 'package:PiliPlus/models_new/fav/fav_video/data.dart';
|
import 'package:PiliPlus/models_new/fav/fav_folder/data.dart';
|
||||||
import 'package:PiliPlus/pages/common/common_data_controller.dart';
|
import 'package:PiliPlus/pages/common/common_data_controller.dart';
|
||||||
import 'package:PiliPlus/services/account_service.dart';
|
import 'package:PiliPlus/services/account_service.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
class MediaController extends CommonDataController<FavVideoData, FavVideoData> {
|
class MediaController
|
||||||
|
extends CommonDataController<FavFolderData, FavFolderData> {
|
||||||
final list = <({IconData icon, String title, VoidCallback onTap})>[
|
final list = <({IconData icon, String title, VoidCallback onTap})>[
|
||||||
(
|
(
|
||||||
icon: Icons.history,
|
icon: Icons.history,
|
||||||
@@ -47,14 +48,14 @@ class MediaController extends CommonDataController<FavVideoData, FavVideoData> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool customHandleResponse(bool isRefresh, Success<FavVideoData> response) {
|
bool customHandleResponse(bool isRefresh, Success<FavFolderData> response) {
|
||||||
count.value = response.response.count ?? -1;
|
count.value = response.response.count ?? -1;
|
||||||
loadingState.value = response;
|
loadingState.value = response;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<LoadingState<FavVideoData>> customGetData() {
|
Future<LoadingState<FavFolderData>> customGetData() {
|
||||||
return FavHttp.userfavFolder(
|
return FavHttp.userfavFolder(
|
||||||
pn: 1,
|
pn: 1,
|
||||||
ps: 5,
|
ps: 5,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import 'dart:async';
|
|||||||
|
|
||||||
import 'package:PiliPlus/http/loading_state.dart';
|
import 'package:PiliPlus/http/loading_state.dart';
|
||||||
import 'package:PiliPlus/models/common/nav_bar_config.dart';
|
import 'package:PiliPlus/models/common/nav_bar_config.dart';
|
||||||
import 'package:PiliPlus/models_new/fav/fav_video/list.dart';
|
import 'package:PiliPlus/models_new/fav/fav_folder/list.dart';
|
||||||
import 'package:PiliPlus/pages/common/common_page.dart';
|
import 'package:PiliPlus/pages/common/common_page.dart';
|
||||||
import 'package:PiliPlus/pages/main/controller.dart';
|
import 'package:PiliPlus/pages/main/controller.dart';
|
||||||
import 'package:PiliPlus/pages/media/controller.dart';
|
import 'package:PiliPlus/pages/media/controller.dart';
|
||||||
@@ -169,7 +169,7 @@ class _MediaPageState extends CommonPageState<MediaPage, MediaController>
|
|||||||
Loading() => const SizedBox.shrink(),
|
Loading() => const SizedBox.shrink(),
|
||||||
Success(:var response) => Builder(
|
Success(:var response) => Builder(
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
List<FavVideoItemModel>? favFolderList = response.list;
|
List<FavFolderInfo>? favFolderList = response.list;
|
||||||
if (favFolderList.isNullOrEmpty) {
|
if (favFolderList.isNullOrEmpty) {
|
||||||
return const SizedBox.shrink();
|
return const SizedBox.shrink();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||||
import 'package:PiliPlus/models_new/fav/fav_video/list.dart';
|
import 'package:PiliPlus/models_new/fav/fav_folder/list.dart';
|
||||||
import 'package:PiliPlus/utils/utils.dart';
|
import 'package:PiliPlus/utils/utils.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -12,7 +12,7 @@ class FavFolderItem extends StatelessWidget {
|
|||||||
required this.heroTag,
|
required this.heroTag,
|
||||||
});
|
});
|
||||||
|
|
||||||
final FavVideoItemModel item;
|
final FavFolderInfo item;
|
||||||
final VoidCallback callback;
|
final VoidCallback callback;
|
||||||
final String heroTag;
|
final String heroTag;
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import 'package:PiliPlus/common/widgets/image/image_save.dart';
|
|||||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||||
import 'package:PiliPlus/models_new/space/space_fav/list.dart';
|
import 'package:PiliPlus/models_new/space/space_fav/list.dart';
|
||||||
import 'package:PiliPlus/models_new/sub/sub/list.dart';
|
import 'package:PiliPlus/models_new/sub/sub/list.dart';
|
||||||
import 'package:PiliPlus/models_new/sub/sub/upper.dart';
|
|
||||||
import 'package:PiliPlus/utils/utils.dart';
|
import 'package:PiliPlus/utils/utils.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -43,11 +42,7 @@ class MemberFavItem extends StatelessWidget {
|
|||||||
type: item.type,
|
type: item.type,
|
||||||
title: item.title,
|
title: item.title,
|
||||||
cover: item.cover,
|
cover: item.cover,
|
||||||
upper: Upper(
|
upper: item.upper,
|
||||||
mid: item.upper?.mid,
|
|
||||||
name: item.upper?.name,
|
|
||||||
face: item.upper?.face,
|
|
||||||
),
|
|
||||||
mediaCount: item.mediaCount,
|
mediaCount: item.mediaCount,
|
||||||
viewCount: item.viewCount,
|
viewCount: item.viewCount,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import 'package:get/get.dart';
|
|||||||
|
|
||||||
class SubDetailController
|
class SubDetailController
|
||||||
extends CommonListController<SubDetailData, SubDetailItemModel> {
|
extends CommonListController<SubDetailData, SubDetailItemModel> {
|
||||||
late SubItemModel item;
|
late SubItemModel subInfo;
|
||||||
|
|
||||||
late int id;
|
late int id;
|
||||||
late String heroTag;
|
late String heroTag;
|
||||||
@@ -19,9 +19,9 @@ class SubDetailController
|
|||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() {
|
||||||
super.onInit();
|
super.onInit();
|
||||||
item = Get.arguments;
|
subInfo = Get.arguments;
|
||||||
mediaCount = (item.mediaCount ?? 0).obs;
|
mediaCount = (subInfo.mediaCount ?? 0).obs;
|
||||||
playCount = (item.viewCount ?? 0).obs;
|
playCount = (subInfo.viewCount ?? 0).obs;
|
||||||
id = int.parse(Get.parameters['id']!);
|
id = int.parse(Get.parameters['id']!);
|
||||||
heroTag = Get.parameters['heroTag']!;
|
heroTag = Get.parameters['heroTag']!;
|
||||||
queryData();
|
queryData();
|
||||||
@@ -42,7 +42,7 @@ class SubDetailController
|
|||||||
@override
|
@override
|
||||||
bool customHandleResponse(bool isRefresh, Success<SubDetailData> response) {
|
bool customHandleResponse(bool isRefresh, Success<SubDetailData> response) {
|
||||||
mediaCount.value = response.response.info!.mediaCount!;
|
mediaCount.value = response.response.info!.mediaCount!;
|
||||||
if (item.type == 11) {
|
if (subInfo.type == 11) {
|
||||||
playCount.value = response.response.info!.cntInfo!.play!;
|
playCount.value = response.response.info!.cntInfo!.play!;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -50,7 +50,7 @@ class SubDetailController
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Future<LoadingState<SubDetailData>> customGetData() {
|
Future<LoadingState<SubDetailData>> customGetData() {
|
||||||
if (item.type == 11) {
|
if (subInfo.type == 11) {
|
||||||
return FavHttp.favResourceList(
|
return FavHttp.favResourceList(
|
||||||
id: id,
|
id: id,
|
||||||
ps: 20,
|
ps: 20,
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ class _SubDetailPageState extends State<SubDetailPage> {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
_subDetailController.item.title!,
|
_subDetailController.subInfo.title!,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: theme.textTheme.titleMedium,
|
style: theme.textTheme.titleMedium,
|
||||||
@@ -136,7 +136,7 @@ class _SubDetailPageState extends State<SubDetailPage> {
|
|||||||
child: NetworkImgLayer(
|
child: NetworkImgLayer(
|
||||||
width: 176,
|
width: 176,
|
||||||
height: 110,
|
height: 110,
|
||||||
src: _subDetailController.item.cover,
|
src: _subDetailController.subInfo.cover,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
@@ -145,7 +145,7 @@ class _SubDetailPageState extends State<SubDetailPage> {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
_subDetailController.item.title!,
|
_subDetailController.subInfo.title!,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: theme.textTheme.titleMedium!.fontSize,
|
fontSize: theme.textTheme.titleMedium!.fontSize,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
@@ -154,14 +154,14 @@ class _SubDetailPageState extends State<SubDetailPage> {
|
|||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.toNamed(
|
Get.toNamed(
|
||||||
'/member?mid=${_subDetailController.item.upper!.mid}',
|
'/member?mid=${_subDetailController.subInfo.upper!.mid}',
|
||||||
arguments: {
|
arguments: {
|
||||||
'face': _subDetailController.item.upper!.face,
|
'face': _subDetailController.subInfo.upper!.face,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
_subDetailController.item.upper!.name!,
|
_subDetailController.subInfo.upper!.name!,
|
||||||
style: TextStyle(color: theme.colorScheme.primary),
|
style: TextStyle(color: theme.colorScheme.primary),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import 'package:PiliPlus/http/fav.dart';
|
|||||||
import 'package:PiliPlus/http/user.dart';
|
import 'package:PiliPlus/http/user.dart';
|
||||||
import 'package:PiliPlus/http/video.dart';
|
import 'package:PiliPlus/http/video.dart';
|
||||||
import 'package:PiliPlus/models/pgc_lcf.dart';
|
import 'package:PiliPlus/models/pgc_lcf.dart';
|
||||||
import 'package:PiliPlus/models_new/fav/fav_video/data.dart';
|
import 'package:PiliPlus/models_new/fav/fav_folder/data.dart';
|
||||||
import 'package:PiliPlus/models_new/fav/fav_video/list.dart';
|
import 'package:PiliPlus/models_new/fav/fav_folder/list.dart';
|
||||||
import 'package:PiliPlus/models_new/pgc/pgc_info_model/episode.dart';
|
import 'package:PiliPlus/models_new/pgc/pgc_info_model/episode.dart';
|
||||||
import 'package:PiliPlus/models_new/pgc/pgc_info_model/result.dart';
|
import 'package:PiliPlus/models_new/pgc/pgc_info_model/result.dart';
|
||||||
import 'package:PiliPlus/models_new/triple/pgc_triple.dart';
|
import 'package:PiliPlus/models_new/triple/pgc_triple.dart';
|
||||||
@@ -59,7 +59,7 @@ class PgcIntroController extends GetxController {
|
|||||||
List<VideoTagItem>? videoTags;
|
List<VideoTagItem>? videoTags;
|
||||||
|
|
||||||
List? favIds;
|
List? favIds;
|
||||||
Rx<FavVideoData> favFolderData = FavVideoData().obs;
|
Rx<FavFolderData> favFolderData = FavFolderData().obs;
|
||||||
|
|
||||||
AccountService accountService = Get.find<AccountService>();
|
AccountService accountService = Get.find<AccountService>();
|
||||||
|
|
||||||
@@ -162,7 +162,7 @@ class PgcIntroController extends GetxController {
|
|||||||
SmartDialog.showLoading(msg: '请求中');
|
SmartDialog.showLoading(msg: '请求中');
|
||||||
queryVideoInFolder().then((res) async {
|
queryVideoInFolder().then((res) async {
|
||||||
if (res['status']) {
|
if (res['status']) {
|
||||||
int defaultFolderId = favFolderData.value.list!.first.id!;
|
int defaultFolderId = favFolderData.value.list!.first.id;
|
||||||
int favStatus = favFolderData.value.list!.first.favState!;
|
int favStatus = favFolderData.value.list!.first.favState!;
|
||||||
var result = await FavHttp.favVideo(
|
var result = await FavHttp.favVideo(
|
||||||
aid: epId,
|
aid: epId,
|
||||||
@@ -352,10 +352,10 @@ class PgcIntroController extends GetxController {
|
|||||||
// 选择文件夹
|
// 选择文件夹
|
||||||
void onChoose(bool checkValue, int index) {
|
void onChoose(bool checkValue, int index) {
|
||||||
feedBack();
|
feedBack();
|
||||||
FavVideoItemModel item = favFolderData.value.list![index];
|
FavFolderInfo item = favFolderData.value.list![index];
|
||||||
item
|
item
|
||||||
..favState = checkValue ? 1 : 0
|
..favState = checkValue ? 1 : 0
|
||||||
..mediaCount = checkValue ? item.mediaCount! + 1 : item.mediaCount! - 1;
|
..mediaCount = checkValue ? item.mediaCount + 1 : item.mediaCount - 1;
|
||||||
favFolderData.refresh();
|
favFolderData.refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import 'package:PiliPlus/http/member.dart';
|
|||||||
import 'package:PiliPlus/http/search.dart';
|
import 'package:PiliPlus/http/search.dart';
|
||||||
import 'package:PiliPlus/http/user.dart';
|
import 'package:PiliPlus/http/user.dart';
|
||||||
import 'package:PiliPlus/http/video.dart';
|
import 'package:PiliPlus/http/video.dart';
|
||||||
import 'package:PiliPlus/models_new/fav/fav_video/data.dart';
|
import 'package:PiliPlus/models_new/fav/fav_folder/data.dart';
|
||||||
import 'package:PiliPlus/models_new/fav/fav_video/list.dart';
|
import 'package:PiliPlus/models_new/fav/fav_folder/list.dart';
|
||||||
import 'package:PiliPlus/models_new/triple/ugc_triple.dart';
|
import 'package:PiliPlus/models_new/triple/ugc_triple.dart';
|
||||||
import 'package:PiliPlus/models_new/video/video_ai_conclusion/data.dart';
|
import 'package:PiliPlus/models_new/video/video_ai_conclusion/data.dart';
|
||||||
import 'package:PiliPlus/models_new/video/video_ai_conclusion/model_result.dart';
|
import 'package:PiliPlus/models_new/video/video_ai_conclusion/model_result.dart';
|
||||||
@@ -78,7 +78,7 @@ class VideoIntroController extends GetxController {
|
|||||||
RxBool hasFav = false.obs;
|
RxBool hasFav = false.obs;
|
||||||
// 是否稍后再看
|
// 是否稍后再看
|
||||||
RxBool hasLater = false.obs;
|
RxBool hasLater = false.obs;
|
||||||
Rx<FavVideoData> favFolderData = FavVideoData().obs;
|
Rx<FavFolderData> favFolderData = FavFolderData().obs;
|
||||||
Set? favIds;
|
Set? favIds;
|
||||||
// 关注状态 默认未关注
|
// 关注状态 默认未关注
|
||||||
RxMap followStatus = {}.obs;
|
RxMap followStatus = {}.obs;
|
||||||
@@ -387,7 +387,7 @@ class VideoIntroController extends GetxController {
|
|||||||
SmartDialog.showLoading(msg: '请求中');
|
SmartDialog.showLoading(msg: '请求中');
|
||||||
queryVideoInFolder().then((res) async {
|
queryVideoInFolder().then((res) async {
|
||||||
if (res['status']) {
|
if (res['status']) {
|
||||||
int defaultFolderId = favFolderData.value.list!.first.id!;
|
int defaultFolderId = favFolderData.value.list!.first.id;
|
||||||
bool notInDefFolder = favFolderData.value.list!.first.favState! == 0;
|
bool notInDefFolder = favFolderData.value.list!.first.favState! == 0;
|
||||||
var result = await FavHttp.favVideo(
|
var result = await FavHttp.favVideo(
|
||||||
aid: IdUtils.bv2av(bvid),
|
aid: IdUtils.bv2av(bvid),
|
||||||
@@ -565,10 +565,10 @@ class VideoIntroController extends GetxController {
|
|||||||
// 选择文件夹
|
// 选择文件夹
|
||||||
void onChoose(bool checkValue, int index) {
|
void onChoose(bool checkValue, int index) {
|
||||||
feedBack();
|
feedBack();
|
||||||
FavVideoItemModel item = favFolderData.value.list![index];
|
FavFolderInfo item = favFolderData.value.list![index];
|
||||||
item
|
item
|
||||||
..favState = checkValue ? 1 : 0
|
..favState = checkValue ? 1 : 0
|
||||||
..mediaCount = checkValue ? item.mediaCount! + 1 : item.mediaCount! - 1;
|
..mediaCount = checkValue ? item.mediaCount + 1 : item.mediaCount - 1;
|
||||||
favFolderData.refresh();
|
favFolderData.refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import 'package:PiliPlus/http/validate.dart';
|
|||||||
import 'package:PiliPlus/http/video.dart';
|
import 'package:PiliPlus/http/video.dart';
|
||||||
import 'package:PiliPlus/models/dynamics/result.dart';
|
import 'package:PiliPlus/models/dynamics/result.dart';
|
||||||
import 'package:PiliPlus/models/login/model.dart';
|
import 'package:PiliPlus/models/login/model.dart';
|
||||||
import 'package:PiliPlus/models_new/fav/fav_video/list.dart';
|
import 'package:PiliPlus/models_new/fav/fav_folder/list.dart';
|
||||||
import 'package:PiliPlus/pages/common/multi_select_controller.dart';
|
import 'package:PiliPlus/pages/common/multi_select_controller.dart';
|
||||||
import 'package:PiliPlus/pages/dynamics_tab/controller.dart';
|
import 'package:PiliPlus/pages/dynamics_tab/controller.dart';
|
||||||
import 'package:PiliPlus/pages/group_panel/view.dart';
|
import 'package:PiliPlus/pages/group_panel/view.dart';
|
||||||
@@ -346,7 +346,7 @@ class RequestUtils {
|
|||||||
if (context.mounted &&
|
if (context.mounted &&
|
||||||
res['status'] &&
|
res['status'] &&
|
||||||
(res['data'].list as List?)?.isNotEmpty == true) {
|
(res['data'].list as List?)?.isNotEmpty == true) {
|
||||||
List<FavVideoItemModel> list = res['data'].list;
|
List<FavFolderInfo> list = res['data'].list;
|
||||||
dynamic checkedId;
|
dynamic checkedId;
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
@@ -360,7 +360,7 @@ class RequestUtils {
|
|||||||
children: List.generate(list.length, (index) {
|
children: List.generate(list.length, (index) {
|
||||||
return RadioWidget(
|
return RadioWidget(
|
||||||
padding: const EdgeInsets.only(left: 14),
|
padding: const EdgeInsets.only(left: 14),
|
||||||
title: list[index].title ?? '',
|
title: list[index].title,
|
||||||
groupValue: checkedId,
|
groupValue: checkedId,
|
||||||
value: list[index].id,
|
value: list[index].id,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
|
|||||||
Reference in New Issue
Block a user