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