mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-01 00:28:18 +08:00
opt: follow btn text
This commit is contained in:
@@ -21,6 +21,8 @@ part 'data.g.dart';
|
|||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class Data {
|
class Data {
|
||||||
int? relation;
|
int? relation;
|
||||||
|
@JsonKey(name: 'rel_special')
|
||||||
|
int? relSpecial;
|
||||||
@JsonKey(name: 'guest_relation')
|
@JsonKey(name: 'guest_relation')
|
||||||
int? guestRelation;
|
int? guestRelation;
|
||||||
@JsonKey(name: 'default_tab')
|
@JsonKey(name: 'default_tab')
|
||||||
@@ -54,6 +56,7 @@ class Data {
|
|||||||
|
|
||||||
Data({
|
Data({
|
||||||
this.relation,
|
this.relation,
|
||||||
|
this.relSpecial,
|
||||||
this.guestRelation,
|
this.guestRelation,
|
||||||
this.defaultTab,
|
this.defaultTab,
|
||||||
this.isParams,
|
this.isParams,
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ part of 'data.dart';
|
|||||||
|
|
||||||
Data _$DataFromJson(Map<String, dynamic> json) => Data(
|
Data _$DataFromJson(Map<String, dynamic> json) => Data(
|
||||||
relation: (json['relation'] as num?)?.toInt(),
|
relation: (json['relation'] as num?)?.toInt(),
|
||||||
|
relSpecial: (json['rel_special'] as num?)?.toInt(),
|
||||||
guestRelation: (json['guest_relation'] as num?)?.toInt(),
|
guestRelation: (json['guest_relation'] as num?)?.toInt(),
|
||||||
defaultTab: json['default_tab'] as String?,
|
defaultTab: json['default_tab'] as String?,
|
||||||
isParams: json['is_params'] as bool?,
|
isParams: json['is_params'] as bool?,
|
||||||
@@ -64,6 +65,7 @@ Data _$DataFromJson(Map<String, dynamic> json) => Data(
|
|||||||
|
|
||||||
Map<String, dynamic> _$DataToJson(Data instance) => <String, dynamic>{
|
Map<String, dynamic> _$DataToJson(Data instance) => <String, dynamic>{
|
||||||
'relation': instance.relation,
|
'relation': instance.relation,
|
||||||
|
'rel_special': instance.relSpecial,
|
||||||
'guest_relation': instance.guestRelation,
|
'guest_relation': instance.guestRelation,
|
||||||
'default_tab': instance.defaultTab,
|
'default_tab': instance.defaultTab,
|
||||||
'is_params': instance.isParams,
|
'is_params': instance.isParams,
|
||||||
|
|||||||
@@ -46,10 +46,12 @@ class FollowItem extends StatelessWidget {
|
|||||||
? SizedBox(
|
? SizedBox(
|
||||||
height: 34,
|
height: 34,
|
||||||
child: TextButton(
|
child: TextButton(
|
||||||
onPressed: () async {
|
onPressed: () {
|
||||||
await Get.bottomSheet(
|
Utils.actionRelationMod(
|
||||||
GroupPanel(mid: item.mid!),
|
context: context,
|
||||||
isScrollControlled: true,
|
mid: item.mid,
|
||||||
|
isFollow: true,
|
||||||
|
callback: (attribute) {},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
style: TextButton.styleFrom(
|
style: TextButton.styleFrom(
|
||||||
|
|||||||
@@ -36,7 +36,9 @@ class MemberControllerNew extends CommonController
|
|||||||
bool customHandleResponse(Success response) {
|
bool customHandleResponse(Success response) {
|
||||||
username = response.response?.card?.name ?? '';
|
username = response.response?.card?.name ?? '';
|
||||||
isFollow.value = response.response?.card?.relation?.isFollow == 1;
|
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;
|
tab2 = response.response.tab2;
|
||||||
if (tab2 != null && tab2!.isNotEmpty) {
|
if (tab2 != null && tab2!.isNotEmpty) {
|
||||||
if (!response.response.tab.toJson().values.contains(true) &&
|
if (!response.response.tab.toJson().values.contains(true) &&
|
||||||
@@ -127,7 +129,7 @@ class MemberControllerNew extends CommonController
|
|||||||
mid: mid,
|
mid: mid,
|
||||||
isFollow: isFollow.value,
|
isFollow: isFollow.value,
|
||||||
callback: (attribute) {
|
callback: (attribute) {
|
||||||
relation.value = 1;
|
relation.value = attribute;
|
||||||
isFollow.value = attribute != 0;
|
isFollow.value = attribute != 0;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -238,6 +238,8 @@ class UserInfoCard extends StatelessWidget {
|
|||||||
TextSpan(
|
TextSpan(
|
||||||
text: relation == -1
|
text: relation == -1
|
||||||
? '移除黑名单'
|
? '移除黑名单'
|
||||||
|
: relation == 2
|
||||||
|
? ' 特别关注'
|
||||||
: isFollow
|
: isFollow
|
||||||
? ' 已关注'
|
? ' 已关注'
|
||||||
: '关注',
|
: '关注',
|
||||||
|
|||||||
@@ -53,11 +53,11 @@ class _GroupPanelState extends State<GroupPanel> {
|
|||||||
final bool anyHasChecked =
|
final bool anyHasChecked =
|
||||||
tagsList.any((MemberTagItemModel e) => e.checked == true);
|
tagsList.any((MemberTagItemModel e) => e.checked == true);
|
||||||
late String tagids;
|
late String tagids;
|
||||||
|
List<int>? tagidList;
|
||||||
if (anyHasChecked) {
|
if (anyHasChecked) {
|
||||||
final List<MemberTagItemModel> checkedList =
|
final List<MemberTagItemModel> checkedList =
|
||||||
tagsList.where((MemberTagItemModel e) => e.checked == true).toList();
|
tagsList.where((MemberTagItemModel e) => e.checked == true).toList();
|
||||||
final List<int> tagidList =
|
tagidList = checkedList.map<int>((e) => e.tagid!).toList();
|
||||||
checkedList.map<int>((e) => e.tagid!).toList();
|
|
||||||
tagids = tagidList.join(',');
|
tagids = tagidList.join(',');
|
||||||
} else {
|
} else {
|
||||||
tagids = '0';
|
tagids = '0';
|
||||||
@@ -66,7 +66,7 @@ class _GroupPanelState extends State<GroupPanel> {
|
|||||||
final res = await MemberHttp.addUsers(widget.mid, tagids);
|
final res = await MemberHttp.addUsers(widget.mid, tagids);
|
||||||
SmartDialog.showToast(res['msg']);
|
SmartDialog.showToast(res['msg']);
|
||||||
if (res['status']) {
|
if (res['status']) {
|
||||||
Get.back(result: true);
|
Get.back(result: tagidList?.contains(-10) == true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ class Utils {
|
|||||||
);
|
);
|
||||||
SmartDialog.showToast(res['status'] ? "关注成功" : res['msg']);
|
SmartDialog.showToast(res['status'] ? "关注成功" : res['msg']);
|
||||||
if (res['status']) {
|
if (res['status']) {
|
||||||
callback(2);
|
callback(1);
|
||||||
// followStatus['attribute'] = 2;
|
// followStatus['attribute'] = 2;
|
||||||
// followStatus.refresh();
|
// followStatus.refresh();
|
||||||
}
|
}
|
||||||
@@ -84,6 +84,11 @@ class Utils {
|
|||||||
// followStatus['tag'] = tags;
|
// followStatus['tag'] = tags;
|
||||||
// followStatus.refresh();
|
// followStatus.refresh();
|
||||||
SmartDialog.showToast('$text成功');
|
SmartDialog.showToast('$text成功');
|
||||||
|
if (isSpecialFollowed) {
|
||||||
|
callback(1);
|
||||||
|
} else {
|
||||||
|
callback(2);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
SmartDialog.showToast(res['msg']);
|
SmartDialog.showToast(res['msg']);
|
||||||
}
|
}
|
||||||
@@ -97,7 +102,7 @@ class Utils {
|
|||||||
dense: true,
|
dense: true,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
Get.back();
|
Get.back();
|
||||||
await showModalBottomSheet(
|
dynamic result = await showModalBottomSheet(
|
||||||
context: context,
|
context: context,
|
||||||
useSafeArea: true,
|
useSafeArea: true,
|
||||||
isScrollControlled: true,
|
isScrollControlled: true,
|
||||||
@@ -125,10 +130,11 @@ class Utils {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
// await Future.delayed(const Duration(milliseconds: 500));
|
if (result == true) {
|
||||||
// if (result == true) {
|
callback(2);
|
||||||
// queryFollowStatus();
|
} else if (result == false) {
|
||||||
// }
|
callback(1);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
title: const Text(
|
title: const Text(
|
||||||
'设置分组',
|
'设置分组',
|
||||||
|
|||||||
Reference in New Issue
Block a user