diff --git a/YuMi.xcodeproj/project.pbxproj b/YuMi.xcodeproj/project.pbxproj index fc85a0eb..4509cdcf 100644 --- a/YuMi.xcodeproj/project.pbxproj +++ b/YuMi.xcodeproj/project.pbxproj @@ -196,6 +196,7 @@ 237D64F32A58139E000442C6 /* treasure_fairy_trials_middle.mp4 in Resources */ = {isa = PBXBuildFile; fileRef = 237D64EB2A58139E000442C6 /* treasure_fairy_trials_middle.mp4 */; }; 237D64F42A58139E000442C6 /* treasure_fairy_one.mp4 in Resources */ = {isa = PBXBuildFile; fileRef = 237D64EC2A58139E000442C6 /* treasure_fairy_one.mp4 */; }; 237D64F52A58139E000442C6 /* treasure_fairy_gift_bg.svga in Resources */ = {isa = PBXBuildFile; fileRef = 237D64ED2A58139E000442C6 /* treasure_fairy_gift_bg.svga */; }; + 23D0B01F2A5BFF2D00C9B18B /* PIBaseAnimationViewModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 23D0B01E2A5BFF2D00C9B18B /* PIBaseAnimationViewModel.m */; }; 73FFADDC93E195344047A2EC /* Pods_YuMi.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CACF623970097D653132D69A /* Pods_YuMi.framework */; }; 9B0086C627BA392B0032BD2B /* KellegPhaseRegard.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B0086C527BA392B0032BD2B /* KellegPhaseRegard.m */; }; 9B0086CA27BA4F570032BD2B /* KellegMiecreoscoopeRegard.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B0086C927BA4F570032BD2B /* KellegMiecreoscoopeRegard.m */; }; @@ -1650,6 +1651,8 @@ 237D64EB2A58139E000442C6 /* treasure_fairy_trials_middle.mp4 */ = {isa = PBXFileReference; lastKnownFileType = file; path = treasure_fairy_trials_middle.mp4; sourceTree = ""; }; 237D64EC2A58139E000442C6 /* treasure_fairy_one.mp4 */ = {isa = PBXFileReference; lastKnownFileType = file; path = treasure_fairy_one.mp4; sourceTree = ""; }; 237D64ED2A58139E000442C6 /* treasure_fairy_gift_bg.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = treasure_fairy_gift_bg.svga; sourceTree = ""; }; + 23D0B01D2A5BFF2D00C9B18B /* PIBaseAnimationViewModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIBaseAnimationViewModel.h; sourceTree = ""; }; + 23D0B01E2A5BFF2D00C9B18B /* PIBaseAnimationViewModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIBaseAnimationViewModel.m; sourceTree = ""; }; 7DB00EC07F1D0ADFF900B38D /* Pods-YuMi.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-YuMi.debug.xcconfig"; path = "Target Support Files/Pods-YuMi/Pods-YuMi.debug.xcconfig"; sourceTree = ""; }; 9B0086C427BA392B0032BD2B /* KellegPhaseRegard.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KellegPhaseRegard.h; sourceTree = ""; }; 9B0086C527BA392B0032BD2B /* KellegPhaseRegard.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KellegPhaseRegard.m; sourceTree = ""; }; @@ -6473,6 +6476,8 @@ children = ( E83DB47827462C4500D8CBD1 /* YUMIPresentBigCaptureMatrix.h */, E83DB47927462C4500D8CBD1 /* YUMIPresentBigCaptureMatrix.m */, + 23D0B01D2A5BFF2D00C9B18B /* PIBaseAnimationViewModel.h */, + 23D0B01E2A5BFF2D00C9B18B /* PIBaseAnimationViewModel.m */, E83DB47F274649FB00D8CBD1 /* YUMIPresentOriflammeConsumerAbstractMatrix.h */, E83DB480274649FB00D8CBD1 /* YUMIPresentOriflammeConsumerAbstractMatrix.m */, E83DB485274670DA00D8CBD1 /* YUMIChamberPresentBroadCastMatrix.h */, @@ -10503,6 +10508,7 @@ E841ED61280FB0BD00904808 /* SatisfactionPrototypeAscensionMatrix.m in Sources */, 189DD74026E21C3F00AB55B1 /* YYUtility+App.m in Sources */, E86A16CE28574844004228B8 /* YUMIChamberLicneseHourRateRegard.m in Sources */, + 23D0B01F2A5BFF2D00C9B18B /* PIBaseAnimationViewModel.m in Sources */, E85E7B182A4EB0D200B6D00A /* CollectiveSpecificAbstractMatrix.m in Sources */, E85E7B272A4EB0D300B6D00A /* YUMIUnionSensationalManagementParrotRegard.m in Sources */, 189DD74526E21CCC00AB55B1 /* YYReachability.m in Sources */, diff --git a/YuMi.xcodeproj/xcshareddata/xcschemes/YuMi.xcscheme b/YuMi.xcodeproj/xcshareddata/xcschemes/YuMi.xcscheme index 9e3921f5..d258e3d3 100644 --- a/YuMi.xcodeproj/xcshareddata/xcschemes/YuMi.xcscheme +++ b/YuMi.xcodeproj/xcshareddata/xcschemes/YuMi.xcscheme @@ -31,7 +31,7 @@ +#import "PIBaseAnimationViewModel.h" + +typedef enum : NSUInteger { + GiftBannerType_Lucky,///福袋 + GiftBannerType_Love,///寻爱之旅 + GiftBannerType_Nobleman,///贵族 + GiftBannerType_kitchen,///厨房 + GiftBannerType_AnchorHour,///个播小时榜 + GiftBannerType_LicneseHour,///牌照房小时榜 +} GiftBannerType; NS_ASSUME_NONNULL_BEGIN -@interface YUMIPresentBigCaptureMatrix : NSObject +@interface YUMIPresentBigCaptureMatrix : PIBaseAnimationViewModel @property(nonatomic, copy)NSString *nick; @property(nonatomic, copy)NSString *giftName; @property (nonatomic,copy) NSString *luckyBagName; @@ -18,6 +28,14 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic,copy) NSString *roomUid; @property (nonatomic,copy) NSString *goldPrice; @property (nonatomic,assign) BOOL isInRoomVisiable; +@property(nonatomic,assign) GiftBannerType type; +@property (nonatomic,copy) NSDictionary *data; + +@property (nonatomic,copy) NSString *skipUrl; +@property (nonatomic,copy) NSString *itemId; +@property (nonatomic,copy) NSString *itemMultiple; +@property (nonatomic,copy) NSString *diamonds; +@property (nonatomic,copy) NSString * bannerId; @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/AnimationView/YUMIChamberBrightnessRegard.m b/YuMi/Modules/YMRoom/View/AnimationView/YUMIChamberBrightnessRegard.m index f7817880..0b5995c9 100644 --- a/YuMi/Modules/YMRoom/View/AnimationView/YUMIChamberBrightnessRegard.m +++ b/YuMi/Modules/YMRoom/View/AnimationView/YUMIChamberBrightnessRegard.m @@ -65,13 +65,10 @@ @property (nonatomic,strong) SVGAImageView *fortunatePresentImpressionRegard; @property (nonatomic, strong) VAPView *fortunateVepporPresentImpressionRegard; @property (nonatomic,weak) iddelegate; -@property (nonatomic,strong) NSMutableArray *presentImpressionFormation; @property (strong,nonatomic)NSMutableSet * oriflammeDequePond; @property (strong,nonatomic)NSMutableSet * oriflammeVisiablePond; @property (nonatomic,strong)dispatch_source_t presentImpressionIntratemper; -@property (nonatomic,strong) NSMutableArray *bigCapturePresentFormation; -@property (nonatomic,strong)dispatch_source_t fortunatecaptureIntratemper; @property (nonatomic,strong) NSMutableArray *presentPingencourageFormation; #pragma mark - 送礼物的动画的 @@ -79,9 +76,7 @@ @property (nonatomic ,strong)dispatch_source_t presentIntratemper; @property (nonatomic,strong) NSMutableSet * presentReuseGarment; @property (nonatomic,strong) NSMutableSet * presentVisibleGarment; -@property (nonatomic,strong) NSMutableArray *confectioneryTimberpresentFormation; @property (nonatomic,strong) NSMutableArray *compoundPresentFormation; -@property (nonatomic, strong) NSMutableArray *magnificentPrototypeUpwardsFormation; @property (nonatomic,assign) BOOL isBignessPresentAnimating; #pragma mark - 进房座驾动画的 @property (nonatomic, strong) NSMutableArray *automobileImpressionFormation; @@ -99,10 +94,17 @@ @property (nonatomic, strong) NSMutableArray *marchingFormation; #pragma mark - 涂鸦礼物 @property (nonatomic, strong) NSMutableArray *doodlePresentFormation; -@property (nonatomic,assign) BOOL isFortunatePresentBrectifyness; #pragma mark - 心愿礼物 @property (nonatomic,strong) SVGAImageView *sequencirePresentImpressionRegard; -@property (nonatomic,strong) NSMutableArray *satelliteKitchenFormation; + +///礼物飘屏 PresentAchieveAbstractMatrix +@property(nonatomic,strong) NSMutableArray *animationListA; +///玩法飘屏 YUMIPresentBigCaptureMatrix +@property(nonatomic,strong) NSMutableArray *animationListB; +///礼物飘屏正在播放中 +@property(nonatomic,assign) BOOL isPlayOfA; +///玩法飘屏正在播放中 +@property(nonatomic,assign) BOOL isPlayOfB; @end @implementation YUMIChamberBrightnessRegard @@ -263,9 +265,9 @@ } else if (attachment.first == IndividualityCommunicationGenre_Across_Room_PK && attachment.second == Custom_Message_Sub_AnchorPK_Result) { [self throughoutChamberCombatOriflammeBrectifyness:attachment]; } else if (attachment.first == IndividualityCommunicationGenre_Anchor_Hour_Rank && attachment.second == Custom_Message_Sub_Anchor_Hour_Rank) { - [self achieveKellegStundeRtowardse:attachment]; + [self receiveAnchorHourList:attachment]; } else if (attachment.first == IndividualityCommunicationGenre_Licnese_Hour_Rank && attachment.second == Custom_Message_Sub_Licnese_Hour_Rank) { - [self achieveLicneseStundeRtowardse:attachment]; + [self receiveLicneseHourList:attachment]; } else if (attachment.first == IndividualityCommunicationGenre_Gift_Compound && attachment.second == Custom_Message_Sub_Gift_Compound) { [self achievePresentSynthetise:attachment]; } else if(attachment.first == IndividualityCommunicationGenre_Room_Sailing && (attachment.second == Custom_Message_Sub_Sailing_AllRoom_Notify || attachment.second == Custom_Message_Sub_Sailing_InRoom_NeedAllMicSend)) { @@ -298,18 +300,21 @@ #pragma mark - 收到星级厨房飘屏 -(void)achieveChamberDoodleStowardselliteKitchen:(AttachmentMatrix *)attacment{ - if(self.satelliteKitchenFormation.count == 0){ - [self produceStowardselliteKitchenOriflammeBrectifyness:attacment]; + YUMIPresentBigCaptureMatrix * captureMatrix = [YUMIPresentBigCaptureMatrix new]; + captureMatrix.data = attacment.data; + captureMatrix.type = GiftBannerType_kitchen; + if(self.animationListB.count == 0 && self.isPlayOfB == NO){ + [self produceStowardselliteKitchenOriflammeBrectifyness:captureMatrix]; } - [self.satelliteKitchenFormation addObject:attacment]; + [self.animationListB addObject:captureMatrix]; } -- (void)produceStowardselliteKitchenOriflammeBrectifyness:(AttachmentMatrix *)attacment{ +- (void)produceStowardselliteKitchenOriflammeBrectifyness:(YUMIPresentBigCaptureMatrix *)attacment{ + self.isPlayOfB = YES; YUMIChamberSatelliteKitchenOriflammeRegard *starKitchenView = [[YUMIChamberSatelliteKitchenOriflammeRegard alloc]initWithFrame:CGRectMake(0, kNavigationHeight + 15, KScreenWidth, kGetScaleWidth(60))]; starKitchenView.isSvga = attacment.second == Custom_Message_Sub_Star_Kitchen_Server; - YUMIChamberSatelliteKitchenMatrix *starMatrix = [YUMIChamberSatelliteKitchenMatrix mtowardsrixAboutImpactbasket:attacment.data]; starKitchenView.delegate = self; - starKitchenView.starMatrix = starMatrix; + starKitchenView.starMatrix = attacment; [self.highProttypeRegard addSubview:starKitchenView]; POPSpringAnimation *springAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPViewCenter]; springAnimation.springSpeed = 12; @@ -330,10 +335,12 @@ @kStrongify(self); if (finished) { [starKitchenView removeFromSuperview]; - [self.satelliteKitchenFormation removeObjectAtIndex:0]; - if (self.satelliteKitchenFormation.count > 0) { - [self produceStowardselliteKitchenOriflammeBrectifyness:self.satelliteKitchenFormation.firstObject]; - } + self.isPlayOfB = NO; + if(self.animationListB.count > 0){ + [self.animationListB removeObjectAtIndex:0]; + } + + [self playAnimationWithModel]; } }]; [starKitchenView pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"]; @@ -343,7 +350,7 @@ } #pragma mark - FBCChamberStarKitchenBannerRegardRepresendtation -- (void)yUMIChamberStowardselliteKitchenOriflammeRegard:(YUMIChamberSatelliteKitchenOriflammeRegard *)view didClick:(YUMIChamberSatelliteKitchenMatrix *)starMatrix{ +- (void)yUMIChamberStowardselliteKitchenOriflammeRegard:(YUMIChamberSatelliteKitchenOriflammeRegard *)view didClick:(YUMIPresentBigCaptureMatrix *)starMatrix{ if(starMatrix.skipUrl == nil || starMatrix.skipUrl.length == 0)return; YUMITissueRegardGovernancer * webVewC = [[YUMITissueRegardGovernancer alloc] init]; webVewC.isPush = YES; @@ -681,14 +688,21 @@ #pragma mark - 糖果树横幅动画 - (void)achieveConfectioneryTimberPresentHighProttype:(AttachmentMatrix *)attatchment { if ([self isInYoudCompetition]) {return;} - if (self.confectioneryTimberpresentFormation.count == 0) { - [self produceConfectioneryTimberOriflammeBrectifyness:attatchment]; + YUMIPresentBigCaptureMatrix * captureMatrix = [YUMIPresentBigCaptureMatrix new]; + captureMatrix.data = attatchment.data; + captureMatrix.second = attatchment.second; + captureMatrix.first = attatchment.first; + captureMatrix.type = GiftBannerType_Love; + if (self.animationListB.count == 0 && self.isPlayOfB == NO) { + [self produceConfectioneryTimberOriflammeBrectifyness:captureMatrix]; } - [self.confectioneryTimberpresentFormation addObject:attatchment]; + + [self.animationListB addObject:captureMatrix]; } -- (void)produceConfectioneryTimberOriflammeBrectifyness:(AttachmentMatrix *)attatchment { +- (void)produceConfectioneryTimberOriflammeBrectifyness:(YUMIPresentBigCaptureMatrix *)attatchment { CGFloat kscale = (CGFloat)60 / (CGFloat)375; + self.isPlayOfB = YES; YUMIChamberConfectioneryPresentRegard *confectioneryTimberRegard = [[YUMIChamberConfectioneryPresentRegard alloc] initWithFrame:CGRectMake(KScreenWidth, kNavigationHeight + 15, KScreenWidth , KScreenWidth * kscale)]; confectioneryTimberRegard.isLargestBignessPresent = attatchment.second == Custom_Message_Sub_Candy_Tree_InRoom_NeedAllMicSend; confectioneryTimberRegard.confectioneryAbstract = attatchment.data; @@ -712,12 +726,11 @@ @kStrongify(self); if (finished) { [confectioneryTimberRegard removeFromSuperview]; - if (self.confectioneryTimberpresentFormation.count > 0) { - [self.confectioneryTimberpresentFormation removeObjectAtIndex:0]; - } - if (self.confectioneryTimberpresentFormation.count > 0) { - [self produceConfectioneryTimberOriflammeBrectifyness:self.confectioneryTimberpresentFormation.firstObject]; + self.isPlayOfB = NO; + if (self.animationListB.count > 0) { + [self.animationListB removeObjectAtIndex:0]; } + [self playAnimationWithModel]; } }]; [confectioneryTimberRegard pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"]; @@ -775,15 +788,19 @@ #pragma mark - 贵族升级 - (void)achieveMagnificentPrototypeUpwards:(AttachmentMatrix *)attachment { - if (self.magnificentPrototypeUpwardsFormation.count == 0) { - [self produceMagnificentPrototypeUpwardsOriflammeBrectifyness:attachment.data]; + YUMIPresentBigCaptureMatrix * captureMatrix = [YUMIPresentBigCaptureMatrix new]; + captureMatrix.data = attachment.data; + captureMatrix.type = GiftBannerType_Nobleman; + if (self.animationListB.count == 0 && self.isPlayOfB == NO) { + [self produceMagnificentPrototypeUpwardsOriflammeBrectifyness:captureMatrix]; } - [self.magnificentPrototypeUpwardsFormation addObject:attachment.data]; + [self.animationListB addObject:captureMatrix]; } -- (void)produceMagnificentPrototypeUpwardsOriflammeBrectifyness:(NSDictionary *)dic { +- (void)produceMagnificentPrototypeUpwardsOriflammeBrectifyness:(YUMIPresentBigCaptureMatrix *)model { + self.isPlayOfB = YES; YUMIChamberMagnificentPrototypeUpwardsRegard *nobleLevelUpView = [[YUMIChamberMagnificentPrototypeUpwardsRegard alloc] initWithFrame:CGRectMake(KScreenWidth, kNavigationHeight + 15, KScreenWidth, 90)]; - nobleLevelUpView.magnificentAbstract = dic; + nobleLevelUpView.magnificentAbstract = model.data; [self.highProttypeRegard addSubview:nobleLevelUpView]; POPSpringAnimation *springAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPViewCenter]; springAnimation.springSpeed = 12; @@ -804,12 +821,11 @@ @kStrongify(self); if (finished) { [nobleLevelUpView removeFromSuperview]; - if (self.magnificentPrototypeUpwardsFormation > 0) { - [self.magnificentPrototypeUpwardsFormation removeObjectAtIndex:0]; + self.isPlayOfB = NO; + if (self.animationListB > 0) { + [self.animationListB removeObjectAtIndex:0]; } - if (self.magnificentPrototypeUpwardsFormation.count > 0) { - [self produceMagnificentPrototypeUpwardsOriflammeBrectifyness:self.magnificentPrototypeUpwardsFormation.firstObject]; - } + [self playAnimationWithModel]; } }]; [nobleLevelUpView pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"]; @@ -866,7 +882,16 @@ } #pragma mark - 牌照房小时榜飘屏 -- (void)achieveLicneseStundeRtowardse:(AttachmentMatrix *)attachment { +- (void)receiveLicneseHourList:(AttachmentMatrix *)attachment{ + YUMIPresentBigCaptureMatrix * captureMatrix = [YUMIPresentBigCaptureMatrix new]; + captureMatrix.data = attachment.data; + captureMatrix.type = GiftBannerType_AnchorHour; + if(self.animationListB.count == 0 && self.isPlayOfB == NO){ + [self achieveLicneseStundeRtowardse:captureMatrix]; + } + [self.animationListB addObject:captureMatrix]; +} +- (void)achieveLicneseStundeRtowardse:(YUMIPresentBigCaptureMatrix *)attachment { YUMIChamberLicneseHourRateRegard *anchorRankView = [[YUMIChamberLicneseHourRateRegard alloc] initWithFrame:CGRectMake(KScreenWidth, kNavigationHeight + 15, 375, 60)]; anchorRankView.delegate = self; anchorRankView.licneseRateAbstract = [ChamberHalfHourRateMatrix mtowardsrixAboutImpactbasket:attachment.data]; @@ -887,6 +912,13 @@ moveAnimation.removedOnCompletion = YES; [moveAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) { [anchorRankView removeFromSuperview]; + + self.isPlayOfB = NO; + if(self.animationListB.count > 0){ + [self.animationListB removeObjectAtIndex:0]; + } + [self playAnimationWithModel]; + }]; [anchorRankView pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"]; } @@ -904,7 +936,18 @@ } #pragma mark - 个播小时榜飘屏 -- (void)achieveKellegStundeRtowardse:(AttachmentMatrix *)attachment { +- (void)receiveAnchorHourList:(AttachmentMatrix *)attachment{ + YUMIPresentBigCaptureMatrix * captureMatrix = [YUMIPresentBigCaptureMatrix new]; + captureMatrix.data = attachment.data; + captureMatrix.type = GiftBannerType_AnchorHour; + if(self.animationListB.count == 0 && self.isPlayOfB == NO){ + [self achieveKellegStundeRtowardse:captureMatrix]; + } + [self.animationListB addObject:captureMatrix]; +} + +- (void)achieveKellegStundeRtowardse:(YUMIPresentBigCaptureMatrix *)attachment { + self.isPlayOfB = YES; YUMIChamberKellegRateOriflammeRegard *anchorRankView = [[YUMIChamberKellegRateOriflammeRegard alloc] initWithFrame:CGRectMake(KScreenWidth, kNavigationHeight + 15, KScreenWidth, 60)]; anchorRankView.kellegRateAbstract = [ChamberHalfHourRateMatrix mtowardsrixAboutImpactbasket:attachment.data]; UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(passtoApexRtowardseKellegChamber:)]; @@ -924,6 +967,14 @@ moveAnimation.duration = 0.5; moveAnimation.repeatCount = 1; moveAnimation.removedOnCompletion = YES; + [moveAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) { + [anchorRankView removeFromSuperview]; + self.isPlayOfB = NO; + if(self.animationListB.count > 0){ + [self.animationListB removeObjectAtIndex:0]; + } + [self playAnimationWithModel]; + }]; [anchorRankView pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"]; } }]; @@ -1230,57 +1281,77 @@ if (attachment.second == Custom_Message_Sub_Room_Gift_LuckBag || attachment.second == Custom_Message_Sub_Room_Gift_LuckBag_Server) { YUMIPresentBigCaptureMatrix * captureMatrix = [YUMIPresentBigCaptureMatrix mtowardsrixAboutImpactbasket:attachment.data]; captureMatrix.isInRoomVisiable = attachment.second == Custom_Message_Sub_Room_Gift_LuckBag; - [self.bigCapturePresentFormation addObject:captureMatrix]; - if (self.fortunatecaptureIntratemper == nil) { - [self inititowardseShankConsiderableCapturePresentIntrtowardsemper]; - } + captureMatrix.type = GiftBannerType_Lucky; + if(self.animationListB.count == 0 && self.isPlayOfB == NO){ + [self produceConsiderableCaptureBrectifyness:captureMatrix]; + } + [self.animationListB addObject:captureMatrix]; + } } -- (void)inititowardseShankConsiderableCapturePresentIntrtowardsemper { - NSTimeInterval period = 1.0; - dispatch_queue_t queue = dispatch_get_global_queue(0, 0); - dispatch_source_t _timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, queue); - dispatch_source_set_timer(_timer, dispatch_walltime(NULL, 0), period * NSEC_PER_SEC, 0); - @kWeakify(self); - dispatch_source_set_event_handler(_timer, ^{ - @kStrongify(self) - if (self.bigCapturePresentFormation.count > 0) { - dispatch_sync(dispatch_get_main_queue(), ^{ - if (self.isFortunatePresentBrectifyness) { - return; - } - YUMIPresentBigCaptureMatrix * captureMatrix = [self.bigCapturePresentFormation firstObject]; - [self produceConsiderableCaptureBrectifyness:captureMatrix]; - [self.bigCapturePresentFormation removeObject:captureMatrix]; - }); - }else { - dispatch_source_cancel(_timer); - self.fortunatecaptureIntratemper = nil; - } - }); - dispatch_resume(_timer); - self.fortunatecaptureIntratemper = _timer; -} - - (void)produceConsiderableCaptureBrectifyness:(YUMIPresentBigCaptureMatrix *)captureMatrix { - self.isFortunatePresentBrectifyness = YES; - YUMIChamberFortunateBigCaptureRegard * fortunatePresentImpressionRegard = [[YUMIChamberFortunateBigCaptureRegard alloc] init]; + + self.isPlayOfB = YES; + CGFloat top = self.isPlayOfA == YES ? 268 : (kNavigationHeight + 15); + YUMIChamberFortunateBigCaptureRegard * fortunatePresentImpressionRegard = [[YUMIChamberFortunateBigCaptureRegard alloc] initWithFrame:CGRectMake(KScreenWidth, top, 375, 60)]; fortunatePresentImpressionRegard.delegate = self; [self.highProttypeRegard addSubview:fortunatePresentImpressionRegard]; - [fortunatePresentImpressionRegard mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerX.mas_equalTo(self); - make.top.mas_equalTo(self).offset(kNavigationHeight + 15); - make.size.mas_equalTo(CGSizeMake(375, 60)); - }]; fortunatePresentImpressionRegard.giftInfo = captureMatrix; - [self performSelector:@selector(InthecaseoftuntowardseConsiderableCaptureBrectifynessAccomplish:) withObject:fortunatePresentImpressionRegard afterDelay:6]; + POPSpringAnimation *springAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPViewCenter]; + springAnimation.springSpeed = 12; + springAnimation.springBounciness = 10.f; + springAnimation.fromValue = [NSValue valueWithCGPoint:fortunatePresentImpressionRegard.center]; + springAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(KScreenWidth / 2, fortunatePresentImpressionRegard.center.y)]; + [springAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) { + if (finished) { + POPBasicAnimation *moveAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewCenter]; + moveAnimation.fromValue = [NSValue valueWithCGPoint:CGPointMake(KScreenWidth / 2, fortunatePresentImpressionRegard.center.y)]; + moveAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(-KScreenWidth, fortunatePresentImpressionRegard.center.y)]; + moveAnimation.beginTime = CACurrentMediaTime() + 3; + moveAnimation.duration = 0.5; + moveAnimation.repeatCount = 1; + moveAnimation.removedOnCompletion = YES; + [moveAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) { + [fortunatePresentImpressionRegard removeFromSuperview]; + if (self.animationListB.count > 0) { + [self.animationListB removeObjectAtIndex:0]; + } + self.isPlayOfB = NO; + + [self playAnimationWithModel]; + + }]; + [fortunatePresentImpressionRegard pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"]; + } + }]; + [fortunatePresentImpressionRegard pop_addAnimation:springAnimation forKey:@"nobleLevelUpspingOutAnimation"]; } -- (void)InthecaseoftuntowardseConsiderableCaptureBrectifynessAccomplish:(YUMIChamberFortunateBigCaptureRegard *)player { - [player removeFromSuperview]; - player.hidden = YES; - self.isFortunatePresentBrectifyness = NO; +-(void)playAnimationWithModel{ + + if(self.animationListB.count <= 0){ + if(self.animationListA.count > 0 && self.isPlayOfB == NO && self.isPlayOfA == NO){ + PresentAchieveAbstractMatrix * achieveMatrix = [self.animationListA firstObject]; + [self producePresentOriflammeRegardBrectifyness:achieveMatrix]; + } + return; + } + if(self.isPlayOfB == YES)return; + YUMIPresentBigCaptureMatrix *model = self.animationListB.firstObject; + if(model.type == GiftBannerType_Lucky){ + [self produceConsiderableCaptureBrectifyness:model]; + }else if (model.type == GiftBannerType_Love){ + [self produceConfectioneryTimberOriflammeBrectifyness:model]; + }else if(model.type == GiftBannerType_Nobleman){ + [self produceMagnificentPrototypeUpwardsOriflammeBrectifyness:model]; + }else if(model.type == GiftBannerType_kitchen){ + [self produceStowardselliteKitchenOriflammeBrectifyness:model]; + }else if(model.type == GiftBannerType_AnchorHour){ + [self achieveKellegStundeRtowardse:model]; + }else if(model.type == GiftBannerType_LicneseHour){ + [self achieveLicneseStundeRtowardse:model]; + } } #pragma mark - FBCChamberLuckyBigPrizeRegardRepresendtation @@ -1306,11 +1377,11 @@ if (obj.otherViewType == PresentOtherRegardGenreMp4 && obj.viewUrl && obj.viewUrl.length > 0 && roomInfor.hasAnimationEffect) { PresentAchieveAbstractMatrix * model = [[PresentAchieveAbstractMatrix alloc] init]; model.viewUrl = obj.viewUrl; - [self.presentImpressionFormation addObject:model]; + [self.animationListA addObject:model]; } else if (obj.hasVggPic && roomInfor.hasAnimationEffect) { PresentAchieveAbstractMatrix * model = [[PresentAchieveAbstractMatrix alloc] init]; model.vggUrl = obj.vggUrl; - [self.presentImpressionFormation addObject:model]; + [self.animationListA addObject:model]; } }]; } @@ -1339,40 +1410,20 @@ if (giftInfo.otherViewType == PresentOtherRegardGenreMp4 && giftInfo.viewUrl.length > 0 && roomInfor.hasAnimationEffect) { receiveInfo.viewUrl = giftInfo.viewUrl; - [self.presentImpressionFormation addObject:receiveInfo]; + [self.animationListA addObject:receiveInfo]; } else if (giftInfo.hasVggPic && giftInfo.vggUrl.length > 0 && roomInfor.hasAnimationEffect) { receiveInfo.vggUrl = giftInfo.vggUrl; - [self.presentImpressionFormation addObject:receiveInfo]; + [self.animationListA addObject:receiveInfo]; } } + if(self.animationListA.count > 0 && self.isPlayOfB == NO && self.isPlayOfA == NO){ + PresentAchieveAbstractMatrix * achieveMatrix = [self.animationListA firstObject]; + [self producePresentOriflammeRegardBrectifyness:achieveMatrix]; + } - if (self.presentImpressionIntratemper == nil && self.presentImpressionFormation.count > 0) { - [self inititowardseShankPresentImpressionIntrtowardsemper]; - } } -- (void)inititowardseShankPresentImpressionIntrtowardsemper { - NSTimeInterval period = 6.0; - dispatch_queue_t queue = dispatch_get_global_queue(0, 0); - dispatch_source_t _timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, queue); - dispatch_source_set_timer(_timer, dispatch_walltime(NULL, 0), period * NSEC_PER_SEC, 0); - @kWeakify(self); - dispatch_source_set_event_handler(_timer, ^{ - @kStrongify(self) - if (self.presentImpressionFormation.count > 0) { - dispatch_sync(dispatch_get_main_queue(), ^{ - PresentAchieveAbstractMatrix * achieveMatrix = [self.presentImpressionFormation firstObject]; - [self producePresentOriflammeRegardBrectifyness:achieveMatrix]; - [self.presentImpressionFormation removeObject:achieveMatrix]; - }); - }else { - dispatch_source_cancel(_timer); - self.presentImpressionIntratemper = nil; - } - }); - dispatch_resume(_timer); - self.presentImpressionIntratemper = _timer; -} + - (void)producePresentOriflammeRegardBrectifyness:(PresentAchieveAbstractMatrix *)receiveInfo { PresentAbstractMatrix *giftInfo = receiveInfo.gift != nil ? receiveInfo.gift : receiveInfo.giftInfo; @@ -1393,6 +1444,7 @@ }else{ [self.oriflammeDequePond removeObject:view]; } + self.isPlayOfA = YES; [self transltowardsePresentOriflammeRegard:view]; [view prohibitipositionPresentOriflamme:receiveInfo users:[self manufactureOriflammeConsumers]]; view.frame = CGRectMake(KScreenWidth, 100, KScreenWidth, 153); @@ -1451,6 +1503,19 @@ moveAnimation.duration = 0.5; moveAnimation.repeatCount = 1; moveAnimation.removedOnCompletion = YES; + [moveAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) { + if(finished){ + [view removeFromSuperview]; + self.isPlayOfA = NO; + if(self.animationListA.count > 0){ + [self.animationListA removeObjectAtIndex:0]; + } + if(self.animationListA.count > 0 && self.isPlayOfB == NO && self.isPlayOfA == NO){ + PresentAchieveAbstractMatrix * achieveMatrix = [self.animationListA firstObject]; + [self producePresentOriflammeRegardBrectifyness:achieveMatrix]; + } + } + }]; [view pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"]; } @@ -1499,7 +1564,7 @@ [self.presentImpressionRegard startAnimation]; } } failureBlock:^(NSError * _Nullable error) { - + self.presentImpressionRegard.hidden = YES; }]; } @@ -1784,19 +1849,9 @@ return _anatomiser; } -- (NSMutableArray *)presentImpressionFormation { - if (!_presentImpressionFormation) { - _presentImpressionFormation = [NSMutableArray array]; - } - return _presentImpressionFormation; -} -- (NSMutableArray *)bigCapturePresentFormation { - if (!_bigCapturePresentFormation) { - _bigCapturePresentFormation = [NSMutableArray array]; - } - return _bigCapturePresentFormation; -} + + - (NSMutableArray *)presentPingencourageFormation { if (!_presentPingencourageFormation) { @@ -1866,12 +1921,7 @@ return _presentVisibleGarment; } -- (NSMutableArray *)confectioneryTimberpresentFormation { - if (!_confectioneryTimberpresentFormation) { - _confectioneryTimberpresentFormation = [NSMutableArray array]; - } - return _confectioneryTimberpresentFormation; -} + - (NSMutableArray *)compoundPresentFormation { if (!_compoundPresentFormation) { @@ -1880,12 +1930,6 @@ return _compoundPresentFormation; } -- (NSMutableArray *)magnificentPrototypeUpwardsFormation { - if (!_magnificentPrototypeUpwardsFormation) { - _magnificentPrototypeUpwardsFormation = [NSMutableArray array]; - } - return _magnificentPrototypeUpwardsFormation; -} - (NSMutableArray *)automobileImpressionFormation { if (_automobileImpressionFormation == nil) { @@ -1977,11 +2021,17 @@ return _sequencirePresentImpressionRegard; } -- (NSMutableArray *)satelliteKitchenFormation{ - if (!_satelliteKitchenFormation){ - _satelliteKitchenFormation = [NSMutableArray array]; - } - return _satelliteKitchenFormation; -} +- (NSMutableArray *)animationListA{ + if(!_animationListA){ + _animationListA = [NSMutableArray array]; + } + return _animationListA; +} +- (NSMutableArray *)animationListB{ + if(!_animationListB){ + _animationListB = [NSMutableArray array]; + } + return _animationListB; +} @end diff --git a/YuMi/Modules/YMRoom/View/AnimationView/YUMIChamberConfectioneryPresentRegard.h b/YuMi/Modules/YMRoom/View/AnimationView/YUMIChamberConfectioneryPresentRegard.h index 0e18cd92..9c6a36a6 100644 --- a/YuMi/Modules/YMRoom/View/AnimationView/YUMIChamberConfectioneryPresentRegard.h +++ b/YuMi/Modules/YMRoom/View/AnimationView/YUMIChamberConfectioneryPresentRegard.h @@ -6,7 +6,7 @@ // #import - +#import "YUMIPresentBigCaptureMatrix.h" NS_ASSUME_NONNULL_BEGIN @interface YUMIChamberConfectioneryPresentRegard : UIView diff --git a/YuMi/Modules/YMRoom/View/AnimationView/YUMIChamberSatelliteKitchenOriflammeRegard.h b/YuMi/Modules/YMRoom/View/AnimationView/YUMIChamberSatelliteKitchenOriflammeRegard.h index fb12eb97..22e22015 100644 --- a/YuMi/Modules/YMRoom/View/AnimationView/YUMIChamberSatelliteKitchenOriflammeRegard.h +++ b/YuMi/Modules/YMRoom/View/AnimationView/YUMIChamberSatelliteKitchenOriflammeRegard.h @@ -6,20 +6,22 @@ // #import -#import "YUMIChamberSatelliteKitchenMatrix.h" +#import "YUMIPresentBigCaptureMatrix.h" + + NS_ASSUME_NONNULL_BEGIN @class YUMIChamberSatelliteKitchenOriflammeRegard; @protocol FBCChamberStarKitchenBannerRegardRepresendtation -- (void)yUMIChamberStowardselliteKitchenOriflammeRegard:(YUMIChamberSatelliteKitchenOriflammeRegard *)view didClick:(YUMIChamberSatelliteKitchenMatrix *)starMatrix; +- (void)yUMIChamberStowardselliteKitchenOriflammeRegard:(YUMIChamberSatelliteKitchenOriflammeRegard *)view didClick:(YUMIPresentBigCaptureMatrix *)starMatrix; @end @interface YUMIChamberSatelliteKitchenOriflammeRegard : UIView @property (nonatomic,assign) BOOL isSvga; -@property (nonatomic,strong) YUMIChamberSatelliteKitchenMatrix *starMatrix; +@property (nonatomic,strong) YUMIPresentBigCaptureMatrix *starMatrix; @property (nonatomic,weak) id delegate; @end diff --git a/YuMi/Modules/YMRoom/View/AnimationView/YUMIChamberSatelliteKitchenOriflammeRegard.m b/YuMi/Modules/YMRoom/View/AnimationView/YUMIChamberSatelliteKitchenOriflammeRegard.m index 2064ec8d..e9079eee 100644 --- a/YuMi/Modules/YMRoom/View/AnimationView/YUMIChamberSatelliteKitchenOriflammeRegard.m +++ b/YuMi/Modules/YMRoom/View/AnimationView/YUMIChamberSatelliteKitchenOriflammeRegard.m @@ -56,7 +56,7 @@ }]; } --(void)setStarMatrix:(YUMIChamberSatelliteKitchenMatrix *)starMatrix{ +-(void)setStarMatrix:(YUMIPresentBigCaptureMatrix *)starMatrix{ _starMatrix = starMatrix; NSString *name = _starMatrix.nick.length < 7 ? _starMatrix.nick : [NSString stringWithFormat:@"%@...",[_starMatrix.nick substringWithRange:NSMakeRange(0, 6)]]; NSString *title = [NSString stringWithFormat:YMLocalizedString(@"XPRoomStarKitchenBannerView0"),name,_starMatrix.itemMultiple,_starMatrix.diamonds]; diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/Model/PresentAchieveAbstractMatrix.h b/YuMi/Modules/YMRoom/View/SendGiftView/Model/PresentAchieveAbstractMatrix.h index 3638700c..5d951113 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/Model/PresentAchieveAbstractMatrix.h +++ b/YuMi/Modules/YMRoom/View/SendGiftView/Model/PresentAchieveAbstractMatrix.h @@ -59,6 +59,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic,assign) BOOL isLuckyBagGift; @property (nonatomic,assign) BOOL isBatch; @property (nonatomic, assign) BOOL isShowAnimation; +@property(nonatomic,copy) NSString *key; @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Network/HttpRequestFacilitater.m b/YuMi/Network/HttpRequestFacilitater.m index 2bb864cf..06fabe4e 100644 --- a/YuMi/Network/HttpRequestFacilitater.m +++ b/YuMi/Network/HttpRequestFacilitater.m @@ -33,6 +33,18 @@ return manager; } ++ (NSURLSessionDataTask * _Nullable)extracted:(void (^ _Nonnull)(NSInteger, NSString *))failure manager:(AFHTTPSessionManager *)manager method:(NSString * _Nonnull)method params:(NSDictionary * _Nonnull)params success:(void (^ _Nonnull)(BaseMatrix *))success { + return [manager GET:method parameters:params headers:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { + BaseMatrix *baseModel = [BaseMatrix mtowardsrixAboutImpactbasket:responseObject]; +#ifdef DEBUG + NSLog(@"\n%@", [baseModel toJSONBWSttr]); +#endif + success(baseModel); + } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { + [self shankNetMistake:error method:method failure:failure]; + }]; +} + + (void)GET:(NSString *)method params:(NSDictionary *)params success:(void (^)(BaseMatrix *data))success @@ -52,15 +64,7 @@ #endif AFHTTPSessionManager *manager = [HttpRequestFacilitater requisitionExecutive]; - [manager GET:method parameters:params headers:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { - BaseMatrix *baseModel = [BaseMatrix mtowardsrixAboutImpactbasket:responseObject]; -#ifdef DEBUG - NSLog(@"\n%@", [baseModel toJSONBWSttr]); -#endif - success(baseModel); - } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { - [self shankNetMistake:error method:method failure:failure]; - }]; + [self extracted:failure manager:manager method:method params:params success:success]; } + (void)POST:(NSString *)method