mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-07-29 23:10:13 +08:00
opt handle res
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -6,7 +6,10 @@ import 'package:PiliPlus/grpc/view.dart';
|
||||
import 'package:PiliPlus/http/constants.dart';
|
||||
import 'package:PiliPlus/http/user.dart';
|
||||
import 'package:PiliPlus/http/video.dart';
|
||||
import 'package:PiliPlus/models/pgc/info.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/episode.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/result.dart';
|
||||
import 'package:PiliPlus/models/pgc_lcf.dart';
|
||||
import 'package:PiliPlus/models/triple/pgc_triple.dart';
|
||||
import 'package:PiliPlus/models/user/fav_folder.dart';
|
||||
import 'package:PiliPlus/models/video_tag/data.dart';
|
||||
import 'package:PiliPlus/pages/dynamics_repost/view.dart';
|
||||
@@ -87,9 +90,10 @@ class BangumiIntroController extends GetxController {
|
||||
Future<void> queryBangumiLikeCoinFav() async {
|
||||
var result = await VideoHttp.bangumiLikeCoinFav(epId: epId);
|
||||
if (result['status']) {
|
||||
hasLike.value = result["data"]['like'] == 1;
|
||||
_coinNum.value = result["data"]['coin_number'];
|
||||
hasFav.value = result["data"]['favorite'] == 1;
|
||||
PgcLCF data = result['data'];
|
||||
hasLike.value = data.like == 1;
|
||||
_coinNum.value = data.coinNumber!;
|
||||
hasFav.value = data.favorite == 1;
|
||||
} else {
|
||||
SmartDialog.showToast(result['msg']);
|
||||
}
|
||||
@@ -100,8 +104,8 @@ class BangumiIntroController extends GetxController {
|
||||
var result = await VideoHttp.likeVideo(bvid: bvid, type: !hasLike.value);
|
||||
if (result['status']) {
|
||||
SmartDialog.showToast(!hasLike.value ? result['data']['toast'] : '取消赞');
|
||||
bangumiItem.stat!['likes'] =
|
||||
bangumiItem.stat!['likes'] + (!hasLike.value ? 1 : -1);
|
||||
bangumiItem.stat!.likes =
|
||||
bangumiItem.stat!.likes! + (!hasLike.value ? 1 : -1);
|
||||
hasLike.value = !hasLike.value;
|
||||
} else {
|
||||
SmartDialog.showToast(result['msg']);
|
||||
@@ -116,10 +120,10 @@ class BangumiIntroController extends GetxController {
|
||||
);
|
||||
if (res['status']) {
|
||||
SmartDialog.showToast('投币成功');
|
||||
bangumiItem.stat!['coins'] = bangumiItem.stat!['coins'] + coin;
|
||||
bangumiItem.stat!.coins = bangumiItem.stat!.coins! + coin;
|
||||
if (selectLike && hasLike.value.not) {
|
||||
hasLike.value = true;
|
||||
bangumiItem.stat!['likes'] = bangumiItem.stat!['likes'] + 1;
|
||||
bangumiItem.stat!.likes = bangumiItem.stat!.likes! + 1;
|
||||
}
|
||||
_coinNum.value += coin;
|
||||
GlobalData().afterCoin(coin);
|
||||
@@ -517,12 +521,13 @@ class BangumiIntroController extends GetxController {
|
||||
}
|
||||
var result = await VideoHttp.triple(epId: epId, seasonId: seasonId);
|
||||
if (result['status']) {
|
||||
hasLike.value = result["data"]["like"] == 1;
|
||||
if (result["data"]["coin"] == 1) {
|
||||
PgcTriple data = result['data'];
|
||||
hasLike.value = data.like == 1;
|
||||
if (data.coin == 1) {
|
||||
_coinNum.value = 2;
|
||||
GlobalData().afterCoin(2);
|
||||
}
|
||||
hasFav.value = result["data"]["favorite"] == 1;
|
||||
hasFav.value = data.favorite == 1;
|
||||
SmartDialog.showToast('三连成功');
|
||||
} else {
|
||||
SmartDialog.showToast(result['msg']);
|
||||
@@ -534,7 +539,7 @@ class BangumiIntroController extends GetxController {
|
||||
|
||||
Future<void> queryIsFollowed() async {
|
||||
// try {
|
||||
// dynamic result = await Request().get(
|
||||
// var result = await Request().get(
|
||||
// 'https://www.bilibili.com/bangumi/play/ss$seasonId',
|
||||
// );
|
||||
// dom.Document document = html_parser.parse(result.data);
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'package:PiliPlus/common/widgets/dialog/dialog.dart';
|
||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||
import 'package:PiliPlus/common/widgets/stat/stat.dart';
|
||||
import 'package:PiliPlus/models/common/image_preview_type.dart';
|
||||
import 'package:PiliPlus/models/pgc/info.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/result.dart';
|
||||
import 'package:PiliPlus/pages/video/controller.dart';
|
||||
import 'package:PiliPlus/pages/video/introduction/pgc/controller.dart';
|
||||
import 'package:PiliPlus/pages/video/introduction/pgc/widgets/bangumi_panel.dart';
|
||||
@@ -114,7 +114,7 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
|
||||
),
|
||||
if (bangumiItem.rating != null)
|
||||
PBadge(
|
||||
text: '评分 ${bangumiItem.rating!['score']!}',
|
||||
text: '评分 ${bangumiItem.rating!.score!}',
|
||||
top: null,
|
||||
right: 6,
|
||||
bottom: 6,
|
||||
@@ -209,14 +209,13 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
|
||||
StatView(
|
||||
context: context,
|
||||
theme: 'gray',
|
||||
value:
|
||||
Utils.numFormat(bangumiItem.stat!['views']),
|
||||
value: Utils.numFormat(bangumiItem.stat!.views),
|
||||
),
|
||||
StatDanMu(
|
||||
context: context,
|
||||
theme: 'gray',
|
||||
value: Utils.numFormat(
|
||||
bangumiItem.stat!['danmakus']),
|
||||
value:
|
||||
Utils.numFormat(bangumiItem.stat!.danmakus),
|
||||
),
|
||||
if (isLandscape) ...[
|
||||
areasAndPubTime(theme, bangumiItem),
|
||||
@@ -287,7 +286,7 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
|
||||
selectStatus: bangumiIntroController.hasLike.value,
|
||||
isLoading: false,
|
||||
semanticsLabel: '点赞',
|
||||
text: Utils.numFormat(bangumiItem.stat!['likes']!),
|
||||
text: Utils.numFormat(bangumiItem.stat!.likes),
|
||||
needAnim: true,
|
||||
hasTriple: bangumiIntroController.hasLike.value &&
|
||||
bangumiIntroController.hasCoin &&
|
||||
@@ -314,7 +313,7 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
|
||||
selectStatus: bangumiIntroController.hasCoin,
|
||||
isLoading: false,
|
||||
semanticsLabel: '投币',
|
||||
text: Utils.numFormat(bangumiItem.stat!['coins']!),
|
||||
text: Utils.numFormat(bangumiItem.stat!.coins),
|
||||
needAnim: true,
|
||||
),
|
||||
),
|
||||
@@ -330,7 +329,7 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
|
||||
selectStatus: bangumiIntroController.hasFav.value,
|
||||
isLoading: false,
|
||||
semanticsLabel: '收藏',
|
||||
text: Utils.numFormat(bangumiItem.stat!['favorite']!),
|
||||
text: Utils.numFormat(bangumiItem.stat!.favorite),
|
||||
needAnim: true,
|
||||
),
|
||||
),
|
||||
@@ -341,7 +340,7 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
|
||||
selectStatus: false,
|
||||
isLoading: false,
|
||||
semanticsLabel: '评论',
|
||||
text: Utils.numFormat(bangumiItem.stat!['reply']!),
|
||||
text: Utils.numFormat(bangumiItem.stat!.reply),
|
||||
),
|
||||
ActionItem(
|
||||
icon: const Icon(FontAwesomeIcons.shareFromSquare),
|
||||
@@ -349,7 +348,7 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
|
||||
selectStatus: false,
|
||||
isLoading: false,
|
||||
semanticsLabel: '转发',
|
||||
text: Utils.numFormat(bangumiItem.stat!['share']!),
|
||||
text: Utils.numFormat(bangumiItem.stat!.share),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -372,7 +371,7 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
|
||||
onTap: () => handleState(bangumiIntroController.actionLikeVideo),
|
||||
selectStatus: bangumiIntroController.hasLike.value,
|
||||
isLoading: false,
|
||||
text: bangumiItem.stat!['likes']!.toString(),
|
||||
text: bangumiItem.stat!.likes!.toString(),
|
||||
),
|
||||
),
|
||||
Obx(
|
||||
@@ -381,7 +380,7 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
|
||||
onTap: () => handleState(bangumiIntroController.actionCoinVideo),
|
||||
selectStatus: bangumiIntroController.hasCoin,
|
||||
isLoading: false,
|
||||
text: bangumiItem.stat!['coins']!.toString(),
|
||||
text: bangumiItem.stat!.coins!.toString(),
|
||||
),
|
||||
),
|
||||
Obx(
|
||||
@@ -392,7 +391,7 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
|
||||
.showFavBottomSheet(context, type: 'longPress'),
|
||||
selectStatus: bangumiIntroController.hasFav.value,
|
||||
isLoading: false,
|
||||
text: bangumiItem.stat!['favorite']!.toString(),
|
||||
text: bangumiItem.stat!.favorite!.toString(),
|
||||
),
|
||||
),
|
||||
ActionRowItem(
|
||||
@@ -400,7 +399,7 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
|
||||
onTap: () => videoDetailCtr.tabCtr.animateTo(1),
|
||||
selectStatus: false,
|
||||
isLoading: false,
|
||||
text: bangumiItem.stat!['reply']!.toString(),
|
||||
text: bangumiItem.stat!.reply!.toString(),
|
||||
),
|
||||
ActionRowItem(
|
||||
icon: const Icon(FontAwesomeIcons.share),
|
||||
@@ -418,16 +417,14 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
|
||||
spacing: 6,
|
||||
children: [
|
||||
Text(
|
||||
(bangumiItem.areas!.isNotEmpty
|
||||
? bangumiItem.areas!.first['name']
|
||||
: ''),
|
||||
(bangumiItem.areas!.isNotEmpty ? bangumiItem.areas!.first.name! : ''),
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: theme.colorScheme.outline,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
bangumiItem.publish!['pub_time_show'],
|
||||
bangumiItem.publish!.pubTimeShow!,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: theme.colorScheme.outline,
|
||||
@@ -439,7 +436,7 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
|
||||
|
||||
Widget newEpDesc(ThemeData theme, BangumiInfoModel bangumiItem) {
|
||||
return Text(
|
||||
bangumiItem.newEp!['desc'],
|
||||
bangumiItem.newEp!.desc!,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: theme.colorScheme.outline,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:PiliPlus/models/pgc/info.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/episode.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/new_ep.dart';
|
||||
import 'package:PiliPlus/pages/video/controller.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
@@ -24,7 +25,7 @@ class BangumiPanel extends StatefulWidget {
|
||||
final Function changeFuc;
|
||||
final Function showEpisodes;
|
||||
final String heroTag;
|
||||
final dynamic newEp;
|
||||
final NewEp? newEp;
|
||||
|
||||
@override
|
||||
State<BangumiPanel> createState() => _BangumiPanelState();
|
||||
@@ -116,9 +117,9 @@ class _BangumiPanelState extends State<BangumiPanel> {
|
||||
cid,
|
||||
),
|
||||
child: Text(
|
||||
widget.newEp?['desc']?.contains('连载') == true
|
||||
? '连载中,更新至${Utils.isStringNumeric(widget.newEp['title']) ? '第${widget.newEp?['title']}话' : '${widget.newEp?['title']}'}'
|
||||
: widget.newEp?['desc'],
|
||||
widget.newEp?.desc?.contains('连载') == true
|
||||
? '连载中,更新至${Utils.isStringNumeric(widget.newEp!.title) ? '第${widget.newEp!.title}话' : '${widget.newEp!.title}'}'
|
||||
: widget.newEp?.desc ?? '',
|
||||
style: const TextStyle(fontSize: 13),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'package:PiliPlus/common/widgets/keep_alive_wrapper.dart';
|
||||
import 'package:PiliPlus/common/widgets/page/tabs.dart';
|
||||
import 'package:PiliPlus/common/widgets/scroll_physics.dart';
|
||||
import 'package:PiliPlus/common/widgets/stat/stat.dart';
|
||||
import 'package:PiliPlus/models/pgc/info.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/result.dart';
|
||||
import 'package:PiliPlus/models/video_tag/data.dart';
|
||||
import 'package:PiliPlus/pages/common/common_collapse_slide_page.dart';
|
||||
import 'package:PiliPlus/pages/pgc_review/view.dart';
|
||||
@@ -110,13 +110,13 @@ class _IntroDetailState extends CommonCollapseSlidePageState<IntroDetail> {
|
||||
StatView(
|
||||
context: context,
|
||||
theme: 'gray',
|
||||
value: Utils.numFormat(widget.bangumiDetail.stat!['views']),
|
||||
value: Utils.numFormat(widget.bangumiDetail.stat!.views),
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
StatDanMu(
|
||||
context: context,
|
||||
theme: 'gray',
|
||||
value: Utils.numFormat(widget.bangumiDetail.stat!['danmakus']),
|
||||
value: Utils.numFormat(widget.bangumiDetail.stat!.danmakus),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -124,17 +124,17 @@ class _IntroDetailState extends CommonCollapseSlidePageState<IntroDetail> {
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
widget.bangumiDetail.areas!.first['name'],
|
||||
widget.bangumiDetail.areas!.first.name!,
|
||||
style: smallTitle,
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
Text(
|
||||
widget.bangumiDetail.publish!['pub_time_show'],
|
||||
widget.bangumiDetail.publish!.pubTimeShow!,
|
||||
style: smallTitle,
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
Text(
|
||||
widget.bangumiDetail.newEp!['desc'],
|
||||
widget.bangumiDetail.newEp!.desc!,
|
||||
style: smallTitle,
|
||||
),
|
||||
],
|
||||
|
||||
@@ -8,9 +8,16 @@ import 'package:PiliPlus/http/member.dart';
|
||||
import 'package:PiliPlus/http/search.dart';
|
||||
import 'package:PiliPlus/http/user.dart';
|
||||
import 'package:PiliPlus/http/video.dart';
|
||||
import 'package:PiliPlus/models/triple/ugc_triple.dart';
|
||||
import 'package:PiliPlus/models/user/fav_folder.dart';
|
||||
import 'package:PiliPlus/models/video/ai.dart';
|
||||
import 'package:PiliPlus/models/video_detail_res.dart';
|
||||
import 'package:PiliPlus/models/video_detail/data.dart';
|
||||
import 'package:PiliPlus/models/video_detail/episode.dart';
|
||||
import 'package:PiliPlus/models/video_detail/page.dart';
|
||||
import 'package:PiliPlus/models/video_detail/section.dart';
|
||||
import 'package:PiliPlus/models/video_detail/staff.dart';
|
||||
import 'package:PiliPlus/models/video_detail/ugc_season.dart';
|
||||
import 'package:PiliPlus/models/video_relation/data.dart';
|
||||
import 'package:PiliPlus/models/video_tag/data.dart';
|
||||
import 'package:PiliPlus/pages/dynamics_repost/view.dart';
|
||||
import 'package:PiliPlus/pages/video/controller.dart';
|
||||
@@ -228,11 +235,11 @@ class VideoIntroController extends GetxController {
|
||||
Future<void> queryAllStatus() async {
|
||||
var result = await VideoHttp.videoRelation(bvid: bvid);
|
||||
if (result['status']) {
|
||||
var data = result['data'];
|
||||
hasLike.value = data['like'];
|
||||
hasDislike.value = data['dislike'];
|
||||
_coinNum.value = data['coin'];
|
||||
hasFav.value = data['favorite'];
|
||||
VideoRelation data = result['data'];
|
||||
hasLike.value = data.like!;
|
||||
hasDislike.value = data.dislike!;
|
||||
_coinNum.value = data.coin!;
|
||||
hasFav.value = data.favorite!;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,12 +257,13 @@ class VideoIntroController extends GetxController {
|
||||
}
|
||||
var result = await VideoHttp.oneThree(bvid: bvid);
|
||||
if (result['status']) {
|
||||
hasLike.value = result["data"]["like"];
|
||||
if (result["data"]["coin"]) {
|
||||
UgcTriple data = result['data'];
|
||||
hasLike.value = data.like!;
|
||||
if (data.coin == true) {
|
||||
_coinNum.value = 2;
|
||||
GlobalData().afterCoin(2);
|
||||
}
|
||||
hasFav.value = result["data"]["fav"];
|
||||
hasFav.value = data.fav!;
|
||||
SmartDialog.showToast('三连成功');
|
||||
} else {
|
||||
SmartDialog.showToast(result['msg']);
|
||||
@@ -584,7 +592,7 @@ class VideoIntroController extends GetxController {
|
||||
}
|
||||
int attr = followStatus['attribute'] ?? 0;
|
||||
if (attr == 128) {
|
||||
dynamic res = await VideoHttp.relationMod(
|
||||
var res = await VideoHttp.relationMod(
|
||||
mid: mid,
|
||||
act: 6,
|
||||
reSrc: 11,
|
||||
@@ -692,7 +700,7 @@ class VideoIntroController extends GetxController {
|
||||
if (isShowOnlineTotal.not) {
|
||||
return;
|
||||
}
|
||||
dynamic result = await VideoHttp.onlineTotal(
|
||||
var result = await VideoHttp.onlineTotal(
|
||||
aid: IdUtils.bv2av(bvid),
|
||||
bvid: bvid,
|
||||
cid: lastPlayCid.value,
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'package:PiliPlus/common/widgets/pendant_avatar.dart';
|
||||
import 'package:PiliPlus/common/widgets/self_sized_horizontal_list.dart';
|
||||
import 'package:PiliPlus/common/widgets/stat/stat.dart';
|
||||
import 'package:PiliPlus/models/common/image_type.dart';
|
||||
import 'package:PiliPlus/models/video_detail_res.dart';
|
||||
import 'package:PiliPlus/models/video_detail/data.dart';
|
||||
import 'package:PiliPlus/pages/mine/controller.dart';
|
||||
import 'package:PiliPlus/pages/search/widgets/search_text.dart';
|
||||
import 'package:PiliPlus/pages/video/controller.dart';
|
||||
@@ -397,7 +397,8 @@ class _VideoInfoState extends State<VideoInfo> {
|
||||
fadeOutDuration: Duration.zero,
|
||||
),
|
||||
if ((videoItem['staff'][index]
|
||||
.official?['type'] ??
|
||||
.official
|
||||
?.type ??
|
||||
-1) !=
|
||||
-1)
|
||||
Positioned(
|
||||
@@ -412,8 +413,8 @@ class _VideoInfoState extends State<VideoInfo> {
|
||||
child: Icon(
|
||||
Icons.offline_bolt,
|
||||
color: videoItem['staff'][index]
|
||||
.official?[
|
||||
'type'] ==
|
||||
.official
|
||||
?.type ==
|
||||
0
|
||||
? const Color(0xFFFFCC00)
|
||||
: Colors.lightBlueAccent,
|
||||
@@ -634,8 +635,8 @@ class _VideoInfoState extends State<VideoInfo> {
|
||||
)
|
||||
],
|
||||
),
|
||||
if (videoIntroController
|
||||
.videoDetail.value.argueMsg?.isNotEmpty ==
|
||||
if (videoIntroController.videoDetail.value.argueInfo?.argueMsg
|
||||
?.isNotEmpty ==
|
||||
true &&
|
||||
videoIntroController.showArgueMsg) ...[
|
||||
const SizedBox(height: 2),
|
||||
@@ -653,7 +654,7 @@ class _VideoInfoState extends State<VideoInfo> {
|
||||
const WidgetSpan(child: SizedBox(width: 2)),
|
||||
TextSpan(
|
||||
text:
|
||||
'${videoIntroController.videoDetail.value.argueMsg}',
|
||||
'${videoIntroController.videoDetail.value.argueInfo!.argueMsg}',
|
||||
)
|
||||
],
|
||||
),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'dart:async';
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:PiliPlus/models/video_detail_res.dart';
|
||||
import 'package:PiliPlus/models/video_detail/page.dart';
|
||||
import 'package:PiliPlus/pages/video/controller.dart';
|
||||
import 'package:PiliPlus/pages/video/introduction/ugc/controller.dart';
|
||||
import 'package:PiliPlus/utils/id_utils.dart';
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:PiliPlus/models/video_detail_res.dart';
|
||||
import 'package:PiliPlus/models/video_detail/data.dart';
|
||||
import 'package:PiliPlus/models/video_detail/episode.dart';
|
||||
import 'package:PiliPlus/models/video_detail/section.dart';
|
||||
import 'package:PiliPlus/pages/video/controller.dart';
|
||||
import 'package:PiliPlus/pages/video/introduction/ugc/controller.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
|
||||
Reference in New Issue
Block a user