mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-21 08:38:37 +00:00
opt: follow btn text
This commit is contained in:
@@ -46,10 +46,12 @@ class FollowItem extends StatelessWidget {
|
||||
? SizedBox(
|
||||
height: 34,
|
||||
child: TextButton(
|
||||
onPressed: () async {
|
||||
await Get.bottomSheet(
|
||||
GroupPanel(mid: item.mid!),
|
||||
isScrollControlled: true,
|
||||
onPressed: () {
|
||||
Utils.actionRelationMod(
|
||||
context: context,
|
||||
mid: item.mid,
|
||||
isFollow: true,
|
||||
callback: (attribute) {},
|
||||
);
|
||||
},
|
||||
style: TextButton.styleFrom(
|
||||
|
||||
@@ -36,7 +36,9 @@ class MemberControllerNew extends CommonController
|
||||
bool customHandleResponse(Success response) {
|
||||
username = response.response?.card?.name ?? '';
|
||||
isFollow.value = response.response?.card?.relation?.isFollow == 1;
|
||||
relation.value = response.response?.relation ?? 1;
|
||||
relation.value = response.response?.relSpecial == 1
|
||||
? 2
|
||||
: response.response?.relation ?? 1;
|
||||
tab2 = response.response.tab2;
|
||||
if (tab2 != null && tab2!.isNotEmpty) {
|
||||
if (!response.response.tab.toJson().values.contains(true) &&
|
||||
@@ -127,7 +129,7 @@ class MemberControllerNew extends CommonController
|
||||
mid: mid,
|
||||
isFollow: isFollow.value,
|
||||
callback: (attribute) {
|
||||
relation.value = 1;
|
||||
relation.value = attribute;
|
||||
isFollow.value = attribute != 0;
|
||||
},
|
||||
);
|
||||
|
||||
@@ -238,9 +238,11 @@ class UserInfoCard extends StatelessWidget {
|
||||
TextSpan(
|
||||
text: relation == -1
|
||||
? '移除黑名单'
|
||||
: isFollow
|
||||
? ' 已关注'
|
||||
: '关注',
|
||||
: relation == 2
|
||||
? ' 特别关注'
|
||||
: isFollow
|
||||
? ' 已关注'
|
||||
: '关注',
|
||||
)
|
||||
],
|
||||
),
|
||||
|
||||
@@ -53,11 +53,11 @@ class _GroupPanelState extends State<GroupPanel> {
|
||||
final bool anyHasChecked =
|
||||
tagsList.any((MemberTagItemModel e) => e.checked == true);
|
||||
late String tagids;
|
||||
List<int>? tagidList;
|
||||
if (anyHasChecked) {
|
||||
final List<MemberTagItemModel> checkedList =
|
||||
tagsList.where((MemberTagItemModel e) => e.checked == true).toList();
|
||||
final List<int> tagidList =
|
||||
checkedList.map<int>((e) => e.tagid!).toList();
|
||||
tagidList = checkedList.map<int>((e) => e.tagid!).toList();
|
||||
tagids = tagidList.join(',');
|
||||
} else {
|
||||
tagids = '0';
|
||||
@@ -66,7 +66,7 @@ class _GroupPanelState extends State<GroupPanel> {
|
||||
final res = await MemberHttp.addUsers(widget.mid, tagids);
|
||||
SmartDialog.showToast(res['msg']);
|
||||
if (res['status']) {
|
||||
Get.back(result: true);
|
||||
Get.back(result: tagidList?.contains(-10) == true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user