mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
fix: member status on video intro
This commit is contained in:
@@ -507,15 +507,30 @@ class VideoIntroController extends GetxController
|
|||||||
SmartDialog.showToast('账号未登录');
|
SmartDialog.showToast('账号未登录');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Utils.actionRelationMod(
|
int attr = followStatus['attribute'] ?? 0;
|
||||||
context: context,
|
if (attr == 128) {
|
||||||
mid: videoDetail.value.owner?.mid,
|
dynamic res = await VideoHttp.relationMod(
|
||||||
isFollow: (followStatus['attribute'] ?? 0) != 0,
|
mid: videoDetail.value.owner?.mid ?? -1,
|
||||||
callback: (attribute) {
|
act: attr != 128 ? 5 : 6,
|
||||||
followStatus['attribute'] = attribute;
|
reSrc: 11,
|
||||||
|
);
|
||||||
|
if (res['status']) {
|
||||||
|
followStatus['attribute'] = 0;
|
||||||
followStatus.refresh();
|
followStatus.refresh();
|
||||||
},
|
}
|
||||||
);
|
return;
|
||||||
|
}
|
||||||
|
if (context.mounted) {
|
||||||
|
Utils.actionRelationMod(
|
||||||
|
context: context,
|
||||||
|
mid: videoDetail.value.owner?.mid,
|
||||||
|
isFollow: (followStatus['attribute'] ?? 0) != 0,
|
||||||
|
callback: (attribute) {
|
||||||
|
followStatus['attribute'] = attribute;
|
||||||
|
followStatus.refresh();
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// MemberController _ = Get.put<MemberController>(MemberController(mid: mid),
|
// MemberController _ = Get.put<MemberController>(MemberController(mid: mid),
|
||||||
// tag: mid.toString());
|
// tag: mid.toString());
|
||||||
|
|||||||
@@ -545,26 +545,28 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
|
|||||||
|
|
||||||
Obx followButton(BuildContext context, ThemeData t) {
|
Obx followButton(BuildContext context, ThemeData t) {
|
||||||
return Obx(
|
return Obx(
|
||||||
() => TextButton(
|
() {
|
||||||
onPressed: () => videoIntroController.actionRelationMod(context),
|
int attr = videoIntroController.followStatus['attribute'] ?? 0;
|
||||||
style: TextButton.styleFrom(
|
return TextButton(
|
||||||
visualDensity: const VisualDensity(horizontal: -2, vertical: -3),
|
onPressed: () => videoIntroController.actionRelationMod(context),
|
||||||
foregroundColor:
|
style: TextButton.styleFrom(
|
||||||
(videoIntroController.followStatus['attribute'] ?? 0) != 0
|
visualDensity: const VisualDensity(horizontal: -2, vertical: -3),
|
||||||
? t.colorScheme.outline
|
foregroundColor:
|
||||||
: t.colorScheme.onPrimary,
|
attr != 0 ? t.colorScheme.outline : t.colorScheme.onPrimary,
|
||||||
backgroundColor:
|
backgroundColor: attr != 0
|
||||||
(videoIntroController.followStatus['attribute'] ?? 0) != 0
|
? t.colorScheme.onInverseSurface
|
||||||
? t.colorScheme.onInverseSurface
|
: t.colorScheme.primary, // 设置按钮背景色
|
||||||
: t.colorScheme.primary, // 设置按钮背景色
|
),
|
||||||
),
|
child: Text(
|
||||||
child: Text(
|
attr == 128
|
||||||
((videoIntroController.followStatus['attribute'] ?? 0) != 0)
|
? '已拉黑'
|
||||||
? '已关注'
|
: attr != 0
|
||||||
: '关注',
|
? '已关注'
|
||||||
style: TextStyle(fontSize: t.textTheme.labelMedium!.fontSize),
|
: '关注',
|
||||||
),
|
style: TextStyle(fontSize: t.textTheme.labelMedium!.fontSize),
|
||||||
),
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user