From c49517dd947e66948f66c103df3a5c8d35c479fb Mon Sep 17 00:00:00 2001 From: edwinQQQ <> Date: Mon, 2 Dec 2024 19:33:20 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=AD=A3=E5=8F=91=E9=80=81?= =?UTF-8?q?=E7=A4=BC=E7=89=A9=E7=9A=84=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../View/AnimationView/XPRoomAnimationView.m | 13 +++++++++++-- .../Model/XPMessageInfoModel.h | 4 ++-- .../YMRoom/View/SendGiftView/View/GiftComboView.m | 15 +++++++-------- .../View/SendGiftView/View/XPSendGiftView.m | 6 +++--- 4 files changed, 23 insertions(+), 15 deletions(-) diff --git a/YuMi/Modules/YMRoom/View/AnimationView/XPRoomAnimationView.m b/YuMi/Modules/YMRoom/View/AnimationView/XPRoomAnimationView.m index 639dec8a..abd27c38 100644 --- a/YuMi/Modules/YMRoom/View/AnimationView/XPRoomAnimationView.m +++ b/YuMi/Modules/YMRoom/View/AnimationView/XPRoomAnimationView.m @@ -315,8 +315,17 @@ PIUniversalBannerViewDelegate> receiveInfo.nick = [attachment.data objectForKey:@"sendUserNick"]; receiveInfo.uid = [[attachment.data objectForKey:@"sendUserUid"] stringValue]; } else if (attachment.second == Custom_Message_Sub_Gift_Send) { - receiveInfo.targetUsers = @[]; - NSLog(@"******************* %@", receiveInfo.targetAvatar); + if (receiveInfo.targetUsers.count == 0) { + GiftReceiveUserInfoModel *model = [[GiftReceiveUserInfoModel alloc] init]; + model.nick = receiveInfo.targetNick; + model.avatar = receiveInfo.targetAvatar; + model.uid = receiveInfo.uid.integerValue; + receiveInfo.targetUsers = @[model]; + } + + if (receiveInfo.targetUids.count == 0) { + receiveInfo.targetUids = @[@(receiveInfo.uid.integerValue)]; + } } if (!_embeddedTargetDatas) { diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.h b/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.h index f16481e2..e583113d 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.h +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.h @@ -23,8 +23,8 @@ NS_ASSUME_NONNULL_BEGIN ///cell的高度 @property (nonatomic,assign) CGFloat rowHeight; @property (nonatomic,assign) CGFloat textWidth; -@property(nonatomic, strong) YYTextLayout *textLayout; -@property(nonatomic, strong) NSMutableArray *extraSizeArray; +//@property(nonatomic, strong) YYTextLayout *textLayout; +//@property(nonatomic, strong) NSMutableArray *extraSizeArray; ///文本内容的 @property (nonatomic,assign) CGFloat contentLeftMargin; ///文本右边的间隙 diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/View/GiftComboView.m b/YuMi/Modules/YMRoom/View/SendGiftView/View/GiftComboView.m index 058d1826..8a959a7a 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/View/GiftComboView.m +++ b/YuMi/Modules/YMRoom/View/SendGiftView/View/GiftComboView.m @@ -26,10 +26,9 @@ - (instancetype)init { if (self = [super init]) { - UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTapSpace)]; [self addGestureRecognizer:tap]; - + [self setupUI]; [self setupTimer]; [self updateCount]; @@ -104,10 +103,10 @@ } - (void)handleTap { - dispatch_async(dispatch_get_main_queue(), ^{ +// dispatch_async(dispatch_get_main_queue(), ^{ // 1521 连续震动 3 次 AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); - }); +// }); [[GiftComboManager sharedManager] sendGift]; [self.playImageView startAnimation]; @@ -128,9 +127,6 @@ if (!_container) { _container = [[UIView alloc] init]; _container.backgroundColor = [UIColor clearColor]; - - UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap)]; - [_container addGestureRecognizer:tap]; } return _container; } @@ -141,6 +137,7 @@ font:kFontSemibold(30) textColor:UIColorFromRGB(0xFFE07B)]; _comboCountLabel.transform = isMSRTL() ? CGAffineTransformMakeRotation(M_PI_4) : CGAffineTransformMakeRotation(-M_PI_4); + _comboCountLabel.userInteractionEnabled = YES; } return _comboCountLabel; } @@ -158,7 +155,9 @@ - (CountdownRingView *)countdownRingView { if (!_countdownRingView) { _countdownRingView = [[CountdownRingView alloc] initWithFrame:CGRectMake(0, 0, kGetScaleWidth(90), kGetScaleWidth(90)) - duration:5]; + duration:555]; + UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap)]; + [_countdownRingView addGestureRecognizer:tap]; } return _countdownRingView; } diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/View/XPSendGiftView.m b/YuMi/Modules/YMRoom/View/SendGiftView/View/XPSendGiftView.m index f931c354..b9191367 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/View/XPSendGiftView.m +++ b/YuMi/Modules/YMRoom/View/SendGiftView/View/XPSendGiftView.m @@ -353,11 +353,11 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; @kStrongify(self); AttachmentModel *attachment = [[AttachmentModel alloc] init]; attachment.first = CustomMessageType_Gift; - attachment.second = Custom_Message_Sub_Gift_Send; + attachment.second = Custom_Message_Sub_Gift_EmbeddedStyle; [data setObject:[[obj objectForKey:@"uid"] stringValue] forKey:@"targetUid"]; [data setObject:[obj objectForKey:@"nick"] forKey:@"targetNick"]; [data setObject:[obj objectForKey:@"avatar"] forKey:@"targetAvatar"]; - [data removeObjectForKey:@"targetUsers"]; +// [data removeObjectForKey:@"targetUsers"]; attachment.data = data; [self sendCustomMessage:attachment]; }); @@ -927,13 +927,13 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; dispatch_after(delayTime, dispatch_get_main_queue(), ^{ @kStrongify(self); if (self) { + [self sendCustomMessage:receiveInfo oringinDic:originDic]; [[GiftComboManager sharedManager] resetCombo]; @kWeakify(self); [[GiftComboManager sharedManager] setHandleComboSuccess:^(GiftReceiveInfoModel * _Nonnull receiveModel, NSMutableDictionary * _Nonnull originDic) { @kStrongify(self); [self sendCustomMessage:receiveInfo oringinDic:originDic.copy]; }]; - [self sendCustomMessage:receiveInfo oringinDic:originDic]; } });