修复塔罗房间公屏不显示问题

This commit is contained in:
liyuhua
2023-08-16 17:03:40 +08:00
parent c069152790
commit fa3d394dec
4 changed files with 44 additions and 4 deletions

View File

@@ -161,7 +161,10 @@ UIKIT_EXTERN NSString * adImageName;
if (!shouldJump || info == nil) { if (!shouldJump || info == nil) {
return; return;
} }
[self performSelectorOnMainThread:@selector(advertiseJumpHandleWithInfo:) withObject:info waitUntilDone:NO]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self performSelectorOnMainThread:@selector(advertiseJumpHandleWithInfo:) withObject:info waitUntilDone:NO];
});
}; };
[advertiseView show]; [advertiseView show];
} }

View File

@@ -21,7 +21,7 @@
int second = [dict[@"second"] intValue]; int second = [dict[@"second"] intValue];
NSDictionary *data = dict[@"data"]; NSDictionary *data = dict[@"data"];
if ([data isKindOfClass:[NSString class]]) { if ([data isKindOfClass:[NSString class]]) {
data = [(NSString *)data model2dictionary]; data = [self dictionaryWithJsonString:(NSString *)data];
} }
if ([data isKindOfClass:[NSDictionary class]]) { if ([data isKindOfClass:[NSDictionary class]]) {
AttachmentModel *attachment = [[AttachmentModel alloc]init]; AttachmentModel *attachment = [[AttachmentModel alloc]init];
@@ -35,5 +35,35 @@
} }
return attachment; return attachment;
} }
//json
- (NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString {
if (jsonString == nil) {
return nil;
}
NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding];
NSError *err;
NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:jsonData
options:NSJSONReadingMutableContainers
error:&err];
if(err) {
NSLog(@"json解析失败%@",err);
return nil;
}
return dic;
}
@end @end

View File

@@ -846,9 +846,12 @@
NSString *text = [NSString stringWithFormat:@" %@", attachment.data[@"drawMsgText"]]; NSString *text = [NSString stringWithFormat:@" %@", attachment.data[@"drawMsgText"]];
[attribute appendAttributedString:[self createTextAttribute:text color:[DJDKMIMOMColor messageDefaultTextColor] font:kRoomMessageDefalutFont]]; [attribute appendAttributedString:[self createTextAttribute:text color:[DJDKMIMOMColor messageDefaultTextColor] font:kRoomMessageDefalutFont]];
if ([attachment.data[@"drawGoldNum"] intValue] > 1) { if ([attachment.data[@"drawGoldNum"] intValue] > 1) {
[attribute appendAttributedString:[self createTextAttribute:[NSString stringWithFormat:@"%d",[attachment.data[@"drawGoldNum"] intValue]] color:[DJDKMIMOMColor messageDefaultTextColor] font:kRoomMessageDefalutFont]];
[attribute appendAttributedString:[self createTextAttribute:[NSString stringWithFormat:@"%d",[attachment.data[@"drawGoldNum"] intValue]] color:[DJDKMIMOMColor messageNickColor] font:kRoomMessageDefalutFont]];
} }
[attribute appendAttributedString:[self createTextAttribute:[NSString stringWithFormat:@"%@ ", attachment.data[@"chargeProdName"]] color:[DJDKMIMOMColor messageDefaultTextColor] font:kRoomMessageDefalutFont]]; [attribute appendAttributedString:[self createTextAttribute:YMLocalizedString(@"XPNobleCenterPayView1") color:[DJDKMIMOMColor messageNickColor] font:kRoomMessageDefalutFont]];
} }
messageInfo.content = attribute; messageInfo.content = attribute;
return messageInfo; return messageInfo;

View File

@@ -477,6 +477,10 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey";
@(CustomMessageType_Gift_Compound): @(CustomMessageType_Gift_Compound):
[NSSet setWithObjects:@(Custom_Message_Sub_Gift_Compound), [NSSet setWithObjects:@(Custom_Message_Sub_Gift_Compound),
nil], nil],
@(CustomMessageType_Tarot):
[NSSet setWithObjects:
@(Custom_Message_Sub_Tarot),
nil],
@(CustomMessageType_Room_Sailing): @(CustomMessageType_Room_Sailing):
[NSSet setWithObjects: [NSSet setWithObjects:
@(Custom_Message_Sub_Sailing_Me), @(Custom_Message_Sub_Sailing_Me),