mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: follow dialog
This commit is contained in:
@@ -210,11 +210,7 @@ class _MemberFavoriteState extends State<MemberFavorite>
|
||||
),
|
||||
subtitle: Text(
|
||||
item1.type == 0
|
||||
? '${item1.mediaCount}个内容 · ${[
|
||||
0,
|
||||
2,
|
||||
22
|
||||
].contains(item1.attr) ? '公开' : '私密'}'
|
||||
? '${item1.mediaCount}个内容'
|
||||
: item1.type == 11
|
||||
? '${item1.mediaCount}个内容 · ${item1.upper?.name}'
|
||||
: item1.type == 21
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:PiliPalaX/http/video.dart';
|
||||
import 'package:PiliPalaX/models/space/tab2.dart';
|
||||
import 'package:PiliPalaX/pages/common/common_controller.dart';
|
||||
import 'package:PiliPalaX/utils/storage.dart';
|
||||
import 'package:PiliPalaX/utils/utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -114,13 +115,23 @@ class MemberControllerNew extends CommonController
|
||||
}
|
||||
}
|
||||
|
||||
void onFollow() async {
|
||||
void onFollow(BuildContext context) async {
|
||||
if (relation.value == -1) {
|
||||
_onBlock();
|
||||
} else if (!isFollow.value) {
|
||||
// TODO
|
||||
} else {
|
||||
// TODO
|
||||
if (ownerMid == null) {
|
||||
SmartDialog.showToast('账号未登录');
|
||||
return;
|
||||
}
|
||||
Utils.actionRelationMod(
|
||||
context: context,
|
||||
mid: mid,
|
||||
isFollow: isFollow.value,
|
||||
callback: (attribute) {
|
||||
relation.value = 1;
|
||||
isFollow.value = attribute != 0;
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -298,7 +298,7 @@ class _MemberPageNewState extends State<MemberPageNew>
|
||||
isFollow: _userController.isFollow.value,
|
||||
card: userState.response.card,
|
||||
images: userState.response.images,
|
||||
onFollow: _userController.onFollow,
|
||||
onFollow: () => _userController.onFollow(context),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -217,17 +217,33 @@ class UserInfoCard extends StatelessWidget {
|
||||
vertical: -2,
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
relation == -1
|
||||
? '已拉黑'
|
||||
: isFollow
|
||||
? '取消关注'
|
||||
: '关注',
|
||||
child: Text.rich(
|
||||
style: TextStyle(
|
||||
color: relation == -1 || isFollow
|
||||
? Theme.of(context).colorScheme.outline
|
||||
: null,
|
||||
),
|
||||
TextSpan(
|
||||
children: [
|
||||
if (isFollow)
|
||||
WidgetSpan(
|
||||
alignment: PlaceholderAlignment.top,
|
||||
child: Icon(
|
||||
Icons.sort,
|
||||
size: 16,
|
||||
color:
|
||||
Theme.of(context).colorScheme.outline,
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
text: relation == -1
|
||||
? '移除黑名单'
|
||||
: isFollow
|
||||
? ' 已关注'
|
||||
: '关注',
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user