mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-07-11 03:40:08 +08:00
@@ -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) {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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}',
|
||||
),
|
||||
|
||||
@@ -36,27 +36,30 @@ class PopupMenuText<T> extends StatelessWidget {
|
||||
}
|
||||
},
|
||||
itemBuilder: itemBuilder,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
getSelectTitle(select),
|
||||
style: TextStyle(
|
||||
height: 1,
|
||||
fontSize: 14,
|
||||
color: secondary,
|
||||
child: Text.rich(
|
||||
style: TextStyle(
|
||||
height: 1,
|
||||
fontSize: 14,
|
||||
color: secondary,
|
||||
),
|
||||
strutStyle: const StrutStyle(
|
||||
height: 1,
|
||||
leading: 0,
|
||||
fontSize: 14,
|
||||
),
|
||||
TextSpan(
|
||||
children: [
|
||||
TextSpan(text: getSelectTitle(select)),
|
||||
WidgetSpan(
|
||||
alignment: .middle,
|
||||
child: Icon(
|
||||
size: 14,
|
||||
MdiIcons.unfoldMoreHorizontal,
|
||||
color: secondary,
|
||||
),
|
||||
),
|
||||
strutStyle: const StrutStyle(
|
||||
height: 1,
|
||||
leading: 0,
|
||||
),
|
||||
),
|
||||
Icon(
|
||||
MdiIcons.unfoldMoreHorizontal,
|
||||
size: MediaQuery.textScalerOf(context).scale(14),
|
||||
color: secondary,
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -48,6 +48,7 @@ class _ReplySearchPageState extends State<ReplySearchPage> {
|
||||
textAlignVertical: TextAlignVertical.center,
|
||||
decoration: InputDecoration(
|
||||
hintText: '搜索',
|
||||
visualDensity: .standard,
|
||||
border: InputBorder.none,
|
||||
suffixIcon: IconButton(
|
||||
tooltip: '清空',
|
||||
|
||||
@@ -1100,33 +1100,36 @@ class HeaderControlState extends State<HeaderControl>
|
||||
plPlayerController.superResolutionType.value,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(4),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
widget
|
||||
.controller
|
||||
.superResolutionType
|
||||
.value
|
||||
.title,
|
||||
strutStyle: const StrutStyle(
|
||||
leading: 0,
|
||||
height: 1,
|
||||
child: Text.rich(
|
||||
style: TextStyle(
|
||||
height: 1,
|
||||
fontSize: 14,
|
||||
color: theme.colorScheme.secondary,
|
||||
),
|
||||
strutStyle: const StrutStyle(
|
||||
leading: 0,
|
||||
height: 1,
|
||||
fontSize: 14,
|
||||
),
|
||||
TextSpan(
|
||||
children: [
|
||||
TextSpan(
|
||||
text: widget
|
||||
.controller
|
||||
.superResolutionType
|
||||
.value
|
||||
.title,
|
||||
),
|
||||
style: TextStyle(
|
||||
height: 1,
|
||||
fontSize: 14,
|
||||
color: theme.colorScheme.secondary,
|
||||
WidgetSpan(
|
||||
alignment: .middle,
|
||||
child: Icon(
|
||||
MdiIcons.unfoldMoreHorizontal,
|
||||
size: 14,
|
||||
color: theme.colorScheme.secondary,
|
||||
),
|
||||
),
|
||||
),
|
||||
Icon(
|
||||
MdiIcons.unfoldMoreHorizontal,
|
||||
size: MediaQuery.textScalerOf(
|
||||
context,
|
||||
).scale(14),
|
||||
color: theme.colorScheme.secondary,
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
onSelected: (value) {
|
||||
|
||||
Reference in New Issue
Block a user