mod: 订阅视频类型补充
This commit is contained in:
@ -490,8 +490,11 @@ class Api {
|
||||
/// 我的订阅
|
||||
static const userSubFolder = '/x/v3/fav/folder/collected/list';
|
||||
|
||||
/// 我的订阅详情
|
||||
static const userSubFolderDetail = '/x/space/fav/season/list';
|
||||
/// 我的订阅详情 type 21
|
||||
static const userSeasonList = '/x/space/fav/season/list';
|
||||
|
||||
/// 我的订阅详情 type 11
|
||||
static const userResourceList = '/x/v3/fav/resource/list';
|
||||
|
||||
/// 表情
|
||||
static const emojiList = '/x/emote/user/panel/web';
|
||||
|
@ -330,12 +330,12 @@ class UserHttp {
|
||||
}
|
||||
}
|
||||
|
||||
static Future userSubFolderDetail({
|
||||
static Future userSeasonList({
|
||||
required int seasonId,
|
||||
required int pn,
|
||||
required int ps,
|
||||
}) async {
|
||||
var res = await Request().get(Api.userSubFolderDetail, data: {
|
||||
var res = await Request().get(Api.userSeasonList, data: {
|
||||
'season_id': seasonId,
|
||||
'ps': ps,
|
||||
'pn': pn,
|
||||
@ -350,6 +350,35 @@ class UserHttp {
|
||||
}
|
||||
}
|
||||
|
||||
static Future userResourceList({
|
||||
required int seasonId,
|
||||
required int pn,
|
||||
required int ps,
|
||||
}) async {
|
||||
var res = await Request().get(Api.userResourceList, data: {
|
||||
'media_id': seasonId,
|
||||
'ps': ps,
|
||||
'pn': pn,
|
||||
'keyword': '',
|
||||
'order': 'mtime',
|
||||
'type': 0,
|
||||
'tid': 0,
|
||||
'platform': 'web',
|
||||
});
|
||||
if (res.data['code'] == 0) {
|
||||
try {
|
||||
return {
|
||||
'status': true,
|
||||
'data': SubDetailModelData.fromJson(res.data['data'])
|
||||
};
|
||||
} catch (err) {
|
||||
return {'status': false, 'msg': err};
|
||||
}
|
||||
} else {
|
||||
return {'status': false, 'msg': res.data['message']};
|
||||
}
|
||||
}
|
||||
|
||||
// 取消订阅
|
||||
static Future cancelSub({required int seasonId}) async {
|
||||
var res = await Request().post(
|
||||
|
@ -6,7 +6,6 @@ import '../../models/user/sub_folder.dart';
|
||||
|
||||
class SubDetailController extends GetxController {
|
||||
late SubFolderItemData item;
|
||||
|
||||
late int seasonId;
|
||||
late String heroTag;
|
||||
int currentPage = 1;
|
||||
@ -26,13 +25,19 @@ class SubDetailController extends GetxController {
|
||||
super.onInit();
|
||||
}
|
||||
|
||||
Future<dynamic> queryUserSubFolderDetail({type = 'init'}) async {
|
||||
Future<dynamic> queryUserSeasonList({type = 'init'}) async {
|
||||
if (type == 'onLoad' && subList.length >= mediaCount) {
|
||||
loadingText.value = '没有更多了';
|
||||
return;
|
||||
}
|
||||
isLoadingMore = true;
|
||||
var res = await UserHttp.userSubFolderDetail(
|
||||
var res = type == 21
|
||||
? await UserHttp.userSeasonList(
|
||||
seasonId: seasonId,
|
||||
ps: 20,
|
||||
pn: currentPage,
|
||||
)
|
||||
: await UserHttp.userResourceList(
|
||||
seasonId: seasonId,
|
||||
ps: 20,
|
||||
pn: currentPage,
|
||||
@ -55,6 +60,6 @@ class SubDetailController extends GetxController {
|
||||
}
|
||||
|
||||
onLoad() {
|
||||
queryUserSubFolderDetail(type: 'onLoad');
|
||||
queryUserSeasonList(type: 'onLoad');
|
||||
}
|
||||
}
|
||||
|
@ -26,13 +26,11 @@ class _SubDetailPageState extends State<SubDetailPage> {
|
||||
Get.put(SubDetailController());
|
||||
late StreamController<bool> titleStreamC; // a
|
||||
late Future _futureBuilderFuture;
|
||||
late String seasonId;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
seasonId = Get.parameters['seasonId']!;
|
||||
_futureBuilderFuture = _subDetailController.queryUserSubFolderDetail();
|
||||
_futureBuilderFuture = _subDetailController.queryUserSeasonList();
|
||||
titleStreamC = StreamController<bool>();
|
||||
_controller.addListener(
|
||||
() {
|
||||
@ -161,15 +159,18 @@ class _SubDetailPageState extends State<SubDetailPage> {
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
'${Utils.numFormat(_subDetailController.item.viewCount)}次播放',
|
||||
Obx(
|
||||
() => Text(
|
||||
'${Utils.numFormat(_subDetailController.subInfo.value.cntInfo?['play'])}次播放',
|
||||
style: TextStyle(
|
||||
fontSize: Theme.of(context)
|
||||
.textTheme
|
||||
.labelSmall!
|
||||
.fontSize,
|
||||
color: Theme.of(context).colorScheme.outline),
|
||||
color:
|
||||
Theme.of(context).colorScheme.outline),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -182,14 +183,12 @@ class _SubDetailPageState extends State<SubDetailPage> {
|
||||
SliverToBoxAdapter(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(top: 15, bottom: 8, left: 14),
|
||||
child: Obx(
|
||||
() => Text(
|
||||
'共${_subDetailController.subList.length}条视频',
|
||||
child: Text(
|
||||
'共${_subDetailController.item.mediaCount}条视频',
|
||||
style: TextStyle(
|
||||
fontSize:
|
||||
Theme.of(context).textTheme.labelMedium!.fontSize,
|
||||
fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
|
||||
color: Theme.of(context).colorScheme.outline,
|
||||
letterSpacing: 1),
|
||||
letterSpacing: 1,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
Reference in New Issue
Block a user