修正个人信息页

This commit is contained in:
zhx 2026-05-23 21:05:39 +08:00
parent 8096ca6acc
commit 3be68c17f8
4 changed files with 111 additions and 97 deletions

View File

@ -346,15 +346,15 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/webview_flutter_wkwebview/darwin"
SPEC CHECKSUMS:
app_links: 3dbc685f76b1693c66a6d9dd1e9ab6f73d97dc0a
app_links: 585674be3c6661708e6cd794ab4f39fb9d8356f9
AppAuth: d4f13a8fe0baf391b2108511793e4b479691fb73
AppCheckCore: cc8fd0a3a230ddd401f326489c99990b013f0c4f
audioplayers_darwin: 835ced6edd4c9fc8ebb0a7cc9e294a91d99917d5
device_info_plus: 71ffc6ab7634ade6267c7a93088ed7e4f74e5896
audioplayers_darwin: f15e209a3e856d1a7edcf98dc029f484fead2242
device_info_plus: 97af1d7e84681a90d0693e63169a5d50e0839a0d
Firebase: d99ac19b909cd2c548339c2241ecd0d1599ab02e
firebase_auth: 50af8366c87bb88c80ebeae62eb60189c7246b9b
firebase_core: 995454a784ff288be5689b796deb9e9fa3601818
firebase_crashlytics: 30dcd6dfd2fe895c0848af46722a4227346c19aa
firebase_auth: 5342db41af2ba5ed32a6177d9e326eecbebda912
firebase_core: 99a37263b3c27536063a7b601d9e2a49400a433c
firebase_crashlytics: 986773c0c7ea4c3f5a4ead141b58522fcd9dfdb1
FirebaseAppCheckInterop: 06fe5a3799278ae4667e6c432edd86b1030fa3df
FirebaseAuth: a6575e5fbf46b046c58dc211a28a5fbdd8d4c83b
FirebaseAuthInterop: 7087d7a4ee4bc4de019b2d0c240974ed5d89e2fd
@ -366,47 +366,47 @@ SPEC CHECKSUMS:
FirebaseRemoteConfigInterop: 1c6135e8a094cc6368949f5faeeca7ee8948b8aa
FirebaseSessions: b9a92c1c51bbb81e78fc3142cda6d925d700f8e7
Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467
flutter_image_compress_common: 1697a328fd72bfb335507c6bca1a65fa5ad87df1
fluttertoast: 2c67e14dce98bbdb200df9e1acf610d7a6264ea1
google_sign_in_ios: b48bb9af78576358a168361173155596c845f0b9
flutter_image_compress_common: ec1d45c362c9d30a3f6a0426c297f47c52007e3e
fluttertoast: 21eecd6935e7064cc1fcb733a4c5a428f3f24f0f
google_sign_in_ios: 7411fab6948df90490dc4620ecbcabdc3ca04017
GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7
GoogleSignIn: ce8c89bb9b37fb624b92e7514cc67335d1e277e4
GoogleUtilities: 00c88b9a86066ef77f0da2fab05f65d7768ed8e1
GTMAppAuth: f69bd07d68cd3b766125f7e072c45d7340dea0de
GTMSessionFetcher: 5aea5ba6bd522a239e236100971f10cb71b96ab6
HydraAsync: 8d589bd725b0224f899afafc9a396327405f8063
image_cropper: 655b3ba703c9e15e3111e79151624d6154288774
image_picker_ios: e0ece4aa2a75771a7de3fa735d26d90817041326
in_app_purchase_storekit: 22cca7d08eebca9babdf4d07d0baccb73325d3c8
image_cropper: a3291c624a953049bc6a02e1f8c8ceb162a24b25
image_picker_ios: 4f2f91b01abdb52842a8e277617df877e40f905b
in_app_purchase_storekit: 2342c0a5da86593124d08dd13d920f39a52b273a
libpag: 98742fad4b3ac2a2ee31e383d2483495fb9a5fb4
libwebp: 02b23773aedb6ff1fd38cec7a77b81414c6842a8
Mantle: c5aa8794a29a022dfbbfc9799af95f477a69b62d
nanopb: fad817b59e0457d11a5dfbde799381cd727c1275
on_audio_query_ios: 28a780e2d0d85d92d500ba6e12c6c8167022b2fa
package_info_plus: af8e2ca6888548050f16fa2f1938db7b5a5df499
pag: f01aa9017ab0e04a83ba4a20d6070a50f0ac9da8
permission_handler_apple: 4ed2196e43d0651e8ff7ca3483a069d469701f2d
on_audio_query_ios: e5afb0d4b42cfa3e8762d8ec1953540cb4f02100
package_info_plus: c0502532a26c7662a62a356cebe2692ec5fe4ec4
pag: ff30ba5e4be59380a5ddac6b183905729be15a3c
permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
PromisesSwift: 9d77319bbe72ebf6d872900551f7eeba9bce2851
RecaptchaInterop: 11e0b637842dfb48308d242afc3f448062325aba
SDWebImage: e9fc87c1aab89a8ab1bbd74eba378c6f53be8abf
SDWebImageWebPCoder: 0e06e365080397465cc73a7a9b472d8a3bd0f377
shared_preferences_foundation: 7036424c3d8ec98dfe75ff1667cb0cd531ec82bb
sign_in_with_apple: c5dcc141574c8c54d5ac99dd2163c0c72ad22418
sqflite_darwin: 20b2a3a3b70e43edae938624ce550a3cbf66a3d0
shared_preferences_foundation: 5086985c1d43c5ba4d5e69a4e8083a389e2909e6
sign_in_with_apple: f3bf75217ea4c2c8b91823f225d70230119b8440
sqflite_darwin: 5a7236e3b501866c1c9befc6771dfd73ffb8702d
SwiftyBeaver: 84069991dd5dca07d7069100985badaca7f0ce82
tancent_vap: fa8ad93814a9f950514a7074c662d2c937084c68
tencent_cloud_chat_sdk: 55e5fffe20f6b7937a26a674ccccb639563a9790
tencent_rtc_sdk: f77558b6b436a149d378557c2a837f73c09061bc
tancent_vap: eceaaf095167d102727cf799c75891057834c311
tencent_cloud_chat_sdk: 546bb906bbe585814e3d2d33afdb91f09c0eac44
tencent_rtc_sdk: 1ca5201f7bddc691a3a95486325ad6dc792a273d
TOCropViewController: edfd4f25713d56905ad1e0b9f5be3fbe0f59c863
TXCustomBeautyProcesserPlugin: 099393b941cb40eda12b3a80bf6c0319957b1cfd
TXIMSDK_Plus_iOS_XCFramework: 5d1933192fb3b7ef2fe933f1623de4a0486a7fe2
TXLiteAVSDK_Professional: e792e6084a208ecef6196c5f28237ad8078b4d7c
url_launcher_ios: 7a95fa5b60cc718a708b8f2966718e93db0cef1b
video_player_avfoundation: 3453f792138786248960ca029747fcd9f318ef52
video_thumbnail: b637e0ad5f588ca9945f6e2c927f73a69a661140
wakelock_plus: e29112ab3ef0b318e58cfa5c32326458be66b556
webview_flutter_wkwebview: 8ebf4fded22593026f7dbff1fbff31ea98573c8d
url_launcher_ios: bb13df5870e8c4234ca12609d04010a21be43dfa
video_player_avfoundation: e54d03b3b19f64f2c557354f72ce538387541ba6
video_thumbnail: c4e2a3c539e247d4de13cd545344fd2d26ffafd1
wakelock_plus: 76957ab028e12bfa4e66813c99e46637f367fc7e
webview_flutter_wkwebview: 29eb20d43355b48fe7d07113835b9128f84e3af4
PODFILE CHECKSUM: a6f49a93e5f85201a2efdadcd7cf184b0e310894

