feat: later page: multi select

feat: fav detail page: multi select

opt: reply item

opt: load more

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2024-11-28 20:53:52 +08:00
parent 665dd8b92a
commit 12818ae415
51 changed files with 988 additions and 759 deletions

View File

@@ -92,7 +92,9 @@ class Api {
// https://api.bilibili.com/x/v3/fav/resource/deal
static const String favVideo = '/x/v3/fav/resource/deal';
static const String favBangumi = '/x/v3/fav/resource/batch-deal';
// static const String favBangumi = '/x/v3/fav/resource/batch-deal';
static const String delFav = '/x/v3/fav/resource/batch-del';
// 判断视频是否被收藏双端GET
/// aid

View File

@@ -158,8 +158,10 @@ class UserHttp {
for (var i in res.data['data']['list']) {
list.add(HotVideoItemModel.fromJson(i));
}
return LoadingState.success(
{'list': list, 'count': res.data['data']['count']});
return LoadingState.success({
'list': list,
'count': res.data['data']['count'],
});
} else {
return LoadingState.error(res.data['message']);
}
@@ -239,16 +241,18 @@ class UserHttp {
}
// 移除已观看
static Future toViewDel({int? aid}) async {
static Future toViewDel({
List? aids,
}) async {
final Map<String, dynamic> params = {
'jsonp': 'jsonp',
'csrf': await Request.getCsrf(),
if (aids != null) 'aid': aids.join(',') else 'viewed': true
};
params[aid != null ? 'aid' : 'viewed'] = aid ?? true;
var res = await Request().post(
dynamic res = await Request().post(
Api.toViewDel,
queryParameters: params,
data: params,
options: Options(contentType: Headers.formUrlEncodedContentType),
);
if (res.data['code'] == 0) {
return {'status': true, 'msg': 'yeah成功移除'};

View File

@@ -563,45 +563,19 @@ class VideoHttp {
}
// (取消)收藏
static Future favVideo({
required int aid,
String? addIds,
String? delIds,
int? type,
}) async {
var res = await Request().post(Api.favVideo, queryParameters: {
'rid': aid,
'type': type ?? 2,
'add_media_ids': addIds ?? '',
'del_media_ids': delIds ?? '',
'csrf': await Request.getCsrf(),
});
if (res.data['code'] == 0) {
return {'status': true, 'data': res.data['data']};
} else {
return {'status': false, 'data': [], 'msg': res.data['message']};
}
}
// (取消)收藏 bangumi
static Future favBangumi({
required dynamic epId,
String? addIds,
static Future delFav({
List? ids,
String? delIds,
}) async {
var res = await Request().post(
Api.favBangumi,
Api.delFav,
data: {
'resources': '$epId:24',
'add_media_ids': addIds ?? '',
'del_media_ids': delIds ?? '',
'resources': ids?.join(','),
'media_id': delIds,
'platform': 'web',
'csrf': await Request.getCsrf(),
},
options: Options(
headers: {
'Content-Type': Headers.formUrlEncodedContentType,
},
),
options: Options(contentType: Headers.formUrlEncodedContentType),
);
if (res.data['code'] == 0) {
return {'status': true, 'data': res.data['data']};
@@ -610,6 +584,58 @@ class VideoHttp {
}
}
// (取消)收藏
static Future favVideo({
int? aid,
String? addIds,
String? delIds,
int? type,
}) async {
var res = await Request().post(
Api.favVideo,
data: {
'rid': aid,
'type': type ?? 2,
'add_media_ids': addIds ?? '',
'del_media_ids': delIds ?? '',
'csrf': await Request.getCsrf(),
},
options: Options(contentType: Headers.formUrlEncodedContentType),
);
if (res.data['code'] == 0) {
return {'status': true, 'data': res.data['data']};
} else {
return {'status': false, 'msg': res.data['message']};
}
}
// (取消)收藏 bangumi
// static Future favBangumi({
// required dynamic epId,
// String? addIds,
// String? delIds,
// }) async {
// var res = await Request().post(
// Api.favBangumi,
// data: {
// 'resources': '$epId:24',
// 'add_media_ids': addIds ?? '',
// 'del_media_ids': delIds ?? '',
// 'csrf': await Request.getCsrf(),
// },
// options: Options(
// headers: {
// 'Content-Type': Headers.formUrlEncodedContentType,
// },
// ),
// );
// if (res.data['code'] == 0) {
// return {'status': true, 'data': res.data['data']};
// } else {
// return {'status': false, 'msg': res.data['message']};
// }
// }
// 查看视频被收藏在哪个文件夹
static Future videoInFolder({
dynamic mid,