增加换肤功能
This commit is contained in:
37
TUIKit/TUIChat/BaseCellData/Custom/TUIOrderCellData.m
Normal file
37
TUIKit/TUIChat/BaseCellData/Custom/TUIOrderCellData.m
Normal file
@@ -0,0 +1,37 @@
|
||||
//
|
||||
// TUIOrderCellData.m
|
||||
// TUIChat
|
||||
//
|
||||
// Created by xia on 2022/6/10.
|
||||
// Copyright © 2023 Tencent. All rights reserved.
|
||||
//
|
||||
|
||||
#import "TUIOrderCellData.h"
|
||||
|
||||
@implementation TUIOrderCellData
|
||||
|
||||
+ (TUIMessageCellData *)getCellData:(V2TIMMessage *)message {
|
||||
NSDictionary *param = [NSJSONSerialization JSONObjectWithData:message.customElem.data options:NSJSONReadingAllowFragments error:nil];
|
||||
TUIOrderCellData *cellData = [[TUIOrderCellData alloc] initWithDirection:message.isSelf ? MsgDirectionOutgoing : MsgDirectionIncoming];
|
||||
cellData.innerMessage = message;
|
||||
cellData.msgID = message.msgID;
|
||||
cellData.title = param[@"title"];
|
||||
cellData.desc = param[@"description"];
|
||||
cellData.imageUrl = param[@"imageUrl"];
|
||||
cellData.link = param[@"link"];
|
||||
cellData.price = param[@"price"];
|
||||
cellData.avatarUrl = [NSURL URLWithString:message.faceURL];
|
||||
return cellData;
|
||||
}
|
||||
|
||||
+ (NSString *)getDisplayString:(V2TIMMessage *)message {
|
||||
NSDictionary *param = [NSJSONSerialization JSONObjectWithData:message.customElem.data options:NSJSONReadingAllowFragments error:nil];
|
||||
return param[@"title"];
|
||||
}
|
||||
|
||||
- (CGSize)contentSize {
|
||||
CGSize size = CGSizeMake(245, 80);
|
||||
return size;
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user