diff --git a/YuMi.xcodeproj/project.pbxproj b/YuMi.xcodeproj/project.pbxproj index fa36f169..73b96114 100644 --- a/YuMi.xcodeproj/project.pbxproj +++ b/YuMi.xcodeproj/project.pbxproj @@ -210,6 +210,7 @@ 235A451A2B04A352009753F5 /* PIRoomActivityWebView.m in Sources */ = {isa = PBXBuildFile; fileRef = 235A45192B04A352009753F5 /* PIRoomActivityWebView.m */; }; 235A451D2B04A452009753F5 /* PIRoomActivityWebCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 235A451C2B04A452009753F5 /* PIRoomActivityWebCell.m */; }; 235A45232B04BEB6009753F5 /* PIBaseModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 235A45222B04BEB6009753F5 /* PIBaseModel.m */; }; + 23630BA62BAC3888003AD25D /* PIGiftSuperGiftBroadcastView.m in Sources */ = {isa = PBXBuildFile; fileRef = 23630BA52BAC3888003AD25D /* PIGiftSuperGiftBroadcastView.m */; }; 236896A02AE6720600EED5F2 /* PIRoomGiftBroadcastWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 2368969F2AE6720600EED5F2 /* PIRoomGiftBroadcastWindow.m */; }; 2369F9912A89CE0E00563B48 /* PIUserSexView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2369F9902A89CE0E00563B48 /* PIUserSexView.m */; }; 2369F9932A8B21EB00563B48 /* pi_treasure_fairy_gift_bg.svga in Resources */ = {isa = PBXBuildFile; fileRef = 2369F9922A8B21EA00563B48 /* pi_treasure_fairy_gift_bg.svga */; }; @@ -908,7 +909,6 @@ E83ABF03280EC90C00322EE4 /* ContentApplicationShareModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E83ABF02280EC90C00322EE4 /* ContentApplicationShareModel.m */; }; E83ABF06280EDE2B00322EE4 /* MessageContentLevelUpgradeView.m in Sources */ = {isa = PBXBuildFile; fileRef = E83ABF05280EDE2B00322EE4 /* MessageContentLevelUpgradeView.m */; }; E83DB47A27462C4500D8CBD1 /* XPGiftBigPrizeModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E83DB47927462C4500D8CBD1 /* XPGiftBigPrizeModel.m */; }; - E83DB47D2746372300D8CBD1 /* XPRoomGiftBannerView.m in Sources */ = {isa = PBXBuildFile; fileRef = E83DB47C2746372300D8CBD1 /* XPRoomGiftBannerView.m */; }; E83DB481274649FB00D8CBD1 /* XPGiftBannerUserInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E83DB480274649FB00D8CBD1 /* XPGiftBannerUserInfoModel.m */; }; E83DB4842746661800D8CBD1 /* XPRoomGiftBroadcastView.m in Sources */ = {isa = PBXBuildFile; fileRef = E83DB4832746661800D8CBD1 /* XPRoomGiftBroadcastView.m */; }; E8412F9627795E34006E1101 /* XPRoomInviteFansView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8412F9527795E34006E1101 /* XPRoomInviteFansView.m */; }; @@ -1890,6 +1890,8 @@ 235A451C2B04A452009753F5 /* PIRoomActivityWebCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIRoomActivityWebCell.m; sourceTree = ""; }; 235A45212B04BEB6009753F5 /* PIBaseModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIBaseModel.h; sourceTree = ""; }; 235A45222B04BEB6009753F5 /* PIBaseModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIBaseModel.m; sourceTree = ""; }; + 23630BA42BAC3888003AD25D /* PIGiftSuperGiftBroadcastView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIGiftSuperGiftBroadcastView.h; sourceTree = ""; }; + 23630BA52BAC3888003AD25D /* PIGiftSuperGiftBroadcastView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIGiftSuperGiftBroadcastView.m; sourceTree = ""; }; 2368969E2AE6720600EED5F2 /* PIRoomGiftBroadcastWindow.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIRoomGiftBroadcastWindow.h; sourceTree = ""; }; 2368969F2AE6720600EED5F2 /* PIRoomGiftBroadcastWindow.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIRoomGiftBroadcastWindow.m; sourceTree = ""; }; 2369F98F2A89CE0E00563B48 /* PIUserSexView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIUserSexView.h; sourceTree = ""; }; @@ -3111,8 +3113,6 @@ E83ABF05280EDE2B00322EE4 /* MessageContentLevelUpgradeView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MessageContentLevelUpgradeView.m; sourceTree = ""; }; E83DB47827462C4500D8CBD1 /* XPGiftBigPrizeModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPGiftBigPrizeModel.h; sourceTree = ""; }; E83DB47927462C4500D8CBD1 /* XPGiftBigPrizeModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPGiftBigPrizeModel.m; sourceTree = ""; }; - E83DB47B2746372300D8CBD1 /* XPRoomGiftBannerView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomGiftBannerView.h; sourceTree = ""; }; - E83DB47C2746372300D8CBD1 /* XPRoomGiftBannerView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomGiftBannerView.m; sourceTree = ""; }; E83DB47F274649FB00D8CBD1 /* XPGiftBannerUserInfoModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPGiftBannerUserInfoModel.h; sourceTree = ""; }; E83DB480274649FB00D8CBD1 /* XPGiftBannerUserInfoModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPGiftBannerUserInfoModel.m; sourceTree = ""; }; E83DB4822746661800D8CBD1 /* XPRoomGiftBroadcastView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomGiftBroadcastView.h; sourceTree = ""; }; @@ -7497,8 +7497,6 @@ E8C21500274B76F60079E6BF /* XPRoomAnimationHitView.m */, 9B8DE0E2289CF7AA00FB6EC2 /* XPRoomGiftCompoundView.h */, 9B8DE0E3289CF7AA00FB6EC2 /* XPRoomGiftCompoundView.m */, - E83DB47B2746372300D8CBD1 /* XPRoomGiftBannerView.h */, - E83DB47C2746372300D8CBD1 /* XPRoomGiftBannerView.m */, 232C43E82AB15F4100D4B2ED /* XPRoomTarrowBannerView.h */, 232C43E92AB15F4100D4B2ED /* XPRoomTarrowBannerView.m */, E83DB4822746661800D8CBD1 /* XPRoomGiftBroadcastView.h */, @@ -8797,6 +8795,8 @@ E8901CF528B38D89001E9A92 /* XPGraffitiGiftView.m */, 9B4D449128F15765002572D5 /* XPGiftLuckyGiftBroadcastView.h */, 9B4D449228F15765002572D5 /* XPGiftLuckyGiftBroadcastView.m */, + 23630BA42BAC3888003AD25D /* PIGiftSuperGiftBroadcastView.h */, + 23630BA52BAC3888003AD25D /* PIGiftSuperGiftBroadcastView.m */, E8D4DE422940462C00EC788D /* XPGiftTwelveStarBroadcastView.h */, E8D4DE432940462C00EC788D /* XPGiftTwelveStarBroadcastView.m */, ); @@ -11252,6 +11252,7 @@ E8E70D8326F2F51A00F03460 /* XPMineHeadView.m in Sources */, E80EC81128ACD84000D133C5 /* QEmotionHelper.m in Sources */, E8EEB90C26FC5EBC007C6EBA /* XPMineUserInfoEditModel.m in Sources */, + 23630BA62BAC3888003AD25D /* PIGiftSuperGiftBroadcastView.m in Sources */, 18E7B31826F097E00064BC9B /* UserInfoModel.m in Sources */, E87DF4F22A42CBEC009C1185 /* XPHomeUserView.m in Sources */, E83ABEF6280E9AD800322EE4 /* MessageContentUnSupportView.m in Sources */, @@ -11768,7 +11769,6 @@ E8B846C526FDB41A00A777FE /* XPMineUserInfolbumPresenter.m in Sources */, 9BFB101F2897CC4300B3985E /* XPAnchorCardView.m in Sources */, 1427218F29A75F6F00C7C423 /* HTTPConnection.m in Sources */, - E83DB47D2746372300D8CBD1 /* XPRoomGiftBannerView.m in Sources */, 9BAA5FED277A1BBE007453F3 /* XPPrivacyViewController.m in Sources */, E873EB02280922720071030D /* XPMineUserInfoEmptyCollectionViewCell.m in Sources */, E872309326E8D31500B90D4F /* LoginVerifCodeView.m in Sources */, diff --git a/YuMi/Appdelegate/AppDelegate.m b/YuMi/Appdelegate/AppDelegate.m index d6d3e76b..f66a35a1 100644 --- a/YuMi/Appdelegate/AppDelegate.m +++ b/YuMi/Appdelegate/AppDelegate.m @@ -70,7 +70,11 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification; - (void) IMLSDKWillRestoreScene:(MLSDKScene *)scene Restore:(void (^)(BOOL, RestoreStyle))restoreHandler { - + NSString *inviteCode = scene.params[@"inviteCode"]; + if (inviteCode != nil && [[AccountInfoStorage instance]getUid].length == 0){ + ClientConfig *config = [ClientConfig shareConfig]; + config.inviteCode = inviteCode; + } restoreHandler(YES, MLDefault); diff --git a/YuMi/Assets.xcassets/yna/room_gift_banner_high_bg.imageset/Contents.json b/YuMi/Assets.xcassets/middle/room_gift_super_gift_icon.imageset/Contents.json similarity index 71% rename from YuMi/Assets.xcassets/yna/room_gift_banner_high_bg.imageset/Contents.json rename to YuMi/Assets.xcassets/middle/room_gift_super_gift_icon.imageset/Contents.json index 0398ce79..d78fcce4 100644 --- a/YuMi/Assets.xcassets/yna/room_gift_banner_high_bg.imageset/Contents.json +++ b/YuMi/Assets.xcassets/middle/room_gift_super_gift_icon.imageset/Contents.json @@ -5,12 +5,12 @@ "scale" : "1x" }, { - "filename" : "room_gift_banner_high_bg@2x.png", + "filename" : "room_gift_super_gift_icon@2x.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "room_gift_banner_high_bg@3x.png", + "filename" : "room_gift_super_gift_icon@3x.png", "idiom" : "universal", "scale" : "3x" } diff --git a/YuMi/Assets.xcassets/middle/room_gift_super_gift_icon.imageset/room_gift_super_gift_icon@2x.png b/YuMi/Assets.xcassets/middle/room_gift_super_gift_icon.imageset/room_gift_super_gift_icon@2x.png new file mode 100644 index 00000000..c48c9285 Binary files /dev/null and b/YuMi/Assets.xcassets/middle/room_gift_super_gift_icon.imageset/room_gift_super_gift_icon@2x.png differ diff --git a/YuMi/Assets.xcassets/middle/room_gift_super_gift_icon.imageset/room_gift_super_gift_icon@3x.png b/YuMi/Assets.xcassets/middle/room_gift_super_gift_icon.imageset/room_gift_super_gift_icon@3x.png new file mode 100644 index 00000000..d6a0f35b Binary files /dev/null and b/YuMi/Assets.xcassets/middle/room_gift_super_gift_icon.imageset/room_gift_super_gift_icon@3x.png differ diff --git a/YuMi/Assets.xcassets/yna/room_gift_banner_high_bg.imageset/room_gift_banner_high_bg@2x.png b/YuMi/Assets.xcassets/yna/room_gift_banner_high_bg.imageset/room_gift_banner_high_bg@2x.png deleted file mode 100644 index 316c58f9..00000000 Binary files a/YuMi/Assets.xcassets/yna/room_gift_banner_high_bg.imageset/room_gift_banner_high_bg@2x.png and /dev/null differ diff --git a/YuMi/Assets.xcassets/yna/room_gift_banner_high_bg.imageset/room_gift_banner_high_bg@3x.png b/YuMi/Assets.xcassets/yna/room_gift_banner_high_bg.imageset/room_gift_banner_high_bg@3x.png deleted file mode 100644 index 63fd4dd0..00000000 Binary files a/YuMi/Assets.xcassets/yna/room_gift_banner_high_bg.imageset/room_gift_banner_high_bg@3x.png and /dev/null differ diff --git a/YuMi/Assets.xcassets/yna/room_gift_banner_low_bg.imageset/Contents.json b/YuMi/Assets.xcassets/yna/room_gift_banner_low_bg.imageset/Contents.json deleted file mode 100644 index 1218342d..00000000 --- a/YuMi/Assets.xcassets/yna/room_gift_banner_low_bg.imageset/Contents.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "scale" : "1x" - }, - { - "filename" : "room_gift_banner_low_bg@2x.png", - "idiom" : "universal", - "scale" : "2x" - }, - { - "filename" : "room_gift_banner_low_bg@3x.png", - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/YuMi/Assets.xcassets/yna/room_gift_banner_low_bg.imageset/room_gift_banner_low_bg@2x.png b/YuMi/Assets.xcassets/yna/room_gift_banner_low_bg.imageset/room_gift_banner_low_bg@2x.png deleted file mode 100644 index 5913265f..00000000 Binary files a/YuMi/Assets.xcassets/yna/room_gift_banner_low_bg.imageset/room_gift_banner_low_bg@2x.png and /dev/null differ diff --git a/YuMi/Assets.xcassets/yna/room_gift_banner_low_bg.imageset/room_gift_banner_low_bg@3x.png b/YuMi/Assets.xcassets/yna/room_gift_banner_low_bg.imageset/room_gift_banner_low_bg@3x.png deleted file mode 100644 index e6cefe19..00000000 Binary files a/YuMi/Assets.xcassets/yna/room_gift_banner_low_bg.imageset/room_gift_banner_low_bg@3x.png and /dev/null differ diff --git a/YuMi/Assets.xcassets/yna/room_gift_banner_middle_bg.imageset/Contents.json b/YuMi/Assets.xcassets/yna/room_gift_banner_middle_bg.imageset/Contents.json deleted file mode 100644 index 3bf340cd..00000000 --- a/YuMi/Assets.xcassets/yna/room_gift_banner_middle_bg.imageset/Contents.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "scale" : "1x" - }, - { - "filename" : "room_gift_banner_middle_bg@2x.png", - "idiom" : "universal", - "scale" : "2x" - }, - { - "filename" : "room_gift_banner_middle_bg@3x.png", - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/YuMi/Assets.xcassets/yna/room_gift_banner_middle_bg.imageset/room_gift_banner_middle_bg@2x.png b/YuMi/Assets.xcassets/yna/room_gift_banner_middle_bg.imageset/room_gift_banner_middle_bg@2x.png deleted file mode 100644 index ed34bd43..00000000 Binary files a/YuMi/Assets.xcassets/yna/room_gift_banner_middle_bg.imageset/room_gift_banner_middle_bg@2x.png and /dev/null differ diff --git a/YuMi/Assets.xcassets/yna/room_gift_banner_middle_bg.imageset/room_gift_banner_middle_bg@3x.png b/YuMi/Assets.xcassets/yna/room_gift_banner_middle_bg.imageset/room_gift_banner_middle_bg@3x.png deleted file mode 100644 index 925fab5b..00000000 Binary files a/YuMi/Assets.xcassets/yna/room_gift_banner_middle_bg.imageset/room_gift_banner_middle_bg@3x.png and /dev/null differ diff --git a/YuMi/CustomUI/UIImageView/NetImageView.h b/YuMi/CustomUI/UIImageView/NetImageView.h index ba5f192e..dc5aa79e 100644 --- a/YuMi/CustomUI/UIImageView/NetImageView.h +++ b/YuMi/CustomUI/UIImageView/NetImageView.h @@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN -typedef void(^LoadCompletion)(UIImage *image, NSURL * url); +typedef void(^LoadCompletion)(UIImage *_Nullable image, NSURL * url); typedef NS_ENUM(NSInteger, NetImageState){ NetImageStateUnload = 1, diff --git a/YuMi/CustomUI/UIImageView/NetImageView.m b/YuMi/CustomUI/UIImageView/NetImageView.m index f7df9401..36a9462c 100644 --- a/YuMi/CustomUI/UIImageView/NetImageView.m +++ b/YuMi/CustomUI/UIImageView/NetImageView.m @@ -64,6 +64,9 @@ [self sd_setImageWithURL:[NSURL URLWithString:_innerConfigedUrl] placeholderImage:self.config.placeHolder options:SDWebImageRetryFailed completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) { if (error) { self.state = NetImageStateUnload; + if (completion) { + completion(nil, imageURL); + }; } else { self.state = NetImageStateLoaded; if (completion) { diff --git a/YuMi/Info.plist b/YuMi/Info.plist index cc8686ae..27c11125 100644 --- a/YuMi/Info.plist +++ b/YuMi/Info.plist @@ -49,7 +49,7 @@ Editor CFBundleURLSchemes - pikoApp + pikoapp @@ -96,10 +96,10 @@ NSCameraUsageDescription “Piko”需要您的同意,才可以访问进行拍照并上传您的图片,然后展示在您的个人主页上,便于他人查看 - NSLocationWhenInUseUsageDescription - “Piko”需要您的同意,才可以进行定位服务,推荐附近好友 NSLocalNetworkUsageDescription 此App将可发现和连接到您所用网络上的设备。 + NSLocationWhenInUseUsageDescription + “Piko”需要您的同意,才可以进行定位服务,推荐附近好友 NSMicrophoneUsageDescription “Piko”需要您的同意,才可以进行语音聊天 NSPhotoLibraryAddUsageDescription diff --git a/YuMi/Modules/YMMessage/Model/AttachmentModel.h b/YuMi/Modules/YMMessage/Model/AttachmentModel.h index 8e2e9e92..e3a02582 100644 --- a/YuMi/Modules/YMMessage/Model/AttachmentModel.h +++ b/YuMi/Modules/YMMessage/Model/AttachmentModel.h @@ -117,6 +117,8 @@ typedef NS_ENUM(NSUInteger, CustomMessageType) { CustomMessageType_Graffiti_Star_Kitchen = 104, ///通用飘屏 CustomMessageType_General_Floating_Screen = 105, + ///超级礼物 + CustomMessageType_Super_Gift = 106, }; @@ -642,6 +644,13 @@ typedef NS_ENUM(NSUInteger, CustomMessageTypeGeneralFloatingScreen) { Custom_Message_Sub_General_Floating_Screen_One_Room = 1051,//单房间 Custom_Message_Sub_General_Floating_Screen_All_Room = 1052,///全部房间 }; +///超级礼物 +//CustomMessageType_Super_Gift = 106, +typedef NS_ENUM(NSUInteger, CustomMessageTypeSuperGift) { + ///所有房间 + Custom_Message_Sub_Super_Gift = 1061, + +}; @interface AttachmentModel : PIBaseModel @property (nonatomic,assign) int first; @property (nonatomic,assign) int second; diff --git a/YuMi/Modules/YMRoom/View/AnimationView/XPRoomAnimationView.m b/YuMi/Modules/YMRoom/View/AnimationView/XPRoomAnimationView.m index 3c936f71..206e6c07 100644 --- a/YuMi/Modules/YMRoom/View/AnimationView/XPRoomAnimationView.m +++ b/YuMi/Modules/YMRoom/View/AnimationView/XPRoomAnimationView.m @@ -42,7 +42,7 @@ #import "RoomHalfHourRankModel.h" #import "ClientConfig.h" ///View -#import "XPRoomGiftBannerView.h" + #import "XPRoomGiftBroadcastView.h" #import "XPRoomCandyGiftView.h" #import "XPRoomDatingAnimationView.h" @@ -1991,69 +1991,6 @@ [self createGiftBroadcastViewAnimation:receiveInfo]; - // GiftInfoModel *giftInfo = receiveInfo.gift != nil ? receiveInfo.gift : receiveInfo.giftInfo; - // if (!giftInfo) { - // giftInfo = [[XPGiftStorage shareStorage] findGiftInfo: receiveInfo.giftId]; - // } - // NSInteger giftTotal = 0; - // if (receiveInfo.targetUids.count > 0) { - // giftTotal = receiveInfo.giftNum * giftInfo.goldPrice * receiveInfo.targetUids.count; - // } else { - // giftTotal = receiveInfo.giftNum * giftInfo.goldPrice; - // } - // if (giftTotal >= 520) { - // self.isPlayOfA = YES; - // __block XPRoomGiftBannerView *view = [self.bannerDequePool anyObject]; - // if (view == nil) { - // view = [[XPRoomGiftBannerView alloc] init]; - // [self.bannerVisiablePool addObject:view]; - // }else{ - // [self.bannerDequePool removeObject:view]; - // } - // [self removeGiftBannerView:view]; - // [view configGiftBanner:receiveInfo users:[self makeBannerUsers]]; - // view.frame = CGRectMake(KScreenWidth, 80, KScreenWidth, 153); - // [self.highLevleView addSubview:view]; - // POPSpringAnimation *springAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPViewCenter]; - // springAnimation.springSpeed = 12; - // springAnimation.springBounciness = 10.f; - // springAnimation.fromValue = [NSValue valueWithCGPoint:view.center]; - // springAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(view.frame.size.width / 2, view.center.y)]; - // @kWeakify(self); - // [springAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) { - // @kStrongify(self); - // if (finished) { - // [self removeAnimation:view]; - // } - // }]; - // - // [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]; - //// } - // }]; - // - // [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]; - //// } - // [self.animationListA removeObjectAtIndex:0]; - // } } - (void)largeGiftStopCarEffect:(double)goldPrice { @@ -2066,38 +2003,7 @@ } } -//移除特效动画 -- (void)removeAnimation:(XPRoomGiftBannerView *)view{ - POPBasicAnimation *moveAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewCenter]; - moveAnimation.fromValue = [NSValue valueWithCGPoint:view.center]; - moveAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(view.center.x - KScreenWidth, view.center.y)]; - moveAnimation.beginTime = CACurrentMediaTime() +5; - moveAnimation.duration = 0.5; - moveAnimation.repeatCount = 1; - moveAnimation.removedOnCompletion = YES; - moveAnimation.completionBlock = ^(POPAnimation *anim, BOOL finished) { - if(finished){ - [view removeFromSuperview]; - self.isPlayOfA = NO; - if(self.animationListA.count > 0){ - [self.animationListA removeObjectAtIndex:0]; - } - - - if(self.animationListB.count > 0){ - // self.isAnimationListAFinish = YES; - [self playAnimationWithModel]; - return; - } - if(self.animationListA.count > 0 && self.isPlayOfB == NO && self.isPlayOfA == NO){ - [self createGiftBannerViewAnimation:self.animationListA.firstObject]; - } - - - } - } ; - [view pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"]; -} + - (NSArray *)makeBannerUsers { NSArray * microArray = [self.delegate getMicroQueue].allValues; @@ -2378,16 +2284,7 @@ } -///移除横幅的veiw 添加到复用池中 -- (void)removeGiftBannerView:(XPRoomGiftBannerView *)view { - [view removeFromSuperview]; - [view resetData]; - [self.bannerVisiablePool removeObject:view]; - [self.bannerDequePool addObject:view]; - ///svga的处理 - [self.giftEffectView stopAnimation]; - self.giftEffectView.hidden = YES; -} + #pragma mark - - (void)svgaPlayerDidFinishedAnimation:(SVGAPlayer *)player { if (player == self.giftEffectView) { diff --git a/YuMi/Modules/YMRoom/View/AnimationView/XPRoomGiftBannerView.h b/YuMi/Modules/YMRoom/View/AnimationView/XPRoomGiftBannerView.h deleted file mode 100644 index ba85464c..00000000 --- a/YuMi/Modules/YMRoom/View/AnimationView/XPRoomGiftBannerView.h +++ /dev/null @@ -1,21 +0,0 @@ -// -// YMRoomGiftBannerView.h -// YUMI -// -// Created by YUMI on 2021/11/18. -// - -#import - -NS_ASSUME_NONNULL_BEGIN -@class GiftReceiveInfoModel, XPGiftBannerUserInfoModel; -@interface XPRoomGiftBannerView : UIView -///配上飘屏的数据 -- (void)configGiftBanner:(GiftReceiveInfoModel *)receiveInfo users:(NSArray *)users; -- (void)configGiftBanner:(GiftReceiveInfoModel *)receiveInfo; -///重置数据 -- (void)resetData; - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/AnimationView/XPRoomGiftBannerView.m b/YuMi/Modules/YMRoom/View/AnimationView/XPRoomGiftBannerView.m deleted file mode 100644 index 406c0d0c..00000000 --- a/YuMi/Modules/YMRoom/View/AnimationView/XPRoomGiftBannerView.m +++ /dev/null @@ -1,369 +0,0 @@ -// -// YMRoomGiftBannerView.m -// YUMI -// -// Created by YUMI on 2021/11/18. -// - -#import "XPRoomGiftBannerView.h" -///Third -#import -///Tool -#import "ThemeColor+Room.h" -///Model -#import "GiftReceiveInfoModel.h" -#import "GiftInfoModel.h" -#import "XPGiftBannerUserInfoModel.h" -///View -#import "NetImageView.h" - -@interface XPRoomAvatarNickView : UIView -/// -@property (nonatomic,strong) NetImageView *avatImageView; -/// -@property (nonatomic,strong) UILabel *nickLabel; -@end - -@implementation XPRoomAvatarNickView - -- (instancetype)initWithFrame:(CGRect)frame { - if (self = [super initWithFrame:frame]) { - [self initSubViews]; - [self initSubViewConstraints]; - } - return self; -} - -- (void)layoutSubviews { - [super layoutSubviews]; - self.avatImageView.layer.cornerRadius = self.avatImageView.bounds.size.width / 2; -} - -#pragma mark - Private Method -- (void)initSubViews { - [self addSubview:self.avatImageView]; - [self addSubview:self.nickLabel]; -} - -- (void)initSubViewConstraints { - [self mas_makeConstraints:^(MASConstraintMaker *make) { - make.bottom.mas_equalTo(self.nickLabel.mas_bottom); - }]; - - [self.avatImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.right.top.mas_equalTo(self); - make.height.mas_equalTo(self.avatImageView.mas_width); - }]; - - [self.nickLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerX.mas_equalTo(self); - make.top.mas_equalTo(self.avatImageView.mas_bottom).offset(2); - make.width.mas_lessThanOrEqualTo(80); - }]; -} - -#pragma mark - Getters And Setters -- (NetImageView *)avatImageView { - if (!_avatImageView) { - NetImageConfig * config = [[NetImageConfig alloc]init]; - config.imageType = ImageTypeUserIcon; - _avatImageView = [[NetImageView alloc] initWithConfig:config]; - _avatImageView.userInteractionEnabled = YES; - _avatImageView.layer.masksToBounds = YES; - } - return _avatImageView; -} - -- (UILabel *)nickLabel { - if (!_nickLabel) { - _nickLabel = [[UILabel alloc] init]; - _nickLabel.font = [UIFont systemFontOfSize:12]; - _nickLabel.textColor = [UIColor whiteColor]; - _nickLabel.textAlignment = NSTextAlignmentCenter; - } - return _nickLabel; -} -@end - - - -@interface XPRoomGiftBannerView () -///背景图 -@property (nonatomic,strong) UIImageView *backImageView; -///赠送 -@property (nonatomic,strong) XPRoomAvatarNickView *sendView; -///接收者 -@property (nonatomic,strong) XPRoomAvatarNickView *receiveView; -///礼物 -@property (nonatomic,strong) XPRoomAvatarNickView *giftView; -///光圈 -@property (nonatomic,strong) UIImageView *lightImageView; -///礼物的个数 -@property (nonatomic,strong) UILabel *giftCountLabel; -///赠送 -@property (nonatomic,strong) UILabel *sendLabel; -@end - - -@implementation XPRoomGiftBannerView - -- (instancetype)initWithFrame:(CGRect)frame -{ - self = [super initWithFrame:frame]; - if (self) { - [self initSubViews]; - [self initSubViewConstraints]; - } - return self; -} - -#pragma mark - Private Method -- (void)initSubViews { - [self addSubview:self.backImageView]; - - [self.backImageView addSubview:self.sendView]; - [self.backImageView addSubview:self.sendLabel]; - [self.backImageView addSubview:self.receiveView]; - [self.backImageView addSubview:self.lightImageView]; - [self.backImageView addSubview:self.giftView]; - [self.backImageView addSubview:self.giftCountLabel]; -} - -- (void)initSubViewConstraints { - [self.backImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.equalTo(self); - }]; - - [self.sendView mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.equalTo(self.backImageView).offset(49); - make.top.equalTo(self).offset(49); - make.width.mas_equalTo(40); - }]; - - [self.sendLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.equalTo(self.sendView.mas_right).offset(24); - make.centerY.equalTo(self.sendView); - }]; - - [self.receiveView mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.equalTo(self.sendLabel.mas_right).offset(24); - make.centerY.width.equalTo(self.sendView); - }]; - - [self.lightImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.equalTo(self.receiveView.mas_right).offset(4); - make.centerY.equalTo(self.sendView); - make.width.height.equalTo(@100); - }]; - - [self.giftView mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.equalTo(self.sendView); - make.center.equalTo(self.lightImageView); - }]; - - - [self.giftCountLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerY.equalTo(self.giftView); - make.right.equalTo(self.backImageView).offset(-36); - }]; -} - -- (void)startLightCircleAnimation { - CABasicAnimation * animation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"]; - animation.toValue = [NSNumber numberWithFloat: M_PI * 2.0 ]; - animation.duration = 1; - animation.cumulative = YES; - animation.repeatCount = MAXFLOAT; - [self.lightImageView.layer addAnimation:animation forKey:@"rotationAnimation"]; -} - -#pragma mark - Public Method -- (void)resetData { - self.sendView.avatImageView.image = nil; - self.sendView.nickLabel.text = nil; - self.receiveView.avatImageView.image = nil; - self.receiveView.nickLabel.text = nil; - self.giftView.avatImageView.image = nil; - self.giftView.nickLabel.text = nil; - self.giftCountLabel.text = nil; - [self.lightImageView stopAnimating]; -} -- (void)configGiftBanner:(GiftReceiveInfoModel *)receiveInfo{ - if (receiveInfo) { - [self startLightCircleAnimation]; - NSInteger giftTotal = receiveInfo.giftGolds; - GiftInfoModel *giftInfo = receiveInfo.gift; - self.sendView.avatImageView.imageUrl = receiveInfo.sendUserAvatar; - self.sendView.nickLabel.text = receiveInfo.sendUserNick; - self.receiveView.nickLabel.text = receiveInfo.recvUserNick; - self.receiveView.avatImageView.imageUrl = receiveInfo.recvUserAvatar; - self.giftView.avatImageView.imageUrl = giftInfo.giftUrl; - self.giftView.nickLabel.text = giftInfo.giftName; - - self.giftCountLabel.text = [NSString stringWithFormat:@" x %ld",receiveInfo.giftNum]; - - [self configAnimateImageByGiftTotal:giftTotal]; - } -} -- (void)configGiftBanner:(GiftReceiveInfoModel *)receiveInfo users:(NSArray *)users { - if (receiveInfo) { - [self startLightCircleAnimation]; - NSInteger giftTotal = 0; - GiftInfoModel *giftInfo = receiveInfo.gift; - self.sendView.avatImageView.imageUrl = receiveInfo.avatar ?: receiveInfo.sendUserAvatar; - self.sendView.nickLabel.text = receiveInfo.nick; - - self.giftView.avatImageView.imageUrl = giftInfo.giftUrl; - self.giftView.nickLabel.text = giftInfo.giftName; - - self.giftCountLabel.text = [NSString stringWithFormat:@" x %ld",receiveInfo.giftNum]; - /*1. 普通单人 targetUid - 2. 普通多人 targetUsers - 3. 普通全麦 targetUids - 4. 福袋 targetUid 不懂请参考此协议*/ - if (receiveInfo.targetUsers.count > 0) { - if (receiveInfo.isBatch) { // 非全麦 多人送礼 - NSString *subTitle = @""; - NSArray *targetUids = receiveInfo.targetUsers; - for (GiftReceiveUserInfoModel *targetUid in targetUids) { - NSInteger position = [self findPositionByUid:targetUid.uid users:users]; - if (position == 0) { - continue; // 收礼人已经下麦了, 则不展示 - } - position += 1; - if (subTitle.length > 0) { - subTitle = [subTitle stringByAppendingFormat:YMLocalizedString(@"XPRoomGiftBannerView0"), position]; - } else { - subTitle = [subTitle stringByAppendingFormat:YMLocalizedString(@"XPRoomGiftBannerView1"), position]; - } - } - if (receiveInfo.targetUsers.count == 1) { - self.receiveView.nickLabel.text = [receiveInfo.targetUsers firstObject].nick; - self.receiveView.avatImageView.imageUrl = [receiveInfo.targetUsers firstObject].avatar; - } else { - self.receiveView.avatImageView.image = [UIImage imageNamed:@"common_avatar"]; - self.receiveView.nickLabel.text = subTitle; - } - - giftTotal = receiveInfo.giftNum * giftInfo.goldPrice * receiveInfo.targetUsers.count; - } else { // 全麦 - self.receiveView.avatImageView.image = [UIImage imageNamed:@"common_avatar"]; - self.receiveView.nickLabel.text = YMLocalizedString(@"XPRoomGiftBannerView2"); - giftTotal = receiveInfo.giftNum * giftInfo.goldPrice * receiveInfo.targetUsers.count; - } - }else if (receiveInfo.targetUids.count > 0) {///根据协议 普通情况 - if (receiveInfo.isBatch) { - NSString *subTitle = @""; - NSArray *targetUids = receiveInfo.targetUids; - for (NSString * targetUid in targetUids) { - NSInteger position = [self findPositionByUid:targetUid.integerValue users:users]; - if (position == 0) { - continue; // 收礼人已经下麦了, 则不展示 - } - position+= 1; - if (subTitle.length > 0) { - subTitle = [subTitle stringByAppendingFormat:YMLocalizedString(@"XPRoomGiftBannerView3"), position]; - } else { - subTitle = [subTitle stringByAppendingFormat:YMLocalizedString(@"XPRoomGiftBannerView4"), position]; - } - } - self.receiveView.avatImageView.image = [UIImage imageNamed:@"common_avatar"]; - self.receiveView.nickLabel.text = subTitle; - giftTotal = receiveInfo.giftNum * giftInfo.goldPrice * receiveInfo.targetUids.count; - } else { // 全麦 - self.receiveView.avatImageView.image = [UIImage imageNamed:@"common_avatar"]; - self.receiveView.nickLabel.text = YMLocalizedString(@"XPRoomGiftBannerView5"); - giftTotal = receiveInfo.giftNum * giftInfo.goldPrice * receiveInfo.targetUids.count; - } - }else { - self.receiveView.avatImageView.imageUrl = receiveInfo.targetAvatar; - self.receiveView.nickLabel.text = receiveInfo.targetNick; - giftTotal = receiveInfo.giftNum * giftInfo.goldPrice; - } - [self configAnimateImageByGiftTotal:giftTotal]; - } -} - -- (void)configAnimateImageByGiftTotal:(NSInteger)giftTotal { - if (giftTotal >= 520 && giftTotal < 4999) { - self.backImageView.image = [UIImage imageNamed:@"room_gift_banner_low_bg"]; - }else if (giftTotal >= 4999 && giftTotal < 9999) { - self.backImageView.image = [UIImage imageNamed:@"room_gift_banner_middle_bg"]; - }else if (giftTotal >= 9999) { - self.backImageView.image = [UIImage imageNamed:@"room_gift_banner_high_bg"]; - } -} - - -- (int)findPositionByUid:(NSInteger)uid users:(NSArray *)users{ - if (uid > 0) { - for (XPGiftBannerUserInfoModel *userInfo in users) { - if (userInfo.uid == uid) { - return userInfo.position; - } - } - } - return 0; -} -#pragma mark - Getters And Setters - - -- (UIImageView *)backImageView { - if (!_backImageView) { - _backImageView = [[UIImageView alloc] init]; - _backImageView.userInteractionEnabled = YES; - } - return _backImageView; -} - -- (XPRoomAvatarNickView *)sendView { - if (!_sendView) { - _sendView = [[XPRoomAvatarNickView alloc] init]; - } - return _sendView; -} - -- (XPRoomAvatarNickView *)receiveView { - if (!_receiveView) { - _receiveView = [[XPRoomAvatarNickView alloc] init]; - } - return _receiveView; -} - -- (XPRoomAvatarNickView *)giftView { - if (!_giftView) { - _giftView = [[XPRoomAvatarNickView alloc] init]; - } - return _giftView; -} - -- (UILabel *)sendLabel { - if (!_sendLabel) { - _sendLabel = [[UILabel alloc] init]; - _sendLabel.text = YMLocalizedString(@"XPRoomGiftBannerView6"); - _sendLabel.font = [UIFont systemFontOfSize:12]; - _sendLabel.textColor = [UIColor whiteColor]; - } - return _sendLabel; -} - -- (UIImageView *)lightImageView { - if (!_lightImageView) { - _lightImageView = [[UIImageView alloc] init]; - _lightImageView.userInteractionEnabled = YES; - _lightImageView.image = [UIImage imageNamed:@"room_gift_banner_light"]; - } - return _lightImageView; -} - -- (UILabel *)giftCountLabel { - if (!_giftCountLabel) { - _giftCountLabel = [[UILabel alloc] init]; - _giftCountLabel.font = [UIFont systemFontOfSize:20.f weight:UIFontWeightBold]; - _giftCountLabel.textColor = [DJDKMIMOMColor animationGiftNumberColor]; - } - return _giftCountLabel; -} - - -@end diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m b/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m index 85babdc7..3afa48ac 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m @@ -114,7 +114,6 @@ XPMessageRemoteExtModel * model = [XPMessageRemoteExtModel modelWithJSON:message.remoteExt[message.from]]; messageInfo.bubbleImageUrl = [self parseMessageBubble:message]; int first = attachment.first; - int second = attachment.second; if (first == CustomMessageType_Gift) {///单人送 return [self createSendGiftAttribute:attachment sendInfo:model messageInfo:messageInfo]; } else if(first == CustomMessageType_AllMicroSend) {///全麦送 多人送 @@ -183,7 +182,10 @@ return [self createGuardianPlanetAttribute:attachment messageInfo:messageInfo]; }else if(first == CustomMessageType_General_Public_Screen){ return [self createGeneralPublicScreenAttribute:attachment messageInfo:messageInfo]; + }else if(first == CustomMessageType_Super_Gift){ + return [self createGeneralPublicScreenAttribute:attachment messageInfo:messageInfo]; } + return nil; } @@ -479,7 +481,9 @@ if(subTextDic.allKeys.count > 0){ NSString *subText = subTextDic[@"zh-CHT"] == nil ? subTextDic[subTextDic.allKeys.firstObject] : subTextDic[@"zh-CHT"]; NSAttributedString *attText = [[NSAttributedString alloc]initWithString:subText attributes:@{NSForegroundColorAttributeName:[DJDKMIMOMColor colorWithHexString:model.textColor]}]; - [attribute replaceCharactersInRange:[attribute.string rangeOfString:[NSString stringWithFormat:@"{%@}",model.key]] withAttributedString:attText]; + if ([attribute.string containsString:[NSString stringWithFormat:@"{%@}",model.key]]){ + [attribute replaceCharactersInRange:[attribute.string rangeOfString:[NSString stringWithFormat:@"{%@}",model.key]] withAttributedString:attText]; + } @kWeakify(self) [attribute yy_setTextHighlightRange:[attribute.string rangeOfString:subText] color:nil backgroundColor:nil tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) { @@ -494,7 +498,10 @@ }else if ([model.type isEqualToString:@"IMAGE"]){ NSMutableAttributedString *attImage = [self createUrlImageAttribute:model.image size:CGSizeMake(model.width, model.height)]; [attImage appendAttributedString:[self createSapceAttribute:2]]; - [attribute replaceCharactersInRange:[attribute.string rangeOfString:[NSString stringWithFormat:@"{%@}",model.key]] withAttributedString:attImage]; + if ([attribute.string containsString:[NSString stringWithFormat:@"{%@}",model.key]]){ + [attribute replaceCharactersInRange:[attribute.string rangeOfString:[NSString stringWithFormat:@"{%@}",model.key]] withAttributedString:attImage]; + } + } } messageInfo.content = attribute; @@ -1042,6 +1049,8 @@ if (giftInfo == nil) { giftInfo = [[XPGiftStorage shareStorage] findGiftInfo:info.giftId]; } + + ///官方新用户 [attribute appendAttributedString:[self createOfficalAndNewuserAttribute:sendInfo.defUser newUser:sendInfo.newUser fromSayHelloChannel:sendInfo.fromSayHelloChannel]]; //nick diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.m b/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.m index de0b3285..bd0d2a94 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.m @@ -33,6 +33,8 @@ #import "RoomSailingPrizeModel.h" #import "UserInfoModel.h" #import "XPMessageInfoModel.h" +#import "GiftReceiveInfoModel.h" +#import "XPGiftStorage.h" ///View #import "XPRoomMessageTableViewCell.h" #import "XPRoomMessageHeaderView.h" @@ -392,7 +394,26 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; } } + GiftReceiveInfoModel *info = [GiftReceiveInfoModel modelWithJSON:attachment.data]; + GiftInfoModel *giftInfo = info.gift == nil ? info.giftInfo : info.gift; + if (giftInfo == nil) { + giftInfo = [[XPGiftStorage shareStorage] findGiftInfo:info.giftId]; + } + if (giftInfo.giftType == GiftType_super){ + return NO; + } + }else if(attachment.first == CustomMessageType_AllMicroSend){ + GiftReceiveInfoModel *info = [GiftReceiveInfoModel modelWithJSON:attachment.data]; + GiftInfoModel *giftInfo = info.gift == nil ? info.giftInfo : info.gift; + if (giftInfo == nil) { + giftInfo = [[XPGiftStorage shareStorage] findGiftInfo:info.giftId]; + } + if (giftInfo.giftType == GiftType_super){ + return NO; + } } + + return [[[self supportMessageDic] objectForKey:@(attachment.first)] containsObject:@(attachment.second)]; } return NO; @@ -538,6 +559,10 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; @(Custom_Message_Sub_General_Public_Screen_One_Room), @(Custom_Message_Sub_General_Public_Screen_All_Room), nil], + @(CustomMessageType_Super_Gift): + [NSSet setWithObjects: + @(Custom_Message_Sub_Super_Gift), + nil], }; } diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/Api/Api+Gift.m b/YuMi/Modules/YMRoom/View/SendGiftView/Api/Api+Gift.m index fd65fa30..5481e88b 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/Api/Api+Gift.m +++ b/YuMi/Modules/YMRoom/View/SendGiftView/Api/Api+Gift.m @@ -23,8 +23,8 @@ /// @param complection 完成 /// @param roomUid 房间的roomuid + (void)requestNormalGiftList:(HttpRequestHelperCompletion)complection roomUid:(NSString *)roomUid { - NSString * fang = [NSString stringFromBase64String:@"Z2lmdC9saXN0VjQ="];///gift/listV4 - [self makeRequest:fang method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__, roomUid, nil]; + + [self makeRequest:@"gift/listV5" method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__, roomUid, nil]; } /// 请求缓存列表 /// @param complection 完成 diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/Model/GiftInfoModel.h b/YuMi/Modules/YMRoom/View/SendGiftView/Model/GiftInfoModel.h index 6b2a5fb9..aa430de4 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/Model/GiftInfoModel.h +++ b/YuMi/Modules/YMRoom/View/SendGiftView/Model/GiftInfoModel.h @@ -21,6 +21,7 @@ typedef NS_ENUM(NSUInteger, GiftType) { GiftType_Anchor = 11, //个播礼物 GiftType_Punish = 12, //惩罚礼物 GiftType_Twelve_Star = 13, //星座礼物 + GiftType_super = 16, //超级礼物 }; //礼物类型 @@ -119,6 +120,9 @@ typedef NS_ENUM(NSUInteger, RoomSendGiftType) { ///上周对应礼物豪气榜第一 @property (nonatomic, strong) XPWeekStarRankUserModel *firstLevelRankUser; @property (nonatomic,assign) BOOL isEmpty; +//超级幸运礼物新增字段 +@property(nonatomic,copy) NSString *bannerUrl; +@property(nonatomic,copy) NSString *skipUrl; @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/Presenter/XPGiftPresenter.m b/YuMi/Modules/YMRoom/View/SendGiftView/Presenter/XPGiftPresenter.m index 9e6f4b7a..4167e169 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/Presenter/XPGiftPresenter.m +++ b/YuMi/Modules/YMRoom/View/SendGiftView/Presenter/XPGiftPresenter.m @@ -58,7 +58,7 @@ [[self getView] getNormalGiftListSuccess:arrary]; } [Api requestNormalGiftList:[self createHttpCompletion:^(BaseModel * _Nonnull data) { - NSArray *luckyBagGift = [GiftInfoModel modelsWithArray:data.data[@"luckyBagGift"]]; // 福袋礼物 + NSArray *luckyBagGift = [GiftInfoModel modelsWithArray:data.data[@"luckyGift"]]; // 福袋礼物 NSArray *vipGift = [GiftInfoModel modelsWithArray:data.data[@"vipGift"]]; // 贵族礼物 NSArray *luckyPoolGift = [GiftInfoModel modelsWithArray:data.data[@"luckyPoolGift"]];// 福袋奖池礼物 NSArray *normalGift = [GiftInfoModel modelsWithArray:data.data[@"normalGift"]]; // 普通面板礼物 diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/View/Cell/XPGiftItemCollectionViewCell.m b/YuMi/Modules/YMRoom/View/SendGiftView/View/Cell/XPGiftItemCollectionViewCell.m index fdd92b4f..14a74203 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/View/Cell/XPGiftItemCollectionViewCell.m +++ b/YuMi/Modules/YMRoom/View/SendGiftView/View/Cell/XPGiftItemCollectionViewCell.m @@ -43,7 +43,8 @@ @property (nonatomic, strong) NetImageView *nobleIconImageView; ///贵族礼物锁 @property (nonatomic, strong) UIImageView *lockImageView; - +///超级礼物icon +@property(nonatomic,strong) UIImageView *superGiftView; @end @implementation XPGiftItemCollectionViewCell @@ -67,6 +68,7 @@ [self.contentView addSubview:self.giftNumLabel]; [self.contentView addSubview:self.lockImageView]; [self.contentView addSubview:self.tagStackView]; + [self.contentView addSubview:self.superGiftView]; [self.tagStackView addArrangedSubview:self.nobleIconImageView]; [self.tagStackView addArrangedSubview:self.exclusiveImageView]; @@ -135,6 +137,12 @@ make.right.bottom.mas_equalTo(self.contentView).mas_offset(-4); make.width.height.mas_equalTo(16); }]; + [self.superGiftView mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(46); + make.height.mas_equalTo(12); + make.left.mas_equalTo(10); + make.bottom.equalTo(self.giftImageView.mas_bottom); + }]; } - (UIImageView *)createImageView:(NSString *)imageName { @@ -182,6 +190,10 @@ self.nobleIconImageView.hidden = YES; self.lockImageView.hidden = YES; } + _superGiftView.hidden = YES; + if (giftInfo.giftType == GiftType_super){ + _superGiftView.hidden = NO; + } } } @@ -314,5 +326,12 @@ } return _lockImageView; } - +- (UIImageView *)superGiftView{ + if(!_superGiftView){ + _superGiftView = [UIImageView new]; + _superGiftView.image = kImage(@"room_gift_super_gift_icon"); + _superGiftView.hidden = YES; + } + return _superGiftView; +} @end diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/View/PIGiftInfoSegmentedView.m b/YuMi/Modules/YMRoom/View/SendGiftView/View/PIGiftInfoSegmentedView.m index 0c6c8d2a..b36a298d 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/View/PIGiftInfoSegmentedView.m +++ b/YuMi/Modules/YMRoom/View/SendGiftView/View/PIGiftInfoSegmentedView.m @@ -227,7 +227,7 @@ NSMutableArray * nobleArray = [NSMutableArray array]; NSMutableArray * anchorArray = [NSMutableArray array]; [_normalOriginArray enumerateObjectsUsingBlock:^(GiftInfoModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { - if (obj.giftType == GiftType_Lucky) { + if (obj.giftType == GiftType_Lucky || obj.giftType == GiftType_super) { [luckyArray addObject:obj]; } else if(obj.giftType == GiftType_Game) { [normaleArray addObject:obj]; diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/View/PIGiftSuperGiftBroadcastView.h b/YuMi/Modules/YMRoom/View/SendGiftView/View/PIGiftSuperGiftBroadcastView.h new file mode 100644 index 00000000..bbe0212a --- /dev/null +++ b/YuMi/Modules/YMRoom/View/SendGiftView/View/PIGiftSuperGiftBroadcastView.h @@ -0,0 +1,22 @@ +// +// PIGiftSuperGiftBroadcastView.h +// YuMi +// +// Created by duoban on 2024/3/21. +// + +#import +#import "GiftInfoModel.h" +NS_ASSUME_NONNULL_BEGIN +@protocol PIGiftSuperGiftBroadcastViewDelegate + +///点击了玩法说明 +- (void)pIGiftSuperGiftBroadcastViewClickWithModel:(GiftInfoModel *)giftModel; + +@end +@interface PIGiftSuperGiftBroadcastView : UIView +@property(nonatomic,strong) GiftInfoModel *giftModel; +@property(nonatomic,weak) iddelegate; +@end + +NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/View/PIGiftSuperGiftBroadcastView.m b/YuMi/Modules/YMRoom/View/SendGiftView/View/PIGiftSuperGiftBroadcastView.m new file mode 100644 index 00000000..a5d879c1 --- /dev/null +++ b/YuMi/Modules/YMRoom/View/SendGiftView/View/PIGiftSuperGiftBroadcastView.m @@ -0,0 +1,60 @@ +// +// PIGiftSuperGiftBroadcastView.m +// YuMi +// +// Created by duoban on 2024/3/21. +// + +#import "PIGiftSuperGiftBroadcastView.h" +@interface PIGiftSuperGiftBroadcastView() +@property(nonatomic,strong) NetImageView *bgImageView; +@property(nonatomic,strong) UIButton *clickBtn; +@end +@implementation PIGiftSuperGiftBroadcastView + +-(instancetype)initWithFrame:(CGRect)frame{ + self = [super initWithFrame:frame]; + if(self){ + [self installUI]; + [self installConstraints]; + } + return self; +} +-(void)installUI{ + [self addSubview:self.bgImageView]; + [self addSubview:self.clickBtn]; +} +-(void)installConstraints{ + [self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.equalTo(self); + }]; + [self.clickBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.equalTo(self); + }]; +} +-(void)setGiftModel:(GiftInfoModel *)giftModel{ + _giftModel = giftModel; + _bgImageView.imageUrl = _giftModel.bannerUrl; +} +-(void)clickBtnAction{ + if (self.delegate && [self.delegate respondsToSelector:@selector(pIGiftSuperGiftBroadcastViewClickWithModel:)]){ + [self.delegate pIGiftSuperGiftBroadcastViewClickWithModel:self.giftModel]; + } +} +#pragma mark - 懒加载 +- (NetImageView *)bgImageView{ + if(!_bgImageView){ + _bgImageView = [NetImageView new]; + _bgImageView.userInteractionEnabled = YES; + } + return _bgImageView; +} +- (UIButton *)clickBtn{ + if(!_clickBtn){ + _clickBtn = [UIButton new]; + [_clickBtn addTarget:self action:@selector(clickBtnAction) forControlEvents:UIControlEventTouchUpInside]; + } + return _clickBtn; +} + +@end diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/View/XPSendGiftView.m b/YuMi/Modules/YMRoom/View/SendGiftView/View/XPSendGiftView.m index 8d6ed40f..2a04a76d 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/View/XPSendGiftView.m +++ b/YuMi/Modules/YMRoom/View/SendGiftView/View/XPSendGiftView.m @@ -46,10 +46,11 @@ #import "XPMineRechargeViewController.h" #import "XPIAPRechargeViewController.h" #import "XPWebViewController.h" +#import "PIGiftSuperGiftBroadcastView.h" UIKIT_EXTERN NSString * const kFreeGiftCountdownNotification; UIKIT_EXTERN NSString * kShowFirstRechargeView; -@interface XPSendGiftView ()< XPGiftBarViewDelegate, XPGiftProtocol, XPGraffitiGiftViewDelegate, XPGiftUsersViewDelegate, XPGiftHeadTypeViewDelegate, XPGiftLuckyGiftBroadcastViewDelegate, XPGiftTwelveStarBroadcastViewDelegate,PIGiftInfoSegmentedViewDelegate> +@interface XPSendGiftView ()< XPGiftBarViewDelegate, XPGiftProtocol, XPGraffitiGiftViewDelegate, XPGiftUsersViewDelegate, XPGiftHeadTypeViewDelegate, XPGiftLuckyGiftBroadcastViewDelegate, XPGiftTwelveStarBroadcastViewDelegate,PIGiftInfoSegmentedViewDelegate,PIGiftSuperGiftBroadcastViewDelegate> ///顶部的区域 @property (nonatomic,strong) UIView * topView; ///内容区域 @@ -62,6 +63,9 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; @property (nonatomic, strong) XPGiftLuckyGiftBroadcastView *luckyBroadcastView; ///星座礼物广播 @property (nonatomic, strong) XPGiftTwelveStarBroadcastView *constellationBanner; + +///超级礼物 +@property(nonatomic,strong) PIGiftSuperGiftBroadcastView *superGiftView; ///礼物类型(普通/互动) @property (nonatomic, strong) XPGiftHeadTypeView *headTypeView; ///送礼物的人 @@ -475,7 +479,12 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; webView.url = giftExplainUrl; [TTPopup popupView:webView style:TTPopupStyleActionSheet]; } - +#pragma mark - PIGiftSuperGiftBroadcastViewDelegate +- (void)pIGiftSuperGiftBroadcastViewClickWithModel:(GiftInfoModel *)giftModel{ + XPRoomHalfWebView * webView = [[XPRoomHalfWebView alloc] init]; + webView.url = giftModel.skipUrl; + [TTPopup popupView:webView style:TTPopupStyleActionSheet]; +} #pragma mark - XPGiftWeekStarBroadcastViewDelegate ///点击了周星榜入口 - (void)xPGiftWeekStarBroadcastViewWeekStarClick { @@ -506,6 +515,7 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; ///点击了礼物 - (void)xPGiftHeadTypeViewDidClickGift:(XPGiftHeadTypeView *)view { [self.luckyBroadcastView removeFromSuperview]; + [self.superGiftView removeFromSuperview]; // [self.giftInfoView giftHeadTypeHadChange:1]; if (!self.graffitiView.hidden) {//清空涂鸦礼物 [self.graffitiView clearData]; @@ -519,6 +529,7 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; ///点击了互动 - (void)xPGiftHeadTypeViewDidClickInteraction:(XPGiftHeadTypeView *)view { [self.luckyBroadcastView removeFromSuperview]; + [self.superGiftView removeFromSuperview]; // [self.giftInfoView giftHeadTypeHadChange:2]; } @@ -530,16 +541,31 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; self.giftBarView.drawGiftCount = 10; if (type == GiftSegmentType_Lucky) { [self.constellationBanner removeFromSuperview]; - if (!self.luckyBroadcastView.superview) { - [self.view addSubview:self.luckyBroadcastView]; - [self.luckyBroadcastView mas_makeConstraints:^(MASConstraintMaker *make) { - make.bottom.mas_equalTo(self.contentView.mas_top); - make.left.right.mas_equalTo(0); - make.height.mas_equalTo(kGetScaleWidth(56)); - }]; + if (view.lastSelectGift.giftType == GiftType_super){ + [self.luckyBroadcastView removeFromSuperview]; + if (!self.superGiftView.superview) { + [self.view addSubview:self.superGiftView]; + [self.superGiftView mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.mas_equalTo(self.contentView.mas_top); + make.left.right.mas_equalTo(0); + make.height.mas_equalTo(kGetScaleWidth(90)); + }]; + } + }else{ + [self.superGiftView removeFromSuperview]; + if (!self.luckyBroadcastView.superview) { + [self.view addSubview:self.luckyBroadcastView]; + [self.luckyBroadcastView mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.mas_equalTo(self.contentView.mas_top); + make.left.right.mas_equalTo(0); + make.height.mas_equalTo(kGetScaleWidth(56)); + }]; + } } + } else if(type == GiftSegmentType_WeekStar) { [self.luckyBroadcastView removeFromSuperview]; + [self.superGiftView removeFromSuperview]; if (!self.constellationBanner.superview) { [self.view addSubview:self.constellationBanner]; [self.constellationBanner mas_makeConstraints:^(MASConstraintMaker *make) { @@ -549,6 +575,7 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; }]; } } else { + [self.superGiftView removeFromSuperview]; [self.luckyBroadcastView removeFromSuperview]; [self.constellationBanner removeFromSuperview]; } @@ -556,7 +583,32 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; ///点击了某个item - (void)pIGiftInfoSegmentedView:(PIGiftInfoSegmentedView *)view didClickItem:(GiftInfoModel *)info type:(GiftSegmentType)type{ - if (type == GiftSegmentType_Graffiti) { + if (type == GiftSegmentType_Lucky){ + [self.constellationBanner removeFromSuperview]; + if (info.giftType == GiftType_super){ + [self.luckyBroadcastView removeFromSuperview]; + if (!self.superGiftView.superview) { + self.superGiftView.giftModel = info; + [self.view addSubview:self.superGiftView]; + [self.superGiftView mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.mas_equalTo(self.contentView.mas_top); + make.left.right.mas_equalTo(0); + make.height.mas_equalTo(kGetScaleWidth(90)); + }]; + } + }else{ + [self.superGiftView removeFromSuperview]; + if (!self.luckyBroadcastView.superview) { + [self.view addSubview:self.luckyBroadcastView]; + [self.luckyBroadcastView mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.mas_equalTo(self.contentView.mas_top); + make.left.right.mas_equalTo(0); + make.height.mas_equalTo(kGetScaleWidth(56)); + }]; + } + } + + }else if (type == GiftSegmentType_Graffiti) { self.giftInfoView.hidden = YES; self.graffitiView.hidden = NO; self.graffitiView.price = info.goldPrice; @@ -876,5 +928,11 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; } return _effectView; } - +- (PIGiftSuperGiftBroadcastView *)superGiftView{ + if(!_superGiftView){ + _superGiftView = [[PIGiftSuperGiftBroadcastView alloc]initWithFrame:CGRectZero]; + _superGiftView.delegate = self; + } + return _superGiftView; +} @end diff --git a/YuMi/Modules/YMRoom/View/XPRoomViewController.m b/YuMi/Modules/YMRoom/View/XPRoomViewController.m index 811fcd94..c63412f9 100644 --- a/YuMi/Modules/YMRoom/View/XPRoomViewController.m +++ b/YuMi/Modules/YMRoom/View/XPRoomViewController.m @@ -1678,6 +1678,8 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 isHave = YES; }else if(attachment.first == CustomMessageType_Guardian_Planet && attachment.second == Custom_Message_Sub_Guardian_Planet_All_Room){ isHave = YES; + }else if(attachment.first == CustomMessageType_Super_Gift && attachment.second == Custom_Message_Sub_Super_Gift){ + isHave = YES; }else if(attachment.first == CustomMessageType_General_Public_Screen && attachment.second == Custom_Message_Sub_General_Public_Screen_All_Room){ isHave = YES; }else if (attachment.first == CustomMessageType_Treasure_Fairy && (attachment.second == Custom_Message_Sub_Treasure_Fairy_Draw_Gift_L4 || attachment.second == Custom_Message_Sub_Treasure_Fairy_Draw_Gift_L5 || attachment.second == Custom_Message_Sub_Treasure_Fairy_Convert_L1 || attachment.second == Custom_Message_Sub_Treasure_Fairy_Convert_L2 || attachment.second == Custom_Message_Sub_Treasure_Fairy_Convert_L3)) { //夺宝精灵 diff --git a/YuMi/Modules/YMTabbar/View/PIFullScreenBannerAnimation.m b/YuMi/Modules/YMTabbar/View/PIFullScreenBannerAnimation.m index e2ef0070..e8f400ae 100644 --- a/YuMi/Modules/YMTabbar/View/PIFullScreenBannerAnimation.m +++ b/YuMi/Modules/YMTabbar/View/PIFullScreenBannerAnimation.m @@ -40,7 +40,7 @@ #import "RoomHalfHourRankModel.h" #import "ClientConfig.h" ///View -#import "XPRoomGiftBannerView.h" + #import "XPRoomGiftBroadcastView.h" #import "XPRoomCandyGiftView.h" #import "XPRoomDatingAnimationView.h" @@ -255,11 +255,26 @@ bannerView = [[PIUniversalBannerView alloc]initWithFrame:CGRectMake(0, top, model.resourceWidth, model.resourceHeight) ]; [self showGeneralFloatingScreenView:bannerView model:model]; } failureBlock:^(NSError * _Nonnull error) { - + [bannerView removeFromSuperview]; + self.isPlayOfB = NO; + if(self.animationListB.count > 0){ + [self.animationListB removeObjectAtIndex:0]; + } + [self playAnimationWithModel]; }]; + }else{ NetImageView *imageView = [NetImageView new]; [imageView loadImageWithUrl:model.resourceContent completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) { + if (image == nil){ + [bannerView removeFromSuperview]; + self.isPlayOfB = NO; + if(self.animationListB.count > 0){ + [self.animationListB removeObjectAtIndex:0]; + } + [self playAnimationWithModel]; + return; + } model.image = image; CGFloat width = image.size.width <= 0 ? kGetScaleWidth(60) : image.size.width; CGFloat height = image.size.height ; diff --git a/YuMi/zh-Hans.lproj/Localizable.strings b/YuMi/zh-Hans.lproj/Localizable.strings index f2fc073c..a43e150c 100644 --- a/YuMi/zh-Hans.lproj/Localizable.strings +++ b/YuMi/zh-Hans.lproj/Localizable.strings @@ -1612,13 +1612,7 @@ "XPRoomAnimationView0" = "【%@】进入了房间"; -"XPRoomGiftBannerView0" = ",%ld麦"; -"XPRoomGiftBannerView1" = "%ld麦"; -"XPRoomGiftBannerView2" = "全麦"; -"XPRoomGiftBannerView3" = ",%ld麦"; -"XPRoomGiftBannerView4" = "%ld麦"; -"XPRoomGiftBannerView5" = "全麦"; -"XPRoomGiftBannerView6" = "赠送"; + "XPRoomYearActivityView0" = "送给"; diff --git a/YuMi/zh-Hant.lproj/Localizable.strings b/YuMi/zh-Hant.lproj/Localizable.strings index 779ddf6a..f0c2cf0a 100644 --- a/YuMi/zh-Hant.lproj/Localizable.strings +++ b/YuMi/zh-Hant.lproj/Localizable.strings @@ -1612,13 +1612,7 @@ "XPRoomAnimationView0" = "【%@】進入了房間"; -"XPRoomGiftBannerView0" = ",%ld麥"; -"XPRoomGiftBannerView1" = "%ld麥"; -"XPRoomGiftBannerView2" = "全麥"; -"XPRoomGiftBannerView3" = ",%ld麥"; -"XPRoomGiftBannerView4" = "%ld麥"; -"XPRoomGiftBannerView5" = "全麥"; -"XPRoomGiftBannerView6" = "贈送"; + "XPRoomYearActivityView0" = "送給";