From 1a9d6650f589f3bd2591c9f06f64a05db1d4cb38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=AF=E6=98=9F?= Date: Mon, 29 Dec 2025 23:28:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BF=9E=E9=80=81=E5=81=B6?= =?UTF-8?q?=E7=8E=B0=E4=B8=8D=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- QXLive/Dynamic(语圈)/View/QXSendGiftView.h | 2 + QXLive/Dynamic(语圈)/View/QXSendGiftView.m | 14 +++-- .../Controller/QXRoomViewController.m | 51 ++++++++++--------- 3 files changed, 38 insertions(+), 29 deletions(-) diff --git a/QXLive/Dynamic(语圈)/View/QXSendGiftView.h b/QXLive/Dynamic(语圈)/View/QXSendGiftView.h index 6f72c3b..b00cff9 100644 --- a/QXLive/Dynamic(语圈)/View/QXSendGiftView.h +++ b/QXLive/Dynamic(语圈)/View/QXSendGiftView.h @@ -127,5 +127,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic,strong)CABasicAnimation *animation; @property (nonatomic,copy)void(^dissMissBlock)(QXGiftModel *gift); + +-(void)startAnimation; @end NS_ASSUME_NONNULL_END diff --git a/QXLive/Dynamic(语圈)/View/QXSendGiftView.m b/QXLive/Dynamic(语圈)/View/QXSendGiftView.m index 1ffc194..3599de7 100644 --- a/QXLive/Dynamic(语圈)/View/QXSendGiftView.m +++ b/QXLive/Dynamic(语圈)/View/QXSendGiftView.m @@ -1262,17 +1262,14 @@ // 添加到视图 [self.layer addSublayer:circleLayer]; // 设置动画完成后的状态 - [circleLayer addAnimation:self.animation forKey:@"circleAnimation"]; +// [circleLayer addAnimation:self.animation forKey:@"circleAnimation"]; circleLayer.strokeEnd = 0.0f; } -(void)sendAction{ - self.circleLayer.strokeEnd = 1.0f; - [self.circleLayer removeAllAnimations]; - _animation = nil; - [self.circleLayer addAnimation:self.animation forKey:@"circleAnimation"]; + [self startAnimation]; [[QXGlobal shareGlobal] vibrationFeedback]; switch (self.sendType) { case QXSendGiftViewTypeRoom: @@ -1300,6 +1297,13 @@ break; } } + +-(void)startAnimation{ + self.circleLayer.strokeEnd = 1.0f; + [self.circleLayer removeAllAnimations]; + _animation = nil; + [self.circleLayer addAnimation:self.animation forKey:@"circleAnimation"]; +} -(CABasicAnimation *)animation{ if (!_animation) { _animation = [CABasicAnimation animationWithKeyPath:@"strokeEnd"]; diff --git a/QXLive/Room(房间)/Controller/QXRoomViewController.m b/QXLive/Room(房间)/Controller/QXRoomViewController.m index e71aad6..7e61c75 100644 --- a/QXLive/Room(房间)/Controller/QXRoomViewController.m +++ b/QXLive/Room(房间)/Controller/QXRoomViewController.m @@ -244,7 +244,9 @@ QXRoomUserInfoViewDelegate [self.view addSubview:self.redBagTagView]; [self.view addSubview:self.dayTaskTagView]; [self setupEffectView]; - + [self.view addSubview:self.continuousView]; + self.continuousView.hidden = YES; + [self.view bringSubviewToFront:self.continuousView]; // [self.view addSubview:self.headlineView]; } #pragma mark - 特效 @@ -1793,28 +1795,30 @@ QXRoomUserInfoViewDelegate // [_sendGiftView reloadData]; MJWeakSelf _sendGiftView.roomSendSuccessBlock = ^(QXSendGiftViewType sendType, QXGiftModel * _Nonnull giftModel, NSString * _Nonnull giftCount, NSString * _Nonnull userId, NSString * _Nonnull optionId) { -// if (self->_continuousView == nil) { - [weakSelf.view addSubview:weakSelf.continuousView]; - [weakSelf.view bringSubviewToFront:weakSelf.continuousView]; -// } - weakSelf.continuousView.giftModel = giftModel; - weakSelf.continuousView.sendType = sendType; - weakSelf.continuousView.userId = userId; - weakSelf.continuousView.giftCount = giftCount; - switch (sendType) { - case QXSendGiftViewTypeFriend:{ - weakSelf.continuousView.heartId = optionId; - weakSelf.continuousView.auctionId = @""; + dispatch_async(dispatch_get_main_queue(), ^{ + weakSelf.continuousView.hidden = NO; + [weakSelf.continuousView startAnimation]; + weakSelf.continuousView.giftModel = giftModel; + weakSelf.continuousView.sendType = sendType; + weakSelf.continuousView.userId = userId; + weakSelf.continuousView.giftCount = giftCount; + switch (sendType) { + case QXSendGiftViewTypeFriend:{ + weakSelf.continuousView.heartId = optionId; + weakSelf.continuousView.auctionId = @""; + } + break; + case QXSendGiftViewTypeAuction:{ + weakSelf.continuousView.auctionId = optionId; + weakSelf.continuousView.heartId = @""; + } + break; + default: + break; } - break; - case QXSendGiftViewTypeAuction:{ - weakSelf.continuousView.auctionId = optionId; - weakSelf.continuousView.heartId = @""; - } - break; - default: - break; - } + }); + + }; _sendGiftView.jumpActivityGiftBlock = ^(QXGiftModel * _Nonnull gift, NSString * _Nonnull userIds) { @@ -1959,8 +1963,7 @@ QXRoomUserInfoViewDelegate _continuousView = [[QXContinuousGiftView alloc] initWithFrame:CGRectMake(SCREEN_WIDTH-65-12, SCREEN_HEIGHT-70-78-52-34-20-70, 65, 65)]; _continuousView.roomId = self.roomId; _continuousView.dissMissBlock = ^(QXGiftModel * _Nonnull gift) { - [weakSelf.continuousView removeFromSuperview]; - self->_continuousView = nil; + weakSelf.continuousView.hidden = YES; }; } return _continuousView;