Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-08-30 14:50:54 +08:00
parent 80fa0240e9
commit 8d94c0405f
115 changed files with 3150 additions and 1438 deletions

View File

@@ -428,17 +428,16 @@ class PgcIntroController extends CommonIntroController {
if (result['status']) {
PgcTriple data = result['data'];
late final stat = pgcItem.stat!;
if ((data.like == 1) != hasLike.value) {
if (data.like == 1 && !hasLike.value) {
stat.like++;
hasLike.value = true;
}
final hasCoin = data.coin == 1;
if (this.hasCoin != hasCoin) {
if (data.coin == 1 && !hasCoin) {
stat.coin += 2;
coinNum.value = 2;
GlobalData().afterCoin(2);
}
if ((data.favorite == 1) != hasFav.value) {
if (data.favorite == 1 && !hasFav.value) {
stat.favorite++;
hasFav.value = true;
}

View File

@@ -198,21 +198,21 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
if (result['status']) {
UgcTriple data = result['data'];
late final stat = videoDetail.value.stat!;
if (data.like != hasLike.value) {
if (data.like == true && !hasLike.value) {
stat.like++;
hasLike.value = true;
}
if (data.coin != hasCoin) {
if (data.coin == true && !hasCoin) {
stat.coin += 2;
coinNum.value = 2;
GlobalData().afterCoin(2);
}
if (data.fav != hasFav.value) {
if (data.fav == true && !hasFav.value) {
stat.favorite++;
hasFav.value = true;
}
hasDislike.value = false;
if (data.coin != true) {
if (!hasCoin) {
SmartDialog.showToast('投币失败');
} else {
SmartDialog.showToast('三连成功');
@@ -460,7 +460,10 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
}
// 修改分P或番剧分集
Future<void> onChangeEpisode(BaseEpisodeItem episode, {bool? isStein}) async {
Future<void> onChangeEpisode(
BaseEpisodeItem episode, {
bool isStein = false,
}) async {
try {
final String bvid = episode.bvid ?? this.bvid;
final int aid = episode.aid ?? IdUtils.bv2av(bvid);
@@ -490,7 +493,7 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
..plPlayerController.pause()
..makeHeartBeat()
..updateMediaListHistory(aid)
..onReset(isStein)
..onReset(isStein: isStein)
..bvid = bvid
..aid = aid
..cid.value = cid

View File

@@ -14,12 +14,12 @@ class SeasonPanel extends StatefulWidget {
super.key,
required this.heroTag,
required this.showEpisodes,
this.onTap,
this.canTap = true,
required this.ugcIntroController,
});
final String heroTag;
final Function showEpisodes;
final bool? onTap;
final bool canTap;
final UgcIntroController ugcIntroController;
@override
@@ -102,16 +102,16 @@ class _SeasonPanelState extends State<SeasonPanel> {
borderRadius: const BorderRadius.all(Radius.circular(6)),
child: InkWell(
borderRadius: const BorderRadius.all(Radius.circular(6)),
onTap: widget.onTap == false
? null
: () => widget.showEpisodes(
onTap: widget.canTap
? () => widget.showEpisodes(
_videoDetailController.seasonIndex.value,
videoDetail.ugcSeason,
null,
_videoDetailController.bvid,
null,
_videoDetailController.seasonCid,
),
)
: null,
child: Padding(
padding: const EdgeInsets.fromLTRB(8, 12, 8, 12),
child: Row(