mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
fix: 番剧支持点击后跳转至历史epId
This commit is contained in:
@@ -78,7 +78,7 @@ class BangumiInfoModel {
|
|||||||
String? title;
|
String? title;
|
||||||
int? total;
|
int? total;
|
||||||
int? type;
|
int? type;
|
||||||
Map? userStatus;
|
UserStatus? userStatus;
|
||||||
String? staff;
|
String? staff;
|
||||||
|
|
||||||
BangumiInfoModel.fromJson(Map<String, dynamic> json) {
|
BangumiInfoModel.fromJson(Map<String, dynamic> json) {
|
||||||
@@ -121,7 +121,7 @@ class BangumiInfoModel {
|
|||||||
title = json['title'];
|
title = json['title'];
|
||||||
total = json['total'];
|
total = json['total'];
|
||||||
type = json['type'];
|
type = json['type'];
|
||||||
userStatus = json['user_status'];
|
userStatus = UserStatus.fromJson(json['user_status']);
|
||||||
staff = json['staff'];
|
staff = json['staff'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -138,6 +138,7 @@ class EpisodeItem {
|
|||||||
this.dimension,
|
this.dimension,
|
||||||
this.duration,
|
this.duration,
|
||||||
this.enableVt,
|
this.enableVt,
|
||||||
|
this.epId,
|
||||||
this.from,
|
this.from,
|
||||||
this.id,
|
this.id,
|
||||||
this.isViewHide,
|
this.isViewHide,
|
||||||
@@ -167,6 +168,7 @@ class EpisodeItem {
|
|||||||
Map? dimension;
|
Map? dimension;
|
||||||
int? duration;
|
int? duration;
|
||||||
bool? enableVt;
|
bool? enableVt;
|
||||||
|
int? epId;
|
||||||
String? from;
|
String? from;
|
||||||
int? id;
|
int? id;
|
||||||
bool? isViewHide;
|
bool? isViewHide;
|
||||||
@@ -196,6 +198,7 @@ class EpisodeItem {
|
|||||||
dimension = json['dimension'];
|
dimension = json['dimension'];
|
||||||
duration = json['duration'];
|
duration = json['duration'];
|
||||||
enableVt = json['enable_vt'];
|
enableVt = json['enable_vt'];
|
||||||
|
epId = json['ep_id'];
|
||||||
from = json['from'];
|
from = json['from'];
|
||||||
id = json['id'];
|
id = json['id'];
|
||||||
isViewHide = json['is_view_hide'];
|
isViewHide = json['is_view_hide'];
|
||||||
@@ -215,3 +218,69 @@ class EpisodeItem {
|
|||||||
vid = json['vid'];
|
vid = json['vid'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
class UserStatus {
|
||||||
|
UserStatus({
|
||||||
|
this.areaLimit,
|
||||||
|
this.banAreaShow,
|
||||||
|
this.follow,
|
||||||
|
this.followStatus,
|
||||||
|
this.login,
|
||||||
|
this.pay,
|
||||||
|
this.payPackPaid,
|
||||||
|
this.progress,
|
||||||
|
this.sponsor,
|
||||||
|
this.vipInfo,
|
||||||
|
});
|
||||||
|
int? areaLimit;
|
||||||
|
int? banAreaShow;
|
||||||
|
int? follow;
|
||||||
|
int? followStatus;
|
||||||
|
int? login;
|
||||||
|
int? pay;
|
||||||
|
int? payPackPaid;
|
||||||
|
UserProgress? progress;
|
||||||
|
int? sponsor;
|
||||||
|
VipInfo? vipInfo;
|
||||||
|
UserStatus.fromJson(Map<String, dynamic> json) {
|
||||||
|
areaLimit = json['area_limit'];
|
||||||
|
banAreaShow = json['ban_area_show'];
|
||||||
|
follow = json['follow'];
|
||||||
|
followStatus = json['follow_status'];
|
||||||
|
login = json['login'];
|
||||||
|
pay = json['pay'];
|
||||||
|
payPackPaid = json['pay_pack_paid'];
|
||||||
|
progress = UserProgress.fromJson(json['progress']);
|
||||||
|
sponsor = json['sponsor'];
|
||||||
|
vipInfo = VipInfo.fromJson(json['vip_info']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
class UserProgress {
|
||||||
|
UserProgress({
|
||||||
|
this.lastEpId,
|
||||||
|
this.lastEpIndex,
|
||||||
|
this.lastTime,
|
||||||
|
});
|
||||||
|
int? lastEpId;
|
||||||
|
String? lastEpIndex;
|
||||||
|
int? lastTime;
|
||||||
|
UserProgress.fromJson(Map<String, dynamic> json) {
|
||||||
|
lastEpId = json['last_ep_id'];
|
||||||
|
lastEpIndex = json['last_ep_index'];
|
||||||
|
lastTime = json['last_time'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
class VipInfo {
|
||||||
|
VipInfo({
|
||||||
|
this.dueDate,
|
||||||
|
this.status,
|
||||||
|
this.type,
|
||||||
|
});
|
||||||
|
int? dueDate;
|
||||||
|
int? status;
|
||||||
|
int? type;
|
||||||
|
VipInfo.fromJson(Map<String, dynamic> json) {
|
||||||
|
dueDate = json['due_date'];
|
||||||
|
status = json['status'];
|
||||||
|
type = json['type'];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -52,12 +52,25 @@ class BangumiCardV extends StatelessWidget {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
EpisodeItem episode = res['data'].episodes.first;
|
EpisodeItem episode = res['data'].episodes.first;
|
||||||
|
int? epId = res['data'].userStatus?.progress?.lastEpId;
|
||||||
|
if (epId == null) {
|
||||||
|
epId = episode.epId;
|
||||||
|
} else {
|
||||||
|
for (var item in res['data'].episodes) {
|
||||||
|
if (item.epId == epId) {
|
||||||
|
episode = item;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
String bvid = episode.bvid!;
|
String bvid = episode.bvid!;
|
||||||
int cid = episode.cid!;
|
int cid = episode.cid!;
|
||||||
String pic = episode.cover!;
|
String pic = episode.cover!;
|
||||||
|
print('epId');
|
||||||
|
print(epId);
|
||||||
String heroTag = Utils.makeHeroTag(cid);
|
String heroTag = Utils.makeHeroTag(cid);
|
||||||
Get.toNamed(
|
Get.toNamed(
|
||||||
'/video?bvid=$bvid&cid=$cid&seasonId=$seasonId',
|
'/video?bvid=$bvid&cid=$cid&seasonId=$seasonId&epId=$epId',
|
||||||
arguments: {
|
arguments: {
|
||||||
'pic': pic,
|
'pic': pic,
|
||||||
'heroTag': heroTag,
|
'heroTag': heroTag,
|
||||||
|
|||||||
@@ -225,12 +225,23 @@ class DynamicsController extends GetxController {
|
|||||||
SmartDialog.dismiss();
|
SmartDialog.dismiss();
|
||||||
if (res['status']) {
|
if (res['status']) {
|
||||||
EpisodeItem episode = res['data'].episodes.first;
|
EpisodeItem episode = res['data'].episodes.first;
|
||||||
|
int? epId = res['data'].userStatus?.progress?.lastEpId;
|
||||||
|
if (epId == null) {
|
||||||
|
epId = episode.epId;
|
||||||
|
} else {
|
||||||
|
for (var item in res['data'].episodes) {
|
||||||
|
if (item.epId == epId) {
|
||||||
|
episode = item;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
String bvid = episode.bvid!;
|
String bvid = episode.bvid!;
|
||||||
int cid = episode.cid!;
|
int cid = episode.cid!;
|
||||||
String pic = episode.cover!;
|
String pic = episode.cover!;
|
||||||
String heroTag = Utils.makeHeroTag(cid);
|
String heroTag = Utils.makeHeroTag(cid);
|
||||||
Get.toNamed(
|
Get.toNamed(
|
||||||
'/video?bvid=$bvid&cid=$cid&seasonId=${res['data'].seasonId}',
|
'/video?bvid=$bvid&cid=$cid&seasonId=${res['data'].seasonId}&epid=$epId',
|
||||||
arguments: {
|
arguments: {
|
||||||
'pic': pic,
|
'pic': pic,
|
||||||
'heroTag': heroTag,
|
'heroTag': heroTag,
|
||||||
|
|||||||
@@ -109,12 +109,18 @@ class HistoryItem extends StatelessWidget {
|
|||||||
SmartDialog.dismiss();
|
SmartDialog.dismiss();
|
||||||
if (res['status']) {
|
if (res['status']) {
|
||||||
EpisodeItem episode = res['data'].episodes.first;
|
EpisodeItem episode = res['data'].episodes.first;
|
||||||
|
for (EpisodeItem i in res['data'].episodes) {
|
||||||
|
if (i.epId == videoItem.history.epid) {
|
||||||
|
episode = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
String bvid = episode.bvid!;
|
String bvid = episode.bvid!;
|
||||||
int cid = episode.cid!;
|
int cid = episode.cid!;
|
||||||
String pic = episode.cover!;
|
String pic = episode.cover!;
|
||||||
String heroTag = Utils.makeHeroTag(cid);
|
String heroTag = Utils.makeHeroTag(cid);
|
||||||
Get.toNamed(
|
Get.toNamed(
|
||||||
'/video?bvid=$bvid&cid=$cid&seasonId=${res['data'].seasonId}',
|
'/video?bvid=$bvid&cid=$cid&seasonId=${res['data'].seasonId}&epid=${episode.epId}',
|
||||||
arguments: {
|
arguments: {
|
||||||
'pic': pic,
|
'pic': pic,
|
||||||
'heroTag': heroTag,
|
'heroTag': heroTag,
|
||||||
|
|||||||
@@ -125,12 +125,23 @@ Widget searchMbangumiPanel(BuildContext context, ctr, list) {
|
|||||||
if (res['status']) {
|
if (res['status']) {
|
||||||
EpisodeItem episode =
|
EpisodeItem episode =
|
||||||
res['data'].episodes.first;
|
res['data'].episodes.first;
|
||||||
|
int? epId = res['data'].userStatus?.progress?.lastEpId;
|
||||||
|
if (epId == null) {
|
||||||
|
epId = episode.epId;
|
||||||
|
} else {
|
||||||
|
for (var item in res['data'].episodes) {
|
||||||
|
if (item.epId == epId) {
|
||||||
|
episode = item;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
String bvid = episode.bvid!;
|
String bvid = episode.bvid!;
|
||||||
int cid = episode.cid!;
|
int cid = episode.cid!;
|
||||||
String pic = episode.cover!;
|
String pic = episode.cover!;
|
||||||
String heroTag = Utils.makeHeroTag(cid);
|
String heroTag = Utils.makeHeroTag(cid);
|
||||||
Get.toNamed(
|
Get.toNamed(
|
||||||
'/video?bvid=$bvid&cid=$cid&seasonId=${i.seasonId}',
|
'/video?bvid=$bvid&cid=$cid&seasonId=${i.seasonId}&epid=$epId',
|
||||||
arguments: {
|
arguments: {
|
||||||
'pic': pic,
|
'pic': pic,
|
||||||
'heroTag': heroTag,
|
'heroTag': heroTag,
|
||||||
|
|||||||
Reference in New Issue
Block a user