修改缘分匹配城市无法显示
This commit is contained in:
parent
d8cc691814
commit
1d0438db92
@ -435,41 +435,44 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
|
||||
bool isSameCity = false;
|
||||
if (snapshot.connectionState ==
|
||||
ConnectionState.done) {
|
||||
snapshot.data!.forEach((element) {
|
||||
if (element.userID == conversationItem.userID) {
|
||||
userFullInfo = element;
|
||||
}
|
||||
});
|
||||
//自己的信息
|
||||
V2TimUserFullInfo myuserFullInfo =
|
||||
snapshot.data!.first;
|
||||
if ((snapshot.data ?? []).isNotEmpty) {
|
||||
snapshot.data!.forEach((element) {
|
||||
if (element.userID == conversationItem.userID) {
|
||||
userFullInfo = element;
|
||||
}
|
||||
});
|
||||
//自己的信息
|
||||
V2TimUserFullInfo myuserFullInfo =
|
||||
snapshot.data!.first;
|
||||
|
||||
if (userFullInfo!.customInfo!
|
||||
.containsKey('Label')) {
|
||||
var otherInfo = jsonDecode(userFullInfo!
|
||||
.customInfo!['Label']
|
||||
.toString());
|
||||
var myInfo = jsonDecode(myuserFullInfo!
|
||||
.customInfo!['Label']
|
||||
.toString());
|
||||
if (myInfo['city']
|
||||
.toString()
|
||||
.contains(otherInfo['city'].toString())) {
|
||||
isSameCity = true;
|
||||
if (userFullInfo!.customInfo!
|
||||
.containsKey('Label')) {
|
||||
var otherInfo = jsonDecode(userFullInfo!
|
||||
.customInfo!['Label']
|
||||
.toString());
|
||||
var myInfo = jsonDecode(myuserFullInfo!
|
||||
.customInfo!['Label']
|
||||
.toString());
|
||||
if (myInfo['city']
|
||||
.toString()
|
||||
.contains(otherInfo['city'].toString())) {
|
||||
isSameCity = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (userFullInfo != null) {
|
||||
List<String> userIdList =
|
||||
userFullInfo!.userID!.split('_');
|
||||
if (userIdList.length >= 4) {
|
||||
if (int.parse(userIdList[2]) == 10) {
|
||||
isOfficial = true;
|
||||
} else {
|
||||
isOfficial = false;
|
||||
if (userFullInfo != null) {
|
||||
List<String> userIdList =
|
||||
userFullInfo!.userID!.split('_');
|
||||
if (userIdList.length >= 4) {
|
||||
if (int.parse(userIdList[2]) == 10) {
|
||||
isOfficial = true;
|
||||
} else {
|
||||
isOfficial = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Widget conversationLineItem() {
|
||||
|
||||
@ -32,7 +32,11 @@ final TUIChatSeparateViewModel chatSeparateViewModel =
|
||||
TUIChatSeparateViewModel();
|
||||
|
||||
void main() {
|
||||
|
||||
FlutterError.onError = (FlutterErrorDetails details) {
|
||||
FlutterError.dumpErrorToConsole(details);
|
||||
// if (kReleaseMode)
|
||||
// //处理线上错误,如统计上传
|
||||
};
|
||||
WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized();
|
||||
FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding);
|
||||
runApp(const MyApp());
|
||||
@ -94,6 +98,7 @@ createCustomMsg(String userId, String imId) async {
|
||||
Map<String, dynamic> info = {};
|
||||
if (data['data']['both_cities'] != null) {
|
||||
List city = data['data']['both_cities'];
|
||||
print('城市'+city.toString());
|
||||
if (city.isNotEmpty) {
|
||||
desc = '你们都在$city留下过足迹';
|
||||
}
|
||||
@ -113,6 +118,9 @@ createCustomMsg(String userId, String imId) async {
|
||||
}
|
||||
}
|
||||
if (desc.isNotEmpty) {
|
||||
if (data['data']['both_cities'] != null) {
|
||||
info['city'] = desc;
|
||||
}
|
||||
info['interests'] = data['data']['interests'] ?? [];
|
||||
info['guide_text'] = data['data']['guide_text'] ?? '';
|
||||
info['my'] = data['data']['my'] ?? '';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user