Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-12-26 12:15:25 +08:00
parent c9a02f9c74
commit 25fca498fc
41 changed files with 313 additions and 286 deletions

View File

@@ -80,12 +80,12 @@ class PgcIntroController extends CommonIntroController {
if (result case Success(:final response)) {
final hasLike = response.like == 1;
final hasFav = response.favorite == 1;
late final stat = pgcItem.stat!;
late final stat = pgcItem.stat;
if (hasLike) {
stat.like = max(1, stat.like);
stat?.like = max(1, stat.like);
}
if (hasFav) {
stat.favorite = max(1, stat.favorite);
stat?.favorite = max(1, stat.favorite);
}
this.hasLike.value = hasLike;
coinNum.value = response.coinNumber!;
@@ -106,7 +106,7 @@ class PgcIntroController extends CommonIntroController {
var result = await VideoHttp.likeVideo(bvid: bvid, type: newVal);
if (result case Success(:final response)) {
SmartDialog.showToast(newVal ? response : '取消赞');
pgcItem.stat!.like += newVal ? 1 : -1;
pgcItem.stat?.like += newVal ? 1 : -1;
hasLike.value = newVal;
} else {
result.toast();
@@ -429,18 +429,18 @@ class PgcIntroController extends CommonIntroController {
}
var result = await VideoHttp.pgcTriple(epId: epId!, seasonId: seasonId);
if (result case Success(:final response)) {
late final stat = pgcItem.stat!;
late final stat = pgcItem.stat;
if (response.like == 1 && !hasLike.value) {
stat.like++;
stat?.like++;
hasLike.value = true;
}
if (response.coin == 1 && !hasCoin) {
stat.coin += 2;
stat?.coin += 2;
coinNum.value = 2;
GlobalData().afterCoin(2);
}
if (response.favorite == 1 && !hasFav.value) {
stat.favorite++;
stat?.favorite++;
hasFav.value = true;
}
if (!hasCoin) {

View File

@@ -164,12 +164,12 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
Future<void> queryAllStatus() async {
var result = await VideoHttp.videoRelation(bvid: bvid);
if (result case Success(:var response)) {
late final stat = videoDetail.value.stat!;
late final stat = videoDetail.value.stat;
if (response.like!) {
stat.like = max(1, stat.like);
stat?.like = max(1, stat.like);
}
if (response.favorite!) {
stat.favorite = max(1, stat.favorite);
stat?.favorite = max(1, stat.favorite);
}
hasLike.value = response.like!;
hasDislike.value = response.dislike!;
@@ -193,18 +193,18 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
}
var result = await VideoHttp.ugcTriple(bvid: bvid);
if (result case Success(:final response)) {
late final stat = videoDetail.value.stat!;
late final stat = videoDetail.value.stat;
if (response.like == true && !hasLike.value) {
stat.like++;
stat?.like++;
hasLike.value = true;
}
if (response.coin == true && !hasCoin) {
stat.coin += 2;
stat?.coin += 2;
coinNum.value = 2;
GlobalData().afterCoin(2);
}
if (response.fav == true && !hasFav.value) {
stat.favorite++;
stat?.favorite++;
hasFav.value = true;
}
hasDislike.value = false;
@@ -232,7 +232,7 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
var result = await VideoHttp.likeVideo(bvid: bvid, type: newVal);
if (result case Success(:final response)) {
SmartDialog.showToast(newVal ? response : '取消赞');
videoDetail.value.stat!.like += newVal ? 1 : -1;
videoDetail.value.stat?.like += newVal ? 1 : -1;
hasLike.value = newVal;
if (newVal) {
hasDislike.value = false;
@@ -256,7 +256,7 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
SmartDialog.showToast('点踩成功');
hasDislike.value = true;
if (hasLike.value) {
videoDetail.value.stat!.like--;
videoDetail.value.stat?.like--;
hasLike.value = false;
}
} else {

View File

@@ -209,13 +209,15 @@ class _UgcIntroPanelState extends State<UgcIntroPanel> {
children: [
WidgetSpan(
alignment: PlaceholderAlignment.middle,
child: Icon(
size: 13,
Icons.error_outline,
color: theme.colorScheme.outline,
child: Padding(
padding: const .only(right: 2),
child: Icon(
size: 13,
Icons.error_outline,
color: theme.colorScheme.outline,
),
),
),
const WidgetSpan(child: SizedBox(width: 2)),
TextSpan(
text: '${videoDetail.argueInfo!.argueMsg}',
),