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