From 67ae3508facf4e7a7d5ae2fa11e1930465e8a41e Mon Sep 17 00:00:00 2001 From: liyuhua <15626451870@163.com> Date: Wed, 31 Jan 2024 10:43:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xplan-ios.xcodeproj/project.pbxproj | 8 +++--- .../Login/View/LoginFullInfoViewController.m | 2 +- ...XPMineUserInfoGiftWallCollectionViewCell.m | 1 + .../MineInfo/XPMineUserDataViewController.m | 6 ++-- .../View/Cell/XPGiftItemCollectionViewCell.m | 3 +- .../View/MewUnlockGiftBroadcastView.m | 28 ++++++++++--------- .../View/MewUnlockGiftBroadcastViewCell.m | 13 ++++++--- .../SendGiftView/View/XPGiftInfoView.m | 16 +++++++---- .../SendGiftView/View/XPSendGiftView.m | 6 +--- .../Tool/XPRoomMessageParser.m | 2 +- 10 files changed, 48 insertions(+), 37 deletions(-) diff --git a/xplan-ios.xcodeproj/project.pbxproj b/xplan-ios.xcodeproj/project.pbxproj index 5065b1ee..4986f06c 100644 --- a/xplan-ios.xcodeproj/project.pbxproj +++ b/xplan-ios.xcodeproj/project.pbxproj @@ -11669,7 +11669,7 @@ CODE_SIGN_ENTITLEMENTS = "xplan-ios/xplan-ios.entitlements"; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 48UCG35Q9W; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -11685,7 +11685,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 2.0.0; + MARKETING_VERSION = 2.2.0; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -11932,7 +11932,7 @@ CODE_SIGN_ENTITLEMENTS = "xplan-ios/xplan-iosRelease.entitlements"; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 48UCG35Q9W; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -11948,7 +11948,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 2.0.0; + MARKETING_VERSION = 2.2.0; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", diff --git a/xplan-ios/Main/Login/View/LoginFullInfoViewController.m b/xplan-ios/Main/Login/View/LoginFullInfoViewController.m index 15750363..4f141a09 100644 --- a/xplan-ios/Main/Login/View/LoginFullInfoViewController.m +++ b/xplan-ios/Main/Login/View/LoginFullInfoViewController.m @@ -200,7 +200,7 @@ UIKIT_EXTERN NSString * kUserCompleteInfoFinishKey; if ([self.presenter getThirdUserInfo] && [self.presenter getThirdUserInfo].avatarUrl.length > 0) { avatar = [self.presenter getThirdUserInfo].avatarUrl; } else { - avatar = @"https://image.pekolive.com/default_image.png"; + avatar = @"https://yinmeng-1318633625.cos.ap-guangzhou.myqcloud.com/default_avatar.png"; } return avatar; } diff --git a/xplan-ios/Main/Mine/View/Cell/MineInfo/XPMineUserInfoGiftWallCollectionViewCell.m b/xplan-ios/Main/Mine/View/Cell/MineInfo/XPMineUserInfoGiftWallCollectionViewCell.m index c0d68331..674691c6 100644 --- a/xplan-ios/Main/Mine/View/Cell/MineInfo/XPMineUserInfoGiftWallCollectionViewCell.m +++ b/xplan-ios/Main/Mine/View/Cell/MineInfo/XPMineUserInfoGiftWallCollectionViewCell.m @@ -99,6 +99,7 @@ self.giftNameLabel.text = _giftInfo.giftName; self.giftPriceLabel.text = [NSString stringWithFormat:@"%ld", _giftInfo.giftPrice]; self.numberButton.text = [NSString stringWithFormat:@"x%ld", _giftInfo.reciveCount]; + _bgImageView.image = kImage(@"mine_user_infi_gift_bg1"); if(_giftInfo.giftLevel > 0){ NSString *image = [NSString stringWithFormat:@"mine_user_infi_gift_bg%d",_giftInfo.giftLevel]; _bgImageView.image = kImage(image); diff --git a/xplan-ios/Main/Mine/View/MineInfo/XPMineUserDataViewController.m b/xplan-ios/Main/Mine/View/MineInfo/XPMineUserDataViewController.m index bfaed862..35904269 100644 --- a/xplan-ios/Main/Mine/View/MineInfo/XPMineUserDataViewController.m +++ b/xplan-ios/Main/Mine/View/MineInfo/XPMineUserDataViewController.m @@ -116,7 +116,8 @@ } } - (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section{ - return section == 2 ? UIEdgeInsetsMake(0, 12, 100, 12) : UIEdgeInsetsMake(0, 12, 0, 12);; + CGFloat x = (KScreenWidth - 84 * 4 - 1)/5; + return section == 2 ? UIEdgeInsetsMake(0, x, 100, x) : UIEdgeInsetsMake(0, 12, 0, 12);; } - (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{ if(indexPath.section == 0){ @@ -209,7 +210,8 @@ - (UICollectionView *)collectionView{ if(!_collectionView){ UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; - layout.minimumInteritemSpacing = 5; + + layout.minimumInteritemSpacing = (KScreenWidth - 84 * 4 - 1) / 5; layout.minimumLineSpacing = 8; _collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout]; diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/Cell/XPGiftItemCollectionViewCell.m b/xplan-ios/Main/ModuleKit/SendGiftView/View/Cell/XPGiftItemCollectionViewCell.m index 4419a904..6e541342 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/View/Cell/XPGiftItemCollectionViewCell.m +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/Cell/XPGiftItemCollectionViewCell.m @@ -211,6 +211,7 @@ self.lockImageView.hidden = self.curUserNobleLevel >= giftInfo.giftVipInfo.vipLevel; [self setVeiwLucency:!self.lockImageView.hidden ? 0.5 : 1]; }else if(giftInfo.giftType == GiftType_Unlock){ + self.lockImageView.hidden = YES; for (int i = 0 ; i < giftInfo.unlockGiftList.count; i++) { MewUnlockGiftModel *model = giftInfo.unlockGiftList[i]; if (model.targetGift.giftId == giftInfo.giftId){ @@ -219,8 +220,6 @@ [self setVeiwLucency:0.5]; model.unlocked = NO; }else{ - self.lockImageView.hidden = YES; - [self setVeiwLucency:1]; model.unlocked = YES; } } diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/MewUnlockGiftBroadcastView.m b/xplan-ios/Main/ModuleKit/SendGiftView/View/MewUnlockGiftBroadcastView.m index 9962e276..46187ae0 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/View/MewUnlockGiftBroadcastView.m +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/MewUnlockGiftBroadcastView.m @@ -44,29 +44,31 @@ self.dressUpView.image = image; }]; } - [self.collectionView reloadData]; if(_giftModel.baseGift.isSelect == YES){ dispatch_time_t delayTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)); dispatch_after(delayTime, dispatch_get_main_queue(), ^{ - self.collectionView.contentOffset = CGPointMake(0, 0); + [self.collectionView scrollToItemAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] atScrollPosition:UICollectionViewScrollPositionNone animated:YES]; }); }else{ - CGFloat x = self.giftModel.baseGift.width + 6; + + int j = 0; for (int i = 0; i < _giftModel.unlockGiftList.count ; i++) { - MewUnlockGiftModel *model = self.giftModel.unlockGiftList[i]; - if (model.isSelect){ - if (i > 0){ - x = x + model.width + 6; - } - - } - - } + if(model.isSelect){ + j = i; + break; + } + + } dispatch_time_t delayTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)); dispatch_after(delayTime, dispatch_get_main_queue(), ^{ - self.collectionView.contentOffset = CGPointMake(x, 0); + + if (self.giftModel.unlockGiftList.count > j){ + [self.collectionView scrollToItemAtIndexPath:[NSIndexPath indexPathForRow:j + 1 inSection:0] atScrollPosition:UICollectionViewScrollPositionNone animated:YES]; + } + + }); } diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/MewUnlockGiftBroadcastViewCell.m b/xplan-ios/Main/ModuleKit/SendGiftView/View/MewUnlockGiftBroadcastViewCell.m index 403a9419..277b0afa 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/View/MewUnlockGiftBroadcastViewCell.m +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/MewUnlockGiftBroadcastViewCell.m @@ -131,10 +131,7 @@ [_unlockGiftImageView loadImageWithUrl:_unlockModel.targetGift.giftUrl completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) { self.unlockGiftImageView.image = image; }]; - NSString *text = [NSString stringWithFormat:@"送出 %d个 %@可解锁",_unlockModel.condition,_baseModel.giftName]; - NSMutableAttributedString *textAtt = [[NSMutableAttributedString alloc]initWithString:text attributes:@{NSFontAttributeName: [UIFont systemFontOfSize:10 weight:UIFontWeightRegular],NSForegroundColorAttributeName:[UIColor whiteColor]}]; - [textAtt addAttributes:@{NSForegroundColorAttributeName:UIColorFromRGB(0xFFDA24),NSFontAttributeName:[UIFont systemFontOfSize:10 weight:UIFontWeightMedium]} range:[text rangeOfString:[NSString stringWithFormat:@"%d个",_unlockModel.condition]]]; - _unlockTitleView.attributedText = textAtt; + NSMutableAttributedString *numAtt = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"%d/%d",_unlockModel.process,_unlockModel.condition] attributes:@{NSForegroundColorAttributeName:UIColorFromRGB(0xCED1DB),NSFontAttributeName:[UIFont systemFontOfSize:9 weight:UIFontWeightRegular]}]; _unlockNumView.attributedText = numAtt; @@ -153,9 +150,17 @@ _unlockIconView.hidden = NO; [self setVeiwLucency:0.5]; self.contentView.layer.borderColor = UIColorRGBAlpha(0xFFDA24, 0.5).CGColor ; + NSString *text = [NSString stringWithFormat:@"送出 %d个 %@可解锁",_unlockModel.condition,_baseModel.giftName]; + NSMutableAttributedString *textAtt = [[NSMutableAttributedString alloc]initWithString:text attributes:@{NSFontAttributeName: [UIFont systemFontOfSize:10 weight:UIFontWeightRegular],NSForegroundColorAttributeName:[UIColor whiteColor]}]; + [textAtt addAttributes:@{NSForegroundColorAttributeName:UIColorFromRGB(0xFFDA24),NSFontAttributeName:[UIFont systemFontOfSize:10 weight:UIFontWeightMedium]} range:[text rangeOfString:[NSString stringWithFormat:@"%d个",_unlockModel.condition]]]; + _unlockTitleView.attributedText = textAtt; }else{ _unlockIconView.hidden = YES; self.contentView.layer.borderColor = UIColorRGBAlpha(0xFFDA24, 1).CGColor ; + NSString *text = [NSString stringWithFormat:@"送出 %d个 %@已解锁",_unlockModel.condition,_baseModel.giftName]; + NSMutableAttributedString *textAtt = [[NSMutableAttributedString alloc]initWithString:text attributes:@{NSFontAttributeName: [UIFont systemFontOfSize:10 weight:UIFontWeightRegular],NSForegroundColorAttributeName:[UIColor whiteColor]}]; + [textAtt addAttributes:@{NSForegroundColorAttributeName:UIColorFromRGB(0xFFDA24),NSFontAttributeName:[UIFont systemFontOfSize:10 weight:UIFontWeightMedium]} range:[text rangeOfString:[NSString stringWithFormat:@"%d个",_unlockModel.condition]]]; + _unlockTitleView.attributedText = textAtt; } if (!_baseModel.isSelect){ self.contentView.layer.borderWidth = _unlockModel.isSelect ? 1 : 0; diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftInfoView.m b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftInfoView.m index e3f82df7..eaa3c460 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftInfoView.m +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftInfoView.m @@ -485,6 +485,13 @@ static NSString *kSendGiftViewHidePunishNewIcon = @"kSendGiftViewHidePunishNewIc GiftInfoModel * giftInfo = [self.datasource safeObjectAtIndex1:item]; [self dealSelectGift:giftInfo]; [self.giftcollectionView reloadData]; + + dispatch_time_t delayTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)); + dispatch_after(delayTime, dispatch_get_main_queue(), ^{ + + [self.giftcollectionView scrollToItemAtIndexPath:[NSIndexPath indexPathForRow:item inSection:0] atScrollPosition:UICollectionViewScrollPositionNone animated:YES]; + }); + if (self.delegate && [self.delegate respondsToSelector:@selector(xPGiftInfoView:didClickItem:type:)]) { [self.delegate xPGiftInfoView:self didClickItem:giftInfo type:self.segmentType]; } @@ -496,14 +503,13 @@ static NSString *kSendGiftViewHidePunishNewIcon = @"kSendGiftViewHidePunishNewIc if (obj.baseGift.giftId == giftModel.giftId){ for (int i = 0 ; i < obj.unlockGiftList.count; i++) { MewUnlockGiftModel *model = obj.unlockGiftList[i]; - - int num = model.condition - model.process; - if (count > num){ + int num = count + model.process; + if (num > model.condition){ model.process = model.condition; - count = count - num; }else{ - model.process = model.process + count; + model.process = num; } + } } diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPSendGiftView.m b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPSendGiftView.m index a4899512..6a12968d 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPSendGiftView.m +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPSendGiftView.m @@ -386,11 +386,6 @@ return; } GiftInfoModel * giftInfo = self.giftInfoView.lastSelectGift; - if (giftInfo.giftType == GiftType_Unlock && giftInfo.unlocked == NO){ - - [XCHUDTool showErrorWithMessage:@"暂未解锁该礼物,请留意上方的礼物解锁条件"]; - return; - } if (self.usingplaceType == SendGiftType_Room) { if (uids.count > 0) { ///送礼物的人 @@ -571,6 +566,7 @@ }else if(info.giftType == GiftType_Unlock){ [self.luckyBroadcastView removeFromSuperview]; [self.constellationBanner removeFromSuperview]; + if(info.unlockGiftList.count == 0)return; CGFloat width = [UILabel getWidthWithText:@(info.baseGift.goldPrice).stringValue height:13 font:[UIFont systemFontOfSize:9 weight:UIFontWeightRegular]]; info.baseGift.width = (width < 33 ? 33 : width) + 51; if(info.giftId == info.baseGift.giftId){ diff --git a/xplan-ios/Main/Room/View/MessageContainerView/Tool/XPRoomMessageParser.m b/xplan-ios/Main/Room/View/MessageContainerView/Tool/XPRoomMessageParser.m index c2a40756..26ec7050 100644 --- a/xplan-ios/Main/Room/View/MessageContainerView/Tool/XPRoomMessageParser.m +++ b/xplan-ios/Main/Room/View/MessageContainerView/Tool/XPRoomMessageParser.m @@ -546,7 +546,7 @@ [unlockGiftAtt appendAttributedString:[self createTextAttribute:nick color:[ThemeColor colorWithHexString:@"#FFD980"] font:fontSize]]; [self attributeAddHihtLight:unlockGiftAtt uid:unlockGift.uid.integerValue]; [unlockGiftAtt appendAttributedString:[self createTextAttribute:@" 获得 " color:[UIColor whiteColor] font:fontSize]]; - [unlockGiftAtt appendAttributedString:[self createTextAttribute:unlockGift.dressName color:[UIColor whiteColor] font:fontSize]]; + [unlockGiftAtt appendAttributedString:[self createTextAttribute:[NSString stringWithFormat:@"%@ ",unlockGift.dressName] color:[UIColor whiteColor] font:fontSize]]; [unlockGiftAtt appendAttributedString:[self createUrlImageAttribute:unlockGift.dressUrl size:CGSizeMake(28, 28)]]; messageInfo.content = unlockGiftAtt;