mod: 样式修改、历史记录修改
This commit is contained in:
@ -305,11 +305,11 @@ class VideoHttp {
|
||||
}
|
||||
|
||||
// 视频播放进度
|
||||
static Future heartBeat({bvid, progress, realtime}) async {
|
||||
static Future heartBeat({bvid, cid, progress, realtime}) async {
|
||||
var res = await Request().post(Api.heartBeat, queryParameters: {
|
||||
// 'aid': aid,
|
||||
'bvid': bvid,
|
||||
// 'cid': '',
|
||||
'cid': cid,
|
||||
// 'epid': '',
|
||||
// 'sid': '',
|
||||
// 'mid': '',
|
||||
|
||||
@ -20,10 +20,9 @@ class HistoryItem extends StatelessWidget {
|
||||
return InkWell(
|
||||
onTap: () async {
|
||||
int cid = videoItem.history.cid ??
|
||||
videoItem.history.oid ??
|
||||
// videoItem.history.oid ??
|
||||
await SearchHttp.ab2c(aid: aid, bvid: bvid);
|
||||
await Future.delayed(const Duration(milliseconds: 200));
|
||||
print(videoItem.history.business);
|
||||
if (videoItem.history.business.contains('article')) {
|
||||
Get.toNamed(
|
||||
'/webview',
|
||||
|
||||
@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:pilipala/pages/home/index.dart';
|
||||
import 'package:pilipala/pages/hot/index.dart';
|
||||
import 'package:salomon_bottom_bar/salomon_bottom_bar.dart';
|
||||
import './controller.dart';
|
||||
|
||||
class MainApp extends StatefulWidget {
|
||||
@ -103,7 +102,6 @@ class _MainAppState extends State<MainApp> with SingleTickerProviderStateMixin {
|
||||
),
|
||||
child: PageView(
|
||||
controller: _pageController,
|
||||
// physics: const NeverScrollableScrollPhysics(),
|
||||
onPageChanged: (index) {
|
||||
selectedIndex = index;
|
||||
setState(() {});
|
||||
@ -112,16 +110,21 @@ class _MainAppState extends State<MainApp> with SingleTickerProviderStateMixin {
|
||||
),
|
||||
),
|
||||
),
|
||||
bottomNavigationBar: SalomonBottomBar(
|
||||
bottomNavigationBar: BottomNavigationBar(
|
||||
currentIndex: selectedIndex,
|
||||
type: BottomNavigationBarType.shifting,
|
||||
selectedItemColor: Theme.of(context).colorScheme.primary,
|
||||
unselectedItemColor: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
selectedFontSize: 12.4,
|
||||
onTap: (value) => setIndex(value),
|
||||
items: _mainController.navigationBars.map((e) {
|
||||
return SalomonBottomBarItem(
|
||||
icon: e['icon'],
|
||||
title: Text(e['label']),
|
||||
selectedColor: Theme.of(context).colorScheme.primary,
|
||||
);
|
||||
}).toList(),
|
||||
items: [
|
||||
..._mainController.navigationBars.map((e) {
|
||||
return BottomNavigationBarItem(
|
||||
icon: e['icon'],
|
||||
label: e['label'],
|
||||
);
|
||||
}).toList(),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@ -49,6 +49,8 @@ class VideoDetailController extends GetxController
|
||||
|
||||
Timer? timer;
|
||||
|
||||
RxString bgCover = ''.obs;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
@ -58,10 +60,12 @@ class VideoDetailController extends GetxController
|
||||
var args = Get.arguments['videoItem'];
|
||||
if (args.pic != null && args.pic != '') {
|
||||
videoItem['pic'] = args.pic;
|
||||
bgCover.value = args.pic;
|
||||
}
|
||||
}
|
||||
if (Get.arguments.containsKey('pic')) {
|
||||
videoItem['pic'] = Get.arguments['pic'];
|
||||
bgCover.value = Get.arguments['pic'];
|
||||
}
|
||||
heroTag = Get.arguments['heroTag'];
|
||||
}
|
||||
@ -135,7 +139,11 @@ class VideoDetailController extends GetxController
|
||||
|
||||
void markHeartBeat() async {
|
||||
Duration progress = meeduPlayerController.position.value;
|
||||
await VideoHttp.heartBeat(bvid: bvid, progress: progress.inSeconds);
|
||||
await VideoHttp.heartBeat(
|
||||
bvid: bvid,
|
||||
cid: cid,
|
||||
progress: progress.inSeconds,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@ -78,8 +78,13 @@ Widget seasonPanel(UgcSeason ugcSeason, cid) {
|
||||
padding: const EdgeInsets.fromLTRB(10, 10, 10, 10),
|
||||
child: Row(
|
||||
children: [
|
||||
Text('合集:${ugcSeason.title!}'),
|
||||
const Spacer(),
|
||||
Expanded(
|
||||
child: Text(
|
||||
'合集:${ugcSeason.title!}',
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 15),
|
||||
Text(
|
||||
'${currentIndex + 1} / ${ugcSeason.epCount}',
|
||||
style: Theme.of(context).textTheme.labelSmall,
|
||||
|
||||
@ -345,10 +345,11 @@ class ReplyItemRow extends StatelessWidget {
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.fromLTRB(
|
||||
8,
|
||||
i == 0 && (extraRow == 1 || replies!.length > 1) ? 8 : 5,
|
||||
8,
|
||||
5),
|
||||
8,
|
||||
i == 0 && (extraRow == 1 || replies!.length > 1) ? 8 : 5,
|
||||
8,
|
||||
i == 0 && (extraRow == 1 || replies!.length > 1) ? 5 : 6,
|
||||
),
|
||||
child: Text.rich(
|
||||
overflow: extraRow == 1
|
||||
? TextOverflow.ellipsis
|
||||
|
||||
@ -31,11 +31,6 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
final ScrollController _extendNestCtr = ScrollController();
|
||||
late AnimationController animationController;
|
||||
|
||||
// final _meeduPlayerController = MeeduPlayerController(
|
||||
// pipEnabled: true,
|
||||
// controlsStyle: ControlsStyle.secondary,
|
||||
// enabledButtons: const EnabledButtons(pip: true),
|
||||
// );
|
||||
StreamSubscription? _playerEventSubs;
|
||||
bool isPlay = false;
|
||||
PlayerStatus playerStatus = PlayerStatus.paused;
|
||||
@ -154,11 +149,13 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: NetworkImgLayer(
|
||||
type: 'emote',
|
||||
src: videoDetailController.videoItem['pic'],
|
||||
width: Get.size.width,
|
||||
height: videoHeight + 100,
|
||||
child: Obx(
|
||||
() => NetworkImgLayer(
|
||||
type: 'emote',
|
||||
src: videoDetailController.bgCover.value,
|
||||
width: Get.size.width,
|
||||
height: videoHeight,
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned.fill(
|
||||
@ -226,15 +223,6 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
size: 19,
|
||||
),
|
||||
),
|
||||
title: Text(
|
||||
'视频详情',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: Theme.of(context)
|
||||
.textTheme
|
||||
.titleSmall!
|
||||
.fontSize),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
@ -304,14 +292,6 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
),
|
||||
),
|
||||
),
|
||||
// 弹幕开关
|
||||
// const Spacer(),
|
||||
// Flexible(
|
||||
// flex: 2,
|
||||
// child: Container(
|
||||
// height: 50,
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user