Commit 13c207e6c6d4fee72583cccaee55ec6091383897

Authored by 张旭
1 parent 119c6b6f

更改私聊

LiveVideoCloud/Classes/Sections/InteractionSections/Gift/Present/ComboCell.m
@@ -37,7 +37,7 @@ @@ -37,7 +37,7 @@
37 - (void)setModel:(GiftModel *)model 37 - (void)setModel:(GiftModel *)model
38 { 38 {
39 _model = model; 39 _model = model;
40 - [self.icon sd_setImageWithURL:[NSURL URLWithString:model.icon] placeholderImage:nil];//[UIImage zx_circleImageNamed:model.icon]; 40 + [self.icon sd_setImageWithURL:[NSURL URLWithString:model.icon] placeholderImage:[UIImage imageNamed:@"defaultUserIcon"]];
41 self.senderNameLbl.text = model.sender; 41 self.senderNameLbl.text = model.sender;
42 self.giftNameLbl.text = [NSString stringWithFormat:@"送一个%@",model.giftName]; 42 self.giftNameLbl.text = [NSString stringWithFormat:@"送一个%@",model.giftName];
43 self.senderNameLbl.size = [self.senderNameLbl labelSize]; 43 self.senderNameLbl.size = [self.senderNameLbl labelSize];
LiveVideoCloud/Classes/Sections/InteractionSections/LiveBaseView.m
@@ -251,6 +251,7 @@ typedef NS_ENUM(NSInteger, PopType) {//弹窗类型 @@ -251,6 +251,7 @@ typedef NS_ENUM(NSInteger, PopType) {//弹窗类型
251 return YES; 251 return YES;
252 } 252 }
253 253
  254 +#pragma mark - bounceTypeClick
254 - (void)bounceBtnType:(BounceBtnType)btnType model:(userInfoModel *_Nonnull)model 255 - (void)bounceBtnType:(BounceBtnType)btnType model:(userInfoModel *_Nonnull)model
255 { 256 {
256 switch (btnType) { 257 switch (btnType) {
@@ -312,9 +313,11 @@ typedef NS_ENUM(NSInteger, PopType) {//弹窗类型 @@ -312,9 +313,11 @@ typedef NS_ENUM(NSInteger, PopType) {//弹窗类型
312 } 313 }
313 } 314 }
314 315
  316 +#pragma mark - PrivateMethod
315 - (void)showPrivateView 317 - (void)showPrivateView
316 { 318 {
317 PrivateView *privateView = [PrivateView privateView]; 319 PrivateView *privateView = [PrivateView privateView];
  320 + privateView.roomId = _roomId;
318 privateView.backgroundColor = [UIColor whiteColor]; 321 privateView.backgroundColor = [UIColor whiteColor];
319 [self addSubview:privateView]; 322 [self addSubview:privateView];
320 privateView.delegate = self; 323 privateView.delegate = self;
@@ -382,7 +385,7 @@ typedef NS_ENUM(NSInteger, PopType) {//弹窗类型 @@ -382,7 +385,7 @@ typedef NS_ENUM(NSInteger, PopType) {//弹窗类型
382 385
383 - (NSString *)giftModelToJSON:(GiftModel *)model 386 - (NSString *)giftModelToJSON:(GiftModel *)model
384 { 387 {
385 - NSDictionary *dic = @{chatType:giftType,chatMessage:@{msgGiftName:model.giftName,msgGiftNumber:[NSString stringWithFormat:@"%zd",model.giftNumber],msgGiftPrice:model.price}}; 388 + NSDictionary *dic = @{chatType:giftType,chatMessage:@{msgGiftName:model.giftName,msgGiftNumber:[NSString stringWithFormat:@"%zd",model.giftNumber],msgGiftPrice:model.price,msgContent:model.giftName}};
386 return [Tools dictionaryToJson:dic]; 389 return [Tools dictionaryToJson:dic];
387 } 390 }
388 391
LiveVideoCloud/Classes/Sections/InteractionSections/PrivateView/PrivateView.h
@@ -28,4 +28,6 @@ @@ -28,4 +28,6 @@
28 28
29 @property (nonatomic ,strong) NSMutableArray * _Nullable chatArray; 29 @property (nonatomic ,strong) NSMutableArray * _Nullable chatArray;
30 30
  31 +@property (nonatomic ,copy) NSString * _Nullable roomId;
  32 +
31 @end 33 @end
LiveVideoCloud/Classes/Sections/InteractionSections/PrivateView/PrivateView.m
@@ -63,6 +63,11 @@ static NSString *message_content = @"message_content"; @@ -63,6 +63,11 @@ static NSString *message_content = @"message_content";
63 [self textFieldShouldReturn:self.textField]; 63 [self textFieldShouldReturn:self.textField];
64 } 64 }
65 65
  66 +- (void)setRoomId:(NSString *)roomId
  67 +{
  68 + _roomId = roomId;
  69 +}
  70 +
66 - (void)dealloc 71 - (void)dealloc
67 { 72 {
68 [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillShowNotification object:nil]; 73 [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillShowNotification object:nil];
@@ -102,7 +107,7 @@ static NSString *message_content = @"message_content"; @@ -102,7 +107,7 @@ static NSString *message_content = @"message_content";
102 NSDictionary *dic = @{message_content:textField.text}; 107 NSDictionary *dic = @{message_content:textField.text};
103 weakself 108 weakself
104 NSString *message = [Tools dictionaryToJson:dic]; 109 NSString *message = [Tools dictionaryToJson:dic];
105 - [[CNLiveChatManager sharedCNLiveChatManager] sendMessage:message type:CNLive_ConversationType_PRIVATE targetId:@"20170328" success:^(CNLiveChatMessage *message) { 110 + [[CNLiveChatManager sharedCNLiveChatManager] sendMessage:message type:CNLive_ConversationType_PRIVATE targetId:_roomId success:^(CNLiveChatMessage *message) {
106 111
107 dispatch_async(dispatch_get_main_queue(), ^{ 112 dispatch_async(dispatch_get_main_queue(), ^{
108 strongself 113 strongself