View File

@ -222,30 +222,26 @@ class SocialChatUserProfileManager extends ChangeNotifier {
relations: fallbackCloseFriendPairs,
);
var loadedAnyCabin = false;
final shouldLoadCurrentUserPairs = _isCurrentUserId(userId);
if (kDebugMode) {
final currentUserId =
AccountStorage().getCurrentUser()?.userProfile?.id?.trim() ?? "";
debugPrint(
'[CP][Profile] source userId=$userId currentUserId=$currentUserId '
'profileCp=${profile.cpList?.length ?? 0} '
'profileCloseFriends=${profile.closeFriendList?.length ?? 0} '
'loadCurrentPairs=$shouldLoadCurrentUserPairs',
);
}
if (shouldLoadCurrentUserPairs) {
await Future.wait(
_cpProfileRelationTypes.map((relationType) async {
final pairs = await _safeLoadCpRelationshipPairs(relationType);
_addCpRelationPairs(
cpPairs: cpPairs,
closeFriendPairs: closeFriendPairs,
relations: pairs,
fallbackRelationType: relationType,
);
}),
'profileCloseFriends=${profile.closeFriendList?.length ?? 0}',
);
}
await Future.wait(
_cpProfileRelationTypes.map((relationType) async {
final pairs = await _safeLoadCpRelationshipPairs(userId, relationType);
_addCpRelationPairs(
cpPairs: cpPairs,
closeFriendPairs: closeFriendPairs,
relations: pairs,
fallbackRelationType: relationType,
);
}),
);
await Future.wait(
_cpProfileRelationTypes.map((relationType) async {
final cabin = await _safeLoadCpCabin(userId, relationType);
@ -378,14 +374,18 @@ class SocialChatUserProfileManager extends ChangeNotifier {
].join('|');
}
Future<List<CPRes>> _safeLoadCpRelationshipPairs(String relationType) async {
Future<List<CPRes>> _safeLoadCpRelationshipPairs(
String userId,
String relationType,
) async {
try {
final pairs = await SCAccountRepository().cpRelationshipPairs(
relationType: relationType,
userId: userId,
);
if (kDebugMode) {
debugPrint(
'[CP][Profile] pair loaded relationType=$relationType '
'[CP][Profile] pair loaded userId=$userId relationType=$relationType '
'count=${pairs.length}',
);
}
@ -393,7 +393,7 @@ class SocialChatUserProfileManager extends ChangeNotifier {
} catch (error) {
if (kDebugMode) {
debugPrint(
'[CP][Profile] pair failed relationType=$relationType error=$error',
'[CP][Profile] pair failed userId=$userId relationType=$relationType error=$error',
);
}
return const <CPRes>[];

View File

@ -28,7 +28,7 @@ import 'package:yumi/shared/business_logic/models/res/sc_user_level_exp_res.dart
import 'package:yumi/shared/business_logic/models/res/sc_user_red_packet_grab_res.dart';
import 'package:yumi/shared/business_logic/models/res/sc_user_red_packet_send_res.dart';
import 'package:yumi/shared/business_logic/models/res/sc_violation_handle_res.dart';
import 'package:yumi/shared/business_logic/models/res/sc_cp_rights_config_res.dart';
import 'package:yumi/shared/business_logic/models/res/sc_cp_rights_config_res.dart';
abstract class SocialChatUserRepository {
Future<SocialChatLoginRes> getUser(String id);
@ -299,44 +299,47 @@ abstract class SocialChatUserRepository {
///
Future<bool> logoutAccount();
/// CP
Future<List<CPRes>> cpRelationshipPairs({String relationType = 'CP'});
/// CP
Future<bool> cpRelationshipSendApply(
String acceptApplyUserId, {
String relationType = 'CP',
});
/// CP
Future<bool> cpRelationshipProcessApply(String applyId, bool agree);
/// CP /
Future<bool> cpRelationshipDismissApply(
String cpUserId, {
String relationType = 'CP',
});
/// CP ID
Future<String?> cpRelationshipApplyId(
String userId, {
String relationType = 'CP',
});
/// CP
Future<SCCpCabinRes> cpCabin(String userId, {String relationType = 'CP'});
/// CP
Future<SCCpCabinValueRes> cpCabinValue(
String userId, {
String relationType = 'CP',
});
/// CP
Future<SCCpRightsConfigRes> cpRightsConfig({
String relationType = 'CP',
String? cpUserId,
});
/// CP
Future<List<CPRes>> cpRelationshipPairs({
String relationType = 'CP',
String? userId,
});
/// CP
Future<bool> cpRelationshipSendApply(
String acceptApplyUserId, {
String relationType = 'CP',
});
/// CP
Future<bool> cpRelationshipProcessApply(String applyId, bool agree);
/// CP /
Future<bool> cpRelationshipDismissApply(
String cpUserId, {
String relationType = 'CP',
});
/// CP ID
Future<String?> cpRelationshipApplyId(
String userId, {
String relationType = 'CP',
});
/// CP
Future<SCCpCabinRes> cpCabin(String userId, {String relationType = 'CP'});
/// CP
Future<SCCpCabinValueRes> cpCabinValue(
String userId, {
String relationType = 'CP',
});
/// CP
Future<SCCpRightsConfigRes> cpRightsConfig({
String relationType = 'CP',
String? cpUserId,
});
/// VIP
Future<bool> userVipAbilityUpdate({

View File

@ -110,8 +110,9 @@ class SCAccountRepository implements SocialChatUserRepository {
return normalized.isEmpty ? 'CP' : normalized;
}
String _cpPairsCacheKey(String relationType) {
return '${_currentCpCacheSessionKey()}|${_normalizedCpRelationType(relationType)}';
String _cpPairsCacheKey(String relationType, String? userId) {
final targetUserId = userId?.trim() ?? '';
return '${_currentCpCacheSessionKey()}|${targetUserId.isEmpty ? "self" : targetUserId}|${_normalizedCpRelationType(relationType)}';
}
String _cpCabinCacheKey(String userId, String relationType) {
@ -1334,27 +1335,39 @@ class SCAccountRepository implements SocialChatUserRepository {
///user/cp-relationship/pair
@override
Future<List<CPRes>> cpRelationshipPairs({String relationType = 'CP'}) async {
Future<List<CPRes>> cpRelationshipPairs({
String relationType = 'CP',
String? userId,
}) async {
final normalizedRelationType = _normalizedCpRelationType(relationType);
final cacheKey = _cpPairsCacheKey(normalizedRelationType);
final targetUserId = userId?.trim() ?? '';
final cacheKey = _cpPairsCacheKey(normalizedRelationType, targetUserId);
final cached = _freshCpCacheValue(_cpPairsCache, cacheKey);
if (cached != null) {
_cpDebugLog('pair cache hit relationType=$normalizedRelationType');
_cpDebugLog(
'pair cache hit relationType=$normalizedRelationType userId=$targetUserId',
);
return cached;
}
final inFlight = _cpPairsInFlight[cacheKey];
if (inFlight != null) {
_cpDebugLog('pair join in-flight relationType=$normalizedRelationType');
_cpDebugLog(
'pair join in-flight relationType=$normalizedRelationType userId=$targetUserId',
);
return inFlight;
}
_cpDebugLog('pair request relationType=$normalizedRelationType');
final query = <String, dynamic>{"relationType": normalizedRelationType};
if (targetUserId.isNotEmpty) {
query["userId"] = targetUserId;
}
_cpDebugLog('pair request query=$query');
final requestEpoch = _cpRelationCacheEpoch;
late final Future<List<CPRes>> trackedRequest;
trackedRequest = http
.get<List<CPRes>>(
"/user/cp-relationship/pair",
queryParams: {"relationType": normalizedRelationType},
queryParams: query,
fromJson:
(json) => (json as List).map((e) => CPRes.fromJson(e)).toList(),
)
@ -1366,15 +1379,13 @@ class SCAccountRepository implements SocialChatUserRepository {
);
}
_cpDebugLog(
'pair response relationType=$normalizedRelationType count=${result.length} '
'pair response query=$query count=${result.length} '
'pairs=${result.map(_cpPairSummary).toList()}',
);
return result;
})
.catchError((error) {
_cpDebugLog(
'pair failed relationType=$normalizedRelationType error=$error',
);
_cpDebugLog('pair failed query=$query error=$error');
throw error;
})
.whenComplete(() {