Merge branch 'fix'
This commit is contained in:
@ -487,6 +487,8 @@ class Api {
|
||||
static const getSeasonDetailApi =
|
||||
'/x/polymer/web-space/seasons_archives_list';
|
||||
|
||||
static const getSeriesDetailApi = '/x/series/archives';
|
||||
|
||||
/// 获取未读动态数
|
||||
static const getUnreadDynamic = '/x/web-interface/dynamic/entrance';
|
||||
|
||||
|
||||
@ -520,4 +520,40 @@ class MemberHttp {
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
static Future getSeriesDetail({
|
||||
required int mid,
|
||||
required int currentMid,
|
||||
required int seriesId,
|
||||
required int pn,
|
||||
}) async {
|
||||
var res = await Request().get(
|
||||
Api.getSeriesDetailApi,
|
||||
data: {
|
||||
'mid': mid,
|
||||
'series_id': seriesId,
|
||||
'only_normal': true,
|
||||
'sort': 'desc',
|
||||
'pn': pn,
|
||||
'ps': 30,
|
||||
'current_mid': currentMid,
|
||||
},
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
try {
|
||||
return {
|
||||
'status': true,
|
||||
'data': MemberSeasonsDataModel.fromJson(res.data['data'])
|
||||
};
|
||||
} catch (err) {
|
||||
print(err);
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
'status': false,
|
||||
'data': [],
|
||||
'msg': res.data['message'],
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@ class RecVideoItemAppModel {
|
||||
duration =
|
||||
json['player_args'] != null ? json['player_args']['duration'] : -1;
|
||||
//duration = json['cover_right_text'];
|
||||
title = json['title'];
|
||||
title = json['title'] ?? '获取标题失败';
|
||||
owner = RcmdOwner.fromJson(json);
|
||||
rcmdReason = json['bottom_rcmd_reason'] ?? json['top_rcmd_reason'];
|
||||
// 由于app端api并不会直接返回与owner的关注状态
|
||||
@ -74,7 +74,7 @@ class RecVideoItemAppModel {
|
||||
rcmdReason = null;
|
||||
}
|
||||
goto = json['goto'];
|
||||
param = int.parse(json['param']);
|
||||
param = int.parse(json['param'] ?? '-1');
|
||||
uri = json['uri'];
|
||||
talkBack = json['talk_back'];
|
||||
|
||||
|
||||
@ -2,10 +2,12 @@ class MemberSeasonsDataModel {
|
||||
MemberSeasonsDataModel({
|
||||
this.page,
|
||||
this.seasonsList,
|
||||
this.seriesList,
|
||||
});
|
||||
|
||||
Map? page;
|
||||
List<MemberSeasonsList>? seasonsList;
|
||||
List<MemberArchiveItem>? seriesList;
|
||||
|
||||
MemberSeasonsDataModel.fromJson(Map<String, dynamic> json) {
|
||||
page = json['page'];
|
||||
@ -19,6 +21,11 @@ class MemberSeasonsDataModel {
|
||||
.map<MemberSeasonsList>((e) => MemberSeasonsList.fromJson(e))
|
||||
.toList()
|
||||
: [];
|
||||
seriesList = json['archives'] != null
|
||||
? json['archives']
|
||||
.map<MemberArchiveItem>((e) => MemberArchiveItem.fromJson(e))
|
||||
.toList()
|
||||
: [];
|
||||
|
||||
seasonsList = [...tempList1, ...tempList2];
|
||||
}
|
||||
@ -93,6 +100,8 @@ class MamberMeta {
|
||||
this.ptime,
|
||||
this.seasonId,
|
||||
this.total,
|
||||
this.seriesId,
|
||||
this.category,
|
||||
});
|
||||
|
||||
String? cover;
|
||||
@ -102,6 +111,8 @@ class MamberMeta {
|
||||
int? ptime;
|
||||
int? seasonId;
|
||||
int? total;
|
||||
int? seriesId;
|
||||
int? category;
|
||||
|
||||
MamberMeta.fromJson(Map<String, dynamic> json) {
|
||||
cover = json['cover'];
|
||||
@ -111,5 +122,7 @@ class MamberMeta {
|
||||
ptime = json['ptime'];
|
||||
seasonId = json['season_id'];
|
||||
total = json['total'];
|
||||
seriesId = json['series_id'];
|
||||
category = json['category'];
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,8 +24,27 @@ class MemberSeasonsPanel extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
ListTile(
|
||||
onTap: () => Get.toNamed(
|
||||
'/memberSeasons?mid=${item.meta!.mid}&seasonId=${item.meta!.seasonId}&seasonName=${item.meta!.name}'),
|
||||
onTap: () {
|
||||
final int category = item.meta!.category!;
|
||||
Map<String, String> parameters = {};
|
||||
if (category == 0) {
|
||||
parameters = {
|
||||
'category': '0',
|
||||
'mid': item.meta!.mid.toString(),
|
||||
'seasonId': item.meta!.seasonId.toString(),
|
||||
'seasonName': item.meta!.name!,
|
||||
};
|
||||
}
|
||||
if (category == 1) {
|
||||
parameters = {
|
||||
'category': '1',
|
||||
'mid': item.meta!.mid.toString(),
|
||||
'seriesId': item.meta!.seriesId.toString(),
|
||||
'seasonName': item.meta!.name!,
|
||||
};
|
||||
}
|
||||
Get.toNamed('/memberSeasons', parameters: parameters);
|
||||
},
|
||||
title: Text(
|
||||
item.meta!.name!,
|
||||
maxLines: 1,
|
||||
|
||||
@ -6,7 +6,9 @@ import 'package:pilipala/models/member/seasons.dart';
|
||||
class MemberSeasonsController extends GetxController {
|
||||
final ScrollController scrollController = ScrollController();
|
||||
late int mid;
|
||||
late int seasonId;
|
||||
int? seasonId;
|
||||
int? seriesId;
|
||||
late String category;
|
||||
int pn = 1;
|
||||
int ps = 30;
|
||||
int count = 0;
|
||||
@ -17,17 +19,23 @@ class MemberSeasonsController extends GetxController {
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
mid = int.parse(Get.parameters['mid']!);
|
||||
seasonId = int.parse(Get.parameters['seasonId']!);
|
||||
category = Get.parameters['category']!;
|
||||
if (category == '0') {
|
||||
seasonId = int.parse(Get.parameters['seriesId']!);
|
||||
}
|
||||
if (category == '1') {
|
||||
seriesId = int.parse(Get.parameters['seriesId']!);
|
||||
}
|
||||
}
|
||||
|
||||
// 获取专栏详情
|
||||
// 获取专栏详情 0: 专栏 1: 系列
|
||||
Future getSeasonDetail(type) async {
|
||||
if (type == 'onRefresh') {
|
||||
pn = 1;
|
||||
}
|
||||
var res = await MemberHttp.getSeasonDetail(
|
||||
mid: mid,
|
||||
seasonId: seasonId,
|
||||
seasonId: seasonId!,
|
||||
pn: pn,
|
||||
ps: ps,
|
||||
sortReverse: false,
|
||||
@ -40,8 +48,32 @@ class MemberSeasonsController extends GetxController {
|
||||
return res;
|
||||
}
|
||||
|
||||
// 获取系列详情 0: 专栏 1: 系列
|
||||
Future getSeriesDetail(type) async {
|
||||
if (type == 'onRefresh') {
|
||||
pn = 1;
|
||||
}
|
||||
var res = await MemberHttp.getSeriesDetail(
|
||||
mid: mid,
|
||||
seriesId: seriesId!,
|
||||
pn: pn,
|
||||
currentMid: 17340771,
|
||||
);
|
||||
if (res['status']) {
|
||||
seasonsList.addAll(res['data'].seriesList);
|
||||
page = res['data'].page;
|
||||
pn += 1;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
// 上拉加载
|
||||
Future onLoad() async {
|
||||
getSeasonDetail('onLoad');
|
||||
if (category == '0') {
|
||||
getSeasonDetail('onLoad');
|
||||
}
|
||||
if (category == '1') {
|
||||
getSeriesDetail('onLoad');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,12 +17,15 @@ class _MemberSeasonsPageState extends State<MemberSeasonsPage> {
|
||||
Get.put(MemberSeasonsController());
|
||||
late Future _futureBuilderFuture;
|
||||
late ScrollController scrollController;
|
||||
late String category;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_futureBuilderFuture =
|
||||
_memberSeasonsController.getSeasonDetail('onRefresh');
|
||||
category = Get.parameters['category']!;
|
||||
_futureBuilderFuture = category == '0'
|
||||
? _memberSeasonsController.getSeasonDetail('onRefresh')
|
||||
: _memberSeasonsController.getSeriesDetail('onRefresh');
|
||||
scrollController = _memberSeasonsController.scrollController;
|
||||
scrollController.addListener(
|
||||
() {
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:appscheme/appscheme.dart';
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
@ -549,7 +551,7 @@ InlineSpan buildContent(
|
||||
);
|
||||
}
|
||||
|
||||
void onPreviewImg(picList, initIndex) {
|
||||
void onPreviewImg(picList, initIndex, randomInt) {
|
||||
final MainController mainController = Get.find<MainController>();
|
||||
mainController.imgPreviewStatus = true;
|
||||
Navigator.of(context).push(
|
||||
@ -575,7 +577,7 @@ InlineSpan buildContent(
|
||||
},
|
||||
child: Center(
|
||||
child: Hero(
|
||||
tag: picList[index],
|
||||
tag: picList[index] + randomInt,
|
||||
child: CachedNetworkImage(
|
||||
fadeInDuration: const Duration(milliseconds: 0),
|
||||
imageUrl: picList[index],
|
||||
@ -886,11 +888,12 @@ InlineSpan buildContent(
|
||||
pictureItem['img_width']))
|
||||
.truncateToDouble();
|
||||
} catch (_) {}
|
||||
String randomInt = Random().nextInt(101).toString();
|
||||
|
||||
return Hero(
|
||||
tag: picList[0],
|
||||
tag: picList[0] + randomInt,
|
||||
child: GestureDetector(
|
||||
onTap: () => onPreviewImg(picList, 0),
|
||||
onTap: () => onPreviewImg(picList, 0, randomInt),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.only(top: 4),
|
||||
constraints: BoxConstraints(maxHeight: maxHeight),
|
||||
@ -927,13 +930,14 @@ InlineSpan buildContent(
|
||||
picList.add(content.pictures[i]['img_src']);
|
||||
}
|
||||
for (var i = 0; i < len; i++) {
|
||||
String randomInt = Random().nextInt(101).toString();
|
||||
list.add(
|
||||
LayoutBuilder(
|
||||
builder: (context, BoxConstraints box) {
|
||||
return Hero(
|
||||
tag: picList[i],
|
||||
tag: picList[i] + randomInt,
|
||||
child: GestureDetector(
|
||||
onTap: () => onPreviewImg(picList, i),
|
||||
onTap: () => onPreviewImg(picList, i, randomInt),
|
||||
child: NetworkImgLayer(
|
||||
src: picList[i],
|
||||
width: box.maxWidth,
|
||||
|
||||
@ -330,12 +330,14 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
plPlayerController?.danmakuController?.clear();
|
||||
break;
|
||||
case 'pause':
|
||||
vdCtr.hiddenReplyReplyPanel();
|
||||
if (vdCtr.videoType == SearchType.video) {
|
||||
videoIntroController.hiddenEpisodeBottomSheet();
|
||||
}
|
||||
if (vdCtr.videoType == SearchType.media_bangumi) {
|
||||
bangumiIntroController.hiddenEpisodeBottomSheet();
|
||||
if (autoPiP) {
|
||||
vdCtr.hiddenReplyReplyPanel();
|
||||
if (vdCtr.videoType == SearchType.video) {
|
||||
videoIntroController.hiddenEpisodeBottomSheet();
|
||||
}
|
||||
if (vdCtr.videoType == SearchType.media_bangumi) {
|
||||
bangumiIntroController.hiddenEpisodeBottomSheet();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user