Merge branch 'main' into design
This commit is contained in:
@ -46,7 +46,7 @@ class ApiInterceptor extends Interceptor {
|
|||||||
// 处理网络请求错误
|
// 处理网络请求错误
|
||||||
// handler.next(err);
|
// handler.next(err);
|
||||||
String url = err.requestOptions.uri.toString();
|
String url = err.requestOptions.uri.toString();
|
||||||
if (!url.contains('heartBeat')) {
|
if (!url.contains('heartbeat')) {
|
||||||
SmartDialog.showToast(
|
SmartDialog.showToast(
|
||||||
await dioError(err),
|
await dioError(err),
|
||||||
displayType: SmartToastType.onlyRefresh,
|
displayType: SmartToastType.onlyRefresh,
|
||||||
|
|||||||
@ -218,7 +218,7 @@ class AboutController extends GetxController {
|
|||||||
RxString currentVersion = ''.obs;
|
RxString currentVersion = ''.obs;
|
||||||
RxString remoteVersion = ''.obs;
|
RxString remoteVersion = ''.obs;
|
||||||
late LatestDataModel remoteAppInfo;
|
late LatestDataModel remoteAppInfo;
|
||||||
RxBool isUpdate = true.obs;
|
RxBool isUpdate = false.obs;
|
||||||
RxBool isLoading = true.obs;
|
RxBool isLoading = true.obs;
|
||||||
late LatestDataModel data;
|
late LatestDataModel data;
|
||||||
|
|
||||||
|
|||||||
@ -40,10 +40,10 @@ class MainController extends GetxController {
|
|||||||
dynamicBadgeType.value = DynamicBadgeMode.values[setting.get(
|
dynamicBadgeType.value = DynamicBadgeMode.values[setting.get(
|
||||||
SettingBoxKey.dynamicBadgeMode,
|
SettingBoxKey.dynamicBadgeMode,
|
||||||
defaultValue: DynamicBadgeMode.number.code)];
|
defaultValue: DynamicBadgeMode.number.code)];
|
||||||
|
setNavBarConfig();
|
||||||
if (dynamicBadgeType.value != DynamicBadgeMode.hidden) {
|
if (dynamicBadgeType.value != DynamicBadgeMode.hidden) {
|
||||||
getUnreadDynamic();
|
getUnreadDynamic();
|
||||||
}
|
}
|
||||||
setNavBarConfig();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void onBackPressed(BuildContext context) {
|
void onBackPressed(BuildContext context) {
|
||||||
|
|||||||
@ -138,14 +138,14 @@ class _MainAppState extends State<MainApp> with SingleTickerProviderStateMixin {
|
|||||||
duration: const Duration(milliseconds: 500),
|
duration: const Duration(milliseconds: 500),
|
||||||
offset: Offset(0, snapshot.data ? 0 : 1),
|
offset: Offset(0, snapshot.data ? 0 : 1),
|
||||||
child: GlobalData().enableMYBar
|
child: GlobalData().enableMYBar
|
||||||
? NavigationBar(
|
? Obx(
|
||||||
onDestinationSelected: (value) => setIndex(value),
|
() => NavigationBar(
|
||||||
selectedIndex: _mainController.selectedIndex,
|
onDestinationSelected: (value) => setIndex(value),
|
||||||
destinations: <Widget>[
|
selectedIndex: _mainController.selectedIndex,
|
||||||
..._mainController.navigationBars.map((e) {
|
destinations: <Widget>[
|
||||||
return NavigationDestination(
|
..._mainController.navigationBars.map((e) {
|
||||||
icon: Obx(
|
return NavigationDestination(
|
||||||
() => Badge(
|
icon: Badge(
|
||||||
label: _mainController
|
label: _mainController
|
||||||
.dynamicBadgeType.value ==
|
.dynamicBadgeType.value ==
|
||||||
DynamicBadgeMode.number
|
DynamicBadgeMode.number
|
||||||
@ -159,25 +159,25 @@ class _MainAppState extends State<MainApp> with SingleTickerProviderStateMixin {
|
|||||||
e['count'] > 0,
|
e['count'] > 0,
|
||||||
child: e['icon'],
|
child: e['icon'],
|
||||||
),
|
),
|
||||||
),
|
selectedIcon: e['selectIcon'],
|
||||||
selectedIcon: e['selectIcon'],
|
label: e['label'],
|
||||||
label: e['label'],
|
);
|
||||||
);
|
}).toList(),
|
||||||
}).toList(),
|
],
|
||||||
],
|
),
|
||||||
)
|
)
|
||||||
: BottomNavigationBar(
|
: Obx(
|
||||||
currentIndex: _mainController.selectedIndex,
|
() => BottomNavigationBar(
|
||||||
type: BottomNavigationBarType.fixed,
|
currentIndex: _mainController.selectedIndex,
|
||||||
onTap: (value) => setIndex(value),
|
type: BottomNavigationBarType.fixed,
|
||||||
iconSize: 16,
|
onTap: (value) => setIndex(value),
|
||||||
selectedFontSize: 12,
|
iconSize: 16,
|
||||||
unselectedFontSize: 12,
|
selectedFontSize: 12,
|
||||||
items: [
|
unselectedFontSize: 12,
|
||||||
..._mainController.navigationBars.map((e) {
|
items: [
|
||||||
return BottomNavigationBarItem(
|
..._mainController.navigationBars.map((e) {
|
||||||
icon: Obx(
|
return BottomNavigationBarItem(
|
||||||
() => Badge(
|
icon: Badge(
|
||||||
label: _mainController
|
label: _mainController
|
||||||
.dynamicBadgeType.value ==
|
.dynamicBadgeType.value ==
|
||||||
DynamicBadgeMode.number
|
DynamicBadgeMode.number
|
||||||
@ -191,12 +191,12 @@ class _MainAppState extends State<MainApp> with SingleTickerProviderStateMixin {
|
|||||||
e['count'] > 0,
|
e['count'] > 0,
|
||||||
child: e['icon'],
|
child: e['icon'],
|
||||||
),
|
),
|
||||||
),
|
activeIcon: e['selectIcon'],
|
||||||
activeIcon: e['selectIcon'],
|
label: e['label'],
|
||||||
label: e['label'],
|
);
|
||||||
);
|
}).toList(),
|
||||||
}).toList(),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@ -450,6 +450,7 @@ class VideoIntroController extends GetxController {
|
|||||||
videoDetailCtr.danmakuCid.value = cid;
|
videoDetailCtr.danmakuCid.value = cid;
|
||||||
videoDetailCtr.cover.value = cover;
|
videoDetailCtr.cover.value = cover;
|
||||||
videoDetailCtr.queryVideoUrl();
|
videoDetailCtr.queryVideoUrl();
|
||||||
|
videoDetailCtr.getSubtitle();
|
||||||
// 重新请求评论
|
// 重新请求评论
|
||||||
try {
|
try {
|
||||||
/// 未渲染回复组件时可能异常
|
/// 未渲染回复组件时可能异常
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import 'package:pilipala/pages/preview/index.dart';
|
|||||||
import 'package:pilipala/pages/video/detail/index.dart';
|
import 'package:pilipala/pages/video/detail/index.dart';
|
||||||
import 'package:pilipala/pages/video/detail/reply_new/index.dart';
|
import 'package:pilipala/pages/video/detail/reply_new/index.dart';
|
||||||
import 'package:pilipala/utils/feed_back.dart';
|
import 'package:pilipala/utils/feed_back.dart';
|
||||||
|
import 'package:pilipala/utils/id_utils.dart';
|
||||||
import 'package:pilipala/utils/storage.dart';
|
import 'package:pilipala/utils/storage.dart';
|
||||||
import 'package:pilipala/utils/url_utils.dart';
|
import 'package:pilipala/utils/url_utils.dart';
|
||||||
import 'package:pilipala/utils/utils.dart';
|
import 'package:pilipala/utils/utils.dart';
|
||||||
@ -642,23 +643,25 @@ InlineSpan buildContent(
|
|||||||
'',
|
'',
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
final String redirectUrl =
|
final String pathSegment = Uri.parse(matchStr).path;
|
||||||
await UrlUtils.parseRedirectUrl(matchStr);
|
Map matchRes = IdUtils.matchAvorBv(input: pathSegment);
|
||||||
if (redirectUrl == matchStr) {
|
List matchKeys = matchRes.keys.toList();
|
||||||
Clipboard.setData(ClipboardData(text: matchStr));
|
if (matchKeys.isNotEmpty) {
|
||||||
SmartDialog.showToast('地址可能有误');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
final String pathSegment = Uri.parse(redirectUrl).path;
|
|
||||||
final String lastPathSegment =
|
|
||||||
pathSegment.split('/').last;
|
|
||||||
if (lastPathSegment.startsWith('BV')) {
|
|
||||||
UrlUtils.matchUrlPush(
|
UrlUtils.matchUrlPush(
|
||||||
lastPathSegment,
|
matchRes.containsKey('AV')
|
||||||
|
? matchRes['AV']! as int
|
||||||
|
: matchRes['BV'],
|
||||||
title,
|
title,
|
||||||
redirectUrl,
|
matchStr,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
final String redirectUrl =
|
||||||
|
await UrlUtils.parseRedirectUrl(matchStr);
|
||||||
|
// if (redirectUrl == matchStr) {
|
||||||
|
// Clipboard.setData(ClipboardData(text: matchStr));
|
||||||
|
// SmartDialog.showToast('地址可能有误');
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
Get.toNamed(
|
Get.toNamed(
|
||||||
'/webview',
|
'/webview',
|
||||||
parameters: {
|
parameters: {
|
||||||
|
|||||||
@ -52,15 +52,19 @@ class WebviewController extends GetxController {
|
|||||||
loadProgress.value = progress;
|
loadProgress.value = progress;
|
||||||
},
|
},
|
||||||
onPageStarted: (String url) {
|
onPageStarted: (String url) {
|
||||||
final String str = Uri.parse(url).pathSegments[0];
|
final List pathSegments = Uri.parse(url).pathSegments;
|
||||||
final Map matchRes = IdUtils.matchAvorBv(input: str);
|
if (pathSegments.isNotEmpty &&
|
||||||
final List matchKeys = matchRes.keys.toList();
|
url != 'https://passport.bilibili.com/h5-app/passport/login') {
|
||||||
if (matchKeys.isNotEmpty) {
|
final String str = pathSegments[0];
|
||||||
if (matchKeys.first == 'BV') {
|
final Map matchRes = IdUtils.matchAvorBv(input: str);
|
||||||
Get.offAndToNamed(
|
final List matchKeys = matchRes.keys.toList();
|
||||||
'/searchResult',
|
if (matchKeys.isNotEmpty) {
|
||||||
parameters: {'keyword': matchRes['BV']},
|
if (matchKeys.first == 'BV') {
|
||||||
);
|
Get.offAndToNamed(
|
||||||
|
'/searchResult',
|
||||||
|
parameters: {'keyword': matchRes['BV']},
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -334,7 +334,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
fuc: () => _.triggerFullScreen(),
|
fuc: () => _.triggerFullScreen(status: !_.isFullScreen.value),
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
final List<Widget> list = [];
|
final List<Widget> list = [];
|
||||||
|
|||||||
@ -26,7 +26,7 @@ class VideoPlayerServiceHandler extends BaseAudioHandler with SeekHandler {
|
|||||||
static final List<MediaItem> _item = [];
|
static final List<MediaItem> _item = [];
|
||||||
Box setting = GStrorage.setting;
|
Box setting = GStrorage.setting;
|
||||||
bool enableBackgroundPlay = false;
|
bool enableBackgroundPlay = false;
|
||||||
PlPlayerController player = PlPlayerController.getInstance(videoType: 'none');
|
PlPlayerController player = PlPlayerController.getInstance();
|
||||||
|
|
||||||
VideoPlayerServiceHandler() {
|
VideoPlayerServiceHandler() {
|
||||||
revalidateSetting();
|
revalidateSetting();
|
||||||
|
|||||||
@ -4,7 +4,6 @@ import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:pilipala/utils/route_push.dart';
|
import 'package:pilipala/utils/route_push.dart';
|
||||||
import '../http/search.dart';
|
import '../http/search.dart';
|
||||||
import '../models/common/search_type.dart';
|
|
||||||
import 'id_utils.dart';
|
import 'id_utils.dart';
|
||||||
import 'url_utils.dart';
|
import 'url_utils.dart';
|
||||||
import 'utils.dart';
|
import 'utils.dart';
|
||||||
@ -140,11 +139,13 @@ class PiliSchame {
|
|||||||
print('bilibili.com path: $path');
|
print('bilibili.com path: $path');
|
||||||
final String lastPathSegment = path!.split('/').last;
|
final String lastPathSegment = path!.split('/').last;
|
||||||
if (path.startsWith('/video')) {
|
if (path.startsWith('/video')) {
|
||||||
if (lastPathSegment.contains('BV')) {
|
Map matchRes = IdUtils.matchAvorBv(input: path);
|
||||||
_videoPush(null, lastPathSegment);
|
if (matchRes.containsKey('AV')) {
|
||||||
}
|
_videoPush(matchRes['AV']! as int, null);
|
||||||
if (lastPathSegment.contains('av')) {
|
} else if (matchRes.containsKey('BV')) {
|
||||||
_videoPush(Utils.matchNum(lastPathSegment)[0], null);
|
_videoPush(null, matchRes['BV'] as String);
|
||||||
|
} else {
|
||||||
|
SmartDialog.showToast('投稿匹配失败');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (path.startsWith('/bangumi')) {
|
if (path.startsWith('/bangumi')) {
|
||||||
|
|||||||
Reference in New Issue
Block a user