推送及房间资源位优化

This commit is contained in:
liyuhua
2024-02-21 10:18:59 +08:00
parent 8e1ca7fa99
commit 6cbf6c55ca
38 changed files with 753 additions and 304 deletions

View File

@@ -309,6 +309,9 @@
23B2AEC42A6516C200543D17 /* LoginForgetPasswordViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 23B2AEC22A6516C200543D17 /* LoginForgetPasswordViewController.m */; }; 23B2AEC42A6516C200543D17 /* LoginForgetPasswordViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 23B2AEC22A6516C200543D17 /* LoginForgetPasswordViewController.m */; };
23BA165B2A5D2ACF0030C5A3 /* PIBaseAnimationViewModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 23BA165A2A5D2ACF0030C5A3 /* PIBaseAnimationViewModel.m */; }; 23BA165B2A5D2ACF0030C5A3 /* PIBaseAnimationViewModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 23BA165A2A5D2ACF0030C5A3 /* PIBaseAnimationViewModel.m */; };
23C7C0B72A7CD7B000802205 /* XPNewMineGuildItemView.m in Sources */ = {isa = PBXBuildFile; fileRef = 23C7C0B62A7CD7B000802205 /* XPNewMineGuildItemView.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 */; }; 23CEFB6C2AFB803B00576D89 /* PISwitchingEnvironmentVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 23CEFB6B2AFB803B00576D89 /* PISwitchingEnvironmentVC.m */; };
23CEFC4A2AFB8FC100576D89 /* BSNSStringUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 23CEFC0C2AFB8FC100576D89 /* BSNSStringUtil.m */; }; 23CEFC4A2AFB8FC100576D89 /* BSNSStringUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 23CEFC0C2AFB8FC100576D89 /* BSNSStringUtil.m */; };
23CEFC4B2AFB8FC100576D89 /* BSUIDemoUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 23CEFC0D2AFB8FC100576D89 /* BSUIDemoUtil.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 = "<group>"; }; 23BA165A2A5D2ACF0030C5A3 /* PIBaseAnimationViewModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIBaseAnimationViewModel.m; sourceTree = "<group>"; };
23C7C0B52A7CD7B000802205 /* XPNewMineGuildItemView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPNewMineGuildItemView.h; sourceTree = "<group>"; }; 23C7C0B52A7CD7B000802205 /* XPNewMineGuildItemView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPNewMineGuildItemView.h; sourceTree = "<group>"; };
23C7C0B62A7CD7B000802205 /* XPNewMineGuildItemView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPNewMineGuildItemView.m; sourceTree = "<group>"; }; 23C7C0B62A7CD7B000802205 /* XPNewMineGuildItemView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPNewMineGuildItemView.m; sourceTree = "<group>"; };
23C9DFC12B84807A00B51558 /* PIRoomActivityClickView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIRoomActivityClickView.h; sourceTree = "<group>"; };
23C9DFC22B84807A00B51558 /* PIRoomActivityClickView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIRoomActivityClickView.m; sourceTree = "<group>"; };
23C9DFC42B84903500B51558 /* PIRoomActivityChoosePlayView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIRoomActivityChoosePlayView.h; sourceTree = "<group>"; };
23C9DFC52B84903500B51558 /* PIRoomActivityChoosePlayView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIRoomActivityChoosePlayView.m; sourceTree = "<group>"; };
23C9DFC72B84917B00B51558 /* PIRoomActivityChoosePlayCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIRoomActivityChoosePlayCell.h; sourceTree = "<group>"; };
23C9DFC82B84917B00B51558 /* PIRoomActivityChoosePlayCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIRoomActivityChoosePlayCell.m; sourceTree = "<group>"; };
23CEFB6A2AFB803B00576D89 /* PISwitchingEnvironmentVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PISwitchingEnvironmentVC.h; sourceTree = "<group>"; }; 23CEFB6A2AFB803B00576D89 /* PISwitchingEnvironmentVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PISwitchingEnvironmentVC.h; sourceTree = "<group>"; };
23CEFB6B2AFB803B00576D89 /* PISwitchingEnvironmentVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PISwitchingEnvironmentVC.m; sourceTree = "<group>"; }; 23CEFB6B2AFB803B00576D89 /* PISwitchingEnvironmentVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PISwitchingEnvironmentVC.m; sourceTree = "<group>"; };
23CEFC0B2AFB8FC100576D89 /* BSXWDateUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BSXWDateUtil.h; sourceTree = "<group>"; }; 23CEFC0B2AFB8FC100576D89 /* BSXWDateUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BSXWDateUtil.h; sourceTree = "<group>"; };
@@ -9721,6 +9730,12 @@
children = ( children = (
E8AE427127153A3500BEEBB2 /* XPRoomActivityContainerView.h */, E8AE427127153A3500BEEBB2 /* XPRoomActivityContainerView.h */,
E8AE427227153A3500BEEBB2 /* XPRoomActivityContainerView.m */, E8AE427227153A3500BEEBB2 /* XPRoomActivityContainerView.m */,
23C9DFC12B84807A00B51558 /* PIRoomActivityClickView.h */,
23C9DFC22B84807A00B51558 /* PIRoomActivityClickView.m */,
23C9DFC42B84903500B51558 /* PIRoomActivityChoosePlayView.h */,
23C9DFC52B84903500B51558 /* PIRoomActivityChoosePlayView.m */,
23C9DFC72B84917B00B51558 /* PIRoomActivityChoosePlayCell.h */,
23C9DFC82B84917B00B51558 /* PIRoomActivityChoosePlayCell.m */,
9BAC92EC28E6989400147DD8 /* XPRoomActivityPlayView.h */, 9BAC92EC28E6989400147DD8 /* XPRoomActivityPlayView.h */,
9BAC92ED28E6989400147DD8 /* XPRoomActivityPlayView.m */, 9BAC92ED28E6989400147DD8 /* XPRoomActivityPlayView.m */,
235A45182B04A352009753F5 /* PIRoomActivityWebView.h */, 235A45182B04A352009753F5 /* PIRoomActivityWebView.h */,
@@ -11132,6 +11147,7 @@
E8998D8B2859CB6A00C68558 /* XPMineUserInfoGiftWallSubViewController.m in Sources */, E8998D8B2859CB6A00C68558 /* XPMineUserInfoGiftWallSubViewController.m in Sources */,
E8DEC9A42764A6600078CB70 /* XPMoreMenuPresenter.m in Sources */, E8DEC9A42764A6600078CB70 /* XPMoreMenuPresenter.m in Sources */,
189DD53426DE255300AB55B1 /* TabbarViewController.m in Sources */, 189DD53426DE255300AB55B1 /* TabbarViewController.m in Sources */,
23C9DFC92B84917B00B51558 /* PIRoomActivityChoosePlayCell.m in Sources */,
9BA3B40B293DCDFD0071DF1C /* XPVersionUpdateModel.m in Sources */, 9BA3B40B293DCDFD0071DF1C /* XPVersionUpdateModel.m in Sources */,
18EE401A2754BA9F00A452BF /* NIMMessageMaker.m in Sources */, 18EE401A2754BA9F00A452BF /* NIMMessageMaker.m in Sources */,
E8EEB91D26FC9D58007C6EBA /* XPMineUserInfoDateView.m in Sources */, E8EEB91D26FC9D58007C6EBA /* XPMineUserInfoDateView.m in Sources */,
@@ -11397,6 +11413,7 @@
E8998D8028597B0300C68558 /* XPRoomLuckyBigPrizeView.m in Sources */, E8998D8028597B0300C68558 /* XPRoomLuckyBigPrizeView.m in Sources */,
E88E4A80297673DC00019A50 /* SessionNavLiveView.m in Sources */, E88E4A80297673DC00019A50 /* SessionNavLiveView.m in Sources */,
E81060DC298761F100B772F0 /* MessageTextModel.m in Sources */, E81060DC298761F100B772F0 /* MessageTextModel.m in Sources */,
23C9DFC62B84903500B51558 /* PIRoomActivityChoosePlayView.m in Sources */,
235A45232B04BEB6009753F5 /* PIBaseModel.m in Sources */, 235A45232B04BEB6009753F5 /* PIBaseModel.m in Sources */,
E8DEC9A82764A68B0078CB70 /* Api+MoreMenu.m in Sources */, E8DEC9A82764A68B0078CB70 /* Api+MoreMenu.m in Sources */,
9B86D87A2817DD8400494FCD /* XPRoomEnterHideTipView.m in Sources */, 9B86D87A2817DD8400494FCD /* XPRoomEnterHideTipView.m in Sources */,
@@ -11628,6 +11645,7 @@
E84150C227747BF700A7F548 /* FirstRechargeModel.m in Sources */, E84150C227747BF700A7F548 /* FirstRechargeModel.m in Sources */,
9B1EF3D227E81C0600554295 /* XPMineDressUpBubbleViewController.m in Sources */, 9B1EF3D227E81C0600554295 /* XPMineDressUpBubbleViewController.m in Sources */,
2331C1AB2A60F32D00E1D940 /* CandyTreeResultModel.m in Sources */, 2331C1AB2A60F32D00E1D940 /* CandyTreeResultModel.m in Sources */,
23C9DFC32B84807A00B51558 /* PIRoomActivityClickView.m in Sources */,
1427218B29A75F6F00C7C423 /* HTTPFileResponse.m in Sources */, 1427218B29A75F6F00C7C423 /* HTTPFileResponse.m in Sources */,
E839533C276A0CCD00CF2F24 /* XPMineCarTableViewCell.m in Sources */, E839533C276A0CCD00CF2F24 /* XPMineCarTableViewCell.m in Sources */,
2331C1B62A60F32D00E1D940 /* XPCandyTreeInsufficientBalanceView.m in Sources */, 2331C1B62A60F32D00E1D940 /* XPCandyTreeInsufficientBalanceView.m in Sources */,
@@ -12217,7 +12235,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 20.20.9; MARKETING_VERSION = 20.20.10;
PRODUCT_BUNDLE_IDENTIFIER = com.peko.enterprise.ios; PRODUCT_BUNDLE_IDENTIFIER = com.peko.enterprise.ios;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
@@ -12253,7 +12271,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 20.20.9; MARKETING_VERSION = 20.20.10;
PRODUCT_BUNDLE_IDENTIFIER = com.peko.enterprise.ios; PRODUCT_BUNDLE_IDENTIFIER = com.peko.enterprise.ios;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";

