mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-23 18:46:53 +08:00
show charging label
tweak Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -52,6 +52,7 @@ class LaterItemModel with MultiSelectData {
|
|||||||
int? missionId;
|
int? missionId;
|
||||||
String? firstFrame;
|
String? firstFrame;
|
||||||
int? seasonId;
|
int? seasonId;
|
||||||
|
bool? isCharging;
|
||||||
|
|
||||||
LaterItemModel({
|
LaterItemModel({
|
||||||
this.aid,
|
this.aid,
|
||||||
@@ -98,6 +99,7 @@ class LaterItemModel with MultiSelectData {
|
|||||||
this.missionId,
|
this.missionId,
|
||||||
this.firstFrame,
|
this.firstFrame,
|
||||||
this.seasonId,
|
this.seasonId,
|
||||||
|
this.isCharging,
|
||||||
});
|
});
|
||||||
|
|
||||||
factory LaterItemModel.fromJson(Map<String, dynamic> json) => LaterItemModel(
|
factory LaterItemModel.fromJson(Map<String, dynamic> json) => LaterItemModel(
|
||||||
@@ -155,10 +157,11 @@ class LaterItemModel with MultiSelectData {
|
|||||||
enableVt: json['enable_vt'] as int?,
|
enableVt: json['enable_vt'] as int?,
|
||||||
viewText1: json['view_text_1'] as String?,
|
viewText1: json['view_text_1'] as String?,
|
||||||
isPgc: json['is_pgc'] as bool?,
|
isPgc: json['is_pgc'] as bool?,
|
||||||
pgcLabel: json['pgc_label'] as String?,
|
pgcLabel: json['pgc_label'] == '' ? null : json['pgc_label'],
|
||||||
isPugv: json['is_pugv'] as bool?,
|
isPugv: json['is_pugv'] as bool?,
|
||||||
missionId: json['mission_id'] as int?,
|
missionId: json['mission_id'] as int?,
|
||||||
firstFrame: json['first_frame'] as String?,
|
firstFrame: json['first_frame'] as String?,
|
||||||
seasonId: json['season_id'] as int?,
|
seasonId: json['season_id'] as int?,
|
||||||
|
isCharging: json['charging_pay']?['level'] != null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ class _AboutPageState extends State<AboutPage> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final theme = Theme.of(context);
|
final theme = Theme.of(context);
|
||||||
|
const style = TextStyle(fontSize: 15);
|
||||||
final outline = theme.colorScheme.outline;
|
final outline = theme.colorScheme.outline;
|
||||||
final subTitleStyle = TextStyle(fontSize: 13, color: outline);
|
final subTitleStyle = TextStyle(fontSize: 13, color: outline);
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
@@ -222,7 +223,8 @@ Commit Hash: ${BuildConfig.commitHash}''',
|
|||||||
clipBehavior: Clip.hardEdge,
|
clipBehavior: Clip.hardEdge,
|
||||||
children: [
|
children: [
|
||||||
ListTile(
|
ListTile(
|
||||||
title: const Text('导出'),
|
dense: true,
|
||||||
|
title: const Text('导出', style: style),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.back();
|
Get.back();
|
||||||
String res = jsonEncode(Accounts.account.toMap());
|
String res = jsonEncode(Accounts.account.toMap());
|
||||||
@@ -230,7 +232,8 @@ Commit Hash: ${BuildConfig.commitHash}''',
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
title: const Text('导入'),
|
dense: true,
|
||||||
|
title: const Text('导入', style: style),
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
Get.back();
|
Get.back();
|
||||||
ClipboardData? data =
|
ClipboardData? data =
|
||||||
@@ -302,7 +305,8 @@ Commit Hash: ${BuildConfig.commitHash}''',
|
|||||||
title: const Text('导入/导出设置'),
|
title: const Text('导入/导出设置'),
|
||||||
children: [
|
children: [
|
||||||
ListTile(
|
ListTile(
|
||||||
title: const Text('导出设置至剪贴板'),
|
dense: true,
|
||||||
|
title: const Text('导出设置至剪贴板', style: style),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.back();
|
Get.back();
|
||||||
String data = GStorage.exportAllSettings();
|
String data = GStorage.exportAllSettings();
|
||||||
@@ -310,7 +314,8 @@ Commit Hash: ${BuildConfig.commitHash}''',
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
title: const Text('从剪贴板导入设置'),
|
dense: true,
|
||||||
|
title: const Text('从剪贴板导入设置', style: style),
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
Get.back();
|
Get.back();
|
||||||
ClipboardData? data =
|
ClipboardData? data =
|
||||||
@@ -368,16 +373,13 @@ Commit Hash: ${BuildConfig.commitHash}''',
|
|||||||
onTap: () => showDialog(
|
onTap: () => showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return AlertDialog(
|
return SimpleDialog(
|
||||||
title: const Text('重置所有设置'),
|
clipBehavior: Clip.hardEdge,
|
||||||
content: const Text('是否重置所有设置?'),
|
title: const Text('是否重置所有设置?'),
|
||||||
actions: [
|
children: [
|
||||||
TextButton(
|
ListTile(
|
||||||
onPressed: Get.back,
|
dense: true,
|
||||||
child: const Text('取消'),
|
onTap: () async {
|
||||||
),
|
|
||||||
TextButton(
|
|
||||||
onPressed: () async {
|
|
||||||
Get.back();
|
Get.back();
|
||||||
await Future.wait([
|
await Future.wait([
|
||||||
GStorage.setting.clear(),
|
GStorage.setting.clear(),
|
||||||
@@ -385,10 +387,11 @@ Commit Hash: ${BuildConfig.commitHash}''',
|
|||||||
]);
|
]);
|
||||||
SmartDialog.showToast('重置成功');
|
SmartDialog.showToast('重置成功');
|
||||||
},
|
},
|
||||||
child: const Text('重置可导出的设置'),
|
title: const Text('重置可导出的设置', style: style),
|
||||||
),
|
),
|
||||||
TextButton(
|
ListTile(
|
||||||
onPressed: () async {
|
dense: true,
|
||||||
|
onTap: () async {
|
||||||
Get.back();
|
Get.back();
|
||||||
await Future.wait([
|
await Future.wait([
|
||||||
GStorage.userInfo.clear(),
|
GStorage.userInfo.clear(),
|
||||||
@@ -400,7 +403,7 @@ Commit Hash: ${BuildConfig.commitHash}''',
|
|||||||
]);
|
]);
|
||||||
SmartDialog.showToast('重置成功');
|
SmartDialog.showToast('重置成功');
|
||||||
},
|
},
|
||||||
child: const Text('重置所有数据(含登录信息)'),
|
title: const Text('重置所有数据(含登录信息)', style: style),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -20,7 +20,13 @@ class HistoryBaseController extends GetxController {
|
|||||||
title: const Text('提示'),
|
title: const Text('提示'),
|
||||||
content: const Text('啊叻?你要清空历史记录功能吗?'),
|
content: const Text('啊叻?你要清空历史记录功能吗?'),
|
||||||
actions: [
|
actions: [
|
||||||
TextButton(onPressed: Get.back, child: const Text('取消')),
|
TextButton(
|
||||||
|
onPressed: Get.back,
|
||||||
|
child: Text(
|
||||||
|
'取消',
|
||||||
|
style: TextStyle(color: Theme.of(context).colorScheme.outline),
|
||||||
|
),
|
||||||
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
Get.back();
|
Get.back();
|
||||||
@@ -33,7 +39,7 @@ class HistoryBaseController extends GetxController {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: const Text('确认清空'),
|
child: const Text('确认清空'),
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@@ -50,7 +56,13 @@ class HistoryBaseController extends GetxController {
|
|||||||
content:
|
content:
|
||||||
Text(!pauseStatus.value ? '啊叻?你要暂停历史记录功能吗?' : '啊叻?要恢复历史记录功能吗?'),
|
Text(!pauseStatus.value ? '啊叻?你要暂停历史记录功能吗?' : '啊叻?要恢复历史记录功能吗?'),
|
||||||
actions: [
|
actions: [
|
||||||
TextButton(onPressed: Get.back, child: const Text('取消')),
|
TextButton(
|
||||||
|
onPressed: Get.back,
|
||||||
|
child: Text(
|
||||||
|
'取消',
|
||||||
|
style: TextStyle(color: Theme.of(context).colorScheme.outline),
|
||||||
|
),
|
||||||
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
SmartDialog.showLoading(msg: '请求中');
|
SmartDialog.showLoading(msg: '请求中');
|
||||||
@@ -66,7 +78,7 @@ class HistoryBaseController extends GetxController {
|
|||||||
Get.back();
|
Get.back();
|
||||||
},
|
},
|
||||||
child: Text(!pauseStatus.value ? '确认暂停' : '确认恢复'),
|
child: Text(!pauseStatus.value ? '确认暂停' : '确认恢复'),
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -94,11 +94,19 @@ class VideoCardHLater extends StatelessWidget {
|
|||||||
width: maxWidth,
|
width: maxWidth,
|
||||||
height: maxHeight,
|
height: maxHeight,
|
||||||
),
|
),
|
||||||
PBadge(
|
if (videoItem.isCharging == true)
|
||||||
text: videoItem.pgcLabel,
|
const PBadge(
|
||||||
top: 6.0,
|
text: '充电专属',
|
||||||
right: 6.0,
|
top: 6.0,
|
||||||
),
|
right: 6.0,
|
||||||
|
type: PBadgeType.error,
|
||||||
|
)
|
||||||
|
else if (videoItem.pgcLabel != null)
|
||||||
|
PBadge(
|
||||||
|
text: videoItem.pgcLabel,
|
||||||
|
top: 6.0,
|
||||||
|
right: 6.0,
|
||||||
|
),
|
||||||
if (progress != null && progress != 0) ...[
|
if (progress != null && progress != 0) ...[
|
||||||
PBadge(
|
PBadge(
|
||||||
text: progress == -1
|
text: progress == -1
|
||||||
|
|||||||
@@ -85,7 +85,10 @@ class _PlaySpeedPageState extends State<PlaySpeedPage> {
|
|||||||
actions: [
|
actions: [
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: Get.back,
|
onPressed: Get.back,
|
||||||
child: const Text('取消'),
|
child: Text(
|
||||||
|
'取消',
|
||||||
|
style: TextStyle(color: Theme.of(context).colorScheme.outline),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
|
|||||||
@@ -132,79 +132,102 @@ class _VideoInfoState extends State<VideoInfo> {
|
|||||||
|
|
||||||
late final _horizontalMemberPage = Pref.horizontalMemberPage;
|
late final _horizontalMemberPage = Pref.horizontalMemberPage;
|
||||||
|
|
||||||
Widget _buildVideoTitle(ThemeData theme, [bool isExpand = false]) =>
|
Widget _buildVideoTitle(ThemeData theme, [bool isExpand = false]) {
|
||||||
videoDetailCtr.plPlayerController.enableSponsorBlock
|
late final isDark = theme.brightness == Brightness.dark;
|
||||||
? Obx(
|
Widget child() => Text.rich(
|
||||||
() => Text.rich(
|
TextSpan(
|
||||||
TextSpan(
|
children: [
|
||||||
children: [
|
if (videoDetailCtr.videoLabel.value.isNotEmpty) ...[
|
||||||
if (videoDetailCtr.videoLabel.value.isNotEmpty) ...[
|
WidgetSpan(
|
||||||
WidgetSpan(
|
alignment: PlaceholderAlignment.middle,
|
||||||
alignment: PlaceholderAlignment.middle,
|
child: Container(
|
||||||
child: Container(
|
padding: const EdgeInsets.symmetric(
|
||||||
padding: const EdgeInsets.symmetric(
|
horizontal: 4,
|
||||||
horizontal: 4,
|
vertical: 2,
|
||||||
vertical: 2,
|
),
|
||||||
),
|
decoration: BoxDecoration(
|
||||||
decoration: BoxDecoration(
|
color: theme.colorScheme.secondaryContainer,
|
||||||
color: theme.colorScheme.secondaryContainer,
|
borderRadius: const BorderRadius.all(Radius.circular(4)),
|
||||||
borderRadius:
|
),
|
||||||
const BorderRadius.all(Radius.circular(4)),
|
child: Row(
|
||||||
),
|
mainAxisSize: MainAxisSize.min,
|
||||||
child: Row(
|
children: [
|
||||||
mainAxisSize: MainAxisSize.min,
|
Stack(
|
||||||
children: [
|
clipBehavior: Clip.none,
|
||||||
Stack(
|
alignment: Alignment.center,
|
||||||
clipBehavior: Clip.none,
|
children: [
|
||||||
alignment: Alignment.center,
|
Icon(
|
||||||
children: [
|
Icons.shield_outlined,
|
||||||
Icon(
|
size: 16,
|
||||||
Icons.shield_outlined,
|
color: theme.colorScheme.onSecondaryContainer,
|
||||||
size: 16,
|
),
|
||||||
color:
|
Icon(
|
||||||
theme.colorScheme.onSecondaryContainer,
|
Icons.play_arrow_rounded,
|
||||||
),
|
size: 12,
|
||||||
Icon(
|
color: theme.colorScheme.onSecondaryContainer,
|
||||||
Icons.play_arrow_rounded,
|
),
|
||||||
size: 12,
|
],
|
||||||
color:
|
),
|
||||||
theme.colorScheme.onSecondaryContainer,
|
Text(
|
||||||
),
|
videoDetailCtr.videoLabel.value,
|
||||||
],
|
textScaler: TextScaler.noScaling,
|
||||||
),
|
strutStyle: const StrutStyle(leading: 0, height: 1),
|
||||||
Text(
|
style: TextStyle(
|
||||||
videoDetailCtr.videoLabel.value,
|
height: 1,
|
||||||
textScaler: TextScaler.noScaling,
|
fontSize: 13,
|
||||||
strutStyle:
|
color: theme.colorScheme.onSecondaryContainer,
|
||||||
const StrutStyle(leading: 0, height: 1),
|
|
||||||
style: TextStyle(
|
|
||||||
height: 1,
|
|
||||||
fontSize: 13,
|
|
||||||
color: theme.colorScheme.onSecondaryContainer,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
const TextSpan(text: ' '),
|
),
|
||||||
],
|
),
|
||||||
TextSpan(
|
|
||||||
text:
|
|
||||||
'${videoDetail.title ?? videoItem['title'] ?? ''}'),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
maxLines: isExpand ? null : 2,
|
const TextSpan(text: ' '),
|
||||||
overflow: isExpand ? null : TextOverflow.ellipsis,
|
],
|
||||||
style: const TextStyle(fontSize: 16),
|
if (videoDetail.isUpowerExclusive == true) ...[
|
||||||
),
|
WidgetSpan(
|
||||||
)
|
alignment: PlaceholderAlignment.middle,
|
||||||
: Text(
|
child: Container(
|
||||||
'${videoDetail.title ?? videoItem['title'] ?? ''}',
|
padding: const EdgeInsets.symmetric(
|
||||||
maxLines: isExpand ? null : 2,
|
horizontal: 4,
|
||||||
overflow: isExpand ? null : TextOverflow.ellipsis,
|
vertical: 2,
|
||||||
style: const TextStyle(fontSize: 16),
|
),
|
||||||
);
|
decoration: BoxDecoration(
|
||||||
|
color: isDark
|
||||||
|
? theme.colorScheme.error
|
||||||
|
: theme.colorScheme.errorContainer,
|
||||||
|
borderRadius: const BorderRadius.all(Radius.circular(4)),
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
'充电专属',
|
||||||
|
textScaler: TextScaler.noScaling,
|
||||||
|
strutStyle: const StrutStyle(leading: 0, height: 1),
|
||||||
|
style: TextStyle(
|
||||||
|
height: 1,
|
||||||
|
fontSize: 12,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: isDark
|
||||||
|
? theme.colorScheme.onError
|
||||||
|
: theme.colorScheme.onErrorContainer,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const TextSpan(text: ' '),
|
||||||
|
],
|
||||||
|
TextSpan(
|
||||||
|
text: '${videoDetail.title ?? videoItem['title'] ?? ''}'),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
maxLines: isExpand ? null : 2,
|
||||||
|
overflow: isExpand ? null : TextOverflow.ellipsis,
|
||||||
|
style: const TextStyle(fontSize: 16),
|
||||||
|
);
|
||||||
|
if (videoDetailCtr.plPlayerController.enableSponsorBlock) {
|
||||||
|
return Obx(child);
|
||||||
|
}
|
||||||
|
return child();
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> handleState(FutureOr Function() action) async {
|
Future<void> handleState(FutureOr Function() action) async {
|
||||||
if (!isProcessing) {
|
if (!isProcessing) {
|
||||||
|
|||||||
@@ -239,7 +239,12 @@ class _WebviewPageState extends State<WebviewPage> {
|
|||||||
actions: [
|
actions: [
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: Get.back,
|
onPressed: Get.back,
|
||||||
child: const Text('取消'),
|
child: Text(
|
||||||
|
'取消',
|
||||||
|
style: TextStyle(
|
||||||
|
color:
|
||||||
|
Theme.of(context).colorScheme.outline),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
|
|||||||
Reference in New Issue
Block a user