diff --git a/YuMi/Appdelegate/AppDelegate+ThirdConfig.m b/YuMi/Appdelegate/AppDelegate+ThirdConfig.m index 9aa4d562..6daac3e1 100644 --- a/YuMi/Appdelegate/AppDelegate+ThirdConfig.m +++ b/YuMi/Appdelegate/AppDelegate+ThirdConfig.m @@ -161,7 +161,10 @@ UIKIT_EXTERN NSString * adImageName; if (!shouldJump || info == nil) { 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]; } diff --git a/YuMi/Modules/YMMessage/Tool/CustomAttachmentDecoder.m b/YuMi/Modules/YMMessage/Tool/CustomAttachmentDecoder.m index 5240bc21..0114b31f 100644 --- a/YuMi/Modules/YMMessage/Tool/CustomAttachmentDecoder.m +++ b/YuMi/Modules/YMMessage/Tool/CustomAttachmentDecoder.m @@ -21,7 +21,7 @@ int second = [dict[@"second"] intValue]; NSDictionary *data = dict[@"data"]; if ([data isKindOfClass:[NSString class]]) { - data = [(NSString *)data model2dictionary]; + data = [self dictionaryWithJsonString:(NSString *)data]; } if ([data isKindOfClass:[NSDictionary class]]) { AttachmentModel *attachment = [[AttachmentModel alloc]init]; @@ -35,5 +35,35 @@ } 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 diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m b/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m index 29d14f6d..4c6b8ece 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m @@ -846,9 +846,12 @@ NSString *text = [NSString stringWithFormat:@" %@", attachment.data[@"drawMsgText"]]; [attribute appendAttributedString:[self createTextAttribute:text color:[DJDKMIMOMColor messageDefaultTextColor] font:kRoomMessageDefalutFont]]; 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; return messageInfo; diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.m b/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.m index 89a4d64d..94fe9ad0 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.m @@ -477,6 +477,10 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; @(CustomMessageType_Gift_Compound): [NSSet setWithObjects:@(Custom_Message_Sub_Gift_Compound), nil], + @(CustomMessageType_Tarot): + [NSSet setWithObjects: + @(Custom_Message_Sub_Tarot), + nil], @(CustomMessageType_Room_Sailing): [NSSet setWithObjects: @(Custom_Message_Sub_Sailing_Me),