mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
mod: show total ss
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -23,14 +23,19 @@ class SeasonSeriesPage extends StatefulWidget {
|
|||||||
State<SeasonSeriesPage> createState() => _SeasonSeriesPageState();
|
State<SeasonSeriesPage> createState() => _SeasonSeriesPageState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _SeasonSeriesPageState extends State<SeasonSeriesPage> {
|
class _SeasonSeriesPageState extends State<SeasonSeriesPage>
|
||||||
|
with AutomaticKeepAliveClientMixin {
|
||||||
late final _controller = Get.put(
|
late final _controller = Get.put(
|
||||||
SeasonSeriesController(widget.mid),
|
SeasonSeriesController(widget.mid),
|
||||||
tag: widget.heroTag,
|
tag: widget.heroTag,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool get wantKeepAlive => true;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
super.build(context);
|
||||||
return Obx(() => _buildBody(_controller.loadingState.value));
|
return Obx(() => _buildBody(_controller.loadingState.value));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,11 +2,8 @@ import 'package:PiliPlus/common/constants.dart';
|
|||||||
import 'package:PiliPlus/common/widgets/badge.dart';
|
import 'package:PiliPlus/common/widgets/badge.dart';
|
||||||
import 'package:PiliPlus/common/widgets/image_save.dart';
|
import 'package:PiliPlus/common/widgets/image_save.dart';
|
||||||
import 'package:PiliPlus/common/widgets/network_img_layer.dart';
|
import 'package:PiliPlus/common/widgets/network_img_layer.dart';
|
||||||
import 'package:PiliPlus/pages/member/new/content/member_contribute/content/video/member_video.dart';
|
|
||||||
import 'package:PiliPlus/pages/member/new/content/member_contribute/member_contribute.dart';
|
|
||||||
import 'package:PiliPlus/utils/utils.dart';
|
import 'package:PiliPlus/utils/utils.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
|
||||||
|
|
||||||
class SeasonSeriesCard extends StatelessWidget {
|
class SeasonSeriesCard extends StatelessWidget {
|
||||||
const SeasonSeriesCard({
|
const SeasonSeriesCard({
|
||||||
|
|||||||
@@ -32,17 +32,26 @@ class MemberContributeCtr extends CommonController
|
|||||||
if (contribute.items?.isNullOrEmpty == false &&
|
if (contribute.items?.isNullOrEmpty == false &&
|
||||||
contribute.items!.length > 1) {
|
contribute.items!.length > 1) {
|
||||||
items = contribute.items;
|
items = contribute.items;
|
||||||
if (_ctr.ugcSeasonCount != null) {
|
// if (_ctr.ugcSeasonCount != null) {
|
||||||
int currentSeasonCount =
|
// int currentSeasonCount =
|
||||||
items!.where((item) => item.param == 'season_video').length;
|
// items!.where((item) => item.param == 'season_video').length;
|
||||||
if (currentSeasonCount < _ctr.ugcSeasonCount!) {
|
// if (currentSeasonCount < _ctr.ugcSeasonCount!) {
|
||||||
items!.add(
|
// items!.add(
|
||||||
Item(
|
// Item(
|
||||||
param: 'ugcSeason',
|
// param: 'ugcSeason',
|
||||||
title: '全部合集/列表',
|
// title: '全部合集/列表',
|
||||||
),
|
// ),
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
|
// show if exist
|
||||||
|
if (_ctr.hasSeasonOrSeries == true) {
|
||||||
|
items!.add(
|
||||||
|
Item(
|
||||||
|
param: 'ugcSeason',
|
||||||
|
title: '全部合集/列表',
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
tabs = items!.map((item) => Tab(text: item.title)).toList();
|
tabs = items!.map((item) => Tab(text: item.title)).toList();
|
||||||
tabController = TabController(
|
tabController = TabController(
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'package:PiliPlus/http/loading_state.dart';
|
import 'package:PiliPlus/http/loading_state.dart';
|
||||||
import 'package:PiliPlus/http/member.dart';
|
import 'package:PiliPlus/http/member.dart';
|
||||||
import 'package:PiliPlus/http/video.dart';
|
import 'package:PiliPlus/http/video.dart';
|
||||||
|
import 'package:PiliPlus/models/space/data.dart';
|
||||||
import 'package:PiliPlus/models/space/tab2.dart';
|
import 'package:PiliPlus/models/space/tab2.dart';
|
||||||
import 'package:PiliPlus/pages/common/common_controller.dart';
|
import 'package:PiliPlus/pages/common/common_controller.dart';
|
||||||
import 'package:PiliPlus/utils/storage.dart';
|
import 'package:PiliPlus/utils/storage.dart';
|
||||||
@@ -31,7 +32,7 @@ class MemberControllerNew extends CommonController
|
|||||||
List<Tab2>? tab2;
|
List<Tab2>? tab2;
|
||||||
RxInt contributeInitialIndex = 0.obs;
|
RxInt contributeInitialIndex = 0.obs;
|
||||||
double? top;
|
double? top;
|
||||||
int? ugcSeasonCount;
|
bool? hasSeasonOrSeries;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() {
|
||||||
@@ -47,26 +48,28 @@ class MemberControllerNew extends CommonController
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
bool customHandleResponse(Success response) {
|
bool customHandleResponse(Success response) {
|
||||||
username = response.response?.card?.name ?? '';
|
Data data = response.response;
|
||||||
isFollow.value = response.response?.card?.relation?.isFollow == 1;
|
username = data.card?.name ?? '';
|
||||||
relation.value = response.response?.relSpecial == 1
|
isFollow.value = data.card?.relation?.isFollow == 1;
|
||||||
? 2
|
relation.value = data.relSpecial == 1 ? 2 : data.relation ?? 1;
|
||||||
: response.response?.relation ?? 1;
|
tab2 = data.tab2;
|
||||||
tab2 = response.response.tab2;
|
live = data.live;
|
||||||
live = response.response?.live;
|
silence = data.card?.silence;
|
||||||
silence = response.response?.card?.silence;
|
if ((data.ugcSeason?.count != null && data.ugcSeason?.count != 0) ||
|
||||||
ugcSeasonCount = response.response?.ugcSeason?.count;
|
data.series?.item?.isNotEmpty == true) {
|
||||||
if (response.response?.card?.endTime != null) {
|
hasSeasonOrSeries = true;
|
||||||
if (response.response.card.endTime == 0) {
|
}
|
||||||
|
if (data.card?.endTime != null) {
|
||||||
|
if (data.card!.endTime == 0) {
|
||||||
endTime = ': 永久封禁';
|
endTime = ': 永久封禁';
|
||||||
} else if (response.response.card.endTime >
|
} else if (data.card!.endTime! >
|
||||||
DateTime.now().millisecondsSinceEpoch ~/ 1000) {
|
DateTime.now().millisecondsSinceEpoch ~/ 1000) {
|
||||||
endTime =
|
endTime =
|
||||||
':至 ${DateFormat('yyyy-MM-dd HH:mm:ss').format(DateTime.fromMillisecondsSinceEpoch(response.response.card.endTime * 1000))}';
|
':至 ${DateFormat('yyyy-MM-dd HH:mm:ss').format(DateTime.fromMillisecondsSinceEpoch(data.card!.endTime! * 1000))}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (tab2 != null && tab2!.isNotEmpty) {
|
if (tab2 != null && tab2!.isNotEmpty) {
|
||||||
if (!response.response.tab.toJson().values.contains(true) &&
|
if (!data.tab!.toJson().values.contains(true) &&
|
||||||
tab2!.first.param == 'home') {
|
tab2!.first.param == 'home') {
|
||||||
// remove empty home tab
|
// remove empty home tab
|
||||||
tab2!.removeAt(0);
|
tab2!.removeAt(0);
|
||||||
@@ -80,11 +83,11 @@ class MemberControllerNew extends CommonController
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (initialIndex == -1) {
|
if (initialIndex == -1) {
|
||||||
if (response.response.defaultTab == 'video') {
|
if (data.defaultTab == 'video') {
|
||||||
response.response.defaultTab = 'dynamic';
|
data.defaultTab = 'dynamic';
|
||||||
}
|
}
|
||||||
initialIndex = tab2!.indexWhere((item) {
|
initialIndex = tab2!.indexWhere((item) {
|
||||||
return item.param == response.response.defaultTab;
|
return item.param == data.defaultTab;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
tabs = tab2!.map((item) => Tab(text: item.title ?? '')).toList();
|
tabs = tab2!.map((item) => Tab(text: item.title ?? '')).toList();
|
||||||
|
|||||||
Reference in New Issue
Block a user