Merge branch 'feature-opusRender'
This commit is contained in:
@ -39,6 +39,7 @@ class OpusController extends GetxController {
|
||||
'articleType': 'cv',
|
||||
});
|
||||
} else {
|
||||
title.value = res['data'].detail!.basic!.title!;
|
||||
opusData.value = res['data'];
|
||||
}
|
||||
}
|
||||
@ -91,6 +92,15 @@ class OpusController extends GetxController {
|
||||
);
|
||||
}
|
||||
|
||||
// 跳转webview
|
||||
void onJumpWebview() {
|
||||
Get.toNamed('/webview', parameters: {
|
||||
'url': url,
|
||||
'type': 'webview',
|
||||
'pageTitle': title.value,
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
scrollController.removeListener(_scrollListener);
|
||||
|
@ -60,9 +60,14 @@ class _OpusPageState extends State<OpusPage> {
|
||||
},
|
||||
),
|
||||
actions: [
|
||||
IconButton(
|
||||
icon: const Icon(Icons.more_vert_rounded),
|
||||
onPressed: () {},
|
||||
PopupMenuButton(
|
||||
icon: const Icon(Icons.more_vert_outlined),
|
||||
itemBuilder: (BuildContext context) => <PopupMenuEntry>[
|
||||
PopupMenuItem(
|
||||
onTap: controller.onJumpWebview,
|
||||
child: const Text('查看原网页'),
|
||||
)
|
||||
],
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
],
|
||||
|
@ -22,6 +22,7 @@ class ReadPageController extends GetxController {
|
||||
title.value = Get.parameters['title'] ?? '';
|
||||
id = Get.parameters['id']!;
|
||||
articleType = Get.parameters['articleType']!;
|
||||
url = 'https://www.bilibili.com/read/cv$id';
|
||||
scrollController.addListener(_scrollListener);
|
||||
fetchViewInfo();
|
||||
}
|
||||
@ -85,6 +86,15 @@ class ReadPageController extends GetxController {
|
||||
ReadHttp.getViewInfo(id: id);
|
||||
}
|
||||
|
||||
// 跳转webview
|
||||
void onJumpWebview() {
|
||||
Get.toNamed('/webview', parameters: {
|
||||
'url': url,
|
||||
'type': 'webview',
|
||||
'pageTitle': title.value,
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
scrollController.removeListener(_scrollListener);
|
||||
|
@ -72,9 +72,14 @@ class _ReadPageState extends State<ReadPage> {
|
||||
},
|
||||
),
|
||||
actions: [
|
||||
IconButton(
|
||||
icon: const Icon(Icons.more_vert_rounded),
|
||||
onPressed: () {},
|
||||
PopupMenuButton(
|
||||
icon: const Icon(Icons.more_vert_outlined),
|
||||
itemBuilder: (BuildContext context) => <PopupMenuEntry>[
|
||||
PopupMenuItem(
|
||||
onTap: controller.onJumpWebview,
|
||||
child: const Text('查看原网页'),
|
||||
)
|
||||
],
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
],
|
||||
|
@ -1,19 +1,8 @@
|
||||
// ignore_for_file: avoid_print
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:pilipala/http/init.dart';
|
||||
import 'package:pilipala/http/user.dart';
|
||||
import 'package:pilipala/pages/home/index.dart';
|
||||
import 'package:pilipala/pages/media/index.dart';
|
||||
import 'package:pilipala/utils/cookie.dart';
|
||||
import 'package:pilipala/utils/event_bus.dart';
|
||||
import 'package:pilipala/utils/id_utils.dart';
|
||||
import 'package:pilipala/utils/login.dart';
|
||||
import 'package:pilipala/utils/storage.dart';
|
||||
import 'package:webview_flutter/webview_flutter.dart';
|
||||
|
||||
class WebviewController extends GetxController {
|
||||
|
@ -82,7 +82,7 @@ class PiliSchame {
|
||||
case 'opus':
|
||||
if (path.startsWith('/detail')) {
|
||||
var opusId = path.split('/').last;
|
||||
Get.toNamed('/opus', arguments: {
|
||||
Get.toNamed('/opus', parameters: {
|
||||
'title': '',
|
||||
'id': opusId,
|
||||
'articleType': 'opus',
|
||||
|
Reference in New Issue
Block a user