View File

@@ -31,7 +31,7 @@
</Testables> </Testables>
</TestAction> </TestAction>
<LaunchAction <LaunchAction
buildConfiguration = "Release" buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0" launchStyle = "0"

View File

@@ -10,6 +10,8 @@
#import <NIMSDK/NIMSDK.h> #import <NIMSDK/NIMSDK.h>
#import <ShareSDK/ShareSDK.h> #import <ShareSDK/ShareSDK.h>
#import <UserNotifications/UNUserNotificationCenter.h> #import <UserNotifications/UNUserNotificationCenter.h>
#import <UserNotifications/UserNotifications.h>
///Tool ///Tool
#import "YUMIConstant.h" #import "YUMIConstant.h"
#import "CustomAttachmentDecoder.h" #import "CustomAttachmentDecoder.h"
@@ -23,6 +25,8 @@
#import "XCCurrentVCStackManager.h" #import "XCCurrentVCStackManager.h"
#import "ClientConfig.h" #import "ClientConfig.h"
#import <Adjust/Adjust.h> #import <Adjust/Adjust.h>
#import <UserNotifications/UserNotifications.h>
#import <Bugly/Bugly.h> #import <Bugly/Bugly.h>
@@ -44,6 +48,24 @@ UIKIT_EXTERN NSString * adImageName;
[self initEmojiData]; [self initEmojiData];
[self configAdjust]; [self configAdjust];
[self configBugly]; [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 Bugly
@@ -73,7 +95,12 @@ UIKIT_EXTERN NSString * adImageName;
// NIMSDK // NIMSDK
NSString *appKey = KeyWithType(KeyType_NetEase); NSString *appKey = KeyWithType(KeyType_NetEase);
NIMSDKOption *option = [NIMSDKOption optionWithAppKey:appKey]; NIMSDKOption *option = [NIMSDKOption optionWithAppKey:appKey];
#ifdef DEBUG
option.apnsCername = @"pikoDevelopPush";
#else
option.apnsCername = @"newPiko"; option.apnsCername = @"newPiko";
#endif
[[NIMSDK sharedSDK] registerWithOption:option]; [[NIMSDK sharedSDK] registerWithOption:option];
// NIM SDK // NIM SDK

View File

@@ -20,6 +20,7 @@
#import "XPLoginViewController.h" #import "XPLoginViewController.h"
#import "AccountModel.h" #import "AccountModel.h"
#import "YuMi-swift.h" #import "YuMi-swift.h"
#import "SessionViewController.h"
@import Firebase; @import Firebase;
UIKIT_EXTERN NSString * const kOpenRoomNotification; UIKIT_EXTERN NSString * const kOpenRoomNotification;
@@ -102,7 +103,37 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
- (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { - (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
// 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 ///URL Scheme

View File

@@ -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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 297 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 B

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "pi_room_activity_choose_play_arrow@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "pi_room_activity_choose_play_arrow@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 397 B

View File

@@ -103,5 +103,6 @@
- (UIImage *)applyTintEffectWithColor:(UIColor *)tintColor; - (UIImage *)applyTintEffectWithColor:(UIColor *)tintColor;
- (UIImage *)applyBlurWithRadius:(CGFloat)blurRadius tintColor:(UIColor *)tintColor saturationDeltaFactor:(CGFloat)saturationDeltaFactor maskImage:(UIImage *)maskImage; - (UIImage *)applyBlurWithRadius:(CGFloat)blurRadius tintColor:(UIColor *)tintColor saturationDeltaFactor:(CGFloat)saturationDeltaFactor maskImage:(UIImage *)maskImage;
///为图片增加毛玻璃,value模糊程度
+(UIImage *)setBlurImage:(UIImage *)image value:(CGFloat)value;
@end @end

View File

@@ -273,6 +273,37 @@
return outputImage; 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 @end

View File

@@ -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 @"appstore"
//#define PI_App_Source @"pi_tf" //#define PI_App_Source @"pi_tf"

View File

@@ -110,6 +110,8 @@ typedef NS_ENUM(NSUInteger, CustomMessageType) {
CustomMessageType_Common_H5 = 100, CustomMessageType_Common_H5 = 100,
///房间相册 ///房间相册
CustomMessageType_Room_Album = 101, CustomMessageType_Room_Album = 101,
///守护星球
CustomMessageType_Guardian_Planet = 102,
}; };
@@ -616,6 +618,12 @@ typedef NS_ENUM(NSUInteger, CustomMessageTypeRoomAlbum) {
///所有房间 ///所有房间
Custom_Message_Sub_Room_Album = 1011, 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<NIMCustomAttachment> @interface AttachmentModel : PIBaseModel<NIMCustomAttachment>
@property (nonatomic,assign) int first; @property (nonatomic,assign) int first;
@property (nonatomic,assign) int second; @property (nonatomic,assign) int second;

View File

@@ -71,7 +71,7 @@
CGFloat desHeight = [model.desc boundingRectWithSize:CGSizeMake(240, CGFLOAT_MAX) options:NSStringDrawingUsesFontLeading | NSStringDrawingUsesLineFragmentOrigin 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) { [self.subTitleLabel mas_updateConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(desHeight); make.height.mas_equalTo(desHeight);
}]; }];

View File

@@ -203,7 +203,7 @@
- (void)loadAlbumPhotos { - (void)loadAlbumPhotos {
@kWeakify(self); @kWeakify(self);
[YYUtility checkAssetsLibrayAvailable:^{ [YYUtility checkAssetsLibrayAvailable:^{
@kStrongify(self);
} denied:^{ } denied:^{
@@ -764,6 +764,8 @@
[Api getPrivateChatCheck:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { [Api getPrivateChatCheck:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
if(code == 200){ if(code == 200){
NIMMessage *message = [NIMMessageMaker msgWithText:text]; NIMMessage *message = [NIMMessageMaker msgWithText:text];
message.apnsPayload = @{@"uid": [AccountInfoStorage instance].getUid // ID
};
[[[NIMSDK sharedSDK] chatManager] sendMessage:message toSession:self.session error:nil]; [[[NIMSDK sharedSDK] chatManager] sendMessage:message toSession:self.session error:nil];
return; return;
} }
@@ -777,6 +779,8 @@
[Api getPrivateChatCheck:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { [Api getPrivateChatCheck:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
if(code == 200){ if(code == 200){
NIMMessage *message = [NIMMessageMaker msgWithAudio:recordPath]; NIMMessage *message = [NIMMessageMaker msgWithAudio:recordPath];
message.apnsPayload = @{@"uid": [AccountInfoStorage instance].getUid // ID
};
[[[NIMSDK sharedSDK] chatManager] sendMessage:message toSession:self.session error:nil]; [[[NIMSDK sharedSDK] chatManager] sendMessage:message toSession:self.session error:nil];
return; return;
} }
@@ -793,6 +797,8 @@
if(code == 200){ if(code == 200){
// //
NIMMessage * message = [NIMMessageMaker msgWithImage:obj]; NIMMessage * message = [NIMMessageMaker msgWithImage:obj];
message.apnsPayload = @{@"uid": [AccountInfoStorage instance].getUid // ID
};
// //
[[NIMSDK sharedSDK].chatManager sendMessage:message toSession:self.session error:nil]; [[NIMSDK sharedSDK].chatManager sendMessage:message toSession:self.session error:nil];
return; return;
@@ -985,7 +991,9 @@
[TTPopup alertWithConfig:config confirmHandler:^{ [TTPopup alertWithConfig:config confirmHandler:^{
NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString]; NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
if ([[UIApplication sharedApplication] canOpenURL:url]) { if ([[UIApplication sharedApplication] canOpenURL:url]) {
[[UIApplication sharedApplication] openURL:url]; [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:^(BOOL success) {
}];
} }
} cancelHandler:^{ } cancelHandler:^{
}]; }];
@@ -1057,6 +1065,8 @@
NIMMessage * message = [NIMMessageMaker msgWithImage:image]; NIMMessage * message = [NIMMessageMaker msgWithImage:image];
[Api getPrivateChatCheck:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { [Api getPrivateChatCheck:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
if(code == 200){ if(code == 200){
message.apnsPayload = @{@"uid": [AccountInfoStorage instance].getUid // ID
};
[[NIMSDK sharedSDK].chatManager sendMessage:message toSession:self.session error:nil]; [[NIMSDK sharedSDK].chatManager sendMessage:message toSession:self.session error:nil];
[view resetChoosePhotos]; [view resetChoosePhotos];
return; return;
@@ -1091,6 +1101,8 @@
if(code == 200){ if(code == 200){
// //
NIMMessage * message = [NIMMessageMaker msgWithImage:selectedPhoto]; NIMMessage * message = [NIMMessageMaker msgWithImage:selectedPhoto];
message.apnsPayload = @{@"uid": [AccountInfoStorage instance].getUid // ID
};
// //
[[NIMSDK sharedSDK].chatManager sendMessage:message toSession:self.session error:nil]; [[NIMSDK sharedSDK].chatManager sendMessage:message toSession:self.session error:nil];
return; return;

View File

@@ -476,7 +476,7 @@ UIKIT_EXTERN NSString *kInviteMemeberSuccess;
self.avatarImageView.imageUrl = clanDetailInfo.hall.ownerAvatar; self.avatarImageView.imageUrl = clanDetailInfo.hall.ownerAvatar;
self.idLabel.text = [NSString stringWithFormat:YMLocalizedString(@"XPMineGuildViewController6"),clanDetailInfo.hall.ownerErbanNo]; 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 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; self.titleLabel.text = clanDetailInfo.hall.hallName;
if (clanDetailInfo.manageHall) { if (clanDetailInfo.manageHall) {
@@ -675,38 +675,7 @@ UIKIT_EXTERN NSString *kInviteMemeberSuccess;
managerList.guildId = self.clanDetailInfo.hall.hallId; managerList.guildId = self.clanDetailInfo.hall.hallId;
[self.navigationController pushViewController:managerList animated:YES]; [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 #pragma mark - Getters And Setters
- (UIView *)navView { - (UIView *)navView {

View File

@@ -226,11 +226,12 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
} }
NSString *uid = notification.userInfo[@"uid"]; NSString *uid = notification.userInfo[@"uid"];
NSString *type = notification.userInfo[@"type"]; NSString *type = notification.userInfo[@"type"];
BOOL isNoAttention = [notification.userInfo[@"isNoAttention"] boolValue];
if([type isEqualToString:@"kOpenChat"]){ if([type isEqualToString:@"kOpenChat"]){
if (uid.length > 0) { if (uid.length > 0) {
NIMSession * session = [NIMSession session:uid type:NIMSessionTypeP2P]; NIMSession * session = [NIMSession session:uid type:NIMSessionTypeP2P];
SessionViewController * sessionVC = [[SessionViewController alloc] initWithSession:session]; SessionViewController * sessionVC = [[SessionViewController alloc] initWithSession:session];
sessionVC.isAttention = YES; sessionVC.isAttention = !isNoAttention;
[self.navigationController pushViewController:sessionVC animated:YES]; [self.navigationController pushViewController:sessionVC animated:YES];
[ClientConfig shareConfig].chatId = nil; [ClientConfig shareConfig].chatId = nil;
} }

View File

@@ -86,10 +86,10 @@ NS_ASSUME_NONNULL_BEGIN
/// 房间活动页的列表 /// 房间活动页的列表
/// @param completion 完成 /// @param completion 完成
/// @param roomId 房间的id /// @param roomId 房间的id
/// @param type 类型 2 房间的 1 首页的
+ (void)roomActivityList:(HttpRequestHelperCompletion)completion + (void)roomActivityList:(HttpRequestHelperCompletion)completion
roomId:(NSString *)roomId roomId:(NSString *)roomId;
type:(NSString *)type; +(void)getPlayList:(HttpRequestHelperCompletion)completion roomId:(NSString *)roomId;
/// 收藏房间 /// 收藏房间
/// @param completion 完成 /// @param completion 完成

View File

@@ -103,12 +103,14 @@
/// ///
/// @param completion /// @param completion
/// @param roomId id /// @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 /// @param completion

View File

@@ -28,6 +28,9 @@ typedef NS_ENUM(NSInteger, ActivityType) {
}; };
@interface ActivityInfoModel : PIBaseModel @interface ActivityInfoModel : PIBaseModel
@property(nonatomic,copy) NSString *code;
@property(nonatomic,copy) NSString *icon;
@property(nonatomic,copy) NSString *url;
///名称 ///名称
@property (nonatomic,copy) NSString *bannerName; @property (nonatomic,copy) NSString *bannerName;
///外面的活动的图片 ///外面的活动的图片

View File

@@ -0,0 +1,16 @@
//
// PIRoomActivityChoosePlayCell.h
// YuMi
//
// Created by duoban on 2024/2/20.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface PIRoomActivityChoosePlayCell : UICollectionViewCell
@property(nonatomic,copy) NSString *imageUrl;
@end
NS_ASSUME_NONNULL_END

View File

@@ -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

View File

@@ -0,0 +1,25 @@
//
// PIRoomActivityChoosePlayView.h
// YuMi
//
// Created by duoban on 2024/2/20.
//
#import <UIKit/UIKit.h>
#import "ActivityInfoModel.h"
NS_ASSUME_NONNULL_BEGIN
@class PIRoomActivityChoosePlayView;
@protocol PIRoomActivityChoosePlayViewDelegate <NSObject>
-(void)hiddenViewActionWithView:(PIRoomActivityChoosePlayView *)view;
-(void)choosePlayTypeWithView:(PIRoomActivityChoosePlayView *)view model:(ActivityInfoModel *)model;
@end
@interface PIRoomActivityChoosePlayView : UIView
@property(nonatomic,strong) NSMutableArray *playList;
@property(nonatomic,weak) id<PIRoomActivityChoosePlayViewDelegate>delegate;
@end
NS_ASSUME_NONNULL_END

View File

@@ -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 ()<UICollectionViewDelegate,UICollectionViewDataSource>
@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

View File

@@ -0,0 +1,25 @@
//
// PIRoomActivityClickView.h
// YuMi
//
// Created by duoban on 2024/2/20.
//
#import <UIKit/UIKit.h>
#import "ActivityInfoModel.h"
NS_ASSUME_NONNULL_BEGIN
@protocol PIRoomActivityClickViewDelegate <NSObject>
-(void)showChoosePlayViewAction;
-(void)clickPlayTypeWithModel:(ActivityInfoModel *)model;
@end
@interface PIRoomActivityClickView : UIView
@property(nonatomic,strong) ActivityInfoModel *model;
@property(nonatomic,weak) id<PIRoomActivityClickViewDelegate>delegate;
@end
NS_ASSUME_NONNULL_END

View File

@@ -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

View File

@@ -6,6 +6,7 @@
// //
#import "XPRoomActivityContainerView.h" #import "XPRoomActivityContainerView.h"
#import <ReactiveObjC/ReactiveObjC.h>
///Third ///Third
#import <Masonry/Masonry.h> #import <Masonry/Masonry.h>
#import <SDCycleScrollView/SDCycleScrollView.h> #import <SDCycleScrollView/SDCycleScrollView.h>
@@ -38,37 +39,32 @@
#import "PIRoomEnterRedPacketView.h" #import "PIRoomEnterRedPacketView.h"
#import "BaseNavigationController.h" #import "BaseNavigationController.h"
#import "PIRoomActivityWebView.h" #import "PIRoomActivityWebView.h"
#import "PIRoomActivityClickView.h"
#import "PIRoomActivityChoosePlayView.h"
UIKIT_EXTERN NSString *kShowFirstRechargeView; UIKIT_EXTERN NSString *kShowFirstRechargeView;
@interface XPRoomActivityContainerView ()<SDCycleScrollViewDelegate,PIRoomEnterRedPacketViewDelegate> @interface XPRoomActivityContainerView ()<SDCycleScrollViewDelegate,PIRoomEnterRedPacketViewDelegate,PIRoomActivityClickViewDelegate,PIRoomActivityChoosePlayViewDelegate>
/// ///
@property (nonatomic,strong) UIStackView *stackView; @property (nonatomic,strong) UIStackView *stackView;
/// ///
@property (nonatomic,strong) SDCycleScrollView *pi_cycleScrollView; @property (nonatomic,strong) SDCycleScrollView *pi_cycleScrollView;
///
@property (nonatomic,strong) NetImageView *lookLoveImageView;
/// ///
@property(nonatomic,strong) PIRoomEnterRedPacketView *redPacketView; @property(nonatomic,strong) PIRoomEnterRedPacketView *redPacketView;
/// ///
@property (nonatomic,strong) TreasureFairyLimitModel *fairyModel; @property(nonatomic,strong) PIRoomActivityClickView *clickPlayView;
/// ///
@property (nonatomic,strong) UIImageView *joinDatingView; @property (nonatomic,strong) UIImageView *joinDatingView;
///host ///host
@property (nonatomic,weak) id<RoomHostDelegate>hostDelegate; @property (nonatomic,weak) id<RoomHostDelegate>hostDelegate;
/// ///
@property (nonatomic,copy) NSMutableArray<ActivityInfoModel *> *activityList; @property (nonatomic,strong) NSMutableArray<ActivityInfoModel *> *activityList;
@property(nonatomic,strong) NSMutableArray<ActivityInfoModel *> *playList;
/// ///
@property (nonatomic,strong) UIImageView *sailingImageView; @property (nonatomic,strong) UIImageView *sailingImageView;
/// ///
@property (nonatomic,assign) BOOL isLoadActivity; @property (nonatomic,assign) BOOL isLoadActivity;
///
@property (nonatomic,strong) ActivityInfoModel *fairyActivityModel;
///
@property (nonatomic,strong) ActivityInfoModel * firstRechargeModel;
///
@property (nonatomic,strong) ActivityInfoModel * lookLoveModel;
@end @end
@implementation XPRoomActivityContainerView @implementation XPRoomActivityContainerView
@@ -82,7 +78,7 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
[self initSubViews]; [self initSubViews];
[self initSubViewConstraints]; [self initSubViewConstraints];
[self requestActivityList]; [self requestActivityList];
[self configLookLove];
} }
return self; return self;
} }
@@ -94,8 +90,9 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
[self.stackView addArrangedSubview:self.pi_cycleScrollView]; [self.stackView addArrangedSubview:self.pi_cycleScrollView];
[self.stackView addArrangedSubview:emptyView]; [self.stackView addArrangedSubview:emptyView];
[self.stackView addArrangedSubview:self.redPacketView]; [self.stackView addArrangedSubview:self.redPacketView];
[self.stackView addArrangedSubview:self.lookLoveImageView];
[self.stackView addArrangedSubview:self.joinDatingView]; [self.stackView addArrangedSubview:self.joinDatingView];
[self.stackView addArrangedSubview:self.clickPlayView];
} }
@@ -113,127 +110,96 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
}]; }];
[self.lookLoveImageView mas_makeConstraints:^(MASConstraintMaker *make) { [self.clickPlayView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(itemWidth, itemWidth)); make.left.mas_equalTo(0);
make.size.mas_equalTo(CGSizeMake(81, 66));
}]; }];
[self.joinDatingView mas_makeConstraints:^(MASConstraintMaker *make) { [self.joinDatingView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(35* kScreenHeightScale); make.height.mas_equalTo(35 * kScreenHeightScale);
}]; }];
} }
- (void)requestActivityList { - (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<ActivityInfoModel*> * listModel, NSArray<ActivityInfoModel*> * 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]; NSString * roomId = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.roomId];
[Api roomActivityList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { [Api roomActivityList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
if (code == 200) { if (code == 200) {
NSArray <ActivityInfoModel *>* array = [ActivityInfoModel modelsWithArray:data.data]; NSArray <ActivityInfoModel *>* array = [ActivityInfoModel modelsWithArray:data.data];
[self.activityList addObjectsFromArray:array]; [list sendNext:array];
[list sendCompleted];
return;
} }
dispatch_group_leave(group); [list sendError:nil];
} roomId:roomId type:@"2"]; } roomId:roomId];
});
[Api getPlayList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
dispatch_group_enter(group); if (code == 200) {
dispatch_group_async(group, queue, ^{ NSArray <ActivityInfoModel *>* array = [ActivityInfoModel modelsWithArray:data.data];
[play sendNext:array];
[Api treasureFailyLimitInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { [play sendCompleted];
if(code == 200){ return;
TreasureFairyLimitModel * info =[TreasureFairyLimitModel modelWithDictionary:data.data]; }
self.fairyModel = info; [play sendError:nil];
} } roomId:roomId];
dispatch_group_leave(group);
}];
});
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)dealWithData{
-(void)configfirstRecharge{ self.isLoadActivity = YES;
UserInfoModel * userInfo = self.hostDelegate.getUserInfo; self.pi_cycleScrollView.hidden = NO;
if (userInfo.isFirstCharge == YES) { if (self.hostDelegate.getRoomInfo.type == RoomType_MiniGame) {
if(![self.activityList containsObject:self.firstRechargeModel]){ [self configLittleGameActivity];
[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"];
} else { } 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 { - (void)configLittleGameActivity {
RoomInfoModel * roomInfo = self.hostDelegate.getRoomInfo;
UserInfoModel * userInfo = self.hostDelegate.getUserInfo; NSMutableArray *list = [NSMutableArray array];
if (userInfo.userLevelVo.experLevelSeq >= roomInfo.findLoveDrawSwitchVo.openLevel && roomInfo.findLoveDrawSwitchVo.open == YES) { [list addObjectsFromArray:self.playList];
self.lookLoveModel.bannerPic = @"room_candy_tree_enter"; [list addObjectsFromArray:self.activityList];
if(![self.activityList containsObject:self.lookLoveModel]){
[self.activityList insertObject:self.lookLoveModel atIndex:0];
}
}
NSMutableArray *picArray = [NSMutableArray array]; NSMutableArray *picArray = [NSMutableArray array];
for (ActivityInfoModel *model in self.activityList) { for (ActivityInfoModel *model in list) {
[picArray addObject:model.bannerPic]; [picArray addObject:model.icon];
} }
self.pi_cycleScrollView.imageURLStringsGroup = picArray; self.pi_cycleScrollView.imageURLStringsGroup = picArray;
if (self.activityList.count > 1) { if (self.activityList.count > 1) {
@@ -256,7 +222,7 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
self.redPacketView.type = roomInfo.type; self.redPacketView.type = roomInfo.type;
if (roomInfo.type == RoomType_MiniGame) { if (roomInfo.type == RoomType_MiniGame) {
self.redPacketView.hidden = YES; self.redPacketView.hidden = YES;
self.lookLoveImageView.hidden = YES; self.clickPlayView.hidden = YES;
self.sailingImageView.hidden = YES; self.sailingImageView.hidden = YES;
if (self.isLoadActivity) { if (self.isLoadActivity) {
[self configLittleGameActivity]; [self configLittleGameActivity];
@@ -265,16 +231,9 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
} }
} else { } else {
self.redPacketView.redPacketList = self.redPacketList; 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]; NSMutableArray *picArray = [NSMutableArray array];
for (ActivityInfoModel *model in self.activityList) { for (ActivityInfoModel *model in self.activityList) {
[picArray addObject:model.bannerPic]; [picArray addObject:model.icon];
} }
self.pi_cycleScrollView.imageURLStringsGroup = picArray; self.pi_cycleScrollView.imageURLStringsGroup = picArray;
if (self.activityList.count > 1) { if (self.activityList.count > 1) {
@@ -283,6 +242,13 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
} else { } else {
[self.pi_cycleScrollView setAutoScroll:NO]; [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_Blind || roomInfo.roomModeType == RoomModeType_Open_PK_Mode || roomInfo.roomModeType == RoomModeType_Open_Micro_Mode) {
if (roomInfo.roomModeType == RoomModeType_Open_PK_Mode ) { if (roomInfo.roomModeType == RoomModeType_Open_PK_Mode ) {
self.joinDatingView.image = [UIImage imageNamed:@"room_pk_normal_member_enter"]; self.joinDatingView.image = [UIImage imageNamed:@"room_pk_normal_member_enter"];
@@ -374,9 +340,16 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
if (imageUrlList.count > index) { if (imageUrlList.count > index) {
NSString *pic = imageUrlList[index]; NSString *pic = imageUrlList[index];
NSMutableArray *inftList = [NSMutableArray array]; 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; ActivityInfoModel * info;
for (ActivityInfoModel * getInfo in self.activityList) { for (ActivityInfoModel * getInfo in modelList) {
if([getInfo.bannerPic isEqualToString:pic]){ if([getInfo.icon isEqualToString:pic]){
info = getInfo; info = getInfo;
} }
if(getInfo.skipType == 3){ if(getInfo.skipType == 3){
@@ -384,12 +357,13 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
} }
} }
if(info == nil)return; if(info == nil)return;
if (info.activityType == ActivityType_Love) { if([info.code isEqualToString:@"FIRST_CHARGE"]) {
[self lookLoveTapRecognizer];
} else if(info.activityType == ActivityType_First) {
[self firstRechargeTapRecognizer]; [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]; XPTreasureFairyViewController * fairyVC = [[XPTreasureFairyViewController alloc] initWithdelegate:self.hostDelegate];
fairyVC.roomUid =[NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.uid]; fairyVC.roomUid =[NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.uid];
fairyVC.view.frame = CGRectMake(0, KScreenHeight, KScreenWidth, KScreenHeight); fairyVC.view.frame = CGRectMake(0, KScreenHeight, KScreenWidth, KScreenHeight);
@@ -407,19 +381,21 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
if (info.skipType == ActivitySkipType_Room) { if (info.skipType == ActivitySkipType_Room) {
[self.hostDelegate exitRoom]; [self.hostDelegate exitRoom];
[XPRoomViewController openRoom:info.skipUri viewController:kWindow.rootViewController]; [XPRoomViewController openRoom:info.url viewController:kWindow.rootViewController];
} else if(info.skipType == ActivitySkipType_Web) { } 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); 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 #pragma mark - Getters And Setters
- (SDCycleScrollView *)pi_cycleScrollView { - (SDCycleScrollView *)pi_cycleScrollView {
if (!_pi_cycleScrollView) { if (!_pi_cycleScrollView) {
@@ -509,24 +548,11 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
_stackView.distribution = UIStackViewDistributionFill; _stackView.distribution = UIStackViewDistributionFill;
_stackView.alignment = UIStackViewAlignmentCenter; _stackView.alignment = UIStackViewAlignmentCenter;
_stackView.spacing = 0; _stackView.spacing = 0;
} }
return _stackView; 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; 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{ - (PIRoomEnterRedPacketView *)redPacketView{
if(!_redPacketView){ if(!_redPacketView){
_redPacketView = [[PIRoomEnterRedPacketView alloc]initWithFrame:CGRectZero]; _redPacketView = [[PIRoomEnterRedPacketView alloc]initWithFrame:CGRectZero];
@@ -598,4 +598,13 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
} }
return _redPacketView; return _redPacketView;
} }
- (PIRoomActivityClickView *)clickPlayView{
if(!_clickPlayView){
_clickPlayView = [[PIRoomActivityClickView alloc]initWithFrame:CGRectZero];
_clickPlayView.hidden = YES;
_clickPlayView.delegate = self;
}
return _clickPlayView;
}
@end @end

View File

@@ -179,6 +179,8 @@
messageInfo.nameText = nick; messageInfo.nameText = nick;
messageInfo.albumModel = albumModel; messageInfo.albumModel = albumModel;
return messageInfo; return messageInfo;
}else if(first == CustomMessageType_Guardian_Planet){
return [self createGuardianPlanetAttribute:attachment messageInfo:messageInfo];
} }
return nil; return nil;
} }
@@ -460,6 +462,24 @@
// return attribute; // 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{ - (XPMessageInfoModel *)createStarredKitchenAttribute:(AttachmentModel *)attachment messageInfo:(XPMessageInfoModel *)messageInfo{
XPRoomStarKitchenModel *starModel = [XPRoomStarKitchenModel modelWithDictionary:attachment.data]; XPRoomStarKitchenModel *starModel = [XPRoomStarKitchenModel modelWithDictionary:attachment.data];
NSString *title = [NSString stringWithFormat:YMLocalizedString(@"XPRoomMessageParser1033333"),starModel.nick,starModel.itemMultiple,starModel.diamonds]; NSString *title = [NSString stringWithFormat:YMLocalizedString(@"XPRoomMessageParser1033333"),starModel.nick,starModel.itemMultiple,starModel.diamonds];

View File

@@ -108,7 +108,7 @@
@kStrongify(self); @kStrongify(self);
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
// UI // 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{ -(void)unlockAction{
if(self.delegate && [self.delegate respondsToSelector:@selector(unlockAlbumHandle)]){ if(self.delegate && [self.delegate respondsToSelector:@selector(unlockAlbumHandle)]){
[self.delegate unlockAlbumHandle]; [self.delegate unlockAlbumHandle];

View File

@@ -529,7 +529,12 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey";
@(Custom_Message_Sub_Treasure_Fairy_Convert_L1), @(Custom_Message_Sub_Treasure_Fairy_Convert_L1),
@(Custom_Message_Sub_Treasure_Fairy_Convert_L2), @(Custom_Message_Sub_Treasure_Fairy_Convert_L2),
@(Custom_Message_Sub_Treasure_Fairy_Convert_L3), @(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],
}; };
} }

View File

@@ -31,6 +31,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)exitRoom; - (void)exitRoom;
- (void)miniRoom; - (void)miniRoom;
- (UINavigationController *)getCurrentNav; - (UINavigationController *)getCurrentNav;
-(UIView *)getSuperView;
- (NSArray *)getRoomSuperAdminList; - (NSArray *)getRoomSuperAdminList;
///获取房间PK队伍的 ///获取房间PK队伍的
- (NSArray *)getRoomPKGroupTeamList; - (NSArray *)getRoomPKGroupTeamList;

View File

@@ -93,7 +93,7 @@
@kStrongify(self); @kStrongify(self);
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
// UI // UI
self.bgImageView.image = [self setBlurImage:image]; self.bgImageView.image = [UIImage setBlurImage:image value:30];
}); });
}]; }];
}else{ }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{ -(void)operateAction{
if(self.delegate && [self.delegate respondsToSelector:@selector(pIRoomPhotoAlbumItemCell:clickMornWithModel:)]){ if(self.delegate && [self.delegate respondsToSelector:@selector(pIRoomPhotoAlbumItemCell:clickMornWithModel:)]){
[self.delegate pIRoomPhotoAlbumItemCell:self clickMornWithModel:self.albumModel]; [self.delegate pIRoomPhotoAlbumItemCell:self clickMornWithModel:self.albumModel];

View File

@@ -367,6 +367,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
[self.view addSubview:self.littleGameView]; [self.view addSubview:self.littleGameView];
[self.view addSubview:self.stageView]; [self.view addSubview:self.stageView];
[self.view addSubview:self.messageContainerView]; [self.view addSubview:self.messageContainerView];
[self.view addSubview:self.quickMessageContainerView]; [self.view addSubview:self.quickMessageContainerView];
[self.view addSubview:self.menuContainerView]; [self.view addSubview:self.menuContainerView];
[self.view addSubview:self.activityContainerView]; [self.view addSubview:self.activityContainerView];
@@ -452,7 +453,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
make.top.mas_equalTo(self.messageContainerView); make.top.mas_equalTo(self.messageContainerView);
make.right.mas_equalTo(self.view); make.right.mas_equalTo(self.view);
make.bottom.mas_equalTo(self.quickMessageContainerView.mas_top).offset(-5); 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) { [self.redPacketView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(kGetScaleWidth(58)); make.width.height.mas_equalTo(kGetScaleWidth(58));
@@ -504,7 +505,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
make.top.mas_equalTo(self.messageContainerView); make.top.mas_equalTo(self.messageContainerView);
make.right.mas_equalTo(self.anchorScrollView.middleImageView); make.right.mas_equalTo(self.anchorScrollView.middleImageView);
make.bottom.mas_equalTo(self.quickMessageContainerView.mas_top).mas_offset(-5); 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.height.mas_equalTo(65);
make.right.mas_equalTo(self.view); make.right.mas_equalTo(self.view);
make.bottom.mas_equalTo(self.quickMessageContainerView.mas_top).offset(-5); make.bottom.mas_equalTo(self.quickMessageContainerView.mas_top).offset(-5);
make.width.mas_equalTo(80); make.width.mas_equalTo(87);
}]; }];
} else { } else {
@@ -649,7 +650,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
make.top.mas_equalTo(self.messageContainerView); make.top.mas_equalTo(self.messageContainerView);
make.right.mas_equalTo(self.view); make.right.mas_equalTo(self.view);
make.bottom.mas_equalTo(self.quickMessageContainerView.mas_top).offset(-5); 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.top.mas_equalTo(self.messageContainerView);
make.right.mas_equalTo(self.anchorScrollView.middleImageView); make.right.mas_equalTo(self.anchorScrollView.middleImageView);
make.bottom.mas_equalTo(self.quickMessageContainerView.mas_top).mas_offset(-5); 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){ if(attachment.first == CustomMessageType_Graffiti_Star_Kitchen && attachment.second == Custom_Message_Sub_Star_Kitchen_FullScreen){
isHave = YES; isHave = YES;
}else if(attachment.first == CustomMessageType_Look_Love && attachment.second == Custom_Message_Sub_Look_Love_InRoom_NeedAllMicSend){ }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)) { // }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)){ }else if (attachment.first == CustomMessageType_Tarot && (attachment.second == Custom_Message_Sub_Tarot_Advanced || attachment.second == Custom_Message_Sub_Tarot_Intermediate)){
isHave = YES; isHave = YES;
}if (attachment.first == CustomMessageType_RedPacket && attachment.second == Custom_Message_Sub_AllDiamandRedPacket) { }if (attachment.first == CustomMessageType_RedPacket && attachment.second == Custom_Message_Sub_AllDiamandRedPacket) {
@@ -1950,7 +1953,9 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
- (UINavigationController *)getCurrentNav { - (UINavigationController *)getCurrentNav {
return self.navigationController; return self.navigationController;
} }
-(UIView *)getSuperView{
return self.view;
}
- (NSMutableDictionary<NSString *,MicroQueueModel *> *)getMicroQueue { - (NSMutableDictionary<NSString *,MicroQueueModel *> *)getMicroQueue {
return [self.stageView getMicroQueue]; return [self.stageView getMicroQueue];
} }

View File

@@ -57,5 +57,5 @@ isEnterprise = [bundleID isEqualToString:@"com.hflighting.yumi"];\
#import "BSNetListenModel.h" #import "BSNetListenModel.h"
#import "PIBaseModel.h" #import "PIBaseModel.h"
#import "PLTimeUtil.h" #import "PLTimeUtil.h"
#import "UIImage+ImageEffects.h"
#endif /* PrefixHeader_pch */ #endif /* PrefixHeader_pch */

View File

@@ -138,7 +138,7 @@ static NSString *_from = nil;
if (isEnterprise == NO) { if (isEnterprise == NO) {
_from = @"piko_Enterprise"; // _from = @"piko_Enterprise"; //
}else { }else {
_from = PI_App_Source; // App Store _from = PI_App_Source; //appstore App Store
} }
} }
} }

View File

@@ -49,6 +49,7 @@
"LoginPresenter1" = "登录失败,请重试"; "LoginPresenter1" = "登录失败,请重试";
"XPRoomStarKitchenBannerView0"="恭喜%@在星级厨房抽中%@倍奖励,获得 %@钻石!"; "XPRoomStarKitchenBannerView0"="恭喜%@在星级厨房抽中%@倍奖励,获得 %@钻石!";
"XPRoomMessageParser1033333"="恭喜%@在星级厨房抽中 %@倍奖励,获得 %@钻石!"; "XPRoomMessageParser1033333"="恭喜%@在星级厨房抽中 %@倍奖励,获得 %@钻石!";
"XPRoomMessageParser1033334"="恭喜 [%@] 在守护星球中成功击败怪兽,获得%@鉆石奖励";
///XPShareView.m ///XPShareView.m
"XPShareView0" = "拷贝成功"; "XPShareView0" = "拷贝成功";
"XPShareView1" = "来玩奥"; "XPShareView1" = "来玩奥";

View File

@@ -49,6 +49,7 @@
"LoginPresenter1" = "登錄失敗,請重試"; "LoginPresenter1" = "登錄失敗,請重試";
"XPRoomStarKitchenBannerView0"="恭喜%@在星級廚房抽中%@倍獎勵,獲得 %@鉆石!"; "XPRoomStarKitchenBannerView0"="恭喜%@在星級廚房抽中%@倍獎勵,獲得 %@鉆石!";
"XPRoomMessageParser1033333"="恭喜%@在星級廚房抽中 %@倍獎勵,獲得 %@鉆石!"; "XPRoomMessageParser1033333"="恭喜%@在星級廚房抽中 %@倍獎勵,獲得 %@鉆石!";
"XPRoomMessageParser1033334"="恭喜 [%@] 在守護星球中成功擊敗怪獸,獲得%@鉆石獎勵";
///XPShareView.m ///XPShareView.m
"XPShareView0" = "拷貝成功"; "XPShareView0" = "拷貝成功";
"XPShareView1" = "來玩奧"; "XPShareView1" = "來玩奧";