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