feat: 修正发送礼物的处理

This commit is contained in:
edwinQQQ
2024-12-02 19:33:20 +08:00
parent 4d6e71450a
commit c49517dd94
4 changed files with 23 additions and 15 deletions

View File

@@ -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) {

View File

@@ -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;
///文本右边的间隙

View File

@@ -26,7 +26,6 @@
- (instancetype)init {
if (self = [super init]) {
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTapSpace)];
[self addGestureRecognizer:tap];
@@ -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;
}

View File

@@ -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];
}
});