feat(mobile): integrate community hierarchy API in profile page
- Call getMyCommunityHierarchy() to get parent/child community info - Display parent community name (defaults to 总部社区 if none) - Display child communities count and first name 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
9cf8b5305b
commit
05040b3495
|
|
@ -295,13 +295,28 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
|
|||
debugPrint('[ProfilePage] 市公司授权: ${summary.cityCompany != null}');
|
||||
debugPrint('[ProfilePage] 省公司授权: ${summary.provinceCompany != null}');
|
||||
|
||||
// 获取社区层级数据
|
||||
try {
|
||||
final hierarchy = await authorizationService.getMyCommunityHierarchy();
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_parentCommunity = hierarchy.parentCommunity.communityName;
|
||||
_childCommunity = hierarchy.childCommunityCount > 0
|
||||
? '${hierarchy.childCommunities.first.communityName}${hierarchy.childCommunityCount > 1 ? " 等${hierarchy.childCommunityCount}个" : ""}'
|
||||
: '--';
|
||||
});
|
||||
}
|
||||
debugPrint('[ProfilePage] 社区层级: 上级=${hierarchy.parentCommunity.communityName}, 下级数量=${hierarchy.childCommunityCount}');
|
||||
} catch (e) {
|
||||
debugPrint('[ProfilePage] 获取社区层级失败: $e');
|
||||
// 失败时保持默认值
|
||||
}
|
||||
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_community = summary.communityName ?? '--';
|
||||
_cityCompany = summary.cityCompanyName ?? '--';
|
||||
_provinceCompany = summary.provinceCompanyName ?? '--';
|
||||
// 上级社区和下级社区暂时无法从当前API获取
|
||||
// 后续需要扩展API或从推荐链中计算
|
||||
|
||||
// 更新社区考核数据
|
||||
if (summary.community != null) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue