From bea4ee9c6c992c73fd96d5cd5c56c05faa27f1ab Mon Sep 17 00:00:00 2001 From: liyuhua <15626451870@163.com> Date: Fri, 21 Jul 2023 14:07:04 +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 --- YuMi.xcodeproj/project.pbxproj | 12 +- .../InputView/InputView/QinputPhotoView.m | 5 +- .../View/NewLogin/XPLoginPwdViewController.m | 2 +- .../Cell/SessionUserInfoTableViewCell.m | 1 + .../Session/Content/MessageContentImage.m | 9 +- .../Content/SesssionModel/MessageImageModel.h | 1 + .../Content/SesssionModel/MessageImageModel.m | 1 + .../View/Cell/XPMineGiveDiamondDetailsCell.m | 32 +- .../MineInfo/XPMineUserDataViewController.m | 8 +- .../View/SubViews/XPNobleCenterPayView.m | 2 +- .../View/XPMonentsMineViewController.m | 25 + .../View/Cell/XPHomeBannerTableViewCell.m | 36 +- .../XPRoomSearchContainerViewController.m | 1 + .../XPRoomActivityContainerView.m | 2 + .../View/AnimationView/XPRoomAnimationView.m | 185 ++-- .../View/AnimationView/XPRoomGiftBannerView.m | 2 +- .../AnimationView/XPRoomLuckyBigPrizeView.m | 7 +- .../Model/Music+CoreDataProperties.h | 2 +- .../Model/Music+CoreDataProperties.m | 13 +- .../View/SubViews/XPRoomBackMusicPlayerView.m | 2 +- .../View/XPRoomMusicLibraryViewController.m | 2 +- .../View/XPRoomTransferMusicViewController.m | 2 +- .../XPRoomBackContainerView.m | 10 +- .../View/XPCandyTreeViewController.m | 801 ++++++++++-------- .../View/XPRoomMessageHeaderView.m | 2 +- .../YMRoom/View/SendGiftView/Api/Api+Gift.h | 4 + .../YMRoom/View/SendGiftView/Api/Api+Gift.m | 8 +- .../View/SendGiftView/Model/GiftInfoModel.h | 2 + .../View/SendGiftView/View/XPSendGiftView.m | 16 +- .../StageView/MicroView/MicroGiftValueView.m | 1 + .../View/StageView/MicroView/MicroView.m | 17 +- .../StageView/MicroView/MicroViewProtocol.h | 6 +- .../Modules/YMRoom/View/StageView/StageView.m | 34 +- YuMi/Modules/YMRoom/View/XPMiniRoomView.m | 2 +- .../YMTabbar/View/TabbarViewController.m | 66 +- YuMi/Modules/YMWeb/XPWebViewController.m | 54 +- YuMi/Structure/PrefixHeader.pch | 3 +- YuMi/Tools/SDPhotoBrowser/SDPhotoBrowser.h | 2 +- YuMi/Tools/SDPhotoBrowser/SDPhotoBrowser.m | 14 +- YuMi/Tools/YYUtility/YYUtility+App.m | 2 +- YuMi/zh-Hans.lproj/Localizable.strings | 3 +- YuMi/zh-Hant.lproj/Localizable.strings | 3 + 42 files changed, 821 insertions(+), 581 deletions(-) diff --git a/YuMi.xcodeproj/project.pbxproj b/YuMi.xcodeproj/project.pbxproj index 9934269b..77f3decf 100644 --- a/YuMi.xcodeproj/project.pbxproj +++ b/YuMi.xcodeproj/project.pbxproj @@ -8910,13 +8910,13 @@ E8EEB8EA26FC2050007C6EBA /* SDPhotoBrowser */ = { isa = PBXGroup; children = ( - E8EEB8EB26FC2050007C6EBA /* SDPhotoBrowserConfig.h */, - E8EEB8EC26FC2050007C6EBA /* SDPhotoBrowser.m */, - E8EEB8ED26FC2050007C6EBA /* SDWaitingView.m */, - E8EEB8EE26FC2050007C6EBA /* SDBrowserImageView.m */, - E8EEB8EF26FC2050007C6EBA /* SDWaitingView.h */, - E8EEB8F026FC2050007C6EBA /* SDPhotoBrowser.h */, E8EEB8F126FC2050007C6EBA /* SDBrowserImageView.h */, + E8EEB8EE26FC2050007C6EBA /* SDBrowserImageView.m */, + E8EEB8F026FC2050007C6EBA /* SDPhotoBrowser.h */, + E8EEB8EC26FC2050007C6EBA /* SDPhotoBrowser.m */, + E8EEB8EB26FC2050007C6EBA /* SDPhotoBrowserConfig.h */, + E8EEB8EF26FC2050007C6EBA /* SDWaitingView.h */, + E8EEB8ED26FC2050007C6EBA /* SDWaitingView.m */, ); path = SDPhotoBrowser; sourceTree = ""; diff --git a/YuMi/CustomUI/InputView/InputView/QinputPhotoView.m b/YuMi/CustomUI/InputView/InputView/QinputPhotoView.m index 1f18dfaf..065c8e5e 100644 --- a/YuMi/CustomUI/InputView/InputView/QinputPhotoView.m +++ b/YuMi/CustomUI/InputView/InputView/QinputPhotoView.m @@ -120,7 +120,10 @@ QPhotoImageModel * imageInfo = [self.photoList safeObjectAtIndex1:indexPath.row] } if ([self.photoList containsObject:model]) { NSInteger index = [self.photoList indexOfObject:model]; - [self.collectionView scrollToItemAtIndexPath:[NSIndexPath indexPathForRow:index + 1 inSection:0] atScrollPosition:UICollectionViewScrollPositionRight animated:YES]; + if(index + 1 < self.photoList.count){ + [self.collectionView scrollToItemAtIndexPath:[NSIndexPath indexPathForRow:index + 1 inSection:0] atScrollPosition:UICollectionViewScrollPositionRight animated:YES]; + } + } model.number = self.chooseArray.count; } else { diff --git a/YuMi/Modules/YMLogin/View/NewLogin/XPLoginPwdViewController.m b/YuMi/Modules/YMLogin/View/NewLogin/XPLoginPwdViewController.m index 9b0547eb..cfe81fc1 100644 --- a/YuMi/Modules/YMLogin/View/NewLogin/XPLoginPwdViewController.m +++ b/YuMi/Modules/YMLogin/View/NewLogin/XPLoginPwdViewController.m @@ -90,7 +90,7 @@ - (void)racBind { RAC(self.loginBtn, enabled) = [[RACSignal combineLatest:@[self.phoneInputView.inputTextField.rac_textSignal, self.pwdInputView.inputTextField.rac_textSignal] reduce:^id _Nonnull(NSString *phone, NSString* password){ - return @((phone.length ==11 || phone.length == 7) && password.length >= 6); + return @((phone.length > 0) && password.length >= 6); }] takeUntil:self.rac_willDeallocSignal]; } diff --git a/YuMi/Modules/YMMessage/View/Session/Cell/SessionUserInfoTableViewCell.m b/YuMi/Modules/YMMessage/View/Session/Cell/SessionUserInfoTableViewCell.m index b35f8018..41dccf34 100644 --- a/YuMi/Modules/YMMessage/View/Session/Cell/SessionUserInfoTableViewCell.m +++ b/YuMi/Modules/YMMessage/View/Session/Cell/SessionUserInfoTableViewCell.m @@ -155,6 +155,7 @@ [self.tagStackView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(self.headWearImageView.mas_right).offset(12); + make.right.mas_equalTo(-5); make.bottom.mas_equalTo(self.headWearImageView.mas_centerY).offset(-3); }]; diff --git a/YuMi/Modules/YMMessage/View/Session/Content/MessageContentImage.m b/YuMi/Modules/YMMessage/View/Session/Content/MessageContentImage.m index 583c4d72..a956ef43 100644 --- a/YuMi/Modules/YMMessage/View/Session/Content/MessageContentImage.m +++ b/YuMi/Modules/YMMessage/View/Session/Content/MessageContentImage.m @@ -52,13 +52,18 @@ #pragma mark - SDPhotoBrowserDelegate - (NSURL *)photoBrowser:(SDPhotoBrowser *)browser highQualityImageURLForIndex:(NSInteger)index { - return [NSURL URLWithString:self.imageObject.imageUrl]; + return [NSURL URLWithString:self.imageObject.url]; } - (UIImage *)photoBrowser:(SDPhotoBrowser *)browser placeholderImageForIndex:(NSInteger)index { return [UIImageConstant defalutBannerPlaceholder]; } - +- (UIImage *)photoBrowser:(SDPhotoBrowser *)browser highQualityImageForIndex:(NSInteger)index{ + if(self.imageObject.url == nil && self.imageObject.image != nil){ + return self.imageObject.image; + } + return nil; +} - (void)didTapImage { SDPhotoBrowser *browser = [[SDPhotoBrowser alloc]init]; browser.sourceImagesContainerView = self; diff --git a/YuMi/Modules/YMMessage/View/Session/Content/SesssionModel/MessageImageModel.h b/YuMi/Modules/YMMessage/View/Session/Content/SesssionModel/MessageImageModel.h index 83cb31c3..6cabe470 100644 --- a/YuMi/Modules/YMMessage/View/Session/Content/SesssionModel/MessageImageModel.h +++ b/YuMi/Modules/YMMessage/View/Session/Content/SesssionModel/MessageImageModel.h @@ -12,6 +12,7 @@ NS_ASSUME_NONNULL_BEGIN @interface MessageImageModel : MessageBaseModel @property (nonatomic,strong) UIImage *image; @property (nonatomic,copy) NSString *imageUrl; +@property(nonatomic,strong) NSString *url; @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMMessage/View/Session/Content/SesssionModel/MessageImageModel.m b/YuMi/Modules/YMMessage/View/Session/Content/SesssionModel/MessageImageModel.m index 6386275c..caf35b32 100644 --- a/YuMi/Modules/YMMessage/View/Session/Content/SesssionModel/MessageImageModel.m +++ b/YuMi/Modules/YMMessage/View/Session/Content/SesssionModel/MessageImageModel.m @@ -37,6 +37,7 @@ }else { self.imageUrl = imageObject.url; } + self.url = imageObject.url; } return self; } diff --git a/YuMi/Modules/YMMine/View/GiveDiamond/View/Cell/XPMineGiveDiamondDetailsCell.m b/YuMi/Modules/YMMine/View/GiveDiamond/View/Cell/XPMineGiveDiamondDetailsCell.m index 99d8b56e..a8ab3789 100644 --- a/YuMi/Modules/YMMine/View/GiveDiamond/View/Cell/XPMineGiveDiamondDetailsCell.m +++ b/YuMi/Modules/YMMine/View/GiveDiamond/View/Cell/XPMineGiveDiamondDetailsCell.m @@ -10,7 +10,7 @@ #import "NSDate+DateUtils.h" @interface XPMineGiveDiamondDetailsCell() ///礼物/钻石图标 -@property (nonatomic,strong) NetImageView * iconView; +@property (nonatomic,strong) NetImageView * pi_iconView; ///礼物标题 @property (nonatomic,strong) UILabel *giftTitleView; ///时间 @@ -36,14 +36,14 @@ - (void)initSubViews { self.backgroundColor = [UIColor whiteColor]; self.selectionStyle = 0; - [self.contentView addSubview:self.iconView]; + [self.contentView addSubview:self.pi_iconView]; [self.contentView addSubview:self.giftTitleView]; [self.contentView addSubview:self.timeView]; [self.contentView addSubview:self.numView]; [self.contentView addSubview:self.spendingView]; } - (void)initSubViewConstraints { - [self.iconView mas_makeConstraints:^(MASConstraintMaker *make) { + [self.pi_iconView mas_makeConstraints:^(MASConstraintMaker *make) { make.width.height.mas_equalTo(kGetScaleWidth(40)); make.centerY.equalTo(self.contentView); make.left.mas_equalTo(kGetScaleWidth(15)); @@ -58,7 +58,7 @@ make.right.equalTo(self.timeView.mas_left).mas_offset(-kGetScaleWidth(10)); }]; [self.numView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.equalTo(self.iconView.mas_top).mas_offset(kGetScaleWidth(3)); + make.top.equalTo(self.pi_iconView.mas_top).mas_offset(kGetScaleWidth(3)); make.left.mas_equalTo(kGetScaleWidth(65)); make.height.mas_equalTo(kGetScaleWidth(17)); make.right.equalTo(self.timeView.mas_left).mas_offset(-kGetScaleWidth(10)); @@ -80,20 +80,20 @@ self.giftTitleView.hidden = YES; self.numView.hidden = YES; self.spendingView.hidden = YES; - self.iconView.image = nil; + self.pi_iconView.image = nil; if(self.model.type.intValue == 0){ self.giftTitleView.hidden = YES; self.numView.hidden = NO; self.spendingView.hidden = NO; - self.iconView.image = [UIImage imageNamed:@"mine_examples_record"]; + self.pi_iconView.image = [UIImage imageNamed:@"mine_examples_record"]; self.numView.text = self.model.diamondNum; self.timeView.text = [NSDate timestampSwitchTime:self.model.createTime/1000 andFormatter:@"yyyy-MM-dd HH:mm:ss"]; NSString *realDiamondNum = [NSString stringWithFormat:@"%.2f",self.model.realDiamondNum]; self.spendingView.text = [NSString stringWithFormat:YMLocalizedString(@"XPMineGiveDiamondDetailsCell0"),realDiamondNum]; return; } - self.iconView.image = [UIImageConstant defaultAvatarPlaceholder]; - self.iconView.imageUrl = self.model.giftUrl; + self.pi_iconView.image = [UIImageConstant defaultAvatarPlaceholder]; + self.pi_iconView.imageUrl = self.model.giftUrl; self.giftTitleView.text = [NSString stringWithFormat:@"%@ x%@",self.model.giftName,self.model.giftNum]; self.timeView.text = [NSDate timestampSwitchTime:self.model.createTime/1000 andFormatter:@"yyyy-MM-dd HH:mm:ss"]; self.giftTitleView.hidden = NO; @@ -103,15 +103,15 @@ #pragma mark - 懒加载 -- (NetImageView *)iconView{ - if (!_iconView){ - _iconView = [[NetImageView alloc]init]; - _iconView.backgroundColor = UIColorFromRGB(0xF3F5FA); - _iconView.layer.cornerRadius = kGetScaleWidth(40)/2; - _iconView.clipsToBounds = YES; - _iconView.contentMode = UIViewContentModeScaleAspectFit; +- (NetImageView *)pi_iconView{ + if (!_pi_iconView){ + _pi_iconView = [[NetImageView alloc]init]; + _pi_iconView.backgroundColor = UIColorFromRGB(0xF3F5FA); + _pi_iconView.layer.cornerRadius = kGetScaleWidth(40)/2; + _pi_iconView.clipsToBounds = YES; + _pi_iconView.contentMode = UIViewContentModeScaleAspectFit; } - return _iconView; + return _pi_iconView; } - (UILabel *)giftTitleView { diff --git a/YuMi/Modules/YMMine/View/MineInfo/XPMineUserDataViewController.m b/YuMi/Modules/YMMine/View/MineInfo/XPMineUserDataViewController.m index 009bbc7b..8f1f1cba 100644 --- a/YuMi/Modules/YMMine/View/MineInfo/XPMineUserDataViewController.m +++ b/YuMi/Modules/YMMine/View/MineInfo/XPMineUserDataViewController.m @@ -159,11 +159,11 @@ - (void)xPMineDataClanTableViewCell:(XPMineDataClanTableViewCell *)view didClickEnter:(ClanDetailInfoModel *)clanInfo { [self.presenter getUserInfo:[AccountInfoStorage instance].getUid success:^(UserInfoModel * _Nonnull info) { - if (info.isCertified) { +// if (info.isCertified) { [self.presenter memberApplyHall:clanInfo.hall.hallId]; - } else { - [self showRealNameAuthenticationTipsAlertView]; - } +// } else { +// [self showRealNameAuthenticationTipsAlertView]; +// } }]; } diff --git a/YuMi/Modules/YMMine/View/Noble/View/SubViews/XPNobleCenterPayView.m b/YuMi/Modules/YMMine/View/Noble/View/SubViews/XPNobleCenterPayView.m index f57ec0ce..3f94d6a6 100644 --- a/YuMi/Modules/YMMine/View/Noble/View/SubViews/XPNobleCenterPayView.m +++ b/YuMi/Modules/YMMine/View/Noble/View/SubViews/XPNobleCenterPayView.m @@ -51,7 +51,7 @@ }]; [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) { make.trailing.leading.bottom.equalTo(self); - make.height.mas_equalTo(487); + make.height.mas_equalTo(375); }]; [self.titleView mas_makeConstraints:^(MASConstraintMaker *make) { make.top.mas_equalTo(24); diff --git a/YuMi/Modules/YMMonents/View/XPMonentsMineViewController.m b/YuMi/Modules/YMMonents/View/XPMonentsMineViewController.m index 636205a7..99e72349 100644 --- a/YuMi/Modules/YMMonents/View/XPMonentsMineViewController.m +++ b/YuMi/Modules/YMMonents/View/XPMonentsMineViewController.m @@ -98,6 +98,7 @@ if ([ClientConfig shareConfig].canOpen) { XPMonentsDetailViewController * detailVC = [[XPMonentsDetailViewController alloc] init]; MonentsInfoModel * monentsInfo = [self.datasource safeObjectAtIndex1:indexPath.row]; + if(monentsInfo.dynamicId == nil)return; detailVC.monentsInfo = monentsInfo; detailVC.delegate = self; [self.navigationController pushViewController:detailVC animated:YES]; @@ -105,6 +106,7 @@ XPMomentsSimpleDetailViewController * detailVC = [[XPMomentsSimpleDetailViewController alloc] init]; MonentsInfoModel * monentsInfo = [self.datasource safeObjectAtIndex1:indexPath.row]; detailVC.monentsInfo = monentsInfo; + if(monentsInfo.dynamicId == nil)return; detailVC.delegate = self; [self.navigationController pushViewController:detailVC animated:YES]; } @@ -112,9 +114,32 @@ } #pragma mark - XPMonentsTableViewCellDelegate - (void)xPMonentsTableViewCell:(XPMonentsTableViewCell *)view didClickLike:(MonentsInfoModel *)monentsInfo { + if(monentsInfo.dynamicId == nil){ + [self showErrorToast:YMLocalizedString(@"XPMineUserDataViewController4")]; + return; + } [self.presenter likeMonent:monentsInfo.dynamicId status:!monentsInfo.isLike likedUid:monentsInfo.uid worldId:[NSString stringWithFormat:@"%ld", monentsInfo.worldId]]; } +///点击了评论 +- (void)xPMonentsTableViewCell:(XPMonentsTableViewCell *)view didClicCommon:(MonentsInfoModel *)monentsInfo{ + if(monentsInfo.dynamicId == nil){ + [self showErrorToast:YMLocalizedString(@"XPMineUserDataViewController5")]; + return; + } + if ([ClientConfig shareConfig].canOpen) { + XPMonentsDetailViewController * detailVC = [[XPMonentsDetailViewController alloc] init]; + detailVC.monentsInfo = monentsInfo; + detailVC.delegate = self; + [self.navigationController pushViewController:detailVC animated:YES]; + }else{ + XPMomentsSimpleDetailViewController * detailVC = [[XPMomentsSimpleDetailViewController alloc] init]; + + detailVC.monentsInfo = monentsInfo; + detailVC.delegate = self; + [self.navigationController pushViewController:detailVC animated:YES]; + } +} - (void)xPMonentsTableViewCell:(XPMonentsTableViewCell *)view didClicDelete:(MonentsInfoModel *)monentsInfo { [TTPopup alertWithMessage:YMLocalizedString(@"XPMonentsMineViewController2") confirmHandler:^{ [self.presenter deleteMonents:monentsInfo.dynamicId worldId:[NSString stringWithFormat:@"%ld", monentsInfo.worldId]]; diff --git a/YuMi/Modules/YMNewHome/View/Cell/XPHomeBannerTableViewCell.m b/YuMi/Modules/YMNewHome/View/Cell/XPHomeBannerTableViewCell.m index 0bab9125..4e3c9967 100644 --- a/YuMi/Modules/YMNewHome/View/Cell/XPHomeBannerTableViewCell.m +++ b/YuMi/Modules/YMNewHome/View/Cell/XPHomeBannerTableViewCell.m @@ -14,7 +14,7 @@ #import "NSArray+Safe.h" #import "UIImageConstant.h" @interface XPHomeBannerTableViewCell () -@property (nonatomic, strong) SDCycleScrollView *cycleScrollView; +@property (nonatomic, strong) SDCycleScrollView *pi_cycleScrollView; @end @implementation XPHomeBannerTableViewCell @@ -31,11 +31,11 @@ - (void)initSubViews { self.backgroundColor = [UIColor clearColor]; self.selectionStyle = UITableViewCellSelectionStyleNone; - [self.contentView addSubview:self.cycleScrollView]; + [self.contentView addSubview:self.pi_cycleScrollView]; } - (void)initSubViewConstraints { - [self.cycleScrollView mas_makeConstraints:^(MASConstraintMaker *make) { + [self.pi_cycleScrollView mas_makeConstraints:^(MASConstraintMaker *make) { make.top.mas_equalTo(self.contentView).mas_offset(16); make.bottom.mas_equalTo(self.contentView); make.left.right.mas_equalTo(self.contentView).inset(15); @@ -61,31 +61,31 @@ } }]; if (array.count > 0) { - self.cycleScrollView.imageURLStringsGroup = array; - [self.cycleScrollView autoScroll]; + self.pi_cycleScrollView.imageURLStringsGroup = array; + [self.pi_cycleScrollView autoScroll]; } } } - (void)setIsMineViewBanner:(BOOL)isMineViewBanner { - [self.cycleScrollView mas_updateConstraints:^(MASConstraintMaker *make) { + [self.pi_cycleScrollView mas_updateConstraints:^(MASConstraintMaker *make) { make.top.bottom.mas_equalTo(self.contentView); }]; } -- (SDCycleScrollView *)cycleScrollView { - if (!_cycleScrollView) { - _cycleScrollView = [[SDCycleScrollView alloc] init]; - _cycleScrollView.backgroundColor = [UIColor clearColor]; - _cycleScrollView.layer.cornerRadius = 10; - _cycleScrollView.layer.masksToBounds = YES; - _cycleScrollView.delegate = self; - _cycleScrollView.showPageControl = NO; - _cycleScrollView.autoScrollTimeInterval = 5.0; - _cycleScrollView.bannerImageViewContentMode = UIViewContentModeScaleAspectFill; - _cycleScrollView.placeholderImage = [UIImageConstant defalutBannerPlaceholder]; +- (SDCycleScrollView *)pi_cycleScrollView { + if (!_pi_cycleScrollView) { + _pi_cycleScrollView = [[SDCycleScrollView alloc] init]; + _pi_cycleScrollView.backgroundColor = [UIColor clearColor]; + _pi_cycleScrollView.layer.cornerRadius = 10; + _pi_cycleScrollView.layer.masksToBounds = YES; + _pi_cycleScrollView.delegate = self; + _pi_cycleScrollView.showPageControl = NO; + _pi_cycleScrollView.autoScrollTimeInterval = 5.0; + _pi_cycleScrollView.bannerImageViewContentMode = UIViewContentModeScaleAspectFill; + _pi_cycleScrollView.placeholderImage = [UIImageConstant defalutBannerPlaceholder]; } - return _cycleScrollView; + return _pi_cycleScrollView; } diff --git a/YuMi/Modules/YMNewHome/View/Search/View/XPRoomSearchContainerViewController.m b/YuMi/Modules/YMNewHome/View/Search/View/XPRoomSearchContainerViewController.m index 2802bbcc..01ccff71 100644 --- a/YuMi/Modules/YMNewHome/View/Search/View/XPRoomSearchContainerViewController.m +++ b/YuMi/Modules/YMNewHome/View/Search/View/XPRoomSearchContainerViewController.m @@ -133,6 +133,7 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey; #pragma mark -XPHomeSearchNavViewDelegate - (void)xPHomeSearchNavView:(XPHomeSearchNavView *)view didClickSearch:(UIButton *)sender { if (view.searchTextField.text.length > 0) { + [self searchVCLoadData:view.searchTextField.text]; [view.searchTextField resignFirstResponder]; [self.recordVc storeSearchRecord:view.searchTextField.text]; [StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventRoom_search_input_click eventAttributes:@{@"searchWord":view.searchTextField.text}]; diff --git a/YuMi/Modules/YMRoom/View/ActivityContainerView/XPRoomActivityContainerView.m b/YuMi/Modules/YMRoom/View/ActivityContainerView/XPRoomActivityContainerView.m index e8255d56..47bc8483 100644 --- a/YuMi/Modules/YMRoom/View/ActivityContainerView/XPRoomActivityContainerView.m +++ b/YuMi/Modules/YMRoom/View/ActivityContainerView/XPRoomActivityContainerView.m @@ -301,12 +301,14 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView; XPRoomHalfWebView * webView = [[XPRoomHalfWebView alloc] init]; webView.roomUid = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.uid]; webView.url = info.skipUri; + webView.isPush = YES; [TTPopup popupView:webView style:TTPopupStyleActionSheet]; return; } XPWebViewController * webVC = [[XPWebViewController alloc] init]; webVC.roomUid = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.uid]; webVC.url = info.skipUri; + webVC.isPush = YES; [self.hostDelegate.getCurrentNav pushViewController:webVC animated:YES]; } } diff --git a/YuMi/Modules/YMRoom/View/AnimationView/XPRoomAnimationView.m b/YuMi/Modules/YMRoom/View/AnimationView/XPRoomAnimationView.m index 975e86b5..d6e99047 100644 --- a/YuMi/Modules/YMRoom/View/AnimationView/XPRoomAnimationView.m +++ b/YuMi/Modules/YMRoom/View/AnimationView/XPRoomAnimationView.m @@ -68,6 +68,7 @@ @property (nonatomic,strong) XPRoomAnimationHitView * middleLevelView; ///高层的 @property (nonatomic,strong) XPRoomAnimationHitView * highLevleView; +@property(nonatomic,strong) UIStackView *highSTackView; ///动画管理类 @property (strong, nonatomic) SVGAParser *parser; ///VAP动画管理 @@ -141,6 +142,7 @@ @property(nonatomic,assign) BOOL isPlayOfB; ///animationListA播放完后,如果有animationListB,那么要在animationListA的位置上播放animationListB,只播放一次 @property(nonatomic,assign) BOOL isAnimationListAFinish; +@property(nonatomic,strong) NSMutableArray *svgaQueue; @end @@ -290,9 +292,9 @@ } else { [self receiveGift:receiveInfo]; } - } else if (attachment.first == CustomMessageType_LuckyBag) {//福袋消息厅内展示 + } else if (attachment.first == CustomMessageType_LuckyBag ) {//福袋消息厅内展示 [self receiveLuckyGiftBigPrize:attachment]; - } else if (attachment.first == CustomMessageType_Look_Love && (attachment.second == Custom_Message_Sub_Look_Love_InRoom_NeedAllMicSend || attachment.second == Custom_Message_Sub_Look_Love_AllRoom_Notify) ) {//寻爱之旅 + } else if (attachment.first == CustomMessageType_Look_Love && (attachment.second == Custom_Message_Sub_Look_Love_AllRoom_Notify) ) {//寻爱之旅 [self receiveCandyTreeGiftHighLevle:attachment]; } else if (attachment.first == CustomMessageType_Car_Notify && attachment.second == Custom_Message_Sub_Car_EnterRoom ) {//座驾进房 [self receiveDriveCarEnterRoom:attachment]; @@ -784,12 +786,12 @@ if (self.animationListB.count > 0) { [self.animationListB removeObjectAtIndex:0]; } - if(self. isAnimationListAFinish == YES){ - - [self playAnimationWithModel]; - self.isAnimationListAFinish = NO; - return; - } +// if(self. isAnimationListAFinish == YES){ +// +// [self playAnimationWithModel]; +// self.isAnimationListAFinish = NO; +// return; +// } [self playAnimationWithModel]; } }]; @@ -1408,16 +1410,19 @@ moveAnimation.removedOnCompletion = YES; [moveAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) { [luckyGiftEffectView removeFromSuperview]; - if (self.animationListB.count > 0) { - [self.animationListB removeObjectAtIndex:0]; - } - self.isPlayOfB = NO; - if(self.isAnimationListAFinish == YES){ - self.isAnimationListAFinish = NO; + + if (self.animationListB.count > 0) { + [self.animationListB removeObjectAtIndex:0]; + } + self.isPlayOfB = NO; + if(self.isAnimationListAFinish == YES){ + self.isAnimationListAFinish = NO; + [self playAnimationWithModel]; + return; + } [self playAnimationWithModel]; - return; - } - [self playAnimationWithModel]; + + }]; [luckyGiftEffectView pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"]; @@ -1446,7 +1451,10 @@ if(self.isAnimationListAFinish == YES)return; if(self.animationListB.count <= 0){ if(self.animationListA.count > 0 && self.isPlayOfB == NO && self.isPlayOfA == NO){ - [self createGiftBannerViewAnimation:self.animationListA.firstObject]; + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + [self createGiftBannerViewAnimation:self.animationListA.firstObject]; + }); + } return; } @@ -1493,16 +1501,34 @@ if (obj.otherViewType == GiftOtherViewTypeMp4 && obj.viewUrl && obj.viewUrl.length > 0 && roomInfor.hasAnimationEffect) { GiftReceiveInfoModel * model = [[GiftReceiveInfoModel alloc] init]; model.viewUrl = obj.viewUrl; - [self.animationListA addObject:model]; + model.avatar = receiveInfo.sendUserAvatar; + model.gift = obj; + model.giftNum = [obj.giftNum integerValue];; + model.nick = receiveInfo.nick; + model.targetUids = receiveInfo.targetUids; + model.isBatch = receiveInfo.isBatch; + model.targetAvatar = receiveInfo.targetAvatar; + model.targetNick = receiveInfo.targetNick; + [self.svgaQueue addObject:model]; + +// [self.animationListA addObject:model]; } else if (obj.hasVggPic && roomInfor.hasAnimationEffect) { GiftReceiveInfoModel * model = [[GiftReceiveInfoModel alloc] init]; - model.vggUrl = obj.vggUrl; - [self.animationListA addObject:model]; + model.viewUrl = obj.viewUrl; + model.avatar = receiveInfo.sendUserAvatar; + model.gift = obj; + model.giftNum = [obj.giftNum integerValue];; + model.nick = receiveInfo.nick; + model.targetUids = receiveInfo.targetUids; + model.isBatch = receiveInfo.isBatch; + model.targetAvatar = receiveInfo.targetAvatar; + model.targetNick = receiveInfo.targetNick; + [self.svgaQueue addObject:model]; + +// [self.animationListA addObject:model]; } }]; } - } else { - } } else { GiftInfoModel *giftInfo = receiveInfo.gift != nil ? receiveInfo.gift : receiveInfo.giftInfo; @@ -1527,18 +1553,52 @@ if (giftInfo.otherViewType == GiftOtherViewTypeMp4 && giftInfo.viewUrl.length > 0 && roomInfor.hasAnimationEffect) { receiveInfo.viewUrl = giftInfo.viewUrl; [self.animationListA addObject:receiveInfo]; + [self.svgaQueue addObject:receiveInfo]; } else if (giftInfo.hasVggPic && giftInfo.vggUrl.length > 0 && roomInfor.hasAnimationEffect) {///SVGA动画 receiveInfo.vggUrl = giftInfo.vggUrl; [self.animationListA addObject:receiveInfo]; + [self.svgaQueue addObject:receiveInfo]; } } if (self.animationListA.count > 0 && self.isPlayOfB == NO && self.isPlayOfA == NO) { [self createGiftBannerViewAnimation:self.animationListA.firstObject]; } + + if(self.svgaQueue.count > 0 && self.isLargeGiftAnimating == NO){ + [self createGiftSvgaAnimation:self.svgaQueue.firstObject]; + + } + } +-(void)createGiftSvgaAnimation:(GiftReceiveInfoModel *)receiveInfo{ + GiftInfoModel *giftInfo = receiveInfo.gift != nil ? receiveInfo.gift : receiveInfo.giftInfo; + if (!giftInfo) { + giftInfo = [[XPGiftStorage shareStorage] findGiftInfo: receiveInfo.giftId]; + } + if (giftInfo.otherViewType == GiftOtherViewTypeMp4 && giftInfo.viewUrl.length > 0 && [self.delegate getRoomInfo].hasAnimationEffect) { + [self largeGiftStopCarEffect:giftInfo.goldPrice]; + [self playGiftEffectWithVapUrl:giftInfo.viewUrl]; + } + if (giftInfo.hasVggPic && giftInfo.vggUrl.length > 0 && [self.delegate getRoomInfo].hasAnimationEffect) { + [self largeGiftStopCarEffect:giftInfo.goldPrice]; + [self playGiftEffect:giftInfo.vggUrl]; + } + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(6 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + if (self.isLargeGiftAnimating == YES) { + self.isLargeGiftAnimating = NO; + } + if(self.svgaQueue.count > 0){ + [self.svgaQueue removeObjectAtIndex:0]; + } + + if(self.svgaQueue.count > 0 && self.isLargeGiftAnimating == NO){ + [self createGiftSvgaAnimation:self.svgaQueue.firstObject]; + } + }); +} - (void)createGiftBannerViewAnimation:(GiftReceiveInfoModel *)receiveInfo { GiftInfoModel *giftInfo = receiveInfo.gift != nil ? receiveInfo.gift : receiveInfo.giftInfo; @@ -1580,34 +1640,35 @@ [springAnimation setAnimationDidStartBlock:^(POPAnimation *anim) { @kStrongify(self); - if (giftInfo.otherViewType == GiftOtherViewTypeMp4 && giftInfo.viewUrl.length > 0 && [self.delegate getRoomInfo].hasAnimationEffect) { - [self largeGiftStopCarEffect:giftInfo.goldPrice]; - [self playGiftEffectWithVapUrl:giftInfo.viewUrl]; - } - if (giftInfo.hasVggPic && giftInfo.vggUrl.length > 0 && [self.delegate getRoomInfo].hasAnimationEffect) { - [self largeGiftStopCarEffect:giftInfo.goldPrice]; - [self playGiftEffect:giftInfo.vggUrl]; - } +// if (giftInfo.otherViewType == GiftOtherViewTypeMp4 && giftInfo.viewUrl.length > 0 && [self.delegate getRoomInfo].hasAnimationEffect) { +// [self largeGiftStopCarEffect:giftInfo.goldPrice]; +// [self playGiftEffectWithVapUrl:giftInfo.viewUrl]; +// } +// if (giftInfo.hasVggPic && giftInfo.vggUrl.length > 0 && [self.delegate getRoomInfo].hasAnimationEffect) { +// [self largeGiftStopCarEffect:giftInfo.goldPrice]; +// [self playGiftEffect:giftInfo.vggUrl]; +// } }]; [view pop_addAnimation:springAnimation forKey:@"spingOutAnimation"]; } else { - - if (giftInfo.otherViewType == GiftOtherViewTypeMp4 && receiveInfo.viewUrl.length > 0) {//播放vap动效 - [self largeGiftStopCarEffect:giftInfo.goldPrice]; - [self playGiftEffectWithVapUrl:receiveInfo.viewUrl]; - } - if (receiveInfo.vggUrl.length > 0) {///如果有特效的话就播放特效 - [self largeGiftStopCarEffect:giftInfo.goldPrice]; - [self playGiftEffect:receiveInfo.vggUrl]; - } + +// if (giftInfo.otherViewType == GiftOtherViewTypeMp4 && receiveInfo.viewUrl.length > 0) {//播放vap动效 +// [self largeGiftStopCarEffect:giftInfo.goldPrice]; +// [self playGiftEffectWithVapUrl:receiveInfo.viewUrl]; +// } +// if (receiveInfo.vggUrl.length > 0) {///如果有特效的话就播放特效 +// +// [self largeGiftStopCarEffect:giftInfo.goldPrice]; +// [self playGiftEffect:receiveInfo.vggUrl]; +// } [self.animationListA removeObjectAtIndex:0]; } } - (void)largeGiftStopCarEffect:(double)goldPrice { if ([ClientConfig shareConfig].configInfo.hideCarEffectGiftPrice <= goldPrice) { - self.isLargeGiftAnimating = YES; + [self.carEffectView stopAnimation]; [self.carVapEffectView stopHWDMP4]; [self.carEffectQueue removeAllObjects]; @@ -1625,19 +1686,24 @@ moveAnimation.removedOnCompletion = YES; moveAnimation.completionBlock = ^(POPAnimation *anim, BOOL finished) { if(finished){ + view.frame = CGRectMake(KScreenWidth, 100, KScreenWidth, 0);; [view removeFromSuperview]; self.isPlayOfA = NO; if(self.animationListA.count > 0){ [self.animationListA removeObjectAtIndex:0]; } - if(self.animationListB.count > 0){ - self.isAnimationListAFinish = YES; - [self playAnimationACompletion]; - return; - } - if(self.animationListA.count > 0 && self.isPlayOfB == NO && self.isPlayOfA == NO){ - [self createGiftBannerViewAnimation:self.animationListA.firstObject]; - } + + + if(self.animationListB.count > 0){ + self.isAnimationListAFinish = YES; + [self playAnimationACompletion]; + return; + } + if(self.animationListA.count > 0 && self.isPlayOfB == NO && self.isPlayOfA == NO){ + [self createGiftBannerViewAnimation:self.animationListA.firstObject]; + } + + } } ; [view pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"]; @@ -1659,6 +1725,7 @@ ///播放礼物特效 SVGA的 - (void)playGiftEffect:(NSString *)vggUrl { if ([self isInSudGame]) {return;} + self.isLargeGiftAnimating = YES; self.giftEffectView.hidden = NO; if (self.giftEffectView.superview == nil) { [self.middleLevelView addSubview:self.giftEffectView]; @@ -1727,6 +1794,7 @@ ///播放礼物特效 vap的 - (void)playGiftEffectWithVapUrl:(NSString *)vapUrl { + self.isLargeGiftAnimating = YES; self.vapGiftEffectView.hidden = NO; if (self.vapGiftEffectView.superview == nil) { [self.middleLevelView addSubview:self.vapGiftEffectView]; @@ -1865,9 +1933,8 @@ - (void)svgaPlayerDidFinishedAnimation:(SVGAPlayer *)player { if (player == self.giftEffectView) { self.giftEffectView.hidden = YES; - if (self.isLargeGiftAnimating) { - self.isLargeGiftAnimating = NO; - } + + } else if (player == self.luckyGiftEffectView) { self.luckyGiftEffectView.hidden = YES; } else if(player == self.carEffectView) { @@ -1953,11 +2020,12 @@ [self playCarEffect:self.carEffectQueue.firstObject]; } } else if (container == self.vapGiftEffectView) { - if (self.isLargeGiftAnimating) { - self.isLargeGiftAnimating = NO; - } + + [self.vapGiftEffectView removeFromSuperview]; self.vapGiftEffectView = nil; + + } else if(container == self.luckyVapGiftEffectView) { [self.luckyVapGiftEffectView removeFromSuperview]; self.luckyVapGiftEffectView = nil; @@ -2237,4 +2305,11 @@ } return _animationListB; } +- (NSMutableArray *)svgaQueue{ + if(!_svgaQueue){ + _svgaQueue = [NSMutableArray array]; + } + return _svgaQueue; +} + @end diff --git a/YuMi/Modules/YMRoom/View/AnimationView/XPRoomGiftBannerView.m b/YuMi/Modules/YMRoom/View/AnimationView/XPRoomGiftBannerView.m index a64cd8be..406c0d0c 100644 --- a/YuMi/Modules/YMRoom/View/AnimationView/XPRoomGiftBannerView.m +++ b/YuMi/Modules/YMRoom/View/AnimationView/XPRoomGiftBannerView.m @@ -210,7 +210,7 @@ [self startLightCircleAnimation]; NSInteger giftTotal = 0; GiftInfoModel *giftInfo = receiveInfo.gift; - self.sendView.avatImageView.imageUrl = receiveInfo.avatar; + self.sendView.avatImageView.imageUrl = receiveInfo.avatar ?: receiveInfo.sendUserAvatar; self.sendView.nickLabel.text = receiveInfo.nick; self.giftView.avatImageView.imageUrl = giftInfo.giftUrl; diff --git a/YuMi/Modules/YMRoom/View/AnimationView/XPRoomLuckyBigPrizeView.m b/YuMi/Modules/YMRoom/View/AnimationView/XPRoomLuckyBigPrizeView.m index 5df439cd..633968cc 100644 --- a/YuMi/Modules/YMRoom/View/AnimationView/XPRoomLuckyBigPrizeView.m +++ b/YuMi/Modules/YMRoom/View/AnimationView/XPRoomLuckyBigPrizeView.m @@ -19,7 +19,7 @@ #import "XPSVGAPlayer.h" -@interface XPRoomLuckyBigPrizeView () +@interface XPRoomLuckyBigPrizeView () ///动画管理类 @property (strong, nonatomic) SVGAParser *parser; @property (nonatomic, strong) XPSVGAPlayer *giftImageView; @@ -107,12 +107,15 @@ }]; } } - +- (void)svgaPlayerDidFinishedAnimation:(SVGAPlayer *)player{ + NSLog(@"11111"); +} - (XPSVGAPlayer *)giftImageView { if (!_giftImageView) { _giftImageView = [[XPSVGAPlayer alloc]init]; _giftImageView.backgroundColor = [UIColor clearColor]; _giftImageView.userInteractionEnabled = NO; + _giftImageView.delegate = self; } return _giftImageView; } diff --git a/YuMi/Modules/YMRoom/View/BackMusic/Model/Music+CoreDataProperties.h b/YuMi/Modules/YMRoom/View/BackMusic/Model/Music+CoreDataProperties.h index 4e329325..65f0fe9c 100644 --- a/YuMi/Modules/YMRoom/View/BackMusic/Model/Music+CoreDataProperties.h +++ b/YuMi/Modules/YMRoom/View/BackMusic/Model/Music+CoreDataProperties.h @@ -12,7 +12,7 @@ NS_ASSUME_NONNULL_BEGIN @interface Music (CoreDataProperties) - ++(NSString *)getMusicName; + (NSFetchRequest *)fetchRequest NS_SWIFT_NAME(fetchRequest()); @property (nullable, nonatomic, copy) NSString *author; diff --git a/YuMi/Modules/YMRoom/View/BackMusic/Model/Music+CoreDataProperties.m b/YuMi/Modules/YMRoom/View/BackMusic/Model/Music+CoreDataProperties.m index 32fb1551..3e7bb64d 100644 --- a/YuMi/Modules/YMRoom/View/BackMusic/Model/Music+CoreDataProperties.m +++ b/YuMi/Modules/YMRoom/View/BackMusic/Model/Music+CoreDataProperties.m @@ -9,9 +9,18 @@ #import "Music+CoreDataProperties.h" @implementation Music (CoreDataProperties) - +///因为代码混沌时,music关键字,混沌后不改会闪退 ++(NSString *)getMusicName{ + NSString *musicName = [NSString stringWithFormat:@"M"]; + musicName = [NSString stringWithFormat:@"%@u",musicName]; + musicName = [NSString stringWithFormat:@"%@s",musicName]; + musicName = [NSString stringWithFormat:@"%@i",musicName]; + musicName = [NSString stringWithFormat:@"%@c",musicName]; + + return musicName; +} + (NSFetchRequest *)fetchRequest { - return [NSFetchRequest fetchRequestWithEntityName:@"Music"]; + return [NSFetchRequest fetchRequestWithEntityName:[Music getMusicName]]; } @dynamic author; diff --git a/YuMi/Modules/YMRoom/View/BackMusic/View/SubViews/XPRoomBackMusicPlayerView.m b/YuMi/Modules/YMRoom/View/BackMusic/View/SubViews/XPRoomBackMusicPlayerView.m index cc874cfd..31625d1c 100644 --- a/YuMi/Modules/YMRoom/View/BackMusic/View/SubViews/XPRoomBackMusicPlayerView.m +++ b/YuMi/Modules/YMRoom/View/BackMusic/View/SubViews/XPRoomBackMusicPlayerView.m @@ -407,7 +407,7 @@ UIKIT_EXTERN NSString * kRoomBackMusicPlayMusicOrderKey; - (NSFetchRequest *)request { if (!_request) { - _request = [NSFetchRequest fetchRequestWithEntityName:@"Music"]; + _request = [NSFetchRequest fetchRequestWithEntityName:[Music getMusicName]]; } return _request; } diff --git a/YuMi/Modules/YMRoom/View/BackMusic/View/XPRoomMusicLibraryViewController.m b/YuMi/Modules/YMRoom/View/BackMusic/View/XPRoomMusicLibraryViewController.m index 4f489d34..e05a9797 100644 --- a/YuMi/Modules/YMRoom/View/BackMusic/View/XPRoomMusicLibraryViewController.m +++ b/YuMi/Modules/YMRoom/View/BackMusic/View/XPRoomMusicLibraryViewController.m @@ -331,7 +331,7 @@ if (!_voiceSettingView) { - (NSFetchRequest *)request { if (!_request) { - _request = [NSFetchRequest fetchRequestWithEntityName:@"Music"]; + _request = [NSFetchRequest fetchRequestWithEntityName:[Music getMusicName]]; } return _request; } diff --git a/YuMi/Modules/YMRoom/View/BackMusic/View/XPRoomTransferMusicViewController.m b/YuMi/Modules/YMRoom/View/BackMusic/View/XPRoomTransferMusicViewController.m index 7d9a69ef..3916f9b0 100644 --- a/YuMi/Modules/YMRoom/View/BackMusic/View/XPRoomTransferMusicViewController.m +++ b/YuMi/Modules/YMRoom/View/BackMusic/View/XPRoomTransferMusicViewController.m @@ -238,7 +238,7 @@ - (BOOL)onHttpFileDataEstimateDuplicateCanPassTranSportServer:(MyHTTPConnection *)server withPath:(NSString *)filePath andFileName:(NSString *)fileName { if ([[NSFileManager defaultManager] fileExistsAtPath:filePath] == NO) { - self.currentMusic = [NSEntityDescription insertNewObjectForEntityForName:@"Music" inManagedObjectContext:[XPCoreDataManager shareInstance].managedObjectContext]; + self.currentMusic = [NSEntityDescription insertNewObjectForEntityForName:[Music getMusicName] inManagedObjectContext:[XPCoreDataManager shareInstance].managedObjectContext]; self.currentMusic.musicName = fileName; return YES; }else { diff --git a/YuMi/Modules/YMRoom/View/BaseUIContainerView/XPRoomBackContainerView.m b/YuMi/Modules/YMRoom/View/BaseUIContainerView/XPRoomBackContainerView.m index 1493a8e1..677d3c62 100644 --- a/YuMi/Modules/YMRoom/View/BaseUIContainerView/XPRoomBackContainerView.m +++ b/YuMi/Modules/YMRoom/View/BaseUIContainerView/XPRoomBackContainerView.m @@ -72,11 +72,12 @@ ///MARK:更改图片拉伸策略 BY lvjunhang, 2018-12-03,原值为:UIViewContentModeScaleAspectFit self.backImageView.contentMode = UIViewContentModeScaleAspectFill; if ([roomInfo.backPic containsString:@".svga"]) { //房间背景是SVGA动态背景 - self.svgDisplayView.hidden = NO; + @weakify(self); [self.parserManager loadSvgaWithURL:[NSURL URLWithString:roomInfo.backPic] completionBlock:^(SVGAVideoEntity * _Nullable videoItem) { @strongify(self); if (videoItem != nil) { + self.svgDisplayView.hidden = NO; CGFloat width = videoItem.videoSize.width; CGFloat height = videoItem.videoSize.height; if (width > height) { @@ -143,9 +144,12 @@ #pragma mark - Getters And Setters - (NetImageView *)backImageView { if (!_backImageView) { - _backImageView = [[NetImageView alloc] init]; + NetImageConfig *config = [[NetImageConfig alloc]init]; + config.placeHolder = [UIImage imageNamed:@"room_background"]; + _backImageView = [[NetImageView alloc] initWithConfig:config]; _backImageView.userInteractionEnabled = YES; - _backImageView.image = [UIImage imageNamed:@"room_background"]; + +\ _backImageView.layer.masksToBounds = YES; _backImageView.contentMode = UIViewContentModeScaleAspectFill; } diff --git a/YuMi/Modules/YMRoom/View/CandyTree/View/XPCandyTreeViewController.m b/YuMi/Modules/YMRoom/View/CandyTree/View/XPCandyTreeViewController.m index d08a656d..5d235946 100644 --- a/YuMi/Modules/YMRoom/View/CandyTree/View/XPCandyTreeViewController.m +++ b/YuMi/Modules/YMRoom/View/CandyTree/View/XPCandyTreeViewController.m @@ -95,35 +95,35 @@ UIKIT_EXTERN NSString * const kRoomReceivedCandyNotificationKey; @implementation XPCandyTreeViewController - (void)dealloc { - [[NIMSDK sharedSDK].systemNotificationManager removeDelegate:self]; + [[NIMSDK sharedSDK].systemNotificationManager removeDelegate:self]; [[NSNotificationCenter defaultCenter]postNotificationName:kRoomReceivedCandyNotificationKey object:nil userInfo:@{@"isHidden":@(YES)}]; } - (instancetype)initWithDelegate:(id)delegate { - if (self = [super init]) { - self.hostDelegate = delegate; - [[NIMSDK sharedSDK].systemNotificationManager addDelegate:self]; - } - return self; + if (self = [super init]) { + self.hostDelegate = delegate; + [[NIMSDK sharedSDK].systemNotificationManager addDelegate:self]; + } + return self; } - (XPCandyTreePresenter *)createPresenter { - return [[XPCandyTreePresenter alloc] init]; + return [[XPCandyTreePresenter alloc] init]; } - (BOOL)isHiddenNavBar { return YES; } - (void)viewDidLoad { - [super viewDidLoad]; - [self initSubViews]; - [self initSubViewConstraints]; - self.numberCandy = 1; - [self.presenter getCandyTreeInfo]; + [super viewDidLoad]; + [self initSubViews]; + [self initSubViewConstraints]; + self.numberCandy = 1; + [self.presenter getCandyTreeInfo]; } - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { - [self.view endEditing:YES]; + [self.view endEditing:YES]; } #pragma mark -XPCandyRankContainerViewDelegate - (void)didClickHeadHandle:(NSInteger)uid{ @@ -131,20 +131,20 @@ UIKIT_EXTERN NSString * const kRoomReceivedCandyNotificationKey; XPMineUserInfoViewController * userInfoVC = [[XPMineUserInfoViewController alloc] init]; userInfoVC.uid = uid; [self.hostDelegate.getCurrentNav pushViewController:userInfoVC animated:YES]; - - + + } #pragma mark - XPCandyTreeProtocol - (void)getCandyTreeInfoSuccess:(CandyTreeInfoModel *)info { [self hideHUD]; - self.candyInfo = info; - + self.candyInfo = info; + } - (void)pickCandyFail { [self hideHUD]; - self.isPicking = NO; + self.isPicking = NO; } -(void)pickCandyPay{ [self hideHUD]; @@ -155,270 +155,331 @@ UIKIT_EXTERN NSString * const kRoomReceivedCandyNotificationKey; } - (void)pickCandySuccess:(NSArray *)result { [self hideHUD]; - self.isPicking = NO; - [result enumerateObjectsUsingBlock:^(CandyTreeGiftInfoModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { - if (obj.level > 2) { - ///取消所有的延迟加载的方法 - [NSObject cancelPreviousPerformRequestsWithTarget:self]; - - XPCandyTreeGiftView * newAnimaView = [[XPCandyTreeGiftView alloc] init]; - newAnimaView.giftInfo = obj; - NSString * giftTitle = [NSString stringWithFormat:@"%@ x %d", obj.rewardName, obj.num]; - CGFloat widht = [giftTitle boundingRectWithSize:CGSizeMake(200, CGFLOAT_MAX) options:NSStringDrawingUsesFontLeading | NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:10]} context:nil].size.width + 10; - newAnimaView.frame = CGRectMake(0, 4 * (KitemHeight), widht + 12, KitemHeight); - [self.animationView addSubview:newAnimaView]; - - if (self.animationView.subviews.count > 5) { - [self.animationView.subviews.firstObject removeFromSuperview]; - } - for (int i=0; i < self.animationView.subviews.count; i++) { - XPCandyTreeGiftView * view = [self.animationView.subviews safeObjectAtIndex1:i]; - NSInteger offsetY= (self.animationView.subviews.count - i) * KitemHeight; - [UIView animateWithDuration:0.1 animations:^{ - CGRect rect = view.frame; - rect.origin.y = KitemHeight * 5 - offsetY; - view.frame = rect; - } completion:^(BOOL finished) { - if (i == (self.animationView.subviews.count -1)) { - [self.animationView.subviews enumerateObjectsUsingBlock:^(__kindof UIView * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { - [self performSelector:@selector(giftViewRemoveFromSuperView:) withObject:obj afterDelay:3]; - }]; - } - }]; - } - - - } - }]; + self.isPicking = NO; + [result enumerateObjectsUsingBlock:^(CandyTreeGiftInfoModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { + if (obj.level > 2) { + ///取消所有的延迟加载的方法 + [NSObject cancelPreviousPerformRequestsWithTarget:self]; + + XPCandyTreeGiftView * newAnimaView = [[XPCandyTreeGiftView alloc] init]; + newAnimaView.giftInfo = obj; + NSString * giftTitle = [NSString stringWithFormat:@"%@ x %d", obj.rewardName, obj.num]; + CGFloat widht = [giftTitle boundingRectWithSize:CGSizeMake(200, CGFLOAT_MAX) options:NSStringDrawingUsesFontLeading | NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:10]} context:nil].size.width + 10; + newAnimaView.frame = CGRectMake(0, 4 * (KitemHeight), widht + 12, KitemHeight); + [self.animationView addSubview:newAnimaView]; + + if (self.animationView.subviews.count > 5) { + [self.animationView.subviews.firstObject removeFromSuperview]; + } + for (int i=0; i < self.animationView.subviews.count; i++) { + XPCandyTreeGiftView * view = [self.animationView.subviews safeObjectAtIndex1:i]; + NSInteger offsetY= (self.animationView.subviews.count - i) * KitemHeight; + [UIView animateWithDuration:0.1 animations:^{ + CGRect rect = view.frame; + rect.origin.y = KitemHeight * 5 - offsetY; + view.frame = rect; + } completion:^(BOOL finished) { + if (i == (self.animationView.subviews.count -1)) { + [self.animationView.subviews enumerateObjectsUsingBlock:^(__kindof UIView * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { + [self performSelector:@selector(giftViewRemoveFromSuperView:) withObject:obj afterDelay:3]; + }]; + } + }]; + } + + + } + }]; @kWeakify(self); - [self.parser parseWithNamed:@"candyTree_light" inBundle:[NSBundle mainBundle] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) { - @kStrongify(self); - self.candyTreeLightView.loops = 1; - self.candyTreeLightView.clearsAfterStop = YES; - self.candyTreeLightView.videoItem = videoItem; - [self.candyTreeLightView startAnimation]; - } failureBlock:^(NSError * _Nonnull error) { - - }]; + NSString * lightName = [NSString stringWithFormat:@"https://image.hfighting.com/candyTree_light.svga"]; - [self.parser parseWithNamed:@"candyTree_open" inBundle:[NSBundle mainBundle] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) { - @kStrongify(self); - self.candyTreeOpenView.loops = 1; - self.candyTreeOpenView.clearsAfterStop = YES; - self.candyTreeOpenView.videoItem = videoItem; - [self.candyTreeOpenView startAnimation]; - } failureBlock:^(NSError * _Nonnull error) { + NSString *baseFileName = @"/GiftSvga"; + NSString *filePath = [[[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingPathComponent:baseFileName] stringByAppendingPathComponent:lightName]; + NSFileManager *fileManager = [NSFileManager defaultManager]; + if ([fileManager fileExistsAtPath:filePath]){ + NSData *data=[NSData dataWithContentsOfFile:filePath options:0 error:NULL]; + [self.parser parseWithData:data cacheKey:nil completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) { + if (videoItem != nil) { + self.candyTreeLightView.loops = 1; + self.candyTreeLightView.clearsAfterStop = YES; + self.candyTreeLightView.videoItem = videoItem; + [self.candyTreeLightView startAnimation]; + } + } failureBlock:^(NSError * _Nonnull error) { + + }]; - }]; - - [self.parser parseWithNamed:@"candyTree_transform" inBundle:[NSBundle mainBundle] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) { - @kStrongify(self); - self.candyTreeTransView.loops = 1; - self.candyTreeTransView.clearsAfterStop = YES; - self.candyTreeTransView.videoItem = videoItem; - [self.candyTreeTransView startAnimation]; - } failureBlock:^(NSError * _Nonnull error) { - - }]; + + }else{ + [self.parser parseWithURL:[NSURL URLWithString:lightName] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) { + @kStrongify(self); + self.candyTreeLightView.loops = 1; + self.candyTreeLightView.clearsAfterStop = YES; + self.candyTreeLightView.videoItem = videoItem; + [self.candyTreeLightView startAnimation]; + } failureBlock:^(NSError * _Nonnull error) { + + }]; + }; + + + + NSString * openName = [NSString stringWithFormat:@"https://image.hfighting.com/candyTree_open.svga"]; + NSString *openFilePath = [[[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingPathComponent:baseFileName] stringByAppendingPathComponent:openName]; + if ([fileManager fileExistsAtPath:openFilePath]){ + NSData *data=[NSData dataWithContentsOfFile:openFilePath options:0 error:NULL]; + [self.parser parseWithData:data cacheKey:nil completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) { + if (videoItem != nil) { + self.candyTreeOpenView.loops = 1; + self.candyTreeOpenView.clearsAfterStop = YES; + self.candyTreeOpenView.videoItem = videoItem; + [self.candyTreeOpenView startAnimation]; + } + } failureBlock:^(NSError * _Nonnull error) { + + }]; + + + }else{ + [self.parser parseWithURL:[NSURL URLWithString:lightName] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) { + @kStrongify(self); + self.candyTreeOpenView.loops = 1; + self.candyTreeOpenView.clearsAfterStop = YES; + self.candyTreeOpenView.videoItem = videoItem; + [self.candyTreeOpenView startAnimation]; + } failureBlock:^(NSError * _Nonnull error) { + + }]; + }; + + NSString * transformName = [NSString stringWithFormat:@"https://image.hfighting.com/candyTree_transform.svga"]; + NSString *transformFilePath = [[[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingPathComponent:baseFileName] stringByAppendingPathComponent:transformName]; + if ([fileManager fileExistsAtPath:transformFilePath]){ + NSData *data=[NSData dataWithContentsOfFile:transformFilePath options:0 error:NULL]; + [self.parser parseWithData:data cacheKey:nil completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) { + if (videoItem != nil) { + self.candyTreeTransView.loops = 1; + self.candyTreeTransView.clearsAfterStop = YES; + self.candyTreeTransView.videoItem = videoItem; + [self.candyTreeTransView startAnimation]; + } + } failureBlock:^(NSError * _Nonnull error) { + + }]; + + + }else{ + [self.parser parseWithURL:[NSURL URLWithString:lightName] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) { + @kStrongify(self); + self.candyTreeTransView.loops = 1; + self.candyTreeTransView.clearsAfterStop = YES; + self.candyTreeTransView.videoItem = videoItem; + [self.candyTreeTransView startAnimation]; + self.candyTreeTransView.backgroundColor = [UIColor redColor]; + } failureBlock:^(NSError * _Nonnull error) { + + }]; + }; + } #pragma mark - NIMSystemNotificationManagerDelegate - (void)onReceiveCustomSystemNotification:(NIMCustomSystemNotification *)notification { - if (notification.receiverType == NIMSessionTypeP2P) { - AttachmentModel *attachment = [AttachmentModel modelWithJSON:notification.content]; - if (attachment.first == CustomMessageType_Account && attachment.second == Custom_Message_Sub_Account_Changed){ - if (attachment.second == Custom_Message_Sub_Account_Changed) { - [self.presenter getCandyTreeInfo]; - } - } - } + if (notification.receiverType == NIMSessionTypeP2P) { + AttachmentModel *attachment = [AttachmentModel modelWithJSON:notification.content]; + if (attachment.first == CustomMessageType_Account && attachment.second == Custom_Message_Sub_Account_Changed){ + if (attachment.second == Custom_Message_Sub_Account_Changed) { + [self.presenter getCandyTreeInfo]; + } + } + } } #pragma mark - Private Method - (void)initSubViews { [[NSNotificationCenter defaultCenter]postNotificationName:kRoomReceivedCandyNotificationKey object:nil userInfo:@{@"isHidden":@(NO)}]; - self.view.backgroundColor = [UIColor clearColor]; - [self.view addSubview:self.topTapView]; - [self.view addSubview:self.contentView]; - [self.view addSubview:self.bottomTapView]; - - [self.contentView addSubview:self.backView]; - - - [self.backView addSubview:self.rankStackView]; - [self.backView addSubview:self.moreImageView]; - [self.backView addSubview:self.candyTreeView]; - [self.backView addSubview:self.candyTreeLightView]; - [self.backView addSubview:self.candyTreeOpenView]; - - [self.backView addSubview:self.pickBackImageView]; - - [self.backView addSubview:self.pickButton]; + self.view.backgroundColor = [UIColor clearColor]; + [self.view addSubview:self.topTapView]; + [self.view addSubview:self.contentView]; + [self.view addSubview:self.bottomTapView]; + + [self.contentView addSubview:self.backView]; + + + [self.backView addSubview:self.rankStackView]; + [self.backView addSubview:self.moreImageView]; + [self.backView addSubview:self.candyTreeView]; + [self.backView addSubview:self.candyTreeLightView]; + [self.backView addSubview:self.candyTreeOpenView]; + + [self.backView addSubview:self.pickBackImageView]; + + [self.backView addSubview:self.pickButton]; [self.pickButton addSubview:self.pickLabel]; - [self.backView addSubview:self.candyTreeTransView]; - [self.backView addSubview:self.animationView]; - + [self.backView addSubview:self.candyTreeTransView]; + [self.backView addSubview:self.animationView]; + [self.backView addSubview:self.subtractButton]; [self.backView addSubview:self.textFiled]; [self.backView addSubview:self.addButton]; - [self.rankStackView addArrangedSubview:self.rankImageView]; - + [self.rankStackView addArrangedSubview:self.rankImageView]; + RoomInfoModel * roomInfo = self.hostDelegate.getRoomInfo; self.pickLabel.text = [NSString stringWithFormat:YMLocalizedString(@"XPCandyTreeViewController0"),roomInfo.findLoveDrawSwitchVo.price]; -// @kWeakify(self); -// [self.parser parseWithNamed:@"candyTree" inBundle:[NSBundle mainBundle] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) { -// @kStrongify(self); -// self.candyTreeView.loops = INT_MAX; -// self.candyTreeView.clearsAfterStop = NO; -// self.candyTreeView.videoItem = videoItem; -// [self.candyTreeView startAnimation]; -// } failureBlock:^(NSError * _Nonnull error) { -// -// }]; + // @kWeakify(self); + // [self.parser parseWithNamed:@"candyTree" inBundle:[NSBundle mainBundle] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) { + // @kStrongify(self); + // self.candyTreeView.loops = INT_MAX; + // self.candyTreeView.clearsAfterStop = NO; + // self.candyTreeView.videoItem = videoItem; + // [self.candyTreeView startAnimation]; + // } failureBlock:^(NSError * _Nonnull error) { + // + // }]; } - (void)initSubViewConstraints { - [self.topTapView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.leading.trailing.mas_equalTo(self.view); - make.bottom.mas_equalTo(self.contentView.mas_top); - }]; - [self.contentView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.mas_equalTo(self.view).inset(45); - make.centerY.mas_equalTo(self.view); - make.bottom.mas_equalTo(self.backView.mas_bottom); - }]; - - [self.bottomTapView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.mas_equalTo(self.view); - make.top.mas_equalTo(self.contentView.mas_bottom); - make.bottom.mas_equalTo(self.view); - }]; - - - - [self.backView mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.mas_equalTo(285); - make.height.mas_equalTo(434); - make.centerX.mas_equalTo(self.contentView); - make.top.mas_equalTo(self.contentView).offset(0); - }]; - - [self.rankStackView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self.backView).offset(45); - make.leading.mas_equalTo(self.backView).offset(9); - make.height.mas_equalTo(37); + [self.topTapView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.leading.trailing.mas_equalTo(self.view); + make.bottom.mas_equalTo(self.contentView.mas_top); + }]; + [self.contentView mas_makeConstraints:^(MASConstraintMaker *make) { + make.leading.trailing.mas_equalTo(self.view).inset(45); + make.centerY.mas_equalTo(self.view); + make.bottom.mas_equalTo(self.backView.mas_bottom); + }]; + + [self.bottomTapView mas_makeConstraints:^(MASConstraintMaker *make) { + make.leading.trailing.mas_equalTo(self.view); + make.top.mas_equalTo(self.contentView.mas_bottom); + make.bottom.mas_equalTo(self.view); + }]; + + + + [self.backView mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(285); + make.height.mas_equalTo(434); + make.centerX.mas_equalTo(self.contentView); + make.top.mas_equalTo(self.contentView).offset(0); + }]; + + [self.rankStackView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.backView).offset(45); + make.leading.mas_equalTo(self.backView).offset(9); + make.height.mas_equalTo(37); make.width.mas_equalTo(36); - }]; + }]; + + + + + [self.moreImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.size.mas_equalTo(CGSizeMake(30, 30)); + make.top.mas_equalTo(44); + make.trailing.mas_equalTo(self.backView).offset(-12); + }]; + + + + [self.candyTreeView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.backView).offset(63); + make.centerX.mas_equalTo(self.backView); + make.size.mas_equalTo(CGSizeMake(285, 363)); + }]; + + [self.candyTreeLightView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.mas_equalTo(self.candyTreeView); + }]; + + [self.candyTreeOpenView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.mas_equalTo(self.candyTreeView); + }]; + + + + [self.pickBackImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.size.mas_equalTo(CGSizeMake(150, 29)); + make.centerX.mas_equalTo(self.backView); + make.top.mas_equalTo(340); + }]; - - - [self.moreImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.size.mas_equalTo(CGSizeMake(30, 30)); - make.top.mas_equalTo(44); - make.trailing.mas_equalTo(self.backView).offset(-12); - }]; - - - - [self.candyTreeView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self.backView).offset(63); - make.centerX.mas_equalTo(self.backView); - make.size.mas_equalTo(CGSizeMake(285, 363)); - }]; - - [self.candyTreeLightView mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.mas_equalTo(self.candyTreeView); - }]; - - [self.candyTreeOpenView mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.mas_equalTo(self.candyTreeView); - }]; - - - - [self.pickBackImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.size.mas_equalTo(CGSizeMake(150, 29)); - make.centerX.mas_equalTo(self.backView); - make.top.mas_equalTo(340); - }]; - - [self.subtractButton mas_makeConstraints:^(MASConstraintMaker *make) { make.leading.equalTo(self.pickBackImageView.mas_leading).mas_offset(5);; - make.top.equalTo(self.pickBackImageView.mas_top).mas_offset(2.25); - make.width.mas_equalTo(40); - make.height.mas_equalTo(21); + make.top.equalTo(self.pickBackImageView.mas_top).mas_offset(2.25); + make.width.mas_equalTo(40); + make.height.mas_equalTo(21); }]; - + [self.addButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.top.height.equalTo(self.subtractButton); - make.trailing.equalTo(self.pickBackImageView.mas_trailing).mas_offset(-5);; + make.width.top.height.equalTo(self.subtractButton); + make.trailing.equalTo(self.pickBackImageView.mas_trailing).mas_offset(-5);; }]; [self.textFiled mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerY.height.equalTo(self.subtractButton); - make.width.mas_equalTo(62); - make.leading.equalTo(self.subtractButton.mas_trailing); + make.centerY.height.equalTo(self.subtractButton); + make.width.mas_equalTo(62); + make.leading.equalTo(self.subtractButton.mas_trailing); }]; - [self.pickButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.size.mas_equalTo(CGSizeMake(121, 45)); - make.centerX.mas_equalTo(self.backView); - make.top.mas_equalTo(367); - }]; + [self.pickButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.size.mas_equalTo(CGSizeMake(121, 45)); + make.centerX.mas_equalTo(self.backView); + make.top.mas_equalTo(367); + }]; [self.pickLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.top.mas_equalTo(20); make.centerX.equalTo(self.pickButton); make.left.right.equalTo(self.pickButton); }]; - CGFloat kscale = (CGFloat)350 / (CGFloat)755; - [self.candyTreeTransView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self.candyTreeView); - make.bottom.trailing.mas_equalTo(self.view); - make.width.mas_equalTo(self.candyTreeTransView.mas_height).multipliedBy(kscale); - }]; - - [self.animationView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.mas_equalTo(self.backView).offset(7); - make.bottom.mas_equalTo(self.backView).offset(-106); - make.width.mas_equalTo(150); - make.height.mas_equalTo(KitemHeight * 5); - }]; + CGFloat kscale = (CGFloat)350 / (CGFloat)755; + [self.candyTreeTransView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.candyTreeView); + make.bottom.trailing.mas_equalTo(self.view); + make.width.mas_equalTo(self.candyTreeTransView.mas_height).multipliedBy(kscale); + }]; + + [self.animationView mas_makeConstraints:^(MASConstraintMaker *make) { + make.leading.mas_equalTo(self.backView).offset(7); + make.bottom.mas_equalTo(self.backView).offset(-106); + make.width.mas_equalTo(150); + make.height.mas_equalTo(KitemHeight * 5); + }]; } - (void)giftViewRemoveFromSuperView:(UIView *)view { - [view removeFromSuperview]; + [view removeFromSuperview]; } #pragma mark - Event Response - (void)moreTapRecognizer:(UITapGestureRecognizer *)tap { UserInfoModel * userInfo = self.hostDelegate.getUserInfo; RoomInfoModel * roomInfo = self.hostDelegate.getRoomInfo; - XPCandyTreeMoreView * moreView = [[XPCandyTreeMoreView alloc] init]; - moreView.sendMessageSwitchLevel = roomInfo.findLoveDrawSwitchVo.sendMsgLevel; + XPCandyTreeMoreView * moreView = [[XPCandyTreeMoreView alloc] init]; + moreView.sendMessageSwitchLevel = roomInfo.findLoveDrawSwitchVo.sendMsgLevel; moreView.showMessageSwitch = userInfo.userLevelVo.experLevelSeq >= roomInfo.findLoveDrawSwitchVo.sendMsgLevel; - [TTPopup popupView:moreView style:TTPopupStyleActionSheet]; + [TTPopup popupView:moreView style:TTPopupStyleActionSheet]; } - (void)rankTapRecognizer:(UITapGestureRecognizer *)tap { - XPCandyRankContainerView * rankView = [[XPCandyRankContainerView alloc] init]; + XPCandyRankContainerView * rankView = [[XPCandyRankContainerView alloc] init]; rankView.delegate = self; - [TTPopup popupView:rankView style:TTPopupStyleActionSheet]; + [TTPopup popupView:rankView style:TTPopupStyleActionSheet]; } - (void)addButtonAction:(UIButton *)sender { - self.numberCandy += 1; - self.textFiled.text = [NSString stringWithFormat:@"%ld", self.numberCandy]; - + self.numberCandy += 1; + self.textFiled.text = [NSString stringWithFormat:@"%ld", self.numberCandy]; + } - (void)subtractButtonAction:(UIButton *)sender { - if (self.numberCandy <= 1) return; - self.numberCandy -= 1; - self.textFiled.text = [NSString stringWithFormat:@"%ld", self.numberCandy]; - + if (self.numberCandy <= 1) return; + self.numberCandy -= 1; + self.textFiled.text = [NSString stringWithFormat:@"%ld", self.numberCandy]; + } #pragma mark -XPCandyTreeInsufficientBalanceViewDelegate - (void)payBalanceAction{ @@ -426,33 +487,33 @@ UIKIT_EXTERN NSString * const kRoomReceivedCandyNotificationKey; [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webVC animated:YES]; } - (void)pickButtonAction:(UIButton *)sender { - if (self.numberCandy <= 0) { - [self showErrorToast:YMLocalizedString(@"XPCandyTreeViewController2")]; - return; - } - if (self.isPicking) return; - self.isPicking = YES; - ///摘 - RoomInfoModel * roomInfo = self.hostDelegate.getRoomInfo; - NSString * roomUid = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.uid]; - NSString * candyNumber = [NSString stringWithFormat:@"%ld", self.numberCandy]; - BOOL showMessageSwitch = self.hostDelegate.getUserInfo.userLevelVo.experLevelSeq >= roomInfo.findLoveDrawSwitchVo.sendMsgLevel; - [self.presenter pickCandy:candyNumber roomUid:roomUid isSendMessage:showMessageSwitch]; - + if (self.numberCandy <= 0) { + [self showErrorToast:YMLocalizedString(@"XPCandyTreeViewController2")]; + return; + } + if (self.isPicking) return; + self.isPicking = YES; + ///摘 + RoomInfoModel * roomInfo = self.hostDelegate.getRoomInfo; + NSString * roomUid = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.uid]; + NSString * candyNumber = [NSString stringWithFormat:@"%ld", self.numberCandy]; + BOOL showMessageSwitch = self.hostDelegate.getUserInfo.userLevelVo.experLevelSeq >= roomInfo.findLoveDrawSwitchVo.sendMsgLevel; + [self.presenter pickCandy:candyNumber roomUid:roomUid isSendMessage:showMessageSwitch]; + } - (void)dismissTapRecognizer:(UITapGestureRecognizer *)tap { [[NSNotificationCenter defaultCenter]postNotificationName:kRoomReceivedCandyNotificationKey object:nil userInfo:@{@"isHidden":@(YES)}]; - [self.view removeFromSuperview]; + [self.view removeFromSuperview]; } #pragma mark -UITextFieldDelegate - (void)textFieldDidChanged:(UITextField *)textField { - if (textField.text.integerValue > 200) { - textField.text = @"200"; - [self showErrorToast:YMLocalizedString(@"XPCandyTreeViewController5")]; - } - self.numberCandy = textField.text.intValue; - + if (textField.text.integerValue > 200) { + textField.text = @"200"; + [self showErrorToast:YMLocalizedString(@"XPCandyTreeViewController5")]; + } + self.numberCandy = textField.text.intValue; + } - (void)textFieldDidEndEditing:(UITextField *)textField{ if(textField.text.length <= 0){ @@ -463,7 +524,7 @@ UIKIT_EXTERN NSString * const kRoomReceivedCandyNotificationKey; - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { return [self validateNumber:string]; } - + - (BOOL)validateNumber:(NSString*)number { BOOL res = YES; NSCharacterSet* tmpSet = [NSCharacterSet characterSetWithCharactersInString:@"0123456789"]; @@ -481,82 +542,82 @@ UIKIT_EXTERN NSString * const kRoomReceivedCandyNotificationKey; } #pragma mark - Getters And Setters - (void)setIsPicking:(BOOL)isPicking { - _isPicking = isPicking; - self.pickButton.enabled = !_isPicking; + _isPicking = isPicking; + self.pickButton.enabled = !_isPicking; } - (UIView *)topTapView { - if (!_topTapView) { - _topTapView = [[UIView alloc] init]; - _topTapView.backgroundColor = [UIColor clearColor]; - UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismissTapRecognizer:)]; - [_topTapView addGestureRecognizer:tap]; - } - return _topTapView; + if (!_topTapView) { + _topTapView = [[UIView alloc] init]; + _topTapView.backgroundColor = [UIColor clearColor]; + UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismissTapRecognizer:)]; + [_topTapView addGestureRecognizer:tap]; + } + return _topTapView; } - (UIView *)bottomTapView { - if (!_bottomTapView) { - _bottomTapView = [[UIView alloc] init]; - _bottomTapView.backgroundColor = [UIColor clearColor]; - UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismissTapRecognizer:)]; - [_bottomTapView addGestureRecognizer:tap]; - } - return _bottomTapView; + if (!_bottomTapView) { + _bottomTapView = [[UIView alloc] init]; + _bottomTapView.backgroundColor = [UIColor clearColor]; + UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismissTapRecognizer:)]; + [_bottomTapView addGestureRecognizer:tap]; + } + return _bottomTapView; } - (UIView *)contentView { - if (!_contentView) { - _contentView = [[UIView alloc] init]; - _contentView.backgroundColor = [UIColor clearColor]; - } - return _contentView; + if (!_contentView) { + _contentView = [[UIView alloc] init]; + _contentView.backgroundColor = [UIColor clearColor]; + } + return _contentView; } - (UIImageView *)backView { - if (!_backView) { - _backView = [[UIImageView alloc] init]; - _backView.userInteractionEnabled = YES; - _backView.image = [UIImage imageNamed:@"room_candy_tree_back"]; - - } - return _backView; + if (!_backView) { + _backView = [[UIImageView alloc] init]; + _backView.userInteractionEnabled = YES; + _backView.image = [UIImage imageNamed:@"room_candy_tree_back"]; + + } + return _backView; } - (UIStackView *)rankStackView { - if (!_rankStackView) { - _rankStackView = [[UIStackView alloc] init]; - _rankStackView.axis = UILayoutConstraintAxisHorizontal; - _rankStackView.distribution = UIStackViewDistributionFill; - _rankStackView.alignment = UIStackViewAlignmentCenter; - _rankStackView.spacing = 0; - UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(rankTapRecognizer:)]; - [_rankStackView addGestureRecognizer:tap]; - } - return _rankStackView; + if (!_rankStackView) { + _rankStackView = [[UIStackView alloc] init]; + _rankStackView.axis = UILayoutConstraintAxisHorizontal; + _rankStackView.distribution = UIStackViewDistributionFill; + _rankStackView.alignment = UIStackViewAlignmentCenter; + _rankStackView.spacing = 0; + UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(rankTapRecognizer:)]; + [_rankStackView addGestureRecognizer:tap]; + } + return _rankStackView; } - (UIImageView *)rankImageView { - if (!_rankImageView) { - _rankImageView = [[UIImageView alloc] init]; - _rankImageView.userInteractionEnabled = YES; - _rankImageView.image = [UIImage imageNamed:@"room_candy_tree_rank"]; - } - return _rankImageView; + if (!_rankImageView) { + _rankImageView = [[UIImageView alloc] init]; + _rankImageView.userInteractionEnabled = YES; + _rankImageView.image = [UIImage imageNamed:@"room_candy_tree_rank"]; + } + return _rankImageView; } - (UIImageView *)moreImageView { - if (!_moreImageView) { - _moreImageView = [[UIImageView alloc] init]; - _moreImageView.userInteractionEnabled = YES; - _moreImageView.image = [UIImage imageNamed:@"room_candy_tree_more"]; - UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(moreTapRecognizer:)]; - [_moreImageView addGestureRecognizer:tap]; - } - return _moreImageView; + if (!_moreImageView) { + _moreImageView = [[UIImageView alloc] init]; + _moreImageView.userInteractionEnabled = YES; + _moreImageView.image = [UIImage imageNamed:@"room_candy_tree_more"]; + UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(moreTapRecognizer:)]; + [_moreImageView addGestureRecognizer:tap]; + } + return _moreImageView; } @@ -565,107 +626,107 @@ UIKIT_EXTERN NSString * const kRoomReceivedCandyNotificationKey; - (UIImageView *)candyTreeView { - if (!_candyTreeView) { - _candyTreeView = [[UIImageView alloc]init]; - _candyTreeView.backgroundColor = [UIColor clearColor]; - _candyTreeView.userInteractionEnabled = NO; + if (!_candyTreeView) { + _candyTreeView = [[UIImageView alloc]init]; + _candyTreeView.backgroundColor = [UIColor clearColor]; + _candyTreeView.userInteractionEnabled = NO; _candyTreeView.image = [UIImage imageNamed:@"room_candy_tree_bg"]; - } - return _candyTreeView; + } + return _candyTreeView; } - (SVGAImageView *)candyTreeLightView { - if (!_candyTreeLightView) { - _candyTreeLightView = [[SVGAImageView alloc]init]; - _candyTreeLightView.backgroundColor = [UIColor clearColor]; - _candyTreeLightView.userInteractionEnabled = NO; - } - return _candyTreeLightView; + if (!_candyTreeLightView) { + _candyTreeLightView = [[SVGAImageView alloc]init]; + _candyTreeLightView.backgroundColor = [UIColor clearColor]; + _candyTreeLightView.userInteractionEnabled = NO; + } + return _candyTreeLightView; } - (SVGAImageView *)candyTreeOpenView { - if (!_candyTreeOpenView) { - _candyTreeOpenView = [[SVGAImageView alloc]init]; - _candyTreeOpenView.backgroundColor = [UIColor clearColor]; - _candyTreeOpenView.userInteractionEnabled = NO; - } - return _candyTreeOpenView; + if (!_candyTreeOpenView) { + _candyTreeOpenView = [[SVGAImageView alloc]init]; + _candyTreeOpenView.backgroundColor = [UIColor clearColor]; + _candyTreeOpenView.userInteractionEnabled = NO; + } + return _candyTreeOpenView; } - (SVGAImageView *)candyTreeTransView { - if (!_candyTreeTransView) { - _candyTreeTransView = [[SVGAImageView alloc]init]; - _candyTreeTransView.backgroundColor = [UIColor clearColor]; - _candyTreeTransView.userInteractionEnabled = NO; - } - return _candyTreeTransView; + if (!_candyTreeTransView) { + _candyTreeTransView = [[SVGAImageView alloc]init]; + _candyTreeTransView.backgroundColor = [UIColor clearColor]; + _candyTreeTransView.userInteractionEnabled = NO; + } + return _candyTreeTransView; } - (SVGAParser *)parser { - if (!_parser) { - _parser = [[SVGAParser alloc]init]; - } - return _parser; + if (!_parser) { + _parser = [[SVGAParser alloc]init]; + } + return _parser; } - (UIImageView *)pickBackImageView { - if (!_pickBackImageView) { - _pickBackImageView = [[UIImageView alloc] init]; - _pickBackImageView.userInteractionEnabled = YES; - _pickBackImageView.image = [UIImage imageNamed:@"room_candy_tree_pick_bg"]; - } - return _pickBackImageView; + if (!_pickBackImageView) { + _pickBackImageView = [[UIImageView alloc] init]; + _pickBackImageView.userInteractionEnabled = YES; + _pickBackImageView.image = [UIImage imageNamed:@"room_candy_tree_pick_bg"]; + } + return _pickBackImageView; } - (UIButton *)addButton { - if (!_addButton) { - _addButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_addButton setImage:[UIImage imageNamed:@"room_candy_tree_add"] forState:UIControlStateNormal]; - [_addButton setImage:[UIImage imageNamed:@"room_candy_tree_add"] forState:UIControlStateSelected]; - [_addButton addTarget:self action:@selector(addButtonAction:) forControlEvents:UIControlEventTouchUpInside]; - [_addButton setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal]; - } - return _addButton; + if (!_addButton) { + _addButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_addButton setImage:[UIImage imageNamed:@"room_candy_tree_add"] forState:UIControlStateNormal]; + [_addButton setImage:[UIImage imageNamed:@"room_candy_tree_add"] forState:UIControlStateSelected]; + [_addButton addTarget:self action:@selector(addButtonAction:) forControlEvents:UIControlEventTouchUpInside]; + [_addButton setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal]; + } + return _addButton; } - (UIButton *)subtractButton { - if (!_subtractButton) { - _subtractButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_subtractButton setImage:[UIImage imageNamed:@"room_candy_tree_subtract"] forState:UIControlStateNormal]; - [_subtractButton setImage:[UIImage imageNamed:@"room_candy_tree_subtract"] forState:UIControlStateSelected]; - [_subtractButton addTarget:self action:@selector(subtractButtonAction:) forControlEvents:UIControlEventTouchUpInside]; - [_subtractButton setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal]; - } - return _subtractButton; + if (!_subtractButton) { + _subtractButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_subtractButton setImage:[UIImage imageNamed:@"room_candy_tree_subtract"] forState:UIControlStateNormal]; + [_subtractButton setImage:[UIImage imageNamed:@"room_candy_tree_subtract"] forState:UIControlStateSelected]; + [_subtractButton addTarget:self action:@selector(subtractButtonAction:) forControlEvents:UIControlEventTouchUpInside]; + [_subtractButton setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal]; + } + return _subtractButton; } - (UITextField *)textFiled { - if (!_textFiled) { - _textFiled = [[UITextField alloc] init]; - _textFiled.tintColor = [UIColor whiteColor]; - _textFiled.textColor = [UIColor whiteColor]; - _textFiled.backgroundColor = [UIColor clearColor]; - _textFiled.textAlignment = NSTextAlignmentCenter; - _textFiled.font = [UIFont fontWithName:@"PingFangSC-Medium" size:12]; - _textFiled.text = @"1"; + if (!_textFiled) { + _textFiled = [[UITextField alloc] init]; + _textFiled.tintColor = [UIColor whiteColor]; + _textFiled.textColor = [UIColor whiteColor]; + _textFiled.backgroundColor = [UIColor clearColor]; + _textFiled.textAlignment = NSTextAlignmentCenter; + _textFiled.font = [UIFont fontWithName:@"PingFangSC-Medium" size:12]; + _textFiled.text = @"1"; _textFiled.delegate = self; - [_textFiled addTarget:self action:@selector(textFieldDidChanged:) forControlEvents:UIControlEventEditingChanged]; - _textFiled.keyboardType = UIKeyboardTypeNumberPad; - } - return _textFiled; + [_textFiled addTarget:self action:@selector(textFieldDidChanged:) forControlEvents:UIControlEventEditingChanged]; + _textFiled.keyboardType = UIKeyboardTypeNumberPad; + } + return _textFiled; } - (UIButton *)pickButton { - if (!_pickButton) { - _pickButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_pickButton setImage:[UIImage imageNamed:@"room_candy_tree_pick_normal"] forState:UIControlStateNormal]; - [_pickButton setImage:[UIImage imageNamed:@"room_candy_tree_pick_normal"] forState:UIControlStateDisabled]; - [_pickButton addTarget:self action:@selector(pickButtonAction:) forControlEvents:UIControlEventTouchUpInside]; - } - return _pickButton; + if (!_pickButton) { + _pickButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_pickButton setImage:[UIImage imageNamed:@"room_candy_tree_pick_normal"] forState:UIControlStateNormal]; + [_pickButton setImage:[UIImage imageNamed:@"room_candy_tree_pick_normal"] forState:UIControlStateDisabled]; + [_pickButton addTarget:self action:@selector(pickButtonAction:) forControlEvents:UIControlEventTouchUpInside]; + } + return _pickButton; } - (UILabel *)pickLabel{ if(!_pickLabel){ @@ -675,11 +736,11 @@ UIKIT_EXTERN NSString * const kRoomReceivedCandyNotificationKey; return _pickLabel; } - (UIView *)animationView { - if (!_animationView) { - _animationView = [[UIView alloc] init]; - _animationView.backgroundColor = [UIColor clearColor]; - } - return _animationView; + if (!_animationView) { + _animationView = [[UIView alloc] init]; + _animationView.backgroundColor = [UIColor clearColor]; + } + return _animationView; } diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPRoomMessageHeaderView.m b/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPRoomMessageHeaderView.m index 472f5a03..884e6849 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPRoomMessageHeaderView.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPRoomMessageHeaderView.m @@ -39,7 +39,7 @@ - (void)initSubViewConstraints { /// 设置绿色消息 - NSString *title = @"平台严禁未成年人直播或打赏,倡导绿色互动,禁止宣传及发布政治、低俗、暴力、色情等违规违法内容,严禁违规交易和诱导欺诈用户,如有违规将对账号进行封禁,发现请及时举报。"; + NSString *title = YMLocalizedString(@"XPRoomMessageHeaderView0"); self.titleLabel.text = title; CGFloat height = [self getHeaderViewHeight:title] + kRoomMessageTextSpaceHeight *2; [self mas_makeConstraints:^(MASConstraintMaker *make) { diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/Api/Api+Gift.h b/YuMi/Modules/YMRoom/View/SendGiftView/Api/Api+Gift.h index 916ed574..a4338474 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/Api/Api+Gift.h +++ b/YuMi/Modules/YMRoom/View/SendGiftView/Api/Api+Gift.h @@ -75,6 +75,10 @@ NS_ASSUME_NONNULL_BEGIN /// 请求星座礼物信息 + (void)requestTwelveStarFirst:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid; +/// 请求缓存列表 +/// @param complection 完成 +/// @param roomUid 房间的roomuid ++ (void)requestCacheGiftList:(HttpRequestHelperCompletion)complection; @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/Api/Api+Gift.m b/YuMi/Modules/YMRoom/View/SendGiftView/Api/Api+Gift.m index c1a48e6b..cfe8379b 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/Api/Api+Gift.m +++ b/YuMi/Modules/YMRoom/View/SendGiftView/Api/Api+Gift.m @@ -27,7 +27,13 @@ NSString * fang = [NSString stringFromBase64String:@"Z2lmdC9saXN0VjQ="];///gift/listV4 [self makeRequest:fang method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__, roomUid, nil]; } - +/// 请求缓存列表 +/// @param complection 完成 +/// @param roomUid 房间的roomuid ++ (void)requestCacheGiftList:(HttpRequestHelperCompletion)complection { + NSString * fang = @"gift/vgg";///gift/listV4 + [self makeRequest:fang method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__, nil]; +} /// 请求福袋全服礼物全服记录 /// @param complection 完成 + (void)requestLuckGiftServerBagRecord:(HttpRequestHelperCompletion)complection { diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/Model/GiftInfoModel.h b/YuMi/Modules/YMRoom/View/SendGiftView/Model/GiftInfoModel.h index 164488ca..95614e46 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/Model/GiftInfoModel.h +++ b/YuMi/Modules/YMRoom/View/SendGiftView/Model/GiftInfoModel.h @@ -67,8 +67,10 @@ typedef NS_ENUM(NSUInteger, RoomSendGiftType) { @property (nonatomic, assign)NSInteger giftId; ///礼物名字 @property (nonatomic, strong)NSString *giftName; +@property(nonatomic,copy) NSString *giftNum; ///价格 @property (nonatomic, assign)double goldPrice; + ///礼物url @property (nonatomic, copy)NSString *giftUrl; ///福袋svagUrl diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/View/XPSendGiftView.m b/YuMi/Modules/YMRoom/View/SendGiftView/View/XPSendGiftView.m index 37e4eeee..ca0268d1 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/View/XPSendGiftView.m +++ b/YuMi/Modules/YMRoom/View/SendGiftView/View/XPSendGiftView.m @@ -180,6 +180,8 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; [data addEntriesFromDictionary:dict]; if (receiveModel.gift.giftType == GiftType_Lucky) { // 如果是福袋 需要分开发送消息 NSArray *luckyBagGifts = (NSArray *)[data objectForKey:@"luckyBagGifts"]; +// NSArray *displayGift = (NSArray *)[data objectForKey:@"displayGift"]; +// NSMutableArray *displayList = [NSMutableArray array]; if (luckyBagGifts.count >0) { for (int i = 0; i < luckyBagGifts.count; i++) { NSMutableDictionary * data1 = [NSMutableDictionary dictionary]; @@ -188,6 +190,18 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; attachment.first = CustomMessageType_AllMicroSend; attachment.second = Custom_Message_Sub_AllMicroLuckySend; NSDictionary * obj = [luckyBagGifts safeObjectAtIndex1:i]; +// NSArray *giftList = (NSArray *)obj[@"giftList"]; +// for (NSDictionary *giftDic in giftList) { +// for (NSDictionary *displayDic in displayGift) { +// if([displayDic[@"giftId"]intValue] == [giftDic[@"giftId"]intValue]){ +// NSMutableDictionary *mutDic = [[NSMutableDictionary alloc]initWithDictionary:displayDic]; +// [mutDic setValue:giftDic[@"giftNum"] forKey:@"giftNum"]; +// [displayList addObject:mutDic]; +// +// } +// } +// } +// [data1 setValue:displayList forKey:@"displayGift"]; [data1 setObject:i == 0 ? @(YES):@(NO) forKey:@"isShowAnimation"]; [data1 setObject:obj forKey:@"luckyGiftList"]; [data1 setObject:receiveModel.gift.giftName forKey:@"giftName"]; @@ -672,7 +686,7 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; - (void)luckyGiftBroadcastRecordSuccess:(NSArray *)records { self.records = records; self.luckyBroadcastView.records = records; -} +} - (void)getTwelveStarLastRankFirstSuccess:(GiftTwelveStarFirstModel *)model { diff --git a/YuMi/Modules/YMRoom/View/StageView/MicroView/MicroGiftValueView.m b/YuMi/Modules/YMRoom/View/StageView/MicroView/MicroGiftValueView.m index 34a4abac..afdb9107 100644 --- a/YuMi/Modules/YMRoom/View/StageView/MicroView/MicroGiftValueView.m +++ b/YuMi/Modules/YMRoom/View/StageView/MicroView/MicroGiftValueView.m @@ -60,6 +60,7 @@ } #pragma mark - Getters And Setters - (void)setGiftValue:(long long)giftValue { + _giftValue = giftValue; NSString *value; if (giftValue < 1000000) { value = @(giftValue).stringValue; diff --git a/YuMi/Modules/YMRoom/View/StageView/MicroView/MicroView.m b/YuMi/Modules/YMRoom/View/StageView/MicroView/MicroView.m index 5cd7b1c1..8a927772 100644 --- a/YuMi/Modules/YMRoom/View/StageView/MicroView/MicroView.m +++ b/YuMi/Modules/YMRoom/View/StageView/MicroView/MicroView.m @@ -362,7 +362,12 @@ self.positionCharmImgView.image = [UIImage imageNamed:@"room_game_position_crown"]; } } - +/** + 更新坑位等级头饰 + */ +-(void)hiddenPositionisHighLevel{ + self.positionCharmImgView.hidden = YES; +} /** 重置头饰 */ @@ -407,7 +412,9 @@ self.positionCharmImgView.hidden = YES; } } - +-(UserInfoModel *)getUser{ + return self.userInfo; +} - (void)configUser:(UserInfoModel *)userInfo { self.userInfo = userInfo; if ([ClientConfig shareConfig].canOpen) { @@ -492,13 +499,17 @@ - (void)configGiftValue:(long long)giftValue { self.giftValueView.giftValue = giftValue; } - +- (long long)getGiftValue{ + return self.giftValueView.giftValue; +} - (void)showGiftValueMode:(BOOL)isGiftValue { self.giftValueView.hidden = !isGiftValue; } - (void)resetGiftValue { self.giftValueView.giftValue = 0; + + } - (void)configRoomInfo:(RoomInfoModel *)roomInfo { diff --git a/YuMi/Modules/YMRoom/View/StageView/MicroView/MicroViewProtocol.h b/YuMi/Modules/YMRoom/View/StageView/MicroView/MicroViewProtocol.h index 4eea5754..047ba68a 100644 --- a/YuMi/Modules/YMRoom/View/StageView/MicroView/MicroViewProtocol.h +++ b/YuMi/Modules/YMRoom/View/StageView/MicroView/MicroViewProtocol.h @@ -38,7 +38,7 @@ NS_ASSUME_NONNULL_BEGIN * 设置用户信息。 */ - (void)configUser:(UserInfoModel *)userInfo; - +-(UserInfoModel *)getUser; /** * 用户正在讲话(播放光圈)。 */ @@ -53,7 +53,7 @@ NS_ASSUME_NONNULL_BEGIN * 礼物值。 */ - (void)configGiftValue:(long long)giftValue; - +- (long long)getGiftValue; /** * 礼物值模式 */ @@ -82,7 +82,7 @@ NS_ASSUME_NONNULL_BEGIN 更新坑位等级头饰 */ - (void)updatePositionisHighLevel:(BOOL)isHighLevel isShow:(BOOL)isShow; - +-(void)hiddenPositionisHighLevel; /** 重置头饰 */ diff --git a/YuMi/Modules/YMRoom/View/StageView/StageView.m b/YuMi/Modules/YMRoom/View/StageView/StageView.m index 6304d651..e6116664 100644 --- a/YuMi/Modules/YMRoom/View/StageView/StageView.m +++ b/YuMi/Modules/YMRoom/View/StageView/StageView.m @@ -22,6 +22,7 @@ #import "StatisticsServiceHelper.h" #import "NSArray+Safe.h" #import "ClientConfig.h" +#import "SocialMicroView.h" // Models #import "RoomInfoModel.h" #import "UserInfoModel.h" @@ -262,6 +263,7 @@ } if (view == nil) continue; [view configGiftValue:giftValueModel.giftValue]; + } [self updatePostionItemWithRoomOnMicGiftValue:model]; } @@ -271,13 +273,22 @@ */ - (void)updatePostionItemWithRoomOnMicGiftValue:(GiftValueInfoModel *)roomOnMicGiftValue{ if (self.hostDelegate.getRoomInfo.type == RoomType_Anchor || self.hostDelegate.getRoomInfo.roomModeType == RoomModeType_Open_Blind) return; - // 过滤礼物值为0的 - NSMutableArray *validGifts = [NSMutableArray array]; - for (GiftValueDetailModel *value in roomOnMicGiftValue.giftValueVos) { - if (value.giftValue > 0) { - [validGifts addObject:value]; - } - } + // 过滤礼物值为0的 + NSMutableArray *validGifts = [NSMutableArray array]; + + for (int i = 0; i < self.microViews.count; i++) { + + UIView * view = [self findMicroViewByIndex:i]; + [view hiddenPositionisHighLevel]; + long long value = [view getGiftValue]; + UserInfoModel *user = [view getUser]; + if(value > 0 && user.uid > 0){ + GiftValueDetailModel *model = [GiftValueDetailModel new]; + model.giftValue = value; + model.uid = @(user.uid).stringValue; + [validGifts addObject:model]; + } + } if (validGifts.count == 0) return; NSMutableArray *newOnMicGifts = [NSMutableArray array]; // 过滤厅主 @@ -316,7 +327,10 @@ } } } + + for (MicroQueueModel *item in self.micQueue.allValues) { + if (highest && item.userInfo.uid == highest.integerValue) { UIView * view = [self findMicroViewByUid:highest]; [view updatePositionisHighLevel:YES isShow:YES]; @@ -368,6 +382,7 @@ UIView * view = [self findMicroViewByIndex:i]; [view showGiftValueMode:roomInfo.showGiftValue]; } + // [self microQueueUpdated]; } @@ -415,7 +430,7 @@ sequence.userInfo = nil; } } - + if (changeType == 1) { // 上麦 MicroQueueModel *sequence = [self.micQueue objectForKey:position]; sequence.userInfo = userInfo; @@ -467,6 +482,9 @@ } if (microQueueChanged) { + + + [self updatePostionItemWithRoomOnMicGiftValue:nil]; self.isMiniEnter = NO; [self microQueueUpdated:ownerRTCChanged]; [self.hostDelegate onMicroQueueUpdate:self.micQueue]; diff --git a/YuMi/Modules/YMRoom/View/XPMiniRoomView.m b/YuMi/Modules/YMRoom/View/XPMiniRoomView.m index 526dd841..21850582 100644 --- a/YuMi/Modules/YMRoom/View/XPMiniRoomView.m +++ b/YuMi/Modules/YMRoom/View/XPMiniRoomView.m @@ -873,7 +873,7 @@ UIKIT_EXTERN NSString *kRoomKickoutTime; - (NSFetchRequest *)request { if (!_request) { - _request = [NSFetchRequest fetchRequestWithEntityName:@"Music"]; + _request = [NSFetchRequest fetchRequestWithEntityName:[Music getMusicName]]; } return _request; } diff --git a/YuMi/Modules/YMTabbar/View/TabbarViewController.m b/YuMi/Modules/YMTabbar/View/TabbarViewController.m index 5c339f44..36b1ccfd 100644 --- a/YuMi/Modules/YMTabbar/View/TabbarViewController.m +++ b/YuMi/Modules/YMTabbar/View/TabbarViewController.m @@ -121,6 +121,8 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey; @property (nonatomic,assign) BOOL isReload; ///房间外的飘屏 @property(nonatomic,strong) PIFullScreenBannerAnimation *roomAnimation; +@property(nonatomic,strong) NSMutableArray *cacheList; + @end @implementation TabbarViewController @@ -262,78 +264,48 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey; } /// -(void)requestGiftList{ - - NSString * uid = [AccountInfoStorage instance].getUid; - if(uid.length == 0)return; + [self dealWithDefaultSvga]; ///保存时间,一天只请求一次 NSString *time = [NSDate getNowTimeTimestamp]; NSString *curTime = [NSDate timestampSwitchTime:[time integerValue] andFormatter:@"yyyy-MM-dd"]; NSDictionary *timeDic = [[NSUserDefaults standardUserDefaults]valueForKey:@"kRequestGiftList"]; if(timeDic == nil){ - [timeDic setValue:@(YES) forKey:curTime]; - [[NSUserDefaults standardUserDefaults]setValue:timeDic forKey:@"kRequestGiftList"]; + NSMutableDictionary *curDic = [[NSMutableDictionary alloc]initWithDictionary:timeDic]; + [curDic setValue:@(YES) forKey:curTime]; + [[NSUserDefaults standardUserDefaults]setValue:curDic forKey:@"kRequestGiftList"]; [[NSUserDefaults standardUserDefaults]synchronize]; }else{ if(timeDic[curTime]!= nil)return; NSMutableDictionary *curDic = [[NSMutableDictionary alloc]initWithDictionary:timeDic]; + [curDic removeAllObjects]; [curDic setValue:@(YES) forKey:curTime]; [[NSUserDefaults standardUserDefaults]setValue:curDic forKey:@"kRequestGiftList"]; [[NSUserDefaults standardUserDefaults]synchronize]; } - ///请求普通礼物 - [Api requestNormalGiftList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { + [Api requestCacheGiftList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { if(code == 200){ - NSArray *luckyBagGift = [GiftInfoModel modelsWithArray:data.data[@"luckyBagGift"]]; // 福袋礼物 - NSArray *vipGift = [GiftInfoModel modelsWithArray:data.data[@"vipGift"]]; // 贵族礼物 - NSArray *luckyPoolGift = [GiftInfoModel modelsWithArray:data.data[@"luckyPoolGift"]];// 福袋奖池礼物 - NSArray *normalGift = [GiftInfoModel modelsWithArray:data.data[@"normalGift"]]; // 普通面板礼物 - NSArray *weekStarGift = [GiftInfoModel modelsWithArray:data.data[@"weekStarGift"]]; // 周星礼物 - NSArray *anchorGift = [GiftInfoModel modelsWithArray:data.data[@"singlePopularGift"]]; // 个播礼物 - NSMutableArray *giftList = [[NSMutableArray alloc]initWithArray:luckyBagGift]; - [giftList addObjectsFromArray:vipGift]; - [giftList addObjectsFromArray:luckyPoolGift]; - [giftList addObjectsFromArray:normalGift]; - [giftList addObjectsFromArray:weekStarGift]; - [giftList addObjectsFromArray:anchorGift]; - NSMutableArray *vggUrlList = [NSMutableArray array]; - NSMutableArray *viewUrlList = [NSMutableArray array]; + NSArray *giftList = [GiftInfoModel modelsWithArray:data.data]; for (GiftInfoModel *giftModel in giftList) { if(giftModel.vggUrl.length > 0){ - [vggUrlList addObject:giftModel.vggUrl]; [self dealWithGiftListWithUrl:giftModel.vggUrl fileName:giftModel.vggUrl isSvga:YES]; }else if(giftModel.viewUrl.length > 0){ - [viewUrlList addObject:giftModel.viewUrl]; [self dealWithGiftListWithUrl:giftModel.viewUrl fileName:giftModel.viewUrl isSvga:NO]; } } - [self requestBagGiftListWithVggUrlList:vggUrlList viewUrlList:viewUrlList]; } - } roomUid:uid]; + }]; + } --(void)requestBagGiftListWithVggUrlList:(NSMutableArray *)list viewUrlList:(NSMutableArray *)viewUrlList{ - ///请求背包礼物 - NSString * uid = [AccountInfoStorage instance].getUid; - NSString * ticket = [AccountInfoStorage instance].getTicket; - [Api requestPackGiftList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { - if(code == 200){ - NSArray * info = [GiftInfoModel modelsWithArray:data.data]; - for (GiftInfoModel *giftModel in info) { - if(giftModel.vggUrl.length > 0 && ![list containsObject:giftModel.vggUrl]){ - [self dealWithGiftListWithUrl:giftModel.vggUrl fileName:giftModel.vggUrl isSvga:YES]; - }else if(giftModel.viewUrl.length > 0 && ![viewUrlList containsObject:giftModel.viewUrl]){ - [self dealWithGiftListWithUrl:giftModel.viewUrl fileName:giftModel.viewUrl isSvga:NO]; - } - - } - } - - } uid:uid ticket:ticket]; -} +-(void)dealWithDefaultSvga{ + for (NSString *url in self.cacheList) { + [self dealWithGiftListWithUrl:url fileName:url isSvga:YES]; + } +} -(void)dealWithGiftListWithUrl:(NSString *)url fileName:(NSString *)fileName isSvga:(BOOL)isSvga { NSString *baseFileName = isSvga ? @"/GiftSvga":@"/GiftMp4"; NSString *filePaths = [[[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingPathComponent:baseFileName] stringByAppendingPathComponent:fileName]; @@ -1013,4 +985,10 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey; } return _roomAnimation; } +- (NSMutableArray *)cacheList{ + if(!_cacheList){ + _cacheList = [[NSMutableArray alloc]initWithArray:@[@"https://image.hfighting.com/candyTree_light.svga",@"https://image.hfighting.com/candyTree_open.svga",@"https://image.hfighting.com/candyTree_transform.svga"]]; + } + return _cacheList; +} @end diff --git a/YuMi/Modules/YMWeb/XPWebViewController.m b/YuMi/Modules/YMWeb/XPWebViewController.m index cd582a3f..1e003c51 100644 --- a/YuMi/Modules/YMWeb/XPWebViewController.m +++ b/YuMi/Modules/YMWeb/XPWebViewController.m @@ -73,7 +73,7 @@ typedef NS_ENUM(NSUInteger, RightNavigationPushType){ @property (nonatomic,strong) WalletInfoModel *model ; @property (strong, nonatomic) WKWebView *webview; @property (strong, nonatomic) UIProgressView *progressView; -@property (nonatomic, strong) WKUserContentController *userContentController; +@property (nonatomic, strong) WKUserContentController *pi_userContentController; ///分享的内容 @property (nonatomic,copy) NSDictionary *shareDic; /// @@ -471,7 +471,7 @@ NSString * const kJSOpenRoomForGiftId = @"openRoomForGiftId"; [self.webview goBack]; } else { [self.navigationController popViewControllerAnimated:YES]; - [self.userContentController removeAllUserScripts]; + [self.pi_userContentController removeAllUserScripts]; } } #pragma mark - 分享 @@ -608,18 +608,18 @@ NSString * const kJSOpenRoomForGiftId = @"openRoomForGiftId"; NSString *realCookie = [NSString stringWithFormat:@"%@=%@",@"uid",uid]; WKUserScript *cookieScript = [[WKUserScript alloc] initWithSource: [NSString stringWithFormat:@"document.cookie = '%@';", realCookie] injectionTime:WKUserScriptInjectionTimeAtDocumentStart forMainFrameOnly:NO]; - [self.userContentController addUserScript:cookieScript]; + [self.pi_userContentController addUserScript:cookieScript]; ///禁止缩放 NSString *scaleJs = @"$('meta[name=description]').remove(); $('head').append( '' );"; WKUserScript *scaleScript = [[WKUserScript alloc] initWithSource:scaleJs injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:NO]; - [self.userContentController addUserScript:scaleScript]; + [self.pi_userContentController addUserScript:scaleScript]; //根据生成的WKUserScript对象,初始化WKWebViewConfiguration configuration.preferences.javaScriptEnabled = YES; configuration.preferences.javaScriptCanOpenWindowsAutomatically = YES; configuration.preferences.minimumFontSize = 10; configuration.selectionGranularity = WKSelectionGranularityCharacter; - configuration.userContentController = self.userContentController; + configuration.userContentController = self.pi_userContentController; CGSize size = [UIScreen mainScreen].bounds.size; _webview = [[WKWebView alloc]initWithFrame:CGRectMake(0, 0, size.width,size.height) configuration:configuration]; @@ -664,47 +664,47 @@ NSString * const kJSOpenRoomForGiftId = @"openRoomForGiftId"; return _progressView; } -- (WKUserContentController *)userContentController{ - if (!_userContentController) { +- (WKUserContentController *)pi_userContentController{ + if (!_pi_userContentController) { //自定义的WKScriptMessageHandler 是为了解决内存不释放的问题 WeakWebViewScriptMessageDelegate *weakScriptMessageDelegate = [[WeakWebViewScriptMessageDelegate alloc] initWithDelegate:self]; - _userContentController = [[WKUserContentController alloc] init]; + _pi_userContentController = [[WKUserContentController alloc] init]; // 分享面板 - [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSOpenSharePage]; + [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSOpenSharePage]; // 钱包页面 - [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSOpenPurse]; + [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSOpenPurse]; // 充值页面 - [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSOpenChargePage]; - [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSChargePayPage]; - [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSChargePayClickPage]; + [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSOpenChargePage]; + [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSChargePayPage]; + [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSChargePayClickPage]; // 获取uid - [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetUid]; + [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetUid]; // 获取设备id - [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetDeviceId]; + [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetDeviceId]; // 获取Ticket - [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetTicket]; + [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetTicket]; // 获取设备info - [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetDeviceInfo]; + [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetDeviceInfo]; // 实人认证: 打开原生人脸认证 - [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSOpenFaceLiveness]; + [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSOpenFaceLiveness]; // 分享按钮 - [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSInitNav]; + [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSInitNav]; // 获取房间uid - [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetRoomUid]; + [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetRoomUid]; // 进入个人主页 - [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kOpenPersonPage]; + [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kOpenPersonPage]; // 隐藏导航栏 - [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kInitShowNav]; + [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kInitShowNav]; // 隐藏导航栏 - [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kCloseWebView]; + [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kCloseWebView]; //装扮及其他活动页面 - [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJumpAppointPage]; + [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJumpAppointPage]; //进入房间 - [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSOpenRoom]; + [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSOpenRoom]; //进房并弹出礼物面板 - [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSOpenRoomForGiftId]; + [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSOpenRoomForGiftId]; } - return _userContentController; + return _pi_userContentController; } -(XPWebViewNavView *)navView{ diff --git a/YuMi/Structure/PrefixHeader.pch b/YuMi/Structure/PrefixHeader.pch index 102bdc7d..767809df 100644 --- a/YuMi/Structure/PrefixHeader.pch +++ b/YuMi/Structure/PrefixHeader.pch @@ -17,7 +17,7 @@ #else #define NSLog(...) #endif - +#import "Music+CoreDataProperties.h" #import "YUMIMacroUitls.h" #import #import "NSArray+Safe.h" @@ -32,4 +32,5 @@ #import "UILabel+Utils.h" #import "TTPopup.h" #import "NSDate+DateUtils.h" +#import "NSMutableDictionary+Saft.h" #endif /* PrefixHeader_pch */ diff --git a/YuMi/Tools/SDPhotoBrowser/SDPhotoBrowser.h b/YuMi/Tools/SDPhotoBrowser/SDPhotoBrowser.h index b6c35046..504f44cf 100755 --- a/YuMi/Tools/SDPhotoBrowser/SDPhotoBrowser.h +++ b/YuMi/Tools/SDPhotoBrowser/SDPhotoBrowser.h @@ -20,7 +20,7 @@ @optional - (NSURL *)photoBrowser:(SDPhotoBrowser *)browser highQualityImageURLForIndex:(NSInteger)index; - +- (UIImage *)photoBrowser:(SDPhotoBrowser *)browser highQualityImageForIndex:(NSInteger)index; @end diff --git a/YuMi/Tools/SDPhotoBrowser/SDPhotoBrowser.m b/YuMi/Tools/SDPhotoBrowser/SDPhotoBrowser.m index fb7410ed..88efb830 100755 --- a/YuMi/Tools/SDPhotoBrowser/SDPhotoBrowser.m +++ b/YuMi/Tools/SDPhotoBrowser/SDPhotoBrowser.m @@ -172,7 +172,12 @@ if ([self highQualityImageURLForIndex:index]) { [imageView setImageWithURL:[self highQualityImageURLForIndex:index] placeholderImage:[self placeholderImageForIndex:index]]; } else { - imageView.image = [self placeholderImageForIndex:index]; + if([self highQualityImageForIndex: index]){ + imageView.image = [self highQualityImageForIndex: index]; + }else{ + imageView.image = [self placeholderImageForIndex:index]; + } + } imageView.hasLoadedImage = YES; } @@ -343,7 +348,12 @@ } return nil; } - +-(UIImage *)highQualityImageForIndex:(NSInteger)index{ + if ([self.delegate respondsToSelector:@selector(photoBrowser:highQualityImageForIndex:)]) { + return [self.delegate photoBrowser:self highQualityImageForIndex:index]; + } + return nil; +} - (NSURL *)highQualityImageURLForIndex:(NSInteger)index { if ([self.delegate respondsToSelector:@selector(photoBrowser:highQualityImageURLForIndex:)]) { diff --git a/YuMi/Tools/YYUtility/YYUtility+App.m b/YuMi/Tools/YYUtility/YYUtility+App.m index aa48cf22..cad0aad8 100644 --- a/YuMi/Tools/YYUtility/YYUtility+App.m +++ b/YuMi/Tools/YYUtility/YYUtility+App.m @@ -108,7 +108,7 @@ static NSString *_from = nil; && ![from isEqualToString:@""]) { _from = from; } else { - _from = @"youmi_appstore"; // App Store包 + _from = @"appstore"; // App Store包 } } diff --git a/YuMi/zh-Hans.lproj/Localizable.strings b/YuMi/zh-Hans.lproj/Localizable.strings index 962f43c1..3dfe937a 100644 --- a/YuMi/zh-Hans.lproj/Localizable.strings +++ b/YuMi/zh-Hans.lproj/Localizable.strings @@ -399,7 +399,8 @@ "XPMineUserDataViewController1" = "确定"; "XPMineUserDataViewController2" = "实名认证"; "XPMineUserDataViewController3" = "申请成功,等待管理员审核"; - +"XPMineUserDataViewController4" = "默认动态不能点赞"; +"XPMineUserDataViewController5" = "默认动态不能评论"; "XPMineSimpleUserInfoHeaderView0" = "我是个默认签名"; "XPMineSimpleUserInfoHeaderView1" = "粉丝"; "XPMineSimpleUserInfoHeaderView2" = "直播中"; diff --git a/YuMi/zh-Hant.lproj/Localizable.strings b/YuMi/zh-Hant.lproj/Localizable.strings index b419e787..3a9e00e4 100644 --- a/YuMi/zh-Hant.lproj/Localizable.strings +++ b/YuMi/zh-Hant.lproj/Localizable.strings @@ -399,6 +399,9 @@ "XPMineUserDataViewController1" = "確定"; "XPMineUserDataViewController2" = "實名認證"; "XPMineUserDataViewController3" = "申請成功,等待管理員審核"; +"XPMineUserDataViewController4" = "默認動態不能點贊"; +"XPMineUserDataViewController5" = "默認動態不能評論"; + "XPMineSimpleUserInfoHeaderView0" = "我是個默認簽名"; "XPMineSimpleUserInfoHeaderView1" = "粉絲";