feat: up投稿播放全部
This commit is contained in:
@ -1,14 +1,16 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:pilipala/http/member.dart';
|
||||
import 'package:pilipala/http/search.dart';
|
||||
import 'package:pilipala/models/member/archive.dart';
|
||||
import 'package:pilipala/utils/global_data_cache.dart';
|
||||
import 'package:pilipala/utils/utils.dart';
|
||||
|
||||
class MemberArchiveController extends GetxController {
|
||||
final ScrollController scrollController = ScrollController();
|
||||
late int mid;
|
||||
int pn = 1;
|
||||
int count = 0;
|
||||
RxInt count = 0.obs;
|
||||
RxMap<String, String> currentOrder = <String, String>{}.obs;
|
||||
RxList<Map<String, String>> orderList = [
|
||||
{'type': 'pubdate', 'label': '最新发布'},
|
||||
@ -50,11 +52,11 @@ class MemberArchiveController extends GetxController {
|
||||
if (res['status']) {
|
||||
if (type == 'init') {
|
||||
archivesList.value = res['data'].list.vlist;
|
||||
count.value = res['data'].page['count'];
|
||||
}
|
||||
if (type == 'onLoad') {
|
||||
archivesList.addAll(res['data'].list.vlist);
|
||||
}
|
||||
count = res['data'].page['count'];
|
||||
pn += 1;
|
||||
}
|
||||
isLoading.value = false;
|
||||
@ -76,4 +78,29 @@ class MemberArchiveController extends GetxController {
|
||||
Future onLoad() async {
|
||||
getMemberArchive('onLoad');
|
||||
}
|
||||
|
||||
Future toViewPlayAll() async {
|
||||
final VListItemModel firstItem = archivesList.first;
|
||||
final String bvid = firstItem.bvid!;
|
||||
final int cid = await SearchHttp.ab2c(bvid: bvid);
|
||||
final String heroTag = Utils.makeHeroTag(bvid);
|
||||
late Map sortFieldMap = {
|
||||
'pubdate': 'pubtime',
|
||||
'click': 'play',
|
||||
'fav': 'fav',
|
||||
};
|
||||
Get.toNamed(
|
||||
'/video?bvid=${firstItem.bvid}&cid=$cid',
|
||||
arguments: {
|
||||
'videoItem': firstItem,
|
||||
'heroTag': heroTag,
|
||||
'sourceType': 'up_archive',
|
||||
'oid': firstItem.aid,
|
||||
'favTitle': '${firstItem.owner!.name!} - ${currentOrder['label']!}',
|
||||
'favInfo': firstItem,
|
||||
'count': count.value,
|
||||
'sortField': sortFieldMap[currentOrder['type']],
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user