mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-20 00:56:31 +08:00
opt dyn jump
tweak Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -1157,6 +1157,7 @@ class DynamicTopicModel {
|
|||||||
|
|
||||||
class DynamicArchiveModel {
|
class DynamicArchiveModel {
|
||||||
DynamicArchiveModel({
|
DynamicArchiveModel({
|
||||||
|
this.id,
|
||||||
this.aid,
|
this.aid,
|
||||||
this.badge,
|
this.badge,
|
||||||
this.bvid,
|
this.bvid,
|
||||||
@@ -1172,6 +1173,7 @@ class DynamicArchiveModel {
|
|||||||
this.seasonId,
|
this.seasonId,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
int? id;
|
||||||
int? aid;
|
int? aid;
|
||||||
Badge? badge;
|
Badge? badge;
|
||||||
String? bvid;
|
String? bvid;
|
||||||
@@ -1187,6 +1189,7 @@ class DynamicArchiveModel {
|
|||||||
int? seasonId;
|
int? seasonId;
|
||||||
|
|
||||||
DynamicArchiveModel.fromJson(Map<String, dynamic> json) {
|
DynamicArchiveModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
aid = json['aid'] is String ? int.parse(json['aid']) : json['aid'];
|
aid = json['aid'] is String ? int.parse(json['aid']) : json['aid'];
|
||||||
badge = json['badge'] == null ? null : Badge.fromJson(json['badge']);
|
badge = json['badge'] == null ? null : Badge.fromJson(json['badge']);
|
||||||
bvid = json['bvid'] ?? json['epid'].toString() ?? ' ';
|
bvid = json['bvid'] ?? json['epid'].toString() ?? ' ';
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ import 'package:PiliPlus/utils/storage.dart';
|
|||||||
import 'package:PiliPlus/utils/storage_key.dart';
|
import 'package:PiliPlus/utils/storage_key.dart';
|
||||||
import 'package:PiliPlus/utils/utils.dart';
|
import 'package:PiliPlus/utils/utils.dart';
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
import 'package:flutter/foundation.dart' show kDebugMode;
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
@@ -196,14 +195,14 @@ class _ArticlePageState extends CommonDynPageState<ArticlePage> {
|
|||||||
if (controller.isLoaded.value) {
|
if (controller.isLoaded.value) {
|
||||||
late Widget content;
|
late Widget content;
|
||||||
if (controller.opus != null) {
|
if (controller.opus != null) {
|
||||||
if (kDebugMode) debugPrint('json page');
|
// if (kDebugMode) debugPrint('json page');
|
||||||
content = OpusContent(
|
content = OpusContent(
|
||||||
opus: controller.opus!,
|
opus: controller.opus!,
|
||||||
callback: imageCallback,
|
callback: imageCallback,
|
||||||
maxWidth: maxWidth,
|
maxWidth: maxWidth,
|
||||||
);
|
);
|
||||||
} else if (controller.opusData?.modules.moduleBlocked != null) {
|
} else if (controller.opusData?.modules.moduleBlocked != null) {
|
||||||
if (kDebugMode) debugPrint('moduleBlocked');
|
// if (kDebugMode) debugPrint('moduleBlocked');
|
||||||
final moduleBlocked = controller.opusData!.modules.moduleBlocked!;
|
final moduleBlocked = controller.opusData!.modules.moduleBlocked!;
|
||||||
content = SliverToBoxAdapter(
|
content = SliverToBoxAdapter(
|
||||||
child: moduleBlockedItem(theme, moduleBlocked, maxWidth),
|
child: moduleBlockedItem(theme, moduleBlocked, maxWidth),
|
||||||
@@ -213,7 +212,7 @@ class _ArticlePageState extends CommonDynPageState<ArticlePage> {
|
|||||||
// json
|
// json
|
||||||
return ArticleOpus(ops: controller.articleData?.ops);
|
return ArticleOpus(ops: controller.articleData?.ops);
|
||||||
}
|
}
|
||||||
if (kDebugMode) debugPrint('html page');
|
// if (kDebugMode) debugPrint('html page');
|
||||||
final res = parser.parse(controller.articleData!.content!);
|
final res = parser.parse(controller.articleData!.content!);
|
||||||
if (res.body!.children.isEmpty) {
|
if (res.body!.children.isEmpty) {
|
||||||
content = SliverToBoxAdapter(
|
content = SliverToBoxAdapter(
|
||||||
|
|||||||
@@ -60,8 +60,7 @@ class ActionPanel extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: TextButton.icon(
|
child: TextButton.icon(
|
||||||
onPressed: () =>
|
onPressed: () => PageUtils.pushDynDetail(item, isPush: true),
|
||||||
PageUtils.pushDynDetail(item, 1, action: 'comment'),
|
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
FontAwesomeIcons.comment,
|
FontAwesomeIcons.comment,
|
||||||
size: 16,
|
size: 16,
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ class DynamicPanel extends StatelessWidget {
|
|||||||
'DYNAMIC_TYPE_COURSES_SEASON',
|
'DYNAMIC_TYPE_COURSES_SEASON',
|
||||||
}.contains(item.type)
|
}.contains(item.type)
|
||||||
? null
|
? null
|
||||||
: () => PageUtils.pushDynDetail(item, 1),
|
: () => PageUtils.pushDynDetail(item),
|
||||||
onLongPress: () => _imageSaveDialog(context, authorWidget.morePanel),
|
onLongPress: () => _imageSaveDialog(context, authorWidget.morePanel),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ Widget liveRcmdPanel(
|
|||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: StyleString.safeSpace),
|
padding: const EdgeInsets.symmetric(horizontal: StyleString.safeSpace),
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: () => PageUtils.pushDynDetail(item, floor),
|
onTap: () => PageUtils.pushDynDetail(item),
|
||||||
child: Stack(
|
child: Stack(
|
||||||
clipBehavior: Clip.none,
|
clipBehavior: Clip.none,
|
||||||
children: [
|
children: [
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ Widget module(
|
|||||||
}
|
}
|
||||||
maxWidth -= 30;
|
maxWidth -= 30;
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () => PageUtils.pushDynDetail(orig, floor + 1),
|
onTap: () => PageUtils.pushDynDetail(orig),
|
||||||
onLongPress: () {
|
onLongPress: () {
|
||||||
String? title, cover, bvid;
|
String? title, cover, bvid;
|
||||||
late var origMajor = orig.modules.moduleDynamic?.major;
|
late var origMajor = orig.modules.moduleDynamic?.major;
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ import 'package:PiliPlus/pages/member_like_arc/view.dart';
|
|||||||
import 'package:PiliPlus/pages/member_pgc/widgets/pgc_card_v_member_pgc.dart';
|
import 'package:PiliPlus/pages/member_pgc/widgets/pgc_card_v_member_pgc.dart';
|
||||||
import 'package:PiliPlus/utils/context_ext.dart';
|
import 'package:PiliPlus/utils/context_ext.dart';
|
||||||
import 'package:PiliPlus/utils/grid.dart';
|
import 'package:PiliPlus/utils/grid.dart';
|
||||||
import 'package:flutter/foundation.dart' show kDebugMode;
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
import 'package:get/get.dart' hide ContextExtensionss;
|
import 'package:get/get.dart' hide ContextExtensionss;
|
||||||
@@ -329,10 +328,10 @@ class _MemberHomeState extends State<MemberHome>
|
|||||||
if (contributeCtr.tabController?.index != index1) {
|
if (contributeCtr.tabController?.index != index1) {
|
||||||
contributeCtr.tabController?.index = index1;
|
contributeCtr.tabController?.index = index1;
|
||||||
}
|
}
|
||||||
if (kDebugMode) debugPrint('initialized');
|
// if (kDebugMode) debugPrint('initialized');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
_ctr.contributeInitialIndex.value = index1;
|
_ctr.contributeInitialIndex.value = index1;
|
||||||
if (kDebugMode) debugPrint('not initialized');
|
// if (kDebugMode) debugPrint('not initialized');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1112,7 +1112,6 @@ class VideoDetailController extends GetxController
|
|||||||
(data.timeLength == null
|
(data.timeLength == null
|
||||||
? null
|
? null
|
||||||
: Duration(milliseconds: data.timeLength!)),
|
: Duration(milliseconds: data.timeLength!)),
|
||||||
// 宽>高 水平 否则 垂直
|
|
||||||
isVertical: isVertical.value,
|
isVertical: isVertical.value,
|
||||||
aid: aid,
|
aid: aid,
|
||||||
bvid: bvid,
|
bvid: bvid,
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import 'package:PiliPlus/utils/global_data.dart';
|
|||||||
import 'package:PiliPlus/utils/id_utils.dart';
|
import 'package:PiliPlus/utils/id_utils.dart';
|
||||||
import 'package:PiliPlus/utils/page_utils.dart';
|
import 'package:PiliPlus/utils/page_utils.dart';
|
||||||
import 'package:PiliPlus/utils/utils.dart';
|
import 'package:PiliPlus/utils/utils.dart';
|
||||||
|
import 'package:flutter/foundation.dart' show kDebugMode;
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -323,7 +324,7 @@ class PgcIntroController extends CommonIntroController {
|
|||||||
queryOnlineTotal();
|
queryOnlineTotal();
|
||||||
queryVideoIntro(episode as EpisodeItem);
|
queryVideoIntro(episode as EpisodeItem);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
debugPrint('pgc onChangeEpisode: $e');
|
if (kDebugMode) debugPrint('pgc onChangeEpisode: $e');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ import 'package:PiliPlus/utils/request_utils.dart';
|
|||||||
import 'package:PiliPlus/utils/storage_pref.dart';
|
import 'package:PiliPlus/utils/storage_pref.dart';
|
||||||
import 'package:PiliPlus/utils/utils.dart';
|
import 'package:PiliPlus/utils/utils.dart';
|
||||||
import 'package:expandable/expandable.dart';
|
import 'package:expandable/expandable.dart';
|
||||||
|
import 'package:flutter/foundation.dart' show kDebugMode;
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
import 'package:get/get.dart' hide ContextExtensionss;
|
import 'package:get/get.dart' hide ContextExtensionss;
|
||||||
@@ -540,7 +541,7 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
|
|||||||
this.cid.value = cid;
|
this.cid.value = cid;
|
||||||
queryOnlineTotal();
|
queryOnlineTotal();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
debugPrint('ugc onChangeEpisode: $e');
|
if (kDebugMode) debugPrint('ugc onChangeEpisode: $e');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1062,7 +1062,7 @@ class PlPlayerController {
|
|||||||
// play();
|
// play();
|
||||||
// }
|
// }
|
||||||
} else {
|
} else {
|
||||||
if (kDebugMode) debugPrint('seek duration else');
|
// if (kDebugMode) debugPrint('seek duration else');
|
||||||
_timerForSeek?.cancel();
|
_timerForSeek?.cancel();
|
||||||
_timerForSeek = Timer.periodic(const Duration(milliseconds: 200), (
|
_timerForSeek = Timer.periodic(const Duration(milliseconds: 200), (
|
||||||
Timer t,
|
Timer t,
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart' show kDebugMode;
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:logger/logger.dart';
|
import 'package:logger/logger.dart';
|
||||||
import 'package:path/path.dart' as p;
|
import 'package:path/path.dart' as p;
|
||||||
import 'package:path_provider/path_provider.dart';
|
import 'package:path_provider/path_provider.dart';
|
||||||
@@ -50,7 +48,7 @@ Future<bool> clearLogs() async {
|
|||||||
try {
|
try {
|
||||||
await file.writeAsString('');
|
await file.writeAsString('');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (kDebugMode) debugPrint('Error clearing file: $e');
|
// if (kDebugMode) debugPrint('Error clearing file: $e');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import 'dart:io';
|
|||||||
|
|
||||||
import 'package:PiliPlus/plugin/pl_player/controller.dart';
|
import 'package:PiliPlus/plugin/pl_player/controller.dart';
|
||||||
import 'package:PiliPlus/plugin/pl_player/models/play_status.dart';
|
import 'package:PiliPlus/plugin/pl_player/models/play_status.dart';
|
||||||
import 'package:flutter/foundation.dart' show kDebugMode;
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
|
|
||||||
@@ -73,7 +72,7 @@ class ShutdownTimerService with WidgetsBindingObserver {
|
|||||||
|
|
||||||
void _showShutdownDialog() {
|
void _showShutdownDialog() {
|
||||||
if (isInBackground) {
|
if (isInBackground) {
|
||||||
if (kDebugMode) debugPrint("app在后台运行,不弹窗");
|
// if (kDebugMode) debugPrint("app在后台运行,不弹窗");
|
||||||
_executeShutdown();
|
_executeShutdown();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -372,9 +372,9 @@ class PageUtils {
|
|||||||
EnableManual(
|
EnableManual(
|
||||||
aspectRatio: aspectRatio.fitsInAndroidRequirements
|
aspectRatio: aspectRatio.fitsInAndroidRequirements
|
||||||
? aspectRatio
|
? aspectRatio
|
||||||
: height > width
|
: width > height
|
||||||
? const Rational.vertical()
|
? const Rational.landscape()
|
||||||
: const Rational.landscape(),
|
: const Rational.vertical(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
@@ -383,9 +383,8 @@ class PageUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static Future<void> pushDynDetail(
|
static Future<void> pushDynDetail(
|
||||||
DynamicItemModel item,
|
DynamicItemModel item, {
|
||||||
floor, {
|
bool isPush = false,
|
||||||
action = 'all',
|
|
||||||
}) async {
|
}) async {
|
||||||
feedBack();
|
feedBack();
|
||||||
|
|
||||||
@@ -409,7 +408,7 @@ class PageUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// 点击评论action 直接查看评论
|
/// 点击评论action 直接查看评论
|
||||||
if (action == 'comment') {
|
if (isPush) {
|
||||||
push();
|
push();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -418,15 +417,10 @@ class PageUtils {
|
|||||||
|
|
||||||
switch (item.type) {
|
switch (item.type) {
|
||||||
case 'DYNAMIC_TYPE_AV':
|
case 'DYNAMIC_TYPE_AV':
|
||||||
if (item.modules.moduleDynamic?.major?.archive?.type == 2) {
|
final archive = item.modules.moduleDynamic!.major!.archive!;
|
||||||
if (item.modules.moduleDynamic!.major!.archive!.jumpUrl!.startsWith(
|
if (archive.type == 2) {
|
||||||
'//',
|
|
||||||
)) {
|
|
||||||
item.modules.moduleDynamic!.major!.archive!.jumpUrl =
|
|
||||||
'https:${item.modules.moduleDynamic!.major!.archive!.jumpUrl!}';
|
|
||||||
}
|
|
||||||
String? redirectUrl = await UrlUtils.parseRedirectUrl(
|
String? redirectUrl = await UrlUtils.parseRedirectUrl(
|
||||||
item.modules.moduleDynamic!.major!.archive!.jumpUrl!,
|
archive.jumpUrl!.http2https,
|
||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
if (redirectUrl != null) {
|
if (redirectUrl != null) {
|
||||||
@@ -436,8 +430,8 @@ class PageUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String bvid = item.modules.moduleDynamic!.major!.archive!.bvid!;
|
String bvid = archive.bvid!;
|
||||||
String cover = item.modules.moduleDynamic!.major!.archive!.cover!;
|
String cover = archive.cover!;
|
||||||
int? cid = await SearchHttp.ab2c(bvid: bvid);
|
int? cid = await SearchHttp.ab2c(bvid: bvid);
|
||||||
if (cid != null) {
|
if (cid != null) {
|
||||||
toVideoPage(
|
toVideoPage(
|
||||||
@@ -461,8 +455,9 @@ class PageUtils {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'DYNAMIC_TYPE_PGC':
|
case 'DYNAMIC_TYPE_PGC':
|
||||||
if (kDebugMode) debugPrint('番剧');
|
// if (kDebugMode) debugPrint('番剧');
|
||||||
SmartDialog.showToast('暂未支持的类型,请联系开发者');
|
SmartDialog.showToast('暂未支持的类型,请联系开发者');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -492,34 +487,37 @@ class PageUtils {
|
|||||||
|
|
||||||
/// 番剧查看
|
/// 番剧查看
|
||||||
case 'DYNAMIC_TYPE_PGC_UNION':
|
case 'DYNAMIC_TYPE_PGC_UNION':
|
||||||
if (kDebugMode) debugPrint('DYNAMIC_TYPE_PGC_UNION 番剧');
|
// if (kDebugMode) debugPrint('DYNAMIC_TYPE_PGC_UNION 番剧');
|
||||||
DynamicArchiveModel pgc = item.modules.moduleDynamic!.major!.pgc!;
|
DynamicArchiveModel pgc = item.modules.moduleDynamic!.major!.pgc!;
|
||||||
if (pgc.epid != null) {
|
if (pgc.epid != null) {
|
||||||
viewPgc(epId: pgc.epid);
|
viewPgc(epId: pgc.epid);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'DYNAMIC_TYPE_MEDIALIST':
|
case 'DYNAMIC_TYPE_MEDIALIST':
|
||||||
if (item.modules.moduleDynamic?.major?.medialist != null) {
|
if (item.modules.moduleDynamic?.major?.medialist
|
||||||
final String? url =
|
case Medialist medialist) {
|
||||||
item.modules.moduleDynamic!.major!.medialist!.jumpUrl;
|
final String? url = medialist.jumpUrl;
|
||||||
if (url?.contains('medialist/detail/ml') == true) {
|
if (url != null) {
|
||||||
|
if (url.contains('medialist/detail/ml')) {
|
||||||
Get.toNamed(
|
Get.toNamed(
|
||||||
'/favDetail',
|
'/favDetail',
|
||||||
parameters: {
|
parameters: {
|
||||||
'heroTag':
|
'heroTag': '${medialist.cover}',
|
||||||
'${item.modules.moduleDynamic!.major!.medialist!.cover}',
|
'mediaId': '${medialist.id}',
|
||||||
'mediaId':
|
|
||||||
'${item.modules.moduleDynamic!.major!.medialist!.id}',
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
} else if (url != null) {
|
} else {
|
||||||
handleWebview(url.http2https);
|
handleWebview(url.http2https);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'DYNAMIC_TYPE_COURSES_SEASON':
|
case 'DYNAMIC_TYPE_COURSES_SEASON':
|
||||||
PageUtils.viewPugv(seasonId: item.basic?.ridStr);
|
PageUtils.viewPugv(
|
||||||
|
seasonId: item.modules.moduleDynamic!.major!.courses!.id,
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// 纯文字动态查看
|
// 纯文字动态查看
|
||||||
|
|||||||
Reference in New Issue
Block a user