mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-25 21:05:52 +08:00
show medal wall
show user follow time show top image title Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
@@ -13,6 +13,7 @@ import 'package:PiliPlus/http/user.dart';
|
||||
import 'package:PiliPlus/http/video.dart';
|
||||
import 'package:PiliPlus/models/common/video/source_type.dart';
|
||||
import 'package:PiliPlus/models_new/member_card_info/data.dart';
|
||||
import 'package:PiliPlus/models_new/relation/data.dart';
|
||||
import 'package:PiliPlus/models_new/video/video_ai_conclusion/model_result.dart';
|
||||
import 'package:PiliPlus/models_new/video/video_detail/episode.dart';
|
||||
import 'package:PiliPlus/models_new/video/video_detail/page.dart';
|
||||
@@ -52,7 +53,7 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
|
||||
// up主粉丝数
|
||||
final Rx<MemberCardInfoData> userStat = MemberCardInfoData().obs;
|
||||
// 关注状态 默认未关注
|
||||
late final RxMap followStatus = {}.obs;
|
||||
late final Rx<RelationData> followStatus = Rx(RelationData());
|
||||
late final RxMap staffRelations = {}.obs;
|
||||
|
||||
// 是否点踩
|
||||
@@ -426,9 +427,9 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
|
||||
if (videoDetail.owner == null || videoDetail.staff?.isNotEmpty == true) {
|
||||
return;
|
||||
}
|
||||
final res = await UserHttp.hasFollow(videoDetail.owner!.mid!);
|
||||
final res = await UserHttp.userRelation(videoDetail.owner!.mid!);
|
||||
if (res case Success(:final response)) {
|
||||
if (response['special'] == 1) response['attribute'] = -10;
|
||||
if (response.special == 1) response.attribute = -10;
|
||||
followStatus.value = response;
|
||||
}
|
||||
}
|
||||
@@ -447,7 +448,7 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
|
||||
if (mid == null) {
|
||||
return;
|
||||
}
|
||||
int attr = followStatus['attribute'] ?? 0;
|
||||
int attr = followStatus.value.attribute ?? 0;
|
||||
if (attr == 128) {
|
||||
final res = await VideoHttp.relationMod(
|
||||
mid: mid,
|
||||
@@ -455,7 +456,9 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
|
||||
reSrc: 11,
|
||||
);
|
||||
if (res.isSuccess) {
|
||||
followStatus['attribute'] = 0;
|
||||
followStatus
|
||||
..value.attribute = 0
|
||||
..refresh();
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
@@ -463,9 +466,11 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
|
||||
context: context,
|
||||
mid: mid,
|
||||
isFollow: attr != 0,
|
||||
followStatus: followStatus,
|
||||
followStatus: followStatus.value,
|
||||
afterMod: (attribute) {
|
||||
followStatus['attribute'] = attribute;
|
||||
followStatus
|
||||
..value.attribute = attribute
|
||||
..refresh();
|
||||
Future.delayed(const Duration(milliseconds: 500), queryFollowStatus);
|
||||
},
|
||||
);
|
||||
|
||||
@@ -488,7 +488,7 @@ class _UgcIntroPanelState extends State<UgcIntroPanel> {
|
||||
Widget followButton(BuildContext context, ThemeData t) {
|
||||
return Obx(
|
||||
() {
|
||||
int attr = introController.followStatus['attribute'] ?? 0;
|
||||
int attr = introController.followStatus.value.attribute ?? 0;
|
||||
return TextButton(
|
||||
onPressed: () => introController.actionRelationMod(context),
|
||||
style: TextButton.styleFrom(
|
||||
|
||||
Reference in New Issue
Block a user