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