From 6cbf6c55ca26b31cf77ced34e8d9df359fec2dcf Mon Sep 17 00:00:00 2001 From: liyuhua <15626451870@163.com> Date: Wed, 21 Feb 2024 10:18:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E9=80=81=E5=8F=8A=E6=88=BF=E9=97=B4?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E4=BD=8D=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- YuMi.xcodeproj/project.pbxproj | 22 +- .../xcshareddata/xcschemes/YuMi.xcscheme | 2 +- YuMi/Appdelegate/AppDelegate+ThirdConfig.m | 27 ++ YuMi/Appdelegate/AppDelegate.m | 33 +- .../Contents.json | 22 ++ .../pi_room_activity_click_arrow@2x.png | Bin 0 -> 297 bytes .../pi_room_activity_click_arrow@3x.png | Bin 0 -> 394 bytes .../Contents.json | 22 ++ .../pi_room_activity_choose_play_arrow@2x.png | Bin 0 -> 296 bytes .../pi_room_activity_choose_play_arrow@3x.png | Bin 0 -> 397 bytes .../VagueImageView/UIImage+ImageEffects.h | 3 +- .../VagueImageView/UIImage+ImageEffects.m | 31 ++ YuMi/Global/YUMIMacroUitls.h | 2 +- .../Modules/YMMessage/Model/AttachmentModel.h | 8 + .../Session/Content/MessageContentTweetView.m | 2 +- .../View/Session/SessionViewController.m | 16 +- .../Guild/View/XPMineGuildViewController.m | 33 +- .../YMNewHome/View/XPNewHomeViewController.m | 3 +- YuMi/Modules/YMRoom/Api/Api+Room.h | 6 +- YuMi/Modules/YMRoom/Api/Api+Room.m | 12 +- YuMi/Modules/YMRoom/Model/ActivityInfoModel.h | 3 + .../PIRoomActivityChoosePlayCell.h | 16 + .../PIRoomActivityChoosePlayCell.m | 47 +++ .../PIRoomActivityChoosePlayView.h | 25 ++ .../PIRoomActivityChoosePlayView.m | 115 ++++++ .../PIRoomActivityClickView.h | 25 ++ .../PIRoomActivityClickView.m | 94 +++++ .../XPRoomActivityContainerView.m | 367 +++++++++--------- .../Tool/XPRoomMessageParser.m | 20 + .../View/PIRoomMessagePhotoAlbumView.m | 33 +- .../XPRoomMessageContainerView.m | 7 +- YuMi/Modules/YMRoom/View/RoomHostDelegate.h | 1 + .../View/Cell/PIRoomPhotoAlbumItemCell.m | 33 +- .../YMRoom/View/XPRoomViewController.m | 21 +- YuMi/Structure/PrefixHeader.pch | 2 +- YuMi/Tools/YYUtility/YYUtility+App.m | 2 +- YuMi/zh-Hans.lproj/Localizable.strings | 1 + YuMi/zh-Hant.lproj/Localizable.strings | 1 + 38 files changed, 753 insertions(+), 304 deletions(-) create mode 100644 YuMi/Assets.xcassets/yna/Activity/pi_room_activity_click_arrow.imageset/Contents.json create mode 100644 YuMi/Assets.xcassets/yna/Activity/pi_room_activity_click_arrow.imageset/pi_room_activity_click_arrow@2x.png create mode 100644 YuMi/Assets.xcassets/yna/Activity/pi_room_activity_click_arrow.imageset/pi_room_activity_click_arrow@3x.png create mode 100644 YuMi/Assets.xcassets/yna/Broadcast/pi_room_activity_choose_play_arrow.imageset/Contents.json create mode 100644 YuMi/Assets.xcassets/yna/Broadcast/pi_room_activity_choose_play_arrow.imageset/pi_room_activity_choose_play_arrow@2x.png create mode 100644 YuMi/Assets.xcassets/yna/Broadcast/pi_room_activity_choose_play_arrow.imageset/pi_room_activity_choose_play_arrow@3x.png create mode 100644 YuMi/Modules/YMRoom/View/ActivityContainerView/PIRoomActivityChoosePlayCell.h create mode 100644 YuMi/Modules/YMRoom/View/ActivityContainerView/PIRoomActivityChoosePlayCell.m create mode 100644 YuMi/Modules/YMRoom/View/ActivityContainerView/PIRoomActivityChoosePlayView.h create mode 100644 YuMi/Modules/YMRoom/View/ActivityContainerView/PIRoomActivityChoosePlayView.m create mode 100644 YuMi/Modules/YMRoom/View/ActivityContainerView/PIRoomActivityClickView.h create mode 100644 YuMi/Modules/YMRoom/View/ActivityContainerView/PIRoomActivityClickView.m diff --git a/YuMi.xcodeproj/project.pbxproj b/YuMi.xcodeproj/project.pbxproj index 0aa5ddfd..b0b952a1 100644 --- a/YuMi.xcodeproj/project.pbxproj +++ b/YuMi.xcodeproj/project.pbxproj @@ -309,6 +309,9 @@ 23B2AEC42A6516C200543D17 /* LoginForgetPasswordViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 23B2AEC22A6516C200543D17 /* LoginForgetPasswordViewController.m */; }; 23BA165B2A5D2ACF0030C5A3 /* PIBaseAnimationViewModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 23BA165A2A5D2ACF0030C5A3 /* PIBaseAnimationViewModel.m */; }; 23C7C0B72A7CD7B000802205 /* XPNewMineGuildItemView.m in Sources */ = {isa = PBXBuildFile; fileRef = 23C7C0B62A7CD7B000802205 /* XPNewMineGuildItemView.m */; }; + 23C9DFC32B84807A00B51558 /* PIRoomActivityClickView.m in Sources */ = {isa = PBXBuildFile; fileRef = 23C9DFC22B84807A00B51558 /* PIRoomActivityClickView.m */; }; + 23C9DFC62B84903500B51558 /* PIRoomActivityChoosePlayView.m in Sources */ = {isa = PBXBuildFile; fileRef = 23C9DFC52B84903500B51558 /* PIRoomActivityChoosePlayView.m */; }; + 23C9DFC92B84917B00B51558 /* PIRoomActivityChoosePlayCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 23C9DFC82B84917B00B51558 /* PIRoomActivityChoosePlayCell.m */; }; 23CEFB6C2AFB803B00576D89 /* PISwitchingEnvironmentVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 23CEFB6B2AFB803B00576D89 /* PISwitchingEnvironmentVC.m */; }; 23CEFC4A2AFB8FC100576D89 /* BSNSStringUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 23CEFC0C2AFB8FC100576D89 /* BSNSStringUtil.m */; }; 23CEFC4B2AFB8FC100576D89 /* BSUIDemoUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 23CEFC0D2AFB8FC100576D89 /* BSUIDemoUtil.m */; }; @@ -2081,6 +2084,12 @@ 23BA165A2A5D2ACF0030C5A3 /* PIBaseAnimationViewModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIBaseAnimationViewModel.m; sourceTree = ""; }; 23C7C0B52A7CD7B000802205 /* XPNewMineGuildItemView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPNewMineGuildItemView.h; sourceTree = ""; }; 23C7C0B62A7CD7B000802205 /* XPNewMineGuildItemView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPNewMineGuildItemView.m; sourceTree = ""; }; + 23C9DFC12B84807A00B51558 /* PIRoomActivityClickView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIRoomActivityClickView.h; sourceTree = ""; }; + 23C9DFC22B84807A00B51558 /* PIRoomActivityClickView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIRoomActivityClickView.m; sourceTree = ""; }; + 23C9DFC42B84903500B51558 /* PIRoomActivityChoosePlayView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIRoomActivityChoosePlayView.h; sourceTree = ""; }; + 23C9DFC52B84903500B51558 /* PIRoomActivityChoosePlayView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIRoomActivityChoosePlayView.m; sourceTree = ""; }; + 23C9DFC72B84917B00B51558 /* PIRoomActivityChoosePlayCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIRoomActivityChoosePlayCell.h; sourceTree = ""; }; + 23C9DFC82B84917B00B51558 /* PIRoomActivityChoosePlayCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIRoomActivityChoosePlayCell.m; sourceTree = ""; }; 23CEFB6A2AFB803B00576D89 /* PISwitchingEnvironmentVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PISwitchingEnvironmentVC.h; sourceTree = ""; }; 23CEFB6B2AFB803B00576D89 /* PISwitchingEnvironmentVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PISwitchingEnvironmentVC.m; sourceTree = ""; }; 23CEFC0B2AFB8FC100576D89 /* BSXWDateUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BSXWDateUtil.h; sourceTree = ""; }; @@ -9721,6 +9730,12 @@ children = ( E8AE427127153A3500BEEBB2 /* XPRoomActivityContainerView.h */, E8AE427227153A3500BEEBB2 /* XPRoomActivityContainerView.m */, + 23C9DFC12B84807A00B51558 /* PIRoomActivityClickView.h */, + 23C9DFC22B84807A00B51558 /* PIRoomActivityClickView.m */, + 23C9DFC42B84903500B51558 /* PIRoomActivityChoosePlayView.h */, + 23C9DFC52B84903500B51558 /* PIRoomActivityChoosePlayView.m */, + 23C9DFC72B84917B00B51558 /* PIRoomActivityChoosePlayCell.h */, + 23C9DFC82B84917B00B51558 /* PIRoomActivityChoosePlayCell.m */, 9BAC92EC28E6989400147DD8 /* XPRoomActivityPlayView.h */, 9BAC92ED28E6989400147DD8 /* XPRoomActivityPlayView.m */, 235A45182B04A352009753F5 /* PIRoomActivityWebView.h */, @@ -11132,6 +11147,7 @@ E8998D8B2859CB6A00C68558 /* XPMineUserInfoGiftWallSubViewController.m in Sources */, E8DEC9A42764A6600078CB70 /* XPMoreMenuPresenter.m in Sources */, 189DD53426DE255300AB55B1 /* TabbarViewController.m in Sources */, + 23C9DFC92B84917B00B51558 /* PIRoomActivityChoosePlayCell.m in Sources */, 9BA3B40B293DCDFD0071DF1C /* XPVersionUpdateModel.m in Sources */, 18EE401A2754BA9F00A452BF /* NIMMessageMaker.m in Sources */, E8EEB91D26FC9D58007C6EBA /* XPMineUserInfoDateView.m in Sources */, @@ -11397,6 +11413,7 @@ E8998D8028597B0300C68558 /* XPRoomLuckyBigPrizeView.m in Sources */, E88E4A80297673DC00019A50 /* SessionNavLiveView.m in Sources */, E81060DC298761F100B772F0 /* MessageTextModel.m in Sources */, + 23C9DFC62B84903500B51558 /* PIRoomActivityChoosePlayView.m in Sources */, 235A45232B04BEB6009753F5 /* PIBaseModel.m in Sources */, E8DEC9A82764A68B0078CB70 /* Api+MoreMenu.m in Sources */, 9B86D87A2817DD8400494FCD /* XPRoomEnterHideTipView.m in Sources */, @@ -11628,6 +11645,7 @@ E84150C227747BF700A7F548 /* FirstRechargeModel.m in Sources */, 9B1EF3D227E81C0600554295 /* XPMineDressUpBubbleViewController.m in Sources */, 2331C1AB2A60F32D00E1D940 /* CandyTreeResultModel.m in Sources */, + 23C9DFC32B84807A00B51558 /* PIRoomActivityClickView.m in Sources */, 1427218B29A75F6F00C7C423 /* HTTPFileResponse.m in Sources */, E839533C276A0CCD00CF2F24 /* XPMineCarTableViewCell.m in Sources */, 2331C1B62A60F32D00E1D940 /* XPCandyTreeInsufficientBalanceView.m in Sources */, @@ -12217,7 +12235,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 20.20.9; + MARKETING_VERSION = 20.20.10; PRODUCT_BUNDLE_IDENTIFIER = com.peko.enterprise.ios; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -12253,7 +12271,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 20.20.9; + MARKETING_VERSION = 20.20.10; PRODUCT_BUNDLE_IDENTIFIER = com.peko.enterprise.ios; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; 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 #import +#import + ///Tool #import "YUMIConstant.h" #import "CustomAttachmentDecoder.h" @@ -23,6 +25,8 @@ #import "XCCurrentVCStackManager.h" #import "ClientConfig.h" #import +#import + #import @@ -44,6 +48,24 @@ UIKIT_EXTERN NSString * adImageName; [self initEmojiData]; [self configAdjust]; [self configBugly]; + [self registerNot]; +} +-(void)registerNot{ + if (@available(iOS 10.0, *)) { + UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter]; + [center requestAuthorizationWithOptions:(UNAuthorizationOptionAlert | UNAuthorizationOptionBadge | UNAuthorizationOptionSound) completionHandler:^(BOOL granted, NSError * _Nullable error) { + if (granted) { + [center getNotificationSettingsWithCompletionHandler:^(UNNotificationSettings * _Nonnull settings) { + if (settings.authorizationStatus == UNAuthorizationStatusAuthorized){ + dispatch_async(dispatch_get_main_queue(), ^{ + [[UIApplication sharedApplication] registerForRemoteNotifications]; + }); + } + }]; + } + }]; + } + } /** 崩溃收集 Bugly @@ -73,7 +95,12 @@ UIKIT_EXTERN NSString * adImageName; //推荐在程序启动的时候初始化 NIMSDK NSString *appKey = KeyWithType(KeyType_NetEase); NIMSDKOption *option = [NIMSDKOption optionWithAppKey:appKey]; +#ifdef DEBUG + option.apnsCername = @"pikoDevelopPush"; +#else option.apnsCername = @"newPiko"; +#endif + [[NIMSDK sharedSDK] registerWithOption:option]; // NIM SDK初始化 diff --git a/YuMi/Appdelegate/AppDelegate.m b/YuMi/Appdelegate/AppDelegate.m index ca6fd34f..f24b7c8f 100644 --- a/YuMi/Appdelegate/AppDelegate.m +++ b/YuMi/Appdelegate/AppDelegate.m @@ -20,6 +20,7 @@ #import "XPLoginViewController.h" #import "AccountModel.h" #import "YuMi-swift.h" +#import "SessionViewController.h" @import Firebase; UIKIT_EXTERN NSString * const kOpenRoomNotification; @@ -102,7 +103,37 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification; - (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { // 上传devicetoken至云信服务器。 - [[NIMSDK sharedSDK] updateApnsToken:deviceToken]; + [[NIMSDK sharedSDK] updateApnsToken:deviceToken ]; +} + +- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler{ + + NSString *data = userInfo[@"data"]; + if(data){ + NSDictionary *dataDic = [data mj_JSONObject]; + NSString *userId = dataDic[@"uid"]; + if(userId){ + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + [[NSNotificationCenter defaultCenter]postNotificationName:kOpenRoomNotification object:nil userInfo:@{@"type":@"kOpenChat",@"uid":userId,@"isNoAttention":@(YES)}]; + ClientConfig *config = [ClientConfig shareConfig]; + config.chatId = userId; + + }); + return; + } + } + + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + NSString *userId = userInfo[@"uid"]; + if(userId){ + [[NSNotificationCenter defaultCenter]postNotificationName:kOpenRoomNotification object:nil userInfo:@{@"type":@"kOpenChat",@"uid":userId}]; + ClientConfig *config = [ClientConfig shareConfig]; + config.chatId = userId; + } + }); + + + } ///URL Scheme跳转 diff --git a/YuMi/Assets.xcassets/yna/Activity/pi_room_activity_click_arrow.imageset/Contents.json b/YuMi/Assets.xcassets/yna/Activity/pi_room_activity_click_arrow.imageset/Contents.json new file mode 100644 index 00000000..09932506 --- /dev/null +++ b/YuMi/Assets.xcassets/yna/Activity/pi_room_activity_click_arrow.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "pi_room_activity_click_arrow@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "pi_room_activity_click_arrow@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YuMi/Assets.xcassets/yna/Activity/pi_room_activity_click_arrow.imageset/pi_room_activity_click_arrow@2x.png b/YuMi/Assets.xcassets/yna/Activity/pi_room_activity_click_arrow.imageset/pi_room_activity_click_arrow@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..5f38ec028abf8ddcb2da57de232a4df0fd35cb50 GIT binary patch literal 297 zcmeAS@N?(olHy`uVBq!ia0vp^G9b*s3?yAI>n{UR-T^)#u0Z-fl|b`MZg!w?k|jZY z!3@tH8ar9txq4`2pqjK0H|yCm+qcb{(Uy`l%YEg1prR5_7sn8d^HVRm^EDXoxCGkm zU2@^!KXp~>{2b2o-%C!&`9H0RO}@>&?40SAwyj6~4$qQXw&u3cfq5m|(mjFOEe=VQ zc(e0#=T$b{yY->zR@4VQv*<=9|EKOhuh~yn^N8Q^Q8Bx|da-qyp_{@O1TaS?83{1ORWEo(KQ{ literal 0 HcmV?d00001 diff --git a/YuMi/Assets.xcassets/yna/Activity/pi_room_activity_click_arrow.imageset/pi_room_activity_click_arrow@3x.png b/YuMi/Assets.xcassets/yna/Activity/pi_room_activity_click_arrow.imageset/pi_room_activity_click_arrow@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..b402931b0b386f2a01de1b2d4731a0e32d4a84cb GIT binary patch literal 394 zcmeAS@N?(olHy`uVBq!ia0vp^S|H593?x6vT4n;Nzm*c=ad>`vQEZ^EosPKhzq)!GpyI8bE{-7!xOuUovUGZvAaSjZRhKn@G*2%8J#~FMeY= zanj?m-~{>olUMrOT3{@dGt)|U-FV+=UOA%a|eEeK7Yxqu-~pf|F}zv(WTGVLl*sE{*hm}aR=+2h<$oBoIkTZ xH$O~|D7<51R3Y%O;_n{URegQrqu0Z-f^}vMb(z-wsrAmVQ zf*GDYG#x~A39RAVXBWR`{+a%_rXQRBu1XVWYB5boFyt=akR{0M6T*SpWb4 literal 0 HcmV?d00001 diff --git a/YuMi/Assets.xcassets/yna/Broadcast/pi_room_activity_choose_play_arrow.imageset/pi_room_activity_choose_play_arrow@3x.png b/YuMi/Assets.xcassets/yna/Broadcast/pi_room_activity_choose_play_arrow.imageset/pi_room_activity_choose_play_arrow@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..716a0c1748b597a843db99468c8d8be2a5787934 GIT binary patch literal 397 zcmeAS@N?(olHy`uVBq!ia0vp^S|H593?x6vT4n;Nv;dzFS0MeL_F(G#%oRYJluCm9 zf*GE@7X0v{`O%d#o7YVV_A+Jt{_s|cHRs{^?M1OV8tSUzT%xzC1c0iyc)B=-Se)K_ zHIuJJfu}98kU1sTeQxdU|Eld(P3DTp_4b*oTKix9-}+1Rlu7C3xq+@pLe@@J*Co%YBPx%EwSr9ts-kN8^WZ@bnj zDc!!F#Jq6vbV)zKn~B@~llHGWt2~20YU7u+znM<4J(z#AUM!w5UdLYVX}dv|!ogO? x>jE)(0+JRT6?;BjSQ5C#+3`Sg`r`$^7)uK{L>~*Vi2&Wt;OXk;vd$@?2>?=}*--!h literal 0 HcmV?d00001 diff --git a/YuMi/CustomUI/VagueImageView/UIImage+ImageEffects.h b/YuMi/CustomUI/VagueImageView/UIImage+ImageEffects.h index 5e1b1085..3033e40b 100755 --- a/YuMi/CustomUI/VagueImageView/UIImage+ImageEffects.h +++ b/YuMi/CustomUI/VagueImageView/UIImage+ImageEffects.h @@ -103,5 +103,6 @@ - (UIImage *)applyTintEffectWithColor:(UIColor *)tintColor; - (UIImage *)applyBlurWithRadius:(CGFloat)blurRadius tintColor:(UIColor *)tintColor saturationDeltaFactor:(CGFloat)saturationDeltaFactor maskImage:(UIImage *)maskImage; - +///为图片增加毛玻璃,value模糊程度 ++(UIImage *)setBlurImage:(UIImage *)image value:(CGFloat)value; @end diff --git a/YuMi/CustomUI/VagueImageView/UIImage+ImageEffects.m b/YuMi/CustomUI/VagueImageView/UIImage+ImageEffects.m index e1d6acd2..68be7d2c 100755 --- a/YuMi/CustomUI/VagueImageView/UIImage+ImageEffects.m +++ b/YuMi/CustomUI/VagueImageView/UIImage+ImageEffects.m @@ -273,6 +273,37 @@ return outputImage; } ++(UIImage *)setBlurImage:(UIImage *)image value:(CGFloat)value{ + CIContext *context = [CIContext contextWithOptions:nil]; + CIImage * sourceImage = [CIImage imageWithCGImage:image.CGImage];//将图片转换成CIImage + + ///图片仿射滤镜 + + CIFilter * clamp = [CIFilter filterWithName:@"CIAffineClamp"];//设置绘制类型 + + [clamp setValue:sourceImage forKey:kCIInputImageKey];//设置要绘制的图片 + + CIImage *clampResult = [clamp valueForKey:kCIOutputImageKey]; + + ///高斯模糊滤镜 + + CIFilter* gaussianBlur = [CIFilter filterWithName:@"CIGaussianBlur"]; + + [gaussianBlur setValue:clampResult forKey:kCIInputImageKey]; + + [gaussianBlur setValue:[NSNumber numberWithFloat:value] forKey:@"inputRadius"];//设置模糊值 + + CIImage * gaussianBlurResult = [gaussianBlur valueForKey:kCIOutputImageKey]; + + ///转化获取图片 + + CGImageRef cgImage = [context createCGImage:gaussianBlurResult fromRect:[sourceImage extent]]; + + UIImage * resultImage = [UIImage imageWithCGImage:cgImage]; + return resultImage; + +} + @end diff --git a/YuMi/Global/YUMIMacroUitls.h b/YuMi/Global/YUMIMacroUitls.h index 9350cbd9..a427ab29 100644 --- a/YuMi/Global/YUMIMacroUitls.h +++ b/YuMi/Global/YUMIMacroUitls.h @@ -49,7 +49,7 @@ isPhoneXSeries = [[UIApplication sharedApplication] delegate].window.safeAreaIns ///内置版本号 -#define PI_App_Version @"2.5.2" +#define PI_App_Version @"2.6.0" ///渠道 #define PI_App_Source @"appstore" //#define PI_App_Source @"pi_tf" diff --git a/YuMi/Modules/YMMessage/Model/AttachmentModel.h b/YuMi/Modules/YMMessage/Model/AttachmentModel.h index 0816dca6..388e63d3 100644 --- a/YuMi/Modules/YMMessage/Model/AttachmentModel.h +++ b/YuMi/Modules/YMMessage/Model/AttachmentModel.h @@ -110,6 +110,8 @@ typedef NS_ENUM(NSUInteger, CustomMessageType) { CustomMessageType_Common_H5 = 100, ///房间相册 CustomMessageType_Room_Album = 101, + ///守护星球 + CustomMessageType_Guardian_Planet = 102, }; @@ -616,6 +618,12 @@ typedef NS_ENUM(NSUInteger, CustomMessageTypeRoomAlbum) { ///所有房间 Custom_Message_Sub_Room_Album = 1011, }; +//CustomMessageType_Guardian_Planet = 102, +typedef NS_ENUM(NSUInteger, CustomMessageTypeGuardianPlanet) { + ///所有房间 + Custom_Message_Sub_Guardian_Planet_One_Room = 1021,//单房间 + Custom_Message_Sub_Guardian_Planet_All_Room = 1022,///全部房间 +}; @interface AttachmentModel : PIBaseModel @property (nonatomic,assign) int first; @property (nonatomic,assign) int second; diff --git a/YuMi/Modules/YMMessage/View/Session/Content/MessageContentTweetView.m b/YuMi/Modules/YMMessage/View/Session/Content/MessageContentTweetView.m index 6c42676a..d024cc3f 100644 --- a/YuMi/Modules/YMMessage/View/Session/Content/MessageContentTweetView.m +++ b/YuMi/Modules/YMMessage/View/Session/Content/MessageContentTweetView.m @@ -71,7 +71,7 @@ CGFloat desHeight = [model.desc boundingRectWithSize:CGSizeMake(240, CGFLOAT_MAX) options:NSStringDrawingUsesFontLeading | NSStringDrawingUsesLineFragmentOrigin - attributes:[self messageTextAttibutes:[UIFont systemFontOfSize:13] color:[DJDKMIMOMColor mainTextColor]] context:nil].size.height; + attributes:[self messageTextAttibutes:[UIFont systemFontOfSize:13] color:[DJDKMIMOMColor mainTextColor]] context:nil].size.height + 10; [self.subTitleLabel mas_updateConstraints:^(MASConstraintMaker *make) { make.height.mas_equalTo(desHeight); }]; diff --git a/YuMi/Modules/YMMessage/View/Session/SessionViewController.m b/YuMi/Modules/YMMessage/View/Session/SessionViewController.m index 75cb06a4..52219326 100644 --- a/YuMi/Modules/YMMessage/View/Session/SessionViewController.m +++ b/YuMi/Modules/YMMessage/View/Session/SessionViewController.m @@ -203,7 +203,7 @@ - (void)loadAlbumPhotos { @kWeakify(self); [YYUtility checkAssetsLibrayAvailable:^{ - @kStrongify(self); + } denied:^{ @@ -764,6 +764,8 @@ [Api getPrivateChatCheck:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { if(code == 200){ NIMMessage *message = [NIMMessageMaker msgWithText:text]; + message.apnsPayload = @{@"uid": [AccountInfoStorage instance].getUid //表明该条消息的发送者的账号或者消息所属的群组 ID + }; [[[NIMSDK sharedSDK] chatManager] sendMessage:message toSession:self.session error:nil]; return; } @@ -777,6 +779,8 @@ [Api getPrivateChatCheck:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { if(code == 200){ NIMMessage *message = [NIMMessageMaker msgWithAudio:recordPath]; + message.apnsPayload = @{@"uid": [AccountInfoStorage instance].getUid //表明该条消息的发送者的账号或者消息所属的群组 ID + }; [[[NIMSDK sharedSDK] chatManager] sendMessage:message toSession:self.session error:nil]; return; } @@ -793,6 +797,8 @@ if(code == 200){ // 构造出具体会话 NIMMessage * message = [NIMMessageMaker msgWithImage:obj]; + message.apnsPayload = @{@"uid": [AccountInfoStorage instance].getUid //表明该条消息的发送者的账号或者消息所属的群组 ID + }; // 发送消息 [[NIMSDK sharedSDK].chatManager sendMessage:message toSession:self.session error:nil]; return; @@ -985,7 +991,9 @@ [TTPopup alertWithConfig:config confirmHandler:^{ NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString]; if ([[UIApplication sharedApplication] canOpenURL:url]) { - [[UIApplication sharedApplication] openURL:url]; + [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:^(BOOL success) { + + }]; } } cancelHandler:^{ }]; @@ -1057,6 +1065,8 @@ NIMMessage * message = [NIMMessageMaker msgWithImage:image]; [Api getPrivateChatCheck:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { if(code == 200){ + message.apnsPayload = @{@"uid": [AccountInfoStorage instance].getUid //表明该条消息的发送者的账号或者消息所属的群组 ID + }; [[NIMSDK sharedSDK].chatManager sendMessage:message toSession:self.session error:nil]; [view resetChoosePhotos]; return; @@ -1091,6 +1101,8 @@ if(code == 200){ // 构造出具体会话 NIMMessage * message = [NIMMessageMaker msgWithImage:selectedPhoto]; + message.apnsPayload = @{@"uid": [AccountInfoStorage instance].getUid //表明该条消息的发送者的账号或者消息所属的群组 ID + }; // 发送消息 [[NIMSDK sharedSDK].chatManager sendMessage:message toSession:self.session error:nil]; return; diff --git a/YuMi/Modules/YMMine/View/Guild/View/XPMineGuildViewController.m b/YuMi/Modules/YMMine/View/Guild/View/XPMineGuildViewController.m index 9c6bf0b9..755b9bd9 100644 --- a/YuMi/Modules/YMMine/View/Guild/View/XPMineGuildViewController.m +++ b/YuMi/Modules/YMMine/View/Guild/View/XPMineGuildViewController.m @@ -476,7 +476,7 @@ UIKIT_EXTERN NSString *kInviteMemeberSuccess; self.avatarImageView.imageUrl = clanDetailInfo.hall.ownerAvatar; self.idLabel.text = [NSString stringWithFormat:YMLocalizedString(@"XPMineGuildViewController6"),clanDetailInfo.hall.ownerErbanNo]; [self.backImageView loadImageWithUrl:clanDetailInfo.hall.ownerAvatar completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) { - self.backImageView.image = [self setBlurImage:image]; + self.backImageView.image = [UIImage setBlurImage:image value:1]; }]; self.titleLabel.text = clanDetailInfo.hall.hallName; if (clanDetailInfo.manageHall) { @@ -675,38 +675,7 @@ UIKIT_EXTERN NSString *kInviteMemeberSuccess; managerList.guildId = self.clanDetailInfo.hall.hallId; [self.navigationController pushViewController:managerList animated:YES]; } --(UIImage *)setBlurImage:(UIImage *)image{ - - CIContext *context = [CIContext contextWithOptions:nil]; - CIImage * sourceImage = [CIImage imageWithCGImage:image.CGImage];//将图片转换成CIImage - - ///图片仿射滤镜 - - CIFilter * clamp = [CIFilter filterWithName:@"CIAffineClamp"];//设置绘制类型 - - [clamp setValue:sourceImage forKey:kCIInputImageKey];//设置要绘制的图片 - - CIImage *clampResult = [clamp valueForKey:kCIOutputImageKey]; - - ///高斯模糊滤镜 - - CIFilter* gaussianBlur = [CIFilter filterWithName:@"CIGaussianBlur"]; - - [gaussianBlur setValue:clampResult forKey:kCIInputImageKey]; - - [gaussianBlur setValue:[NSNumber numberWithFloat:1] forKey:@"inputRadius"];//设置模糊值 - - CIImage * gaussianBlurResult = [gaussianBlur valueForKey:kCIOutputImageKey]; - - ///转化获取图片 - - CGImageRef cgImage = [context createCGImage:gaussianBlurResult fromRect:[sourceImage extent]]; - - UIImage * resultImage = [UIImage imageWithCGImage:cgImage]; - return resultImage; - -} #pragma mark - Getters And Setters - (UIView *)navView { diff --git a/YuMi/Modules/YMNewHome/View/XPNewHomeViewController.m b/YuMi/Modules/YMNewHome/View/XPNewHomeViewController.m index fad29863..2f7e561e 100644 --- a/YuMi/Modules/YMNewHome/View/XPNewHomeViewController.m +++ b/YuMi/Modules/YMNewHome/View/XPNewHomeViewController.m @@ -226,11 +226,12 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification; } NSString *uid = notification.userInfo[@"uid"]; NSString *type = notification.userInfo[@"type"]; + BOOL isNoAttention = [notification.userInfo[@"isNoAttention"] boolValue]; if([type isEqualToString:@"kOpenChat"]){ if (uid.length > 0) { NIMSession * session = [NIMSession session:uid type:NIMSessionTypeP2P]; SessionViewController * sessionVC = [[SessionViewController alloc] initWithSession:session]; - sessionVC.isAttention = YES; + sessionVC.isAttention = !isNoAttention; [self.navigationController pushViewController:sessionVC animated:YES]; [ClientConfig shareConfig].chatId = nil; } diff --git a/YuMi/Modules/YMRoom/Api/Api+Room.h b/YuMi/Modules/YMRoom/Api/Api+Room.h index 1b5b0307..9b54d44b 100644 --- a/YuMi/Modules/YMRoom/Api/Api+Room.h +++ b/YuMi/Modules/YMRoom/Api/Api+Room.h @@ -86,10 +86,10 @@ NS_ASSUME_NONNULL_BEGIN /// 房间活动页的列表 /// @param completion 完成 /// @param roomId 房间的id -/// @param type 类型 2 房间的 1 首页的 + + (void)roomActivityList:(HttpRequestHelperCompletion)completion - roomId:(NSString *)roomId - type:(NSString *)type; + roomId:(NSString *)roomId; ++(void)getPlayList:(HttpRequestHelperCompletion)completion roomId:(NSString *)roomId; /// 收藏房间 /// @param completion 完成 diff --git a/YuMi/Modules/YMRoom/Api/Api+Room.m b/YuMi/Modules/YMRoom/Api/Api+Room.m index a76209ae..62777c40 100644 --- a/YuMi/Modules/YMRoom/Api/Api+Room.m +++ b/YuMi/Modules/YMRoom/Api/Api+Room.m @@ -103,12 +103,14 @@ /// 房间活动页的列表 /// @param completion 完成 /// @param roomId 房间的id -/// @param type 类型 2 房间的 1 首页的 -+ (void)roomActivityList:(HttpRequestHelperCompletion)completion roomId:(NSString *)roomId type:(NSString *)type { - NSString * fang = [NSString stringFromBase64String:@"aG9tZS9iYW5uZXI="];///home/banner - [self makeRequest:fang method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, roomId, type, nil]; -} ++ (void)roomActivityList:(HttpRequestHelperCompletion)completion roomId:(NSString *)roomId { + + [self makeRequest:@"resource/list" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, roomId, nil]; +} ++(void)getPlayList:(HttpRequestHelperCompletion)completion roomId:(NSString *)roomId{ + [self makeRequest:@"resource/gamePlay" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__,roomId, nil]; +} /// 收藏房间 /// @param completion 完成 diff --git a/YuMi/Modules/YMRoom/Model/ActivityInfoModel.h b/YuMi/Modules/YMRoom/Model/ActivityInfoModel.h index 8031d2f2..6ad36947 100644 --- a/YuMi/Modules/YMRoom/Model/ActivityInfoModel.h +++ b/YuMi/Modules/YMRoom/Model/ActivityInfoModel.h @@ -28,6 +28,9 @@ typedef NS_ENUM(NSInteger, ActivityType) { }; @interface ActivityInfoModel : PIBaseModel +@property(nonatomic,copy) NSString *code; +@property(nonatomic,copy) NSString *icon; +@property(nonatomic,copy) NSString *url; ///名称 @property (nonatomic,copy) NSString *bannerName; ///外面的活动的图片 diff --git a/YuMi/Modules/YMRoom/View/ActivityContainerView/PIRoomActivityChoosePlayCell.h b/YuMi/Modules/YMRoom/View/ActivityContainerView/PIRoomActivityChoosePlayCell.h new file mode 100644 index 00000000..1c1db19f --- /dev/null +++ b/YuMi/Modules/YMRoom/View/ActivityContainerView/PIRoomActivityChoosePlayCell.h @@ -0,0 +1,16 @@ +// +// PIRoomActivityChoosePlayCell.h +// YuMi +// +// Created by duoban on 2024/2/20. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface PIRoomActivityChoosePlayCell : UICollectionViewCell +@property(nonatomic,copy) NSString *imageUrl; +@end + +NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/ActivityContainerView/PIRoomActivityChoosePlayCell.m b/YuMi/Modules/YMRoom/View/ActivityContainerView/PIRoomActivityChoosePlayCell.m new file mode 100644 index 00000000..cac5a913 --- /dev/null +++ b/YuMi/Modules/YMRoom/View/ActivityContainerView/PIRoomActivityChoosePlayCell.m @@ -0,0 +1,47 @@ +// +// PIRoomActivityChoosePlayCell.m +// YuMi +// +// Created by duoban on 2024/2/20. +// + +#import "PIRoomActivityChoosePlayCell.h" +@interface PIRoomActivityChoosePlayCell() +@property(nonatomic,strong) NetImageView *playIconView; +@end +@implementation PIRoomActivityChoosePlayCell +-(instancetype)initWithFrame:(CGRect)frame{ + self = [super initWithFrame:frame]; + if(self){ + [self installUI]; + [self installConstraints]; + } + return self; +} +- (void)setImageUrl:(NSString *)imageUrl{ + _imageUrl = imageUrl; + _playIconView.image = nil; + [_playIconView loadImageWithUrl:_imageUrl completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) { + self.playIconView.image = image; + }]; +} +-(void)installUI{ + self.contentView.backgroundColor = UIColorRGBAlpha(0x727272, 0.6); + self.contentView.layer.cornerRadius = 7; + self.contentView.layer.masksToBounds = YES; + [self.contentView addSubview:self.playIconView]; +} +-(void)installConstraints{ + [self.playIconView mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.height.mas_equalTo(43); + make.center.equalTo(self.contentView); + }]; +} +#pragma mark - 懒加载 +- (NetImageView *)playIconView{ + if(!_playIconView){ + _playIconView = [NetImageView new]; + } + return _playIconView; +} +@end diff --git a/YuMi/Modules/YMRoom/View/ActivityContainerView/PIRoomActivityChoosePlayView.h b/YuMi/Modules/YMRoom/View/ActivityContainerView/PIRoomActivityChoosePlayView.h new file mode 100644 index 00000000..c6f558cc --- /dev/null +++ b/YuMi/Modules/YMRoom/View/ActivityContainerView/PIRoomActivityChoosePlayView.h @@ -0,0 +1,25 @@ +// +// PIRoomActivityChoosePlayView.h +// YuMi +// +// Created by duoban on 2024/2/20. +// + +#import +#import "ActivityInfoModel.h" +NS_ASSUME_NONNULL_BEGIN +@class PIRoomActivityChoosePlayView; +@protocol PIRoomActivityChoosePlayViewDelegate + +-(void)hiddenViewActionWithView:(PIRoomActivityChoosePlayView *)view; +-(void)choosePlayTypeWithView:(PIRoomActivityChoosePlayView *)view model:(ActivityInfoModel *)model; + +@end + + +@interface PIRoomActivityChoosePlayView : UIView +@property(nonatomic,strong) NSMutableArray *playList; +@property(nonatomic,weak) iddelegate; +@end + +NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/ActivityContainerView/PIRoomActivityChoosePlayView.m b/YuMi/Modules/YMRoom/View/ActivityContainerView/PIRoomActivityChoosePlayView.m new file mode 100644 index 00000000..15493a3a --- /dev/null +++ b/YuMi/Modules/YMRoom/View/ActivityContainerView/PIRoomActivityChoosePlayView.m @@ -0,0 +1,115 @@ +// +// PIRoomActivityChoosePlayView.m +// YuMi +// +// Created by duoban on 2024/2/20. +// + +#import "PIRoomActivityChoosePlayView.h" +#import "PIRoomActivityChoosePlayCell.h" +#import "ActivityInfoModel.h" +@interface PIRoomActivityChoosePlayView () +@property(nonatomic,strong) UIButton *clickBtn; +@property(nonatomic,strong) UICollectionView *collectionView; +@property(nonatomic,strong) UIImageView *bgImageView; +@end +@implementation PIRoomActivityChoosePlayView + +-(instancetype)initWithFrame:(CGRect)frame{ + self = [super initWithFrame:frame]; + if(self){ + [self installUI]; + [self installConstraints]; + } + return self; +} +-(void)installUI{ + self.backgroundColor = [UIColor clearColor]; + [self addSubview:self.clickBtn]; + [self addSubview:self.bgImageView]; + [self.bgImageView addSubview:self.collectionView]; + +} +-(void)installConstraints{ + [self.clickBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.height.mas_equalTo(14); + make.leading.equalTo(self); + make.centerY.equalTo(self); + }]; + [self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.trailing.mas_equalTo(-6); + make.top.bottom.equalTo(self); + make.width.mas_equalTo(180); + }]; + [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.equalTo(self.bgImageView); + }]; +} +-(void)setPlayList:(NSMutableArray *)playList{ + _playList = playList; + [self.collectionView reloadData]; +} +#pragma mark - UICollectionViewDelegate,UICollectionViewDataSource +- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{ + return self.playList.count; +} +- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{ + PIRoomActivityChoosePlayCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([PIRoomActivityChoosePlayCell class]) forIndexPath:indexPath]; + ActivityInfoModel *model = [self.playList safeObjectAtIndex1:indexPath.row]; + cell.imageUrl = model.icon; + return cell; +} +-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{ + ActivityInfoModel *model = [self.playList safeObjectAtIndex1:indexPath.row]; + if(self.delegate && [self.delegate respondsToSelector:@selector(choosePlayTypeWithView:model:)]){ + [self.delegate choosePlayTypeWithView:self model:model]; + } +} +-(void)clickBtnAction{ + if(self.delegate && [self.delegate respondsToSelector:@selector(hiddenViewActionWithView:)]){ + [self.delegate hiddenViewActionWithView:self]; + } + +} +#pragma mark - 懒加载 +- (UICollectionView *)collectionView{ + if(!_collectionView){ + UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; + layout.minimumLineSpacing = 8; + layout.minimumInteritemSpacing = 8; + layout.itemSize = CGSizeMake(48, 48); + layout.scrollDirection = UICollectionViewScrollDirectionVertical; + layout.sectionInset = UIEdgeInsetsMake(10, 10, 10, 10); + _collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout]; + _collectionView.dataSource = self; + _collectionView.delegate = self; + _collectionView.backgroundColor = [UIColor clearColor]; + [_collectionView registerClass:[ PIRoomActivityChoosePlayCell class] forCellWithReuseIdentifier:NSStringFromClass([ PIRoomActivityChoosePlayCell class])]; + + + } + return _collectionView; +} +- (UIButton *)clickBtn{ + if(!_clickBtn){ + _clickBtn = [UIButton new]; + [_clickBtn setEnlargeEdgeWithTop:10 right:10 bottom:10 left:10]; + [_clickBtn setImage:kImage(@"pi_room_activity_choose_play_arrow") forState:UIControlStateNormal]; + [_clickBtn addTarget:self action:@selector(clickBtnAction) forControlEvents:UIControlEventTouchUpInside]; + } + return _clickBtn; +} +- (UIImageView *)bgImageView{ + if(!_bgImageView){ + _bgImageView = [UIImageView new]; + _bgImageView.layer.cornerRadius = 12; + _bgImageView.layer.masksToBounds = YES; + _bgImageView.layer.borderColor = [UIColor colorWithWhite:1 alpha:0.8].CGColor; + _bgImageView.layer.borderWidth = 1; + _bgImageView.userInteractionEnabled = YES; + UIImage *image = [UIImage imageWithColor:[UIColor colorWithWhite:0 alpha:0.5]]; + _bgImageView.image = [UIImage setBlurImage:image value:1]; + } + return _bgImageView; +} +@end diff --git a/YuMi/Modules/YMRoom/View/ActivityContainerView/PIRoomActivityClickView.h b/YuMi/Modules/YMRoom/View/ActivityContainerView/PIRoomActivityClickView.h new file mode 100644 index 00000000..6b5ca22d --- /dev/null +++ b/YuMi/Modules/YMRoom/View/ActivityContainerView/PIRoomActivityClickView.h @@ -0,0 +1,25 @@ +// +// PIRoomActivityClickView.h +// YuMi +// +// Created by duoban on 2024/2/20. +// + +#import +#import "ActivityInfoModel.h" +NS_ASSUME_NONNULL_BEGIN + +@protocol PIRoomActivityClickViewDelegate + +-(void)showChoosePlayViewAction; +-(void)clickPlayTypeWithModel:(ActivityInfoModel *)model; +@end + + +@interface PIRoomActivityClickView : UIView +@property(nonatomic,strong) ActivityInfoModel *model; +@property(nonatomic,weak) iddelegate; + +@end + +NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/ActivityContainerView/PIRoomActivityClickView.m b/YuMi/Modules/YMRoom/View/ActivityContainerView/PIRoomActivityClickView.m new file mode 100644 index 00000000..0fd8710f --- /dev/null +++ b/YuMi/Modules/YMRoom/View/ActivityContainerView/PIRoomActivityClickView.m @@ -0,0 +1,94 @@ +// +// PIRoomActivityClickView.m +// YuMi +// +// Created by duoban on 2024/2/20. +// + +#import "PIRoomActivityClickView.h" +@interface PIRoomActivityClickView() +@property(nonatomic,strong) UIButton *clickBtn; +@property(nonatomic,strong) UIImageView *bgImageView; +@property(nonatomic,strong) NetImageView *playIconView; +@end +@implementation PIRoomActivityClickView + +-(instancetype)initWithFrame:(CGRect)frame{ + self = [super initWithFrame:frame]; + if(self){ + [self installUI]; + [self installConstraints]; + } + return self; +} +-(void)installUI{ + [self addSubview:self.clickBtn]; + [self addSubview:self.bgImageView]; + [self.bgImageView addSubview:self.playIconView]; +} +-(void)installConstraints{ + [self.clickBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.height.mas_equalTo(14); + make.leading.centerY.equalTo(self); + }]; + [self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.height.mas_equalTo(66); + make.centerY.equalTo(self); + make.leading.mas_equalTo(15); + }]; + [self.playIconView mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.height.mas_equalTo(58); + make.center.equalTo(self.bgImageView); + }]; +} +- (void)setModel:(ActivityInfoModel *)model{ + _model = model; + [_playIconView loadImageWithUrl:_model.icon completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) { + self.playIconView.image = image; + }]; +} +-(void)clickBtnAction{ + if(self.delegate && [self.delegate respondsToSelector:@selector(showChoosePlayViewAction)]){ + [self.delegate showChoosePlayViewAction]; + } +} +-(void)clickPlayImageAction{ + if(self.delegate && [self.delegate respondsToSelector:@selector(clickPlayTypeWithModel:)]){ + [self.delegate clickPlayTypeWithModel:self.model]; + } +} +#pragma mark - 懒加载 +- (UIButton *)clickBtn{ + if(!_clickBtn){ + _clickBtn = [UIButton new]; + [_clickBtn setEnlargeEdgeWithTop:10 right:10 bottom:10 left:10]; + [_clickBtn setImage:kImage(@"pi_room_activity_click_arrow") forState:UIControlStateNormal]; + [_clickBtn addTarget:self action:@selector(clickBtnAction) forControlEvents:UIControlEventTouchUpInside]; + + } + return _clickBtn; +} +- (UIImageView *)bgImageView{ + if(!_bgImageView){ + _bgImageView = [UIImageView new]; + _bgImageView.layer.cornerRadius = 7; + _bgImageView.layer.masksToBounds = YES; + _bgImageView.layer.borderColor = [UIColor colorWithWhite:1 alpha:0.8].CGColor; + _bgImageView.layer.borderWidth = 1; + _bgImageView.userInteractionEnabled = YES; + UIImage *image = [UIImage imageWithColor:[UIColor colorWithWhite:0 alpha:0.6]]; + _bgImageView.image = [UIImage setBlurImage:image value:1]; + } + return _bgImageView; +} +- (NetImageView *)playIconView{ + if(!_playIconView){ + _playIconView = [NetImageView new]; + _playIconView.userInteractionEnabled = YES; + UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(clickPlayImageAction)]; + [_playIconView addGestureRecognizer:tap]; + + } + return _playIconView; +} +@end diff --git a/YuMi/Modules/YMRoom/View/ActivityContainerView/XPRoomActivityContainerView.m b/YuMi/Modules/YMRoom/View/ActivityContainerView/XPRoomActivityContainerView.m index 769c8d96..4d9584cb 100644 --- a/YuMi/Modules/YMRoom/View/ActivityContainerView/XPRoomActivityContainerView.m +++ b/YuMi/Modules/YMRoom/View/ActivityContainerView/XPRoomActivityContainerView.m @@ -6,6 +6,7 @@ // #import "XPRoomActivityContainerView.h" +#import ///Third #import #import @@ -38,37 +39,32 @@ #import "PIRoomEnterRedPacketView.h" #import "BaseNavigationController.h" #import "PIRoomActivityWebView.h" +#import "PIRoomActivityClickView.h" +#import "PIRoomActivityChoosePlayView.h" UIKIT_EXTERN NSString *kShowFirstRechargeView; -@interface XPRoomActivityContainerView () +@interface XPRoomActivityContainerView () ///容器 @property (nonatomic,strong) UIStackView *stackView; ///轮播图 @property (nonatomic,strong) SDCycleScrollView *pi_cycleScrollView; -///糖果树 -@property (nonatomic,strong) NetImageView *lookLoveImageView; - ///红包 @property(nonatomic,strong) PIRoomEnterRedPacketView *redPacketView; -///夺宝精灵 -@property (nonatomic,strong) TreasureFairyLimitModel *fairyModel; +///玩法 +@property(nonatomic,strong) PIRoomActivityClickView *clickPlayView; + ///参加相亲 @property (nonatomic,strong) UIImageView *joinDatingView; ///host 代理 @property (nonatomic,weak) idhostDelegate; ///房间活动的列表 -@property (nonatomic,copy) NSMutableArray *activityList; - +@property (nonatomic,strong) NSMutableArray *activityList; +@property(nonatomic,strong) NSMutableArray *playList; ///航海 @property (nonatomic,strong) UIImageView *sailingImageView; ///是否加载了活动 @property (nonatomic,assign) BOOL isLoadActivity; -///夺宝精灵 -@property (nonatomic,strong) ActivityInfoModel *fairyActivityModel; -///首充 -@property (nonatomic,strong) ActivityInfoModel * firstRechargeModel; -///寻爱之旅 -@property (nonatomic,strong) ActivityInfoModel * lookLoveModel; + @end @implementation XPRoomActivityContainerView @@ -82,7 +78,7 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView; [self initSubViews]; [self initSubViewConstraints]; [self requestActivityList]; - [self configLookLove]; + } return self; } @@ -94,8 +90,9 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView; [self.stackView addArrangedSubview:self.pi_cycleScrollView]; [self.stackView addArrangedSubview:emptyView]; [self.stackView addArrangedSubview:self.redPacketView]; - [self.stackView addArrangedSubview:self.lookLoveImageView]; [self.stackView addArrangedSubview:self.joinDatingView]; + [self.stackView addArrangedSubview:self.clickPlayView]; + } @@ -113,127 +110,96 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView; }]; - [self.lookLoveImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.size.mas_equalTo(CGSizeMake(itemWidth, itemWidth)); + [self.clickPlayView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(0); + make.size.mas_equalTo(CGSizeMake(81, 66)); }]; [self.joinDatingView mas_makeConstraints:^(MASConstraintMaker *make) { - make.height.mas_equalTo(35* kScreenHeightScale); + make.height.mas_equalTo(35 * kScreenHeightScale); }]; } - (void)requestActivityList { - ///网络请求异步加载 - dispatch_group_t group =dispatch_group_create(); - // 并行队列 - dispatch_queue_t queue =dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0); - dispatch_group_enter(group); - dispatch_group_async(group, queue, ^{ - + + RACSubject* list = [RACSubject subject]; + RACSubject* play = [RACSubject subject]; + [[RACSignal combineLatest:@[list, play] reduce:^id(NSArray * listModel, NSArray * playModel){ + self.activityList = [NSMutableArray arrayWithArray:listModel]; + self.playList = [NSMutableArray arrayWithArray:playModel]; + [self dealWithData]; + return nil; + }] subscribeError:^(NSError * _Nullable error) { + + }]; NSString * roomId = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.roomId]; [Api roomActivityList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { if (code == 200) { NSArray * array = [ActivityInfoModel modelsWithArray:data.data]; - [self.activityList addObjectsFromArray:array]; + [list sendNext:array]; + [list sendCompleted]; + return; } - dispatch_group_leave(group); - } roomId:roomId type:@"2"]; + [list sendError:nil]; + } roomId:roomId]; - }); - - dispatch_group_enter(group); - dispatch_group_async(group, queue, ^{ - - [Api treasureFailyLimitInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { - if(code == 200){ - TreasureFairyLimitModel * info =[TreasureFairyLimitModel modelWithDictionary:data.data]; - self.fairyModel = info; - } - dispatch_group_leave(group); - }]; - - }); + + [Api getPlayList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { + if (code == 200) { + NSArray * array = [ActivityInfoModel modelsWithArray:data.data]; + [play sendNext:array]; + [play sendCompleted]; + return; + } + [play sendError:nil]; + } roomId:roomId]; + - dispatch_group_notify(group,dispatch_get_main_queue(), ^{ - self.isLoadActivity = YES; - self.pi_cycleScrollView.hidden = NO; - if (self.hostDelegate.getRoomInfo.type == RoomType_MiniGame) { - [self configLittleGameActivity]; - } else { - ///是否包含首充 - [self configFairy]; - [self configfirstRecharge]; - NSMutableArray *picArray = [NSMutableArray array]; - for (ActivityInfoModel *model in self.activityList) { - [picArray addObject:model.bannerPic]; - } - self.pi_cycleScrollView.imageURLStringsGroup = picArray; - if (self.activityList.count > 1) { - [self.pi_cycleScrollView setAutoScroll:YES]; - self.pi_cycleScrollView.autoScrollTimeInterval = 3; - } else { - [self.pi_cycleScrollView setAutoScroll:NO]; - } - } - }); } -///首充 --(void)configfirstRecharge{ - UserInfoModel * userInfo = self.hostDelegate.getUserInfo; - if (userInfo.isFirstCharge == YES) { - if(![self.activityList containsObject:self.firstRechargeModel]){ - [self.activityList insertObject:self.firstRechargeModel atIndex:0]; - } - }else{ - if([self.activityList containsObject:self.firstRechargeModel]){ - [self.activityList removeObject:self.firstRechargeModel]; - } - - } -} -///夺宝精灵 --(void)configFairy{ - if (self.fairyModel.open == YES) { - if(![self.activityList containsObject:self.fairyActivityModel]){ - [self.activityList insertObject:self.fairyActivityModel atIndex:0]; - } - }else{ - if([self.activityList containsObject:self.fairyActivityModel]){ - [self.activityList removeObject:self.fairyActivityModel]; - } - } -} -///寻爱之旅 -- (void)configLookLove { - UserInfoModel * userInfo = self.hostDelegate.getUserInfo; - RoomInfoModel * roomInfo = self.hostDelegate.getRoomInfo; - if (userInfo.userLevelVo.experLevelSeq >= roomInfo.findLoveDrawSwitchVo.openLevel && roomInfo.findLoveDrawSwitchVo.open == YES) { - self.lookLoveImageView.hidden = NO; - self.lookLoveImageView.image = [UIImage imageNamed:@"room_candy_tree_enter"]; +-(void)dealWithData{ + self.isLoadActivity = YES; + self.pi_cycleScrollView.hidden = NO; + if (self.hostDelegate.getRoomInfo.type == RoomType_MiniGame) { + [self configLittleGameActivity]; } else { - self.lookLoveImageView.hidden = YES; + + NSMutableArray *picArray = [NSMutableArray array]; + for (ActivityInfoModel *model in self.activityList) { + [picArray addObject:model.icon]; + } + self.pi_cycleScrollView.imageURLStringsGroup = picArray; + if (self.activityList.count > 1) { + [self.pi_cycleScrollView setAutoScroll:YES]; + self.pi_cycleScrollView.autoScrollTimeInterval = 3; + } else { + [self.pi_cycleScrollView setAutoScroll:NO]; + } + if(self.playList.count > 0){ + ActivityInfoModel *playModel = self.playList.firstObject; + self.clickPlayView.model = playModel; + self.clickPlayView.hidden = NO; + }else{ + self.clickPlayView.hidden = YES; + } } - } + + + - (void)configLittleGameActivity { - RoomInfoModel * roomInfo = self.hostDelegate.getRoomInfo; - UserInfoModel * userInfo = self.hostDelegate.getUserInfo; - if (userInfo.userLevelVo.experLevelSeq >= roomInfo.findLoveDrawSwitchVo.openLevel && roomInfo.findLoveDrawSwitchVo.open == YES) { - self.lookLoveModel.bannerPic = @"room_candy_tree_enter"; - if(![self.activityList containsObject:self.lookLoveModel]){ - [self.activityList insertObject:self.lookLoveModel atIndex:0]; - } - - } + + NSMutableArray *list = [NSMutableArray array]; + [list addObjectsFromArray:self.playList]; + [list addObjectsFromArray:self.activityList]; NSMutableArray *picArray = [NSMutableArray array]; - for (ActivityInfoModel *model in self.activityList) { - [picArray addObject:model.bannerPic]; + for (ActivityInfoModel *model in list) { + [picArray addObject:model.icon]; } self.pi_cycleScrollView.imageURLStringsGroup = picArray; if (self.activityList.count > 1) { @@ -256,7 +222,7 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView; self.redPacketView.type = roomInfo.type; if (roomInfo.type == RoomType_MiniGame) { self.redPacketView.hidden = YES; - self.lookLoveImageView.hidden = YES; + self.clickPlayView.hidden = YES; self.sailingImageView.hidden = YES; if (self.isLoadActivity) { [self configLittleGameActivity]; @@ -265,16 +231,9 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView; } } else { self.redPacketView.redPacketList = self.redPacketList; - if([self.activityList containsObject:self.lookLoveModel]){ - [self.activityList removeObject:self.lookLoveModel]; - } - [self configLookLove]; - - [self configFairy]; - [self configfirstRecharge]; NSMutableArray *picArray = [NSMutableArray array]; for (ActivityInfoModel *model in self.activityList) { - [picArray addObject:model.bannerPic]; + [picArray addObject:model.icon]; } self.pi_cycleScrollView.imageURLStringsGroup = picArray; if (self.activityList.count > 1) { @@ -283,6 +242,13 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView; } else { [self.pi_cycleScrollView setAutoScroll:NO]; } + if(self.playList.count > 0){ + ActivityInfoModel *playModel = self.playList.firstObject; + self.clickPlayView.model = playModel; + self.clickPlayView.hidden = NO; + }else{ + self.clickPlayView.hidden = YES; + } if (roomInfo.roomModeType == RoomModeType_Open_Blind || roomInfo.roomModeType == RoomModeType_Open_PK_Mode || roomInfo.roomModeType == RoomModeType_Open_Micro_Mode) { if (roomInfo.roomModeType == RoomModeType_Open_PK_Mode ) { self.joinDatingView.image = [UIImage imageNamed:@"room_pk_normal_member_enter"]; @@ -374,9 +340,16 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView; if (imageUrlList.count > index) { NSString *pic = imageUrlList[index]; NSMutableArray *inftList = [NSMutableArray array]; + NSMutableArray *modelList = [NSMutableArray array]; + if (self.hostDelegate.getRoomInfo.type == RoomType_MiniGame) { + [modelList addObjectsFromArray:self.playList]; + [modelList addObjectsFromArray:self.activityList]; + }else{ + modelList = self.activityList; + } ActivityInfoModel * info; - for (ActivityInfoModel * getInfo in self.activityList) { - if([getInfo.bannerPic isEqualToString:pic]){ + for (ActivityInfoModel * getInfo in modelList) { + if([getInfo.icon isEqualToString:pic]){ info = getInfo; } if(getInfo.skipType == 3){ @@ -384,12 +357,13 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView; } } if(info == nil)return; - if (info.activityType == ActivityType_Love) { - [self lookLoveTapRecognizer]; - } else if(info.activityType == ActivityType_First) { + if([info.code isEqualToString:@"FIRST_CHARGE"]) { [self firstRechargeTapRecognizer]; - }else if(info.activityType == ActivityType_Fairy){ - + }else if ([info.code isEqualToString:@"FIND_LOVE"]) { + [self lookLoveTapRecognizer]; + } else if([info.code isEqualToString:@"NAUTICAL_ADVENTURE"]) { + [self sailTapRecognizer]; + }else if([info.code isEqualToString:@"SEIZE_TREASURE"]){ XPTreasureFairyViewController * fairyVC = [[XPTreasureFairyViewController alloc] initWithdelegate:self.hostDelegate]; fairyVC.roomUid =[NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.uid]; fairyVC.view.frame = CGRectMake(0, KScreenHeight, KScreenWidth, KScreenHeight); @@ -407,19 +381,21 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView; if (info.skipType == ActivitySkipType_Room) { [self.hostDelegate exitRoom]; - [XPRoomViewController openRoom:info.skipUri viewController:kWindow.rootViewController]; + [XPRoomViewController openRoom:info.url viewController:kWindow.rootViewController]; } else if(info.skipType == ActivitySkipType_Web) { + + PIRoomActivityWebView * webView = [[PIRoomActivityWebView alloc]initWithFrame:CGRectMake(0, KScreenHeight, KScreenWidth, KScreenHeight)]; + webView.roomUid = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.uid]; + webView.url = info.url; + webView.infoList = inftList; + [kWindow addSubview:webView]; + [UIView animateWithDuration:0.2 animations:^{ + webView.frame = CGRectMake(0, 0, KScreenWidth, KScreenHeight); + }]; + - PIRoomActivityWebView * webView = [[PIRoomActivityWebView alloc]initWithFrame:CGRectMake(0, KScreenHeight, KScreenWidth, KScreenHeight)]; - webView.roomUid = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.uid]; - webView.url = info.skipUri; - webView.infoList = inftList; - [kWindow addSubview:webView]; - [UIView animateWithDuration:0.2 animations:^{ - webView.frame = CGRectMake(0, 0, KScreenWidth, KScreenHeight); - }]; } } } @@ -478,6 +454,69 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView; self.openRedPacketHandle(redModel,self.hostDelegate.getRoomInfo.type,NO); } } +#pragma mark - PIRoomActivityClickViewDelegate +- (void)showChoosePlayViewAction{ + self.clickPlayView.hidden = YES; + PIRoomActivityChoosePlayView *choosePlayView = [[PIRoomActivityChoosePlayView alloc]initWithFrame:CGRectZero]; + choosePlayView.delegate = self; + choosePlayView.playList = self.playList; + CGFloat y = self.frame.size.height + self.frame.origin.y - 124; + [self.hostDelegate.getSuperView addSubview:choosePlayView]; + choosePlayView.frame = CGRectMake(KScreenWidth, y, 201, 124); + + [UIView animateWithDuration:0.1 animations:^{ + + choosePlayView.frame = CGRectMake(KScreenWidth - 201, y, 201, 124); + }]; +} +-(void)clickPlayTypeWithModel:(ActivityInfoModel *)model{ + if ([model.code isEqualToString:@"FIND_LOVE"]) { + [self lookLoveTapRecognizer]; + } else if([model.code isEqualToString:@"NAUTICAL_ADVENTURE"]) { + [self sailTapRecognizer]; + }else if([model.code isEqualToString:@"SEIZE_TREASURE"]){ + XPTreasureFairyViewController * fairyVC = [[XPTreasureFairyViewController alloc] initWithdelegate:self.hostDelegate]; + fairyVC.roomUid =[NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.uid]; + fairyVC.view.frame = CGRectMake(0, KScreenHeight, KScreenWidth, KScreenHeight); + [[XCCurrentVCStackManager shareManager].getCurrentVC addChildViewController:fairyVC]; + [fairyVC.navigationController setNavigationBarHidden:YES animated:NO]; + [[XCCurrentVCStackManager shareManager].getCurrentVC.view addSubview:fairyVC.view]; + [UIView animateWithDuration:0.2 animations:^{ + + fairyVC.view.frame = CGRectMake(0, 0, KScreenWidth, KScreenHeight); + + }completion:^(BOOL finished) { + + }]; + } else if(model.skipType == ActivitySkipType_Web) { + if(model.skipType == ActivityShowType_Half){ + XPRoomHalfWebView * webView = [[XPRoomHalfWebView alloc] init]; + webView.roomUid = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.uid]; + webView.url = model.url; + [TTPopup popupView:webView style:TTPopupStyleActionSheet]; + return; + } + XPWebViewController * webVC = [[XPWebViewController alloc] init]; + webVC.roomUid = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.uid]; + webVC.url = model.url; + [self.hostDelegate.getCurrentNav pushViewController:webVC animated:YES]; + } +} +#pragma mark- PIRoomActivityChoosePlayViewDelegate +-(void)choosePlayTypeWithView:(PIRoomActivityChoosePlayView *)view model:(ActivityInfoModel *)model{ + [self hiddenViewActionWithView:view]; + [self clickPlayTypeWithModel:model]; + self.clickPlayView.model = model; +} +-(void)hiddenViewActionWithView:(PIRoomActivityChoosePlayView *)view{ + CGFloat y = self.frame.size.height + self.frame.origin.y - 124; + [UIView animateWithDuration:0.1 animations:^{ + view.frame = CGRectMake(KScreenWidth, y, 201, 124); + }completion:^(BOOL finished) { + self.clickPlayView.hidden = NO; + [view removeFromSuperview]; + }]; +} #pragma mark - Getters And Setters - (SDCycleScrollView *)pi_cycleScrollView { if (!_pi_cycleScrollView) { @@ -509,24 +548,11 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView; _stackView.distribution = UIStackViewDistributionFill; _stackView.alignment = UIStackViewAlignmentCenter; _stackView.spacing = 0; + } return _stackView; } -- (UIImageView *)lookLoveImageView { - if (!_lookLoveImageView) { - NetImageConfig * config = [[NetImageConfig alloc] init]; - config.placeHolder = [UIImage imageNamed:@"room_candy_tree_enter"]; - config.imageType = ImageTypeUserIcon; - _lookLoveImageView = [[NetImageView alloc] initWithConfig:config]; - _lookLoveImageView.userInteractionEnabled = YES; - _lookLoveImageView.hidden = YES; - _lookLoveImageView.image = [UIImage imageNamed:@"room_candy_tree_enter"]; - UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(lookLoveTapRecognizer)]; - [_lookLoveImageView addGestureRecognizer:tap]; - } - return _lookLoveImageView; -} @@ -561,35 +587,9 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView; } return _sailingImageView; } -- (ActivityInfoModel *)fairyActivityModel{ - if (!_fairyActivityModel){ - ActivityInfoModel *fairyModel = [ActivityInfoModel new]; - fairyModel.bannerName = YMLocalizedString(@"XPRoomActivityContainerView3"); - fairyModel.bannerPic = @"room_treasure_fairy_enter"; - _fairyActivityModel = fairyModel; - _fairyActivityModel.activityType = ActivityType_Fairy; - } - return _fairyActivityModel; -} -- (ActivityInfoModel *)firstRechargeModel{ - if (!_firstRechargeModel){ - ActivityInfoModel * activityInfo = [[ActivityInfoModel alloc] init]; - activityInfo.bannerPic = @"room_first_recharge_enter"; - activityInfo.bannerName = YMLocalizedString(@"XPRoomActivityContainerView0"); - _firstRechargeModel = activityInfo; - _firstRechargeModel.activityType = ActivityType_First; - } - return _firstRechargeModel; -} --(ActivityInfoModel *)lookLoveModel{ - if (!_lookLoveModel){ - ActivityInfoModel * activityInfo = [[ActivityInfoModel alloc] init]; - activityInfo.bannerName = YMLocalizedString(@"XPRoomActivityContainerView1"); - _lookLoveModel = activityInfo; - _lookLoveModel.activityType = ActivityType_Love; - } - return _lookLoveModel; -} + + + - (PIRoomEnterRedPacketView *)redPacketView{ if(!_redPacketView){ _redPacketView = [[PIRoomEnterRedPacketView alloc]initWithFrame:CGRectZero]; @@ -598,4 +598,13 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView; } return _redPacketView; } +- (PIRoomActivityClickView *)clickPlayView{ + if(!_clickPlayView){ + _clickPlayView = [[PIRoomActivityClickView alloc]initWithFrame:CGRectZero]; + _clickPlayView.hidden = YES; + _clickPlayView.delegate = self; + } + return _clickPlayView; +} + @end diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m b/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m index a438505c..226f7c2c 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m @@ -179,6 +179,8 @@ messageInfo.nameText = nick; messageInfo.albumModel = albumModel; return messageInfo; + }else if(first == CustomMessageType_Guardian_Planet){ + return [self createGuardianPlanetAttribute:attachment messageInfo:messageInfo]; } return nil; } @@ -460,6 +462,24 @@ // return attribute; //} +- (XPMessageInfoModel *)createGuardianPlanetAttribute:(AttachmentModel *)attachment messageInfo:(XPMessageInfoModel *)messageInfo{ + XPRoomStarKitchenModel *starModel = [XPRoomStarKitchenModel modelWithDictionary:attachment.data]; + NSString *title = [NSString stringWithFormat:YMLocalizedString(@"XPRoomMessageParser1033334"),starModel.nick,starModel.diamonds]; + NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] initWithString:title attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:kRoomMessageDefalutFont],NSForegroundColorAttributeName:[DJDKMIMOMColor messageDefaultTextColor]}]; + [attribute addAttributes:@{NSForegroundColorAttributeName:[DJDKMIMOMColor messageNickColor]} range:[title rangeOfString:starModel.nick]]; + [attribute addAttributes:@{NSForegroundColorAttributeName:[DJDKMIMOMColor messageTextColor]} range:[title rangeOfString:[NSString stringWithFormat:@"%@",starModel.diamonds]]]; + @kWeakify(self) + [attribute yy_setTextHighlightRange:[title rangeOfString:starModel.nick] color:nil backgroundColor:nil tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) { + @kStrongify(self); + if (starModel.uid.integerValue <= 0) {return;} + [self showUserCard:starModel.uid.integerValue]; + }]; + + messageInfo.content = attribute; + return messageInfo; +} + + - (XPMessageInfoModel *)createStarredKitchenAttribute:(AttachmentModel *)attachment messageInfo:(XPMessageInfoModel *)messageInfo{ XPRoomStarKitchenModel *starModel = [XPRoomStarKitchenModel modelWithDictionary:attachment.data]; NSString *title = [NSString stringWithFormat:YMLocalizedString(@"XPRoomMessageParser1033333"),starModel.nick,starModel.itemMultiple,starModel.diamonds]; diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/View/PIRoomMessagePhotoAlbumView.m b/YuMi/Modules/YMRoom/View/MessageContainerView/View/PIRoomMessagePhotoAlbumView.m index c3795aad..ac821b36 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/View/PIRoomMessagePhotoAlbumView.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/View/PIRoomMessagePhotoAlbumView.m @@ -108,7 +108,7 @@ @kStrongify(self); dispatch_async(dispatch_get_main_queue(), ^{ // UI更新代码 - self.unlockPhotoView.image = [self setBlurImage:image]; + self.unlockPhotoView.image = [UIImage setBlurImage:image value:30]; }); }]; @@ -124,38 +124,7 @@ } } --(UIImage *)setBlurImage:(UIImage *)image{ - - CIContext *context = [CIContext contextWithOptions:nil]; - CIImage * sourceImage = [CIImage imageWithCGImage:image.CGImage];//将图片转换成CIImage - - ///图片仿射滤镜 - - CIFilter * clamp = [CIFilter filterWithName:@"CIAffineClamp"];//设置绘制类型 - - [clamp setValue:sourceImage forKey:kCIInputImageKey];//设置要绘制的图片 - - CIImage *clampResult = [clamp valueForKey:kCIOutputImageKey]; - - ///高斯模糊滤镜 - - CIFilter* gaussianBlur = [CIFilter filterWithName:@"CIGaussianBlur"]; - - [gaussianBlur setValue:clampResult forKey:kCIInputImageKey]; - - [gaussianBlur setValue:[NSNumber numberWithFloat:30] forKey:@"inputRadius"];//设置模糊值 - - CIImage * gaussianBlurResult = [gaussianBlur valueForKey:kCIOutputImageKey]; - - ///转化获取图片 - - CGImageRef cgImage = [context createCGImage:gaussianBlurResult fromRect:[sourceImage extent]]; - - UIImage * resultImage = [UIImage imageWithCGImage:cgImage]; - return resultImage; - -} -(void)unlockAction{ if(self.delegate && [self.delegate respondsToSelector:@selector(unlockAlbumHandle)]){ [self.delegate unlockAlbumHandle]; diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.m b/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.m index 615cc9d7..d413d7d1 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.m @@ -529,7 +529,12 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; @(Custom_Message_Sub_Treasure_Fairy_Convert_L1), @(Custom_Message_Sub_Treasure_Fairy_Convert_L2), @(Custom_Message_Sub_Treasure_Fairy_Convert_L3), - nil] + nil], + @(CustomMessageType_Guardian_Planet): + [NSSet setWithObjects: + @(Custom_Message_Sub_Guardian_Planet_One_Room), + @(Custom_Message_Sub_Guardian_Planet_All_Room), + nil], }; } diff --git a/YuMi/Modules/YMRoom/View/RoomHostDelegate.h b/YuMi/Modules/YMRoom/View/RoomHostDelegate.h index a521562e..002b5935 100644 --- a/YuMi/Modules/YMRoom/View/RoomHostDelegate.h +++ b/YuMi/Modules/YMRoom/View/RoomHostDelegate.h @@ -31,6 +31,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)exitRoom; - (void)miniRoom; - (UINavigationController *)getCurrentNav; +-(UIView *)getSuperView; - (NSArray *)getRoomSuperAdminList; ///获取房间PK队伍的 - (NSArray *)getRoomPKGroupTeamList; diff --git a/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/View/Cell/PIRoomPhotoAlbumItemCell.m b/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/View/Cell/PIRoomPhotoAlbumItemCell.m index fef5e415..f94842b1 100644 --- a/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/View/Cell/PIRoomPhotoAlbumItemCell.m +++ b/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/View/Cell/PIRoomPhotoAlbumItemCell.m @@ -93,7 +93,7 @@ @kStrongify(self); dispatch_async(dispatch_get_main_queue(), ^{ // UI更新代码 - self.bgImageView.image = [self setBlurImage:image]; + self.bgImageView.image = [UIImage setBlurImage:image value:30]; }); }]; }else{ @@ -116,38 +116,7 @@ } } --(UIImage *)setBlurImage:(UIImage *)image{ - - CIContext *context = [CIContext contextWithOptions:nil]; - CIImage * sourceImage = [CIImage imageWithCGImage:image.CGImage];//将图片转换成CIImage - - ///图片仿射滤镜 - - CIFilter * clamp = [CIFilter filterWithName:@"CIAffineClamp"];//设置绘制类型 - - [clamp setValue:sourceImage forKey:kCIInputImageKey];//设置要绘制的图片 - - CIImage *clampResult = [clamp valueForKey:kCIOutputImageKey]; - - ///高斯模糊滤镜 - - CIFilter* gaussianBlur = [CIFilter filterWithName:@"CIGaussianBlur"]; - - [gaussianBlur setValue:clampResult forKey:kCIInputImageKey]; - - [gaussianBlur setValue:[NSNumber numberWithFloat:30] forKey:@"inputRadius"];//设置模糊值 - - CIImage * gaussianBlurResult = [gaussianBlur valueForKey:kCIOutputImageKey]; - - ///转化获取图片 - - CGImageRef cgImage = [context createCGImage:gaussianBlurResult fromRect:[sourceImage extent]]; - - UIImage * resultImage = [UIImage imageWithCGImage:cgImage]; - return resultImage; - -} -(void)operateAction{ if(self.delegate && [self.delegate respondsToSelector:@selector(pIRoomPhotoAlbumItemCell:clickMornWithModel:)]){ [self.delegate pIRoomPhotoAlbumItemCell:self clickMornWithModel:self.albumModel]; diff --git a/YuMi/Modules/YMRoom/View/XPRoomViewController.m b/YuMi/Modules/YMRoom/View/XPRoomViewController.m index c6035d15..cf0fb684 100644 --- a/YuMi/Modules/YMRoom/View/XPRoomViewController.m +++ b/YuMi/Modules/YMRoom/View/XPRoomViewController.m @@ -367,6 +367,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 [self.view addSubview:self.littleGameView]; [self.view addSubview:self.stageView]; [self.view addSubview:self.messageContainerView]; + [self.view addSubview:self.quickMessageContainerView]; [self.view addSubview:self.menuContainerView]; [self.view addSubview:self.activityContainerView]; @@ -452,7 +453,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 make.top.mas_equalTo(self.messageContainerView); make.right.mas_equalTo(self.view); make.bottom.mas_equalTo(self.quickMessageContainerView.mas_top).offset(-5); - make.width.mas_equalTo(80); + make.width.mas_equalTo(87); }]; [self.redPacketView mas_makeConstraints:^(MASConstraintMaker *make) { make.width.height.mas_equalTo(kGetScaleWidth(58)); @@ -504,7 +505,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 make.top.mas_equalTo(self.messageContainerView); make.right.mas_equalTo(self.anchorScrollView.middleImageView); make.bottom.mas_equalTo(self.quickMessageContainerView.mas_top).mas_offset(-5); - make.width.mas_equalTo(80); + make.width.mas_equalTo(87); }]; @@ -623,7 +624,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 make.height.mas_equalTo(65); make.right.mas_equalTo(self.view); make.bottom.mas_equalTo(self.quickMessageContainerView.mas_top).offset(-5); - make.width.mas_equalTo(80); + make.width.mas_equalTo(87); }]; } else { @@ -649,7 +650,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 make.top.mas_equalTo(self.messageContainerView); make.right.mas_equalTo(self.view); make.bottom.mas_equalTo(self.quickMessageContainerView.mas_top).offset(-5); - make.width.mas_equalTo(80); + make.width.mas_equalTo(87); }]; } @@ -700,7 +701,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 make.top.mas_equalTo(self.messageContainerView); make.right.mas_equalTo(self.anchorScrollView.middleImageView); make.bottom.mas_equalTo(self.quickMessageContainerView.mas_top).mas_offset(-5); - make.width.mas_equalTo(80); + make.width.mas_equalTo(87); }]; } @@ -1676,9 +1677,11 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 if(attachment.first == CustomMessageType_Graffiti_Star_Kitchen && attachment.second == Custom_Message_Sub_Star_Kitchen_FullScreen){ isHave = YES; }else if(attachment.first == CustomMessageType_Look_Love && attachment.second == Custom_Message_Sub_Look_Love_InRoom_NeedAllMicSend){ - isHave = YES; + + }else if(attachment.first == CustomMessageType_Guardian_Planet && attachment.second == Custom_Message_Sub_Guardian_Planet_All_Room){ + }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)) { //夺宝精灵 - isHave = YES; + }else if (attachment.first == CustomMessageType_Tarot && (attachment.second == Custom_Message_Sub_Tarot_Advanced || attachment.second == Custom_Message_Sub_Tarot_Intermediate)){ isHave = YES; }if (attachment.first == CustomMessageType_RedPacket && attachment.second == Custom_Message_Sub_AllDiamandRedPacket) { @@ -1950,7 +1953,9 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 - (UINavigationController *)getCurrentNav { return self.navigationController; } - +-(UIView *)getSuperView{ + return self.view; +} - (NSMutableDictionary *)getMicroQueue { return [self.stageView getMicroQueue]; } diff --git a/YuMi/Structure/PrefixHeader.pch b/YuMi/Structure/PrefixHeader.pch index 47258b55..1cc7e276 100644 --- a/YuMi/Structure/PrefixHeader.pch +++ b/YuMi/Structure/PrefixHeader.pch @@ -57,5 +57,5 @@ isEnterprise = [bundleID isEqualToString:@"com.hflighting.yumi"];\ #import "BSNetListenModel.h" #import "PIBaseModel.h" #import "PLTimeUtil.h" - +#import "UIImage+ImageEffects.h" #endif /* PrefixHeader_pch */ diff --git a/YuMi/Tools/YYUtility/YYUtility+App.m b/YuMi/Tools/YYUtility/YYUtility+App.m index a99ad256..091d88ed 100644 --- a/YuMi/Tools/YYUtility/YYUtility+App.m +++ b/YuMi/Tools/YYUtility/YYUtility+App.m @@ -138,7 +138,7 @@ static NSString *_from = nil; if (isEnterprise == NO) { _from = @"piko_Enterprise"; // 企业包 }else { - _from = PI_App_Source; // App Store包 + _from = PI_App_Source; //appstore App Store包 } } } diff --git a/YuMi/zh-Hans.lproj/Localizable.strings b/YuMi/zh-Hans.lproj/Localizable.strings index 02261b22..5901aeb6 100644 --- a/YuMi/zh-Hans.lproj/Localizable.strings +++ b/YuMi/zh-Hans.lproj/Localizable.strings @@ -49,6 +49,7 @@ "LoginPresenter1" = "登录失败,请重试"; "XPRoomStarKitchenBannerView0"="恭喜%@在星级厨房抽中%@倍奖励,获得 %@钻石!"; "XPRoomMessageParser1033333"="恭喜%@在星级厨房抽中 %@倍奖励,获得 %@钻石!"; +"XPRoomMessageParser1033334"="恭喜 [%@] 在守护星球中成功击败怪兽,获得%@鉆石奖励"; ///XPShareView.m "XPShareView0" = "拷贝成功"; "XPShareView1" = "来玩奥"; diff --git a/YuMi/zh-Hant.lproj/Localizable.strings b/YuMi/zh-Hant.lproj/Localizable.strings index 14335061..4a877cdf 100644 --- a/YuMi/zh-Hant.lproj/Localizable.strings +++ b/YuMi/zh-Hant.lproj/Localizable.strings @@ -49,6 +49,7 @@ "LoginPresenter1" = "登錄失敗,請重試"; "XPRoomStarKitchenBannerView0"="恭喜%@在星級廚房抽中%@倍獎勵,獲得 %@鉆石!"; "XPRoomMessageParser1033333"="恭喜%@在星級廚房抽中 %@倍獎勵,獲得 %@鉆石!"; +"XPRoomMessageParser1033334"="恭喜 [%@] 在守護星球中成功擊敗怪獸,獲得%@鉆石獎勵"; ///XPShareView.m "XPShareView0" = "拷貝成功"; "XPShareView1" = "來玩奧";