Compare commits
2 Commits
feature-se
...
fix-bangum
Author | SHA1 | Date | |
---|---|---|---|
eb4435045b | |||
f1b829cec1 |
@ -490,9 +490,6 @@ class Api {
|
||||
/// 我的订阅详情
|
||||
static const userSubFolderDetail = '/x/space/fav/season/list';
|
||||
|
||||
/// 取消订阅
|
||||
static const userSubCancel = '/x/v3/fav/season/unfav';
|
||||
|
||||
/// 表情
|
||||
static const emojiList = '/x/emote/user/panel/web';
|
||||
|
||||
|
@ -349,21 +349,4 @@ class UserHttp {
|
||||
return {'status': false, 'msg': res.data['message']};
|
||||
}
|
||||
}
|
||||
|
||||
// 取消订阅
|
||||
static Future userSubCancel({required int seasonId}) async {
|
||||
var res = await Request().post(
|
||||
Api.userSubCancel,
|
||||
queryParameters: {
|
||||
'season_id': seasonId,
|
||||
'platform': 'web',
|
||||
'csrf': await Request.getCsrf(),
|
||||
},
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return {'status': true, 'msg': '取消订阅成功'};
|
||||
} else {
|
||||
return {'status': false, 'msg': res.data['message']};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -91,19 +91,21 @@ class HomeController extends GetxController with GetTickerProviderStateMixin {
|
||||
vsync: this,
|
||||
);
|
||||
// 监听 tabController 切换
|
||||
tabController.animation!.addListener(() {
|
||||
if (tabController.indexIsChanging) {
|
||||
if (initialIndex.value != tabController.index) {
|
||||
initialIndex.value = tabController.index;
|
||||
if (enableGradientBg) {
|
||||
tabController.animation!.addListener(() {
|
||||
if (tabController.indexIsChanging) {
|
||||
if (initialIndex.value != tabController.index) {
|
||||
initialIndex.value = tabController.index;
|
||||
}
|
||||
} else {
|
||||
final int temp = tabController.animation!.value.round();
|
||||
if (initialIndex.value != temp) {
|
||||
initialIndex.value = temp;
|
||||
tabController.index = initialIndex.value;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
final int temp = tabController.animation!.value.round();
|
||||
if (initialIndex.value != temp) {
|
||||
initialIndex.value = temp;
|
||||
tabController.index = initialIndex.value;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void searchDefault() async {
|
||||
|
@ -46,41 +46,4 @@ class SubController extends GetxController {
|
||||
Future onLoad() async {
|
||||
querySubFolder(type: 'onload');
|
||||
}
|
||||
|
||||
// 取消订阅
|
||||
Future<dynamic> cancelSub({required int id}) async {
|
||||
showDialog(
|
||||
context: Get.context!,
|
||||
builder: (context) {
|
||||
return AlertDialog(
|
||||
title: const Text('提示'),
|
||||
content: const Text('确认要取消订阅吗?'),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Get.back(),
|
||||
child: Text(
|
||||
'取消',
|
||||
style:
|
||||
TextStyle(color: Theme.of(context).colorScheme.outline),
|
||||
)),
|
||||
TextButton(
|
||||
onPressed: () async {
|
||||
Get.back();
|
||||
var res = await UserHttp.userSubCancel(seasonId: id);
|
||||
if (res['status']) {
|
||||
SmartDialog.showToast('取消订阅成功');
|
||||
subFolderData.value.list!
|
||||
.removeWhere((element) => element.id == id);
|
||||
subFolderData.update((val) {});
|
||||
} else {
|
||||
SmartDialog.showToast(res['msg']);
|
||||
}
|
||||
},
|
||||
child: const Text('确认'),
|
||||
)
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -57,15 +57,8 @@ class _SubPageState extends State<SubPage> {
|
||||
itemCount: _subController.subFolderData.value.list!.length,
|
||||
itemBuilder: (context, index) {
|
||||
return SubItem(
|
||||
subFolderItem:
|
||||
_subController.subFolderData.value.list![index],
|
||||
fuc: () {
|
||||
_subController.cancelSub(
|
||||
id: _subController
|
||||
.subFolderData.value.list![index].id!,
|
||||
);
|
||||
},
|
||||
);
|
||||
subFolderItem:
|
||||
_subController.subFolderData.value.list![index]);
|
||||
},
|
||||
),
|
||||
);
|
||||
|
@ -8,8 +8,7 @@ import '../../../models/user/sub_folder.dart';
|
||||
|
||||
class SubItem extends StatelessWidget {
|
||||
final SubFolderItemData subFolderItem;
|
||||
final Function fuc;
|
||||
const SubItem({super.key, required this.subFolderItem, required this.fuc});
|
||||
const SubItem({super.key, required this.subFolderItem});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -52,7 +51,7 @@ class SubItem extends StatelessWidget {
|
||||
},
|
||||
),
|
||||
),
|
||||
VideoContent(subFolderItem: subFolderItem, fuc: fuc)
|
||||
VideoContent(subFolderItem: subFolderItem)
|
||||
],
|
||||
),
|
||||
);
|
||||
@ -65,9 +64,7 @@ class SubItem extends StatelessWidget {
|
||||
|
||||
class VideoContent extends StatelessWidget {
|
||||
final SubFolderItemData subFolderItem;
|
||||
final Function fuc;
|
||||
const VideoContent(
|
||||
{super.key, required this.subFolderItem, required this.fuc});
|
||||
const VideoContent({super.key, required this.subFolderItem});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -103,20 +100,6 @@ class VideoContent extends StatelessWidget {
|
||||
color: Theme.of(context).colorScheme.outline,
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
SizedBox(
|
||||
height: 34,
|
||||
child: TextButton(
|
||||
onPressed: () => fuc(),
|
||||
style: TextButton.styleFrom(
|
||||
padding: const EdgeInsets.fromLTRB(15, 0, 15, 0),
|
||||
foregroundColor: Theme.of(context).colorScheme.outline,
|
||||
backgroundColor:
|
||||
Theme.of(context).colorScheme.onInverseSurface, // 设置按钮背景色
|
||||
),
|
||||
child: const Text('取消订阅'),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
@ -129,6 +129,7 @@ class VideoDetailController extends GetxController
|
||||
videoDetailCtr: this,
|
||||
floating: floating,
|
||||
bvid: bvid,
|
||||
videoType: videoType,
|
||||
);
|
||||
// CDN优化
|
||||
enableCDN = setting.get(SettingBoxKey.enableCDN, defaultValue: true);
|
||||
|
@ -572,6 +572,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
controller: plPlayerController,
|
||||
videoDetailCtr: videoDetailController,
|
||||
bvid: videoDetailController.bvid,
|
||||
videoType: videoDetailController.videoType,
|
||||
),
|
||||
danmuWidget: Obx(
|
||||
() => PlDanmaku(
|
||||
|
@ -19,6 +19,7 @@ import 'package:pilipala/plugin/pl_player/models/play_repeat.dart';
|
||||
import 'package:pilipala/utils/storage.dart';
|
||||
import 'package:pilipala/http/danmaku.dart';
|
||||
import 'package:pilipala/services/shutdown_timer_service.dart';
|
||||
import '../../../../models/common/search_type.dart';
|
||||
import '../../../../models/video_detail_res.dart';
|
||||
import '../introduction/index.dart';
|
||||
|
||||
@ -28,12 +29,14 @@ class HeaderControl extends StatefulWidget implements PreferredSizeWidget {
|
||||
this.videoDetailCtr,
|
||||
this.floating,
|
||||
this.bvid,
|
||||
this.videoType,
|
||||
super.key,
|
||||
});
|
||||
final PlPlayerController? controller;
|
||||
final VideoDetailController? videoDetailCtr;
|
||||
final Floating? floating;
|
||||
final String? bvid;
|
||||
final SearchType? videoType;
|
||||
|
||||
@override
|
||||
State<HeaderControl> createState() => _HeaderControlState();
|
||||
@ -1107,14 +1110,16 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
},
|
||||
),
|
||||
SizedBox(width: buttonSpace),
|
||||
if (showTitle && isLandscape) ...[
|
||||
if (showTitle &&
|
||||
isLandscape &&
|
||||
widget.videoType == SearchType.video) ...[
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
ConstrainedBox(
|
||||
constraints: BoxConstraints(maxWidth: 200),
|
||||
constraints: const BoxConstraints(maxWidth: 200),
|
||||
child: Text(
|
||||
videoIntroController.videoDetail.value.title!,
|
||||
videoIntroController.videoDetail.value.title ?? '',
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
|
Reference in New Issue
Block a user