Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
orz12 committed Feb 19, 2024
2 parents bf7667f + bcf94e2 commit 0133284
Show file tree
Hide file tree
Showing 10 changed files with 71 additions and 48 deletions.
10 changes: 8 additions & 2 deletions lib/http/member.dart
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,13 @@ class MemberHttp {
'data': MemberArchiveDataModel.fromJson(res.data['data'])
};
} else {
Map errMap = {
-352: '风控校验失败,请检查登录状态',
};
return {
'status': false,
'data': [],
'msg': res.data['message'],
'msg': errMap[res.data['code']] ?? res.data['message'],
};
}
}
Expand All @@ -128,10 +131,13 @@ class MemberHttp {
'data': DynamicsDataModel.fromJson(res.data['data']),
};
} else {
Map errMap = {
-352: '风控校验失败,请检查登录状态',
};
return {
'status': false,
'data': [],
'msg': res.data['message'],
'msg': errMap[res.data['code']] ?? res.data['message'],
};
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/models/member/archive.dart
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class Stat {

Stat.fromJson(Map<String, dynamic> json) {
view = json["play"];
danmaku = json['comment'];
danmaku = json['video_review'];
}
}

Expand Down
14 changes: 6 additions & 8 deletions lib/pages/bangumi/introduction/controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,12 @@ class BangumiIntroController extends GetxController {
addIds: addMediaIdsNew.join(','),
delIds: delMediaIdsNew.join(','));
if (result['status']) {
if (result['data']['prompt']) {
addMediaIdsNew = [];
delMediaIdsNew = [];
Get.back();
// 重新获取收藏状态
queryHasFavVideo();
SmartDialog.showToast('✅ 操作成功');
}
addMediaIdsNew = [];
delMediaIdsNew = [];
// 重新获取收藏状态
queryHasFavVideo();
SmartDialog.showToast('✅ 操作成功');
Get.back();
}
}

Expand Down
14 changes: 6 additions & 8 deletions lib/pages/fav_detail/controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,14 @@ class FavDetailController extends GetxController {
var result = await VideoHttp.favVideo(
aid: id, addIds: '', delIds: mediaId.toString());
if (result['status']) {
if (result['data']['prompt']) {
List dataList = favList;
for (var i in dataList) {
if (i.id == id) {
dataList.remove(i);
break;
}
List dataList = favList;
for (var i in dataList) {
if (i.id == id) {
dataList.remove(i);
break;
}
SmartDialog.showToast('取消收藏');
}
SmartDialog.showToast('取消收藏');
}
}

Expand Down
1 change: 1 addition & 0 deletions lib/pages/fav_detail/view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class _FavDetailPageState extends State<FavDetailPage> {
@override
void initState() {
super.initState();
mediaId = Get.parameters['mediaId']!;
_futureBuilderFuture = _favDetailController.queryUserFavFolderDetail();
mediaId = Get.parameters['mediaId']!;
titleStreamC = StreamController<bool>();
Expand Down
14 changes: 6 additions & 8 deletions lib/pages/fav_search/controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,14 @@ class FavSearchController extends GetxController {
var result = await VideoHttp.favVideo(
aid: id, addIds: '', delIds: mediaId.toString());
if (result['status']) {
if (result['data']['prompt']) {
List dataList = favList;
for (var i in dataList) {
if (i.id == id) {
dataList.remove(i);
break;
}
List dataList = favList;
for (var i in dataList) {
if (i.id == id) {
dataList.remove(i);
break;
}
SmartDialog.showToast('取消收藏');
}
SmartDialog.showToast('取消收藏');
}
}
}
11 changes: 9 additions & 2 deletions lib/pages/member_archive/view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:PiliPalaX/common/widgets/video_card_h.dart';
import 'package:PiliPalaX/utils/utils.dart';
import '../../common/widgets/http_error.dart';
import 'controller.dart';

class MemberArchivePage extends StatefulWidget {
Expand Down Expand Up @@ -86,10 +87,16 @@ class _MemberArchivePageState extends State<MemberArchivePage> {
: const SliverToBoxAdapter(),
);
} else {
return const SliverToBoxAdapter();
return HttpError(
errMsg: snapshot.data['msg'],
fn: () {},
);
}
} else {
return const SliverToBoxAdapter();
return HttpError(
errMsg: snapshot.data['msg'],
fn: () {},
);
}
} else {
return const SliverToBoxAdapter();
Expand Down
11 changes: 9 additions & 2 deletions lib/pages/member_dynamics/view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:get/get.dart';
import 'package:PiliPalaX/pages/member_dynamics/index.dart';
import 'package:PiliPalaX/utils/utils.dart';

import '../../common/widgets/http_error.dart';
import '../dynamics/widgets/dynamic_panel.dart';

class MemberDynamicsPage extends StatefulWidget {
Expand Down Expand Up @@ -80,10 +81,16 @@ class _MemberDynamicsPageState extends State<MemberDynamicsPage> {
: const SliverToBoxAdapter(),
);
} else {
return const SliverToBoxAdapter();
return HttpError(
errMsg: snapshot.data['msg'],
fn: () {},
);
}
} else {
return const SliverToBoxAdapter();
return HttpError(
errMsg: snapshot.data['msg'],
fn: () {},
);
}
} else {
return const SliverToBoxAdapter();
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/video/detail/introduction/controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ class VideoIntroController extends GetxController {
final ReleatedController releatedCtr =
Get.find<ReleatedController>(tag: heroTag);
videoDetailCtr.bvid = bvid;
videoDetailCtr.oid.value = aid;
videoDetailCtr.oid.value = aid ?? IdUtils.bv2av(bvid);
videoDetailCtr.cid.value = cid;
videoDetailCtr.danmakuCid.value = cid;
videoDetailCtr.queryVideoUrl();
Expand Down
40 changes: 24 additions & 16 deletions lib/pages/video/detail/reply/widgets/reply_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -620,26 +620,34 @@ InlineSpan buildContent(
..onTap = () async {
final String title = content.jumpUrl[matchStr]['title'];
if (appUrlSchema == '') {
final String redirectUrl =
await UrlUtils.parseRedirectUrl(matchStr);
final String pathSegment = Uri.parse(redirectUrl).path;
final String lastPathSegment =
pathSegment.split('/').last;
if (lastPathSegment.startsWith('BV')) {
if (matchStr.startsWith('BV')) {
UrlUtils.matchUrlPush(
lastPathSegment,
matchStr,
title,
redirectUrl,
'',
);
} else {
Get.toNamed(
'/webview',
parameters: {
'url': redirectUrl,
'type': 'url',
'pageTitle': title
},
);
final String redirectUrl =
await UrlUtils.parseRedirectUrl(matchStr);
final String pathSegment = Uri.parse(redirectUrl).path;
final String lastPathSegment =
pathSegment.split('/').last;
if (lastPathSegment.startsWith('BV')) {
UrlUtils.matchUrlPush(
lastPathSegment,
title,
redirectUrl,
);
} else {
Get.toNamed(
'/webview',
parameters: {
'url': redirectUrl,
'type': 'url',
'pageTitle': title
},
);
}
}
} else {
if (appUrlSchema.startsWith('bilibili://search')) {
Expand Down

0 comments on commit 0133284

Please sign in to comment.