Compare commits

...

9 Commits

Author SHA1 Message Date
liyuhua
7fbc7d2e68 更换图片logo 2024-03-20 20:43:06 +08:00
liyuhua
bbbb5215b0 小游戏优化 2024-03-20 20:43:06 +08:00
liyuhua
49ca351985 修复bug 2024-03-20 20:43:06 +08:00
liyuhua
e585a5e47a 更改logo 2024-03-20 20:43:06 +08:00
liyuhua
6f75c535c1 商店包版本修改 此commit置顶 2.6.4 2024-03-20 20:42:53 +08:00
liyuhua
9688b04a25 邀请码及通用飘屏 2024-03-20 19:55:26 +08:00
liyuhua
d9d9976046 邀请码bug修复 2024-03-19 14:48:45 +08:00
liyuhua
de67e0b3f9 邀请保存图片 2024-03-14 17:00:45 +08:00
liyuhua
5554197b7c 邀请保存图片 2024-03-14 16:52:41 +08:00
57 changed files with 1021 additions and 47 deletions

View File

@@ -62,7 +62,7 @@ target 'YuMi' do
pod 'SVGAPlayer'
pod 'GoogleSignIn'
#pod 'mob_linksdk_pro'
pod 'mob_linksdk_pro'
pod 'mob_sharesdk'
pod 'mob_sharesdk/ShareSDKPlatforms/Apple'
#pod 'mob_sharesdk/ShareSDKPlatforms/Line'

View File

@@ -236,6 +236,8 @@
237B94BE2A984DA7007853E3 /* XPRoomTrumpetViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 237B94B72A984DA7007853E3 /* XPRoomTrumpetViewController.m */; };
237B94BF2A984DA7007853E3 /* XPRoomTrumpetView.m in Sources */ = {isa = PBXBuildFile; fileRef = 237B94B82A984DA7007853E3 /* XPRoomTrumpetView.m */; };
237B94C02A984DA7007853E3 /* Api+RoomTrumpet.m in Sources */ = {isa = PBXBuildFile; fileRef = 237B94BA2A984DA7007853E3 /* Api+RoomTrumpet.m */; };
238A90072BA9729200828123 /* PIUniversalBannerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 238A90062BA9729200828123 /* PIUniversalBannerView.m */; };
238A900A2BA9756600828123 /* PIUniversalBannerModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 238A90092BA9756600828123 /* PIUniversalBannerModel.m */; };
238B37A32AC55A2C00BFC9D5 /* XPTreasureFailyPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 238B37242AC55A2C00BFC9D5 /* XPTreasureFailyPresenter.m */; };
238B37A42AC55A2C00BFC9D5 /* TreasureFairyLimitModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 238B372B2AC55A2C00BFC9D5 /* TreasureFairyLimitModel.m */; };
238B37A52AC55A2C00BFC9D5 /* TreasureFailyKeyInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 238B372C2AC55A2C00BFC9D5 /* TreasureFailyKeyInfoModel.m */; };
@@ -403,6 +405,7 @@
23E9EB312A85E5D100B792F2 /* pi_app_logo_new_bg.png in Resources */ = {isa = PBXBuildFile; fileRef = 23E9EB302A85E5D100B792F2 /* pi_app_logo_new_bg.png */; };
23E9EB332A85E97C00B792F2 /* pi_login_new_logo.png in Resources */ = {isa = PBXBuildFile; fileRef = 23E9EB322A85E97B00B792F2 /* pi_login_new_logo.png */; };
23EE96F22B9FF6BE00475D69 /* pi_crazy_zoo.svga in Resources */ = {isa = PBXBuildFile; fileRef = 23EE96F12B9FF6BE00475D69 /* pi_crazy_zoo.svga */; };
23EE970A2BA2D39C00475D69 /* PIWebViewSavePhotoView.m in Sources */ = {isa = PBXBuildFile; fileRef = 23EE97092BA2D39C00475D69 /* PIWebViewSavePhotoView.m */; };
23FF255B2AB956D50064E904 /* pi_home_new_pk.svga in Resources */ = {isa = PBXBuildFile; fileRef = 23FF255A2AB956D50064E904 /* pi_home_new_pk.svga */; };
23FF25622ABAE6310064E904 /* pi_room_game_fine_love.svga in Resources */ = {isa = PBXBuildFile; fileRef = 23FF25612ABAE6310064E904 /* pi_room_game_fine_love.svga */; };
23FF25652ABC3B3C0064E904 /* XPHomeGameView.m in Sources */ = {isa = PBXBuildFile; fileRef = 23FF25642ABC3B3B0064E904 /* XPHomeGameView.m */; };
@@ -1940,6 +1943,10 @@
237B94B82A984DA7007853E3 /* XPRoomTrumpetView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPRoomTrumpetView.m; sourceTree = "<group>"; };
237B94BA2A984DA7007853E3 /* Api+RoomTrumpet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "Api+RoomTrumpet.m"; sourceTree = "<group>"; };
237B94BB2A984DA7007853E3 /* Api+RoomTrumpet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Api+RoomTrumpet.h"; sourceTree = "<group>"; };
238A90052BA9729200828123 /* PIUniversalBannerView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIUniversalBannerView.h; sourceTree = "<group>"; };
238A90062BA9729200828123 /* PIUniversalBannerView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIUniversalBannerView.m; sourceTree = "<group>"; };
238A90082BA9756600828123 /* PIUniversalBannerModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIUniversalBannerModel.h; sourceTree = "<group>"; };
238A90092BA9756600828123 /* PIUniversalBannerModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIUniversalBannerModel.m; sourceTree = "<group>"; };
238B37242AC55A2C00BFC9D5 /* XPTreasureFailyPresenter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPTreasureFailyPresenter.m; sourceTree = "<group>"; };
238B37252AC55A2C00BFC9D5 /* XPTreasureFailyPresenter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPTreasureFailyPresenter.h; sourceTree = "<group>"; };
238B37272AC55A2C00BFC9D5 /* XPTreasureFailyProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPTreasureFailyProtocol.h; sourceTree = "<group>"; };
@@ -2260,6 +2267,8 @@
23E9EB302A85E5D100B792F2 /* pi_app_logo_new_bg.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = pi_app_logo_new_bg.png; sourceTree = "<group>"; };
23E9EB322A85E97B00B792F2 /* pi_login_new_logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = pi_login_new_logo.png; sourceTree = "<group>"; };
23EE96F12B9FF6BE00475D69 /* pi_crazy_zoo.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = pi_crazy_zoo.svga; sourceTree = "<group>"; };
23EE97082BA2D39C00475D69 /* PIWebViewSavePhotoView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIWebViewSavePhotoView.h; sourceTree = "<group>"; };
23EE97092BA2D39C00475D69 /* PIWebViewSavePhotoView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIWebViewSavePhotoView.m; sourceTree = "<group>"; };
23FF255A2AB956D50064E904 /* pi_home_new_pk.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = pi_home_new_pk.svga; sourceTree = "<group>"; };
23FF25612ABAE6310064E904 /* pi_room_game_fine_love.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = pi_room_game_fine_love.svga; sourceTree = "<group>"; };
23FF25632ABC3B3B0064E904 /* XPHomeGameView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPHomeGameView.h; sourceTree = "<group>"; };
@@ -4359,6 +4368,8 @@
E80E09AC2A41336500CD2BE7 /* XPWebViewNavView.m */,
18E7B33026F317A20064BC9B /* XPWebViewController.h */,
18E7B33126F317A20064BC9B /* XPWebViewController.m */,
23EE97082BA2D39C00475D69 /* PIWebViewSavePhotoView.h */,
23EE97092BA2D39C00475D69 /* PIWebViewSavePhotoView.m */,
);
path = YMWeb;
sourceTree = "<group>";
@@ -7518,6 +7529,8 @@
F1D8556E2931FC86008C418F /* XPRoomYearActivityView.m */,
E80E09B12A42071C00CD2BE7 /* XPRoomStarKitchenBannerView.h */,
E80E09B22A42071D00CD2BE7 /* XPRoomStarKitchenBannerView.m */,
238A90052BA9729200828123 /* PIUniversalBannerView.h */,
238A90062BA9729200828123 /* PIUniversalBannerView.m */,
);
path = AnimationView;
sourceTree = "<group>";
@@ -7671,6 +7684,8 @@
E80E09B52A42078F00CD2BE7 /* XPRoomStarKitchenModel.m */,
23BA16592A5D2ACF0030C5A3 /* PIBaseAnimationViewModel.h */,
23BA165A2A5D2ACF0030C5A3 /* PIBaseAnimationViewModel.m */,
238A90082BA9756600828123 /* PIUniversalBannerModel.h */,
238A90092BA9756600828123 /* PIUniversalBannerModel.m */,
);
path = Model;
sourceTree = "<group>";
@@ -10818,6 +10833,7 @@
E839532D276A030F00CF2F24 /* XPMineDressUpListViewController.m in Sources */,
E821077B2987D4AB00DE7040 /* MessageFindNewGreetModel.m in Sources */,
E85E7BA32A4EC99300B6D00A /* XPMineGiveDiamondDetailsVC.m in Sources */,
238A90072BA9729200828123 /* PIUniversalBannerView.m in Sources */,
E8B846D826FDE17300A777FE /* XPMineRechargeProtocol.h in Sources */,
E88C72A6282921D60047FB2B /* XPRoomBackMusicPlayerView.m in Sources */,
E84CBCE72843807500D43221 /* XPMineFriendPresenter.m in Sources */,
@@ -11015,6 +11031,7 @@
23194DCD2AD14BF000649F51 /* DDASLLogger.m in Sources */,
E85E7B492A4EB0D300B6D00A /* XPMineGuildSearchViewController.m in Sources */,
9B86D88328192DC000494FCD /* XPRoomRankEntranceView.m in Sources */,
238A900A2BA9756600828123 /* PIUniversalBannerModel.m in Sources */,
E85E7B012A4EB0D200B6D00A /* XPSuperAdminSetPresenter.m in Sources */,
18F404B7276095D700A6C548 /* SessionChatLimitView.m in Sources */,
E8788942273A55AD00BF1D57 /* XPGiftUsersView.m in Sources */,
@@ -11275,6 +11292,7 @@
1464C5F329A4C18000AF7C94 /* XPIAPRechargeViewController.m in Sources */,
E85E7B662A4EC35A00B6D00A /* XPIncomeRecordGoldDetailsModel.m in Sources */,
9B2EA7CC2804245500ED17BF /* XPAnchorPKPanelUserView.m in Sources */,
23EE970A2BA2D39C00475D69 /* PIWebViewSavePhotoView.m in Sources */,
2331C1B42A60F32D00E1D940 /* XPCandyTreeRankTableViewCell.m in Sources */,
9B85B6DA279FDC5200A0A1AC /* XPUserCardSkillCollectionViewCell.m in Sources */,
E85E7B0D2A4EB0D200B6D00A /* GuildSuperAdminInfoModel.m in Sources */,
@@ -12189,7 +12207,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 20.20.13;
MARKETING_VERSION = 20.20.14;
PRODUCT_BUNDLE_IDENTIFIER = com.peko.enterprise.ios;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -12225,7 +12243,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 20.20.13;
MARKETING_VERSION = 20.20.14;
PRODUCT_BUNDLE_IDENTIFIER = com.peko.enterprise.ios;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";

View File

@@ -11,7 +11,7 @@
#import <ShareSDK/ShareSDK.h>
#import <UserNotifications/UNUserNotificationCenter.h>
#import <UserNotifications/UserNotifications.h>
#import <MOBFoundation/MobSDK+Privacy.h>
///Tool
#import "YUMIConstant.h"
#import "CustomAttachmentDecoder.h"
@@ -145,6 +145,14 @@ UIKIT_EXTERN NSString * adImageName;
// [platformsRegister setupFacebookWithAppkey:@"1266232494209868" appSecret:@"c9b170b383f8be9cdf118823b8632821" displayName:YMLocalizedString(@"AppDelegate_ThirdConfig0")];
[platformsRegister setupLineAuthType:SSDKAuthorizeTypeBoth];
}];
NSString *isUpload = [[NSUserDefaults standardUserDefaults]valueForKey:@"kMobLinkUploadPrivacy"];
if (isUpload == nil){
[MobSDK uploadPrivacyPermissionStatus:YES onResult:^(BOOL success) {
}];
[[NSUserDefaults standardUserDefaults] setValue:@"YES" forKey:@"kMobLinkUploadPrivacy"];
[[NSUserDefaults standardUserDefaults] synchronize];
}
}
#pragma mark -

View File

@@ -5,6 +5,8 @@
// Created by admin on 2023/3/9.
//
#import <MobLinkPro/MobLink.h>
#import <MobLinkPro/MLSDKScene.h>
#import "AppDelegate.h"
#import "TabbarViewController.h"
#import "BaseNavigationController.h"
@@ -21,10 +23,11 @@
#import "AccountModel.h"
#import "YuMi-swift.h"
#import "SessionViewController.h"
#import "LoginFullInfoViewController.h"
@import Firebase;
UIKIT_EXTERN NSString * const kOpenRoomNotification;
@interface AppDelegate ()
@interface AppDelegate ()<IMLSDKRestoreDelegate>
@end
@@ -59,12 +62,19 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
}
[[FBSDKApplicationDelegate sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions];
[FIRApp configure];
[MobLink setDelegate:self];
return YES;
}
- (void) IMLSDKWillRestoreScene:(MLSDKScene *)scene Restore:(void (^)(BOOL, RestoreStyle))restoreHandler
{
restoreHandler(YES, MLDefault);
}
@@ -167,6 +177,12 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
[[NSNotificationCenter defaultCenter]postNotificationName:kOpenRoomNotification object:nil userInfo:@{@"type":@"kOpenChat",@"uid":uid}];
ClientConfig *config = [ClientConfig shareConfig];
config.chatId = uid;
}else if (type == 8){
NSString *inviteCode = paramsDict[@"inviteCode"];
if (inviteCode != nil && [[AccountInfoStorage instance]getUid].length == 0){
ClientConfig *config = [ClientConfig shareConfig];
config.inviteCode = inviteCode;
}
}
return YES;
}

View File

@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 665 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -31,6 +31,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, copy) NSString *__nullable chatId;
///用户id推送跳转到聊天页面
@property (nonatomic, copy) NSString *__nullable pushChatId;
///邀请码,从外面进来会进入注册页面,并自动填写这个邀请码
@property(nonatomic,copy) NSString *inviteCode;
///表情---
@property (nonatomic, copy) NSString *version;
@property (nonatomic, copy) NSString *zipMd5;

View File

@@ -26,9 +26,13 @@ typedef enum : NSUInteger {
XPShareItemTagCopyLink,
///应用好友
XPShareItemTagAppFriends,
///保存到相册
XPShareItemTagAppSaveAlbum,
} XPShareItemTag;
@interface XPShareItem : NSObject
@property(nonatomic,assign) BOOL isShareInvite;
@property (nonatomic, copy) NSString *inviteTitle;
@property (nonatomic, copy) NSString *title;
@property (nonatomic, copy) NSString *imageName;
@property (nonatomic, copy) NSString *disableImageName;

View File

@@ -12,6 +12,8 @@
@class XPShareView;
@protocol XCShareViewDelegate <NSObject>
///点击保存图片到相册
- (void)shareView:(XPShareView *)shareView savePhoto:(XPShareInfoModel *)shareInfo;
///点了取消分享
- (void)shareViewDidClickCancel:(XPShareView *)shareView;
///分享成功

View File

@@ -143,6 +143,13 @@
[TTPopup dismiss];
return;
};
if (item.type == XPShareItemTagAppSaveAlbum){
[TTPopup dismiss];
if (self.delegate && [self.delegate respondsToSelector:@selector(shareView:savePhoto:)]){
[self.delegate shareView:self savePhoto:self.shareInfo];
}
return;
}
if (item.type == XPShareItemTagAppFriends) {
[TTPopup dismiss];
XPMineShareViewController * shareVC = [[XPMineShareViewController alloc] init];
@@ -187,22 +194,14 @@
if (self.delegate && [self.delegate respondsToSelector:@selector(shareView:didSuccess:)]) {
[self.delegate shareView:self didSuccess:self.shareInfo];
}
// FBtype = PlatformOfLine;
// [shareParams SSDKSetupLineParamsByText:encodedUrl image:nil type:SSDKContentTypeAuto];
} else {
title = YMLocalizedString(@"XPShareView3");
platformType = SSDKPlatformTypeFacebook;
FBtype = PlatformOfFB;
content = YMLocalizedString(@"XPShareView4");
[shareParams SSDKSetupFacebookParamsByText:title image:@"https://pic.lecheng163.com/ananLogo256.png" url:[NSURL URLWithString:urlString] urlTitle:@"title" urlName:@"name" attachementUrl:nil hashtag:@"#Piko" quote:@"Piko" shareType:SSDKFacebookShareTypeNative type:SSDKContentTypeWebPage];
return;
}
if(item.type == XPShareItemTagFaceBook){
if(item.type == XPShareItemTagFaceBook){
FBSDKShareLinkContent*linkContent = [[FBSDKShareLinkContent alloc]init];
urlString = [urlString stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLFragmentAllowedCharacterSet]];
linkContent.contentURL= [NSURL URLWithString:urlString];
linkContent.quote = content;
FBSDKShareDialog *shareDialog = [[FBSDKShareDialog alloc]initWithViewController:[XCCurrentVCStackManager shareManager].getCurrentVC content:linkContent delegate:self];
// web
shareDialog.mode = FBSDKShareDialogModeNative;

View File

@@ -52,5 +52,5 @@ typedef NS_ENUM(NSUInteger, GradientType) {
-(UIImage *)compressWithMaxLength:(NSUInteger)maxLength;
- (UIImage *)roundedImageWithCornerRadius:(CGFloat)cornerRadius size:(CGSize)size;
+(UIImage *)getImageFromView:(UIView *)view;
@end

View File

@@ -432,4 +432,23 @@
UIGraphicsEndImageContext();
return roundedImage;
}
+(UIImage *)getImageFromView:(UIView *)view {
// 1. viewbounds
UIGraphicsBeginImageContextWithOptions(view.bounds.size, view.opaque, 0.0);
// 2.
CGContextRef context = UIGraphicsGetCurrentContext();
// 3. view
[view.layer renderInContext:context];
// 4.
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
// 5.
UIGraphicsEndImageContext();
// 6.
return image;
}
@end

View File

@@ -49,7 +49,7 @@ isPhoneXSeries = [[UIApplication sharedApplication] delegate].window.safeAreaIns
///内置版本号
#define PI_App_Version @"2.6.3"
#define PI_App_Version @"2.6.4"
///渠道
#define PI_App_Source @"appstore"
//#define PI_App_Source @"pi_tf"

View File

@@ -10,7 +10,7 @@
NS_ASSUME_NONNULL_BEGIN
@interface LoginFullInfoViewController : MvpViewController
@property(nonatomic,copy) NSString *inviteCode;
@end
NS_ASSUME_NONNULL_END

View File

@@ -24,7 +24,7 @@
#import "LoginFullInfoPresenter.h"
#import "LoginFullInfoProtocol.h"
#import "PILoginManager.h"
#import "ClientConfig.h"
@interface LoginFullInfoViewController ()<LoginFullInfoProtocol>
@@ -81,6 +81,11 @@
[self initSubViews];
[self initSubViewConstraints];
[self initEvents];
ClientConfig *config = [ClientConfig shareConfig];
if (config.inviteCode.length > 0){
self.inviteCode = config.inviteCode;
config.inviteCode = @"";
}
}
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
@@ -226,7 +231,10 @@
}];
}
- (void)setInviteCode:(NSString *)inviteCode{
_inviteCode = inviteCode;
self.codeTextField.text = _inviteCode;
}
///
- (void)updateUserInfo {
[XNDJTDDLoadingTool showOnlyView:self.view];

View File

@@ -115,6 +115,8 @@ typedef NS_ENUM(NSUInteger, CustomMessageType) {
CustomMessageType_General_Public_Screen = 103,
///疯狂动物园飘屏
CustomMessageType_Graffiti_Star_Kitchen = 104,
///通用飘屏
CustomMessageType_General_Floating_Screen = 105,
};
@@ -633,7 +635,13 @@ typedef NS_ENUM(NSUInteger, CustomMessageTypeGeneralPublicScreen) {
Custom_Message_Sub_General_Public_Screen_One_Room = 1031,//单房间
Custom_Message_Sub_General_Public_Screen_All_Room = 1032,///全部房间
};
///通用飘屏
//CustomMessageType_General_Floating_Screen = 105,
typedef NS_ENUM(NSUInteger, CustomMessageTypeGeneralFloatingScreen) {
///所有房间
Custom_Message_Sub_General_Floating_Screen_One_Room = 1051,//单房间
Custom_Message_Sub_General_Floating_Screen_All_Room = 1052,///全部房间
};
@interface AttachmentModel : PIBaseModel<NIMCustomAttachment>
@property (nonatomic,assign) int first;
@property (nonatomic,assign) int second;

View File

@@ -46,7 +46,6 @@ NS_ASSUME_NONNULL_BEGIN
//是否为周榜top1
@property(nonatomic,assign) BOOL isWeekTop1;
@property(nonatomic,copy) NSString *inRoomUid;
//是否在麦位
@property(nonatomic,assign) BOOL inMic;
///是否在线

View File

@@ -24,7 +24,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface XPNewHomePartyTableViewCell : UITableViewCell
@property (nonatomic,strong) HomePlayRoomModel *roomInfo;
@property (nonatomic,strong) HomeRecommendRoomModel *roomInfo1;
@property(nonatomic,weak) id<XPNewHomePartyTableViewCellDelegate>delegate;
///声音卡时svga是否播放动画
-(void)setPlaySoundStatus:(BOOL)isPlay;

View File

@@ -243,14 +243,7 @@
-(void)setPlaySoundTime:(NSInteger)time{
_audioView.voiceDura = @(time).stringValue;
}
- (void)setRoomInfo1:(HomeRecommendRoomModel *)roomInfo1 {
_roomInfo1 = roomInfo1;
if (_roomInfo1) {
}
}
-(void)didSelectItemAction{

View File

@@ -431,6 +431,7 @@ UIKIT_EXTERN NSString * const kShieldingNotification;
-(void)xPNewHomePartyTableViewCell:(XPNewHomePartyTableViewCell *_Nullable)cell didSelectChat:(HomePlayRoomModel *_Nonnull)roomModel{
if(roomModel.inMic == YES){
[XPRoomViewController openRoom:roomModel.inRoomUid fromNick:roomModel.nick fromType:UserEnterRoomFromType_Follow_User fromUid:roomModel.uid viewController:self];
return;
}

View File

@@ -188,7 +188,7 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
header.stateLabel.textColor = [DJDKMIMOMColor secondTextColor];
header.lastUpdatedTimeLabel.textColor = [DJDKMIMOMColor secondTextColor];
self.pagingView.mainTableView.mj_header = header;
[ClientConfig shareConfig].inviteCode = @"";

View File

@@ -17,6 +17,7 @@ typedef enum : NSUInteger {
GiftBannerType_Tarrow,//塔罗
GiftBannerType_Common_H5,//通用h5
GiftBannerType_Magic_House,//魔法屋
GiftBannerType_General_Floating_Screen,///通用飘屏
} GiftBannerType;
NS_ASSUME_NONNULL_BEGIN

View File

@@ -0,0 +1,38 @@
//
// PIUniversalBannerModel.h
// YuMi
//
// Created by duoban on 2024/3/19.
//
#import <Foundation/Foundation.h>
#import <SVGA.h>
NS_ASSUME_NONNULL_BEGIN
@class PIUniversalBannerItemModel;
@interface PIUniversalBannerModel : NSObject
@property(nonatomic,copy) NSDictionary *template;
@property(nonatomic,copy) NSString *textColor;
@property(nonatomic,assign) CGFloat fontSize;
@property(nonatomic,copy) NSString *resourceType;
@property(nonatomic,copy) NSString *resourceContent;
@property(nonatomic,assign) int skipType;
@property(nonatomic,copy) NSString *skipContent;
@property(nonatomic,copy) NSString *svgaTextKey;
@property(nonatomic,copy) NSArray<PIUniversalBannerItemModel *> *contents;
@property(nonatomic,assign) CGFloat resourceWidth;
@property(nonatomic,assign) CGFloat resourceHeight;
@property(nonatomic,strong) SVGAVideoEntity *videoItem;
@property(nonatomic,strong) UIImage *image;
@end
@interface PIUniversalBannerItemModel : NSObject
@property(nonatomic,copy) NSString *type;
@property(nonatomic,copy) NSString *textColor;
@property(nonatomic,copy) NSString *key;
@property(nonatomic,copy) NSDictionary *text;
@property(nonatomic,assign) int skipType;
@property(nonatomic,copy) NSString *skipContent;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,17 @@
//
// PIUniversalBannerModel.m
// YuMi
//
// Created by duoban on 2024/3/19.
//
#import "PIUniversalBannerModel.h"
@implementation PIUniversalBannerModel
+ (NSDictionary *)objectClassInArray {
return @{@"contents":PIUniversalBannerItemModel.class};
}
@end
@implementation PIUniversalBannerItemModel
@end

View File

@@ -0,0 +1,28 @@
//
// PIUniversalBannerView.h
// YuMi
//
// Created by duoban on 2024/3/19.
//
#import <UIKit/UIKit.h>
#import "PIUniversalBannerModel.h"
NS_ASSUME_NONNULL_BEGIN
@class PIUniversalBannerView;
@protocol PIUniversalBannerViewDelegate <NSObject>
- (void)pIUniversalBannerView:(PIUniversalBannerView *)view didClick:(PIUniversalBannerModel *)model;
@end
@interface PIUniversalBannerView : UIView
@property (nonatomic,assign) BOOL isSvga;
@property (nonatomic,strong) PIUniversalBannerModel *model;
@property (nonatomic,weak) id<PIUniversalBannerViewDelegate> delegate;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,142 @@
//
// PIUniversalBannerView.m
// YuMi
//
// Created by duoban on 2024/3/19.
//
#import <Masonry/Masonry.h>
#import "YUMIMacroUitls.h"
#import "DJDKMIMOMColor.h"
#import "PIUniversalBannerView.h"
#import <SVGA.h>
#import "DJDKMIMOMColor.h"
#import "YuMi-swift.h"
@interface PIUniversalBannerView()
@property (strong, nonatomic) SVGAParser *parser;
@property (nonatomic,strong) SVGAImageView *svgaView;
@property (nonatomic,strong) UIImageView *bgImageView;
@property (nonatomic,strong) UILabel *titleView;
@property (nonatomic,strong) UIButton *clickBtn;
@property(nonatomic,strong) SVGAVideoEntity *videoItem;
@end
@implementation PIUniversalBannerView
-(instancetype)initWithFrame:(CGRect)frame{
self = [super initWithFrame:frame];
if(self){
[self initSubViews];
[self initSubViewConstraints];
}
return self;
}
#pragma mark - Private Method
- (void)initSubViews {
[self addSubview:self.bgImageView];
[self addSubview:self.svgaView];
[self addSubview:self.titleView];
[self addSubview:self.clickBtn];
}
- (void)initSubViewConstraints {
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self);
}];
[self.svgaView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self);
}];
[self.titleView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.bottom.equalTo(self);
make.leading.trailing.equalTo(self).inset(kGetScaleWidth(70));
}];
[self.clickBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self);
}];
}
-(void)setModel:(PIUniversalBannerModel *)model{
_model = model;
NSDictionary *textDic = model.template;
if(textDic.allKeys.count == 0)return ;
NSString *title = textDic[@"zh-CHT"] == nil ? textDic[textDic.allKeys.firstObject] : textDic[@"zh-CHT"];
if(title.length == 0)return;
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] initWithString:title attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:_model.fontSize],NSForegroundColorAttributeName:[DJDKMIMOMColor colorWithHexString:_model.textColor]}];
for (PIUniversalBannerItemModel *model in _model.contents) {
if([model.type isEqualToString:@"TEXT"]){
NSDictionary *subTextDic = model.text;
if(subTextDic.allKeys.count > 0){
NSString *subText = subTextDic[@"zh-CHT"] == nil ? subTextDic[subTextDic.allKeys.firstObject] : subTextDic[@"zh-CHT"];
NSAttributedString *attText = [[NSAttributedString alloc]initWithString:subText attributes:@{NSForegroundColorAttributeName:[DJDKMIMOMColor colorWithHexString:model.textColor]}];
[attribute replaceCharactersInRange:[attribute.string rangeOfString:[NSString stringWithFormat:@"{%@}",model.key]] withAttributedString:attText];
}
}
}
if(_isSvga == YES){
self.bgImageView.hidden = YES;
self.svgaView.hidden = NO;
self.titleView.hidden = YES;
self.svgaView.loops = 1;
self.svgaView.clearsAfterStop = NO;
self.svgaView.videoItem = _model.videoItem;
[self.svgaView setAttributedText:attribute forKey:_model.svgaTextKey];
[self.svgaView startAnimation];
}else{
self.bgImageView.hidden = NO;
self.bgImageView.image = _model.image;
self.titleView.hidden = NO;
self.svgaView.hidden = YES;
self.titleView.attributedText = attribute;
}
}
-(void)clickAction{
if(self.delegate &&
[self.delegate respondsToSelector:@selector(pIUniversalBannerView:didClick:)]){
[self.delegate pIUniversalBannerView:self didClick:self.model];
}
}
#pragma mark -
- (UIImageView *)bgImageView{
if (!_bgImageView){
_bgImageView = [UIImageView new];
_bgImageView.userInteractionEnabled = YES;
}
return _bgImageView;
}
-(UILabel *)titleView{
if (!_titleView){
_titleView = [UILabel new];
_titleView.textAlignment = NSTextAlignmentCenter;
_titleView.numberOfLines = 2;
}
return _titleView;
}
- (SVGAParser *)parser {
if (!_parser) {
_parser = [[SVGAParser alloc]init];
}
return _parser;
}
- (SVGAImageView *)svgaView {
if (!_svgaView) {
_svgaView= [[SVGAImageView alloc]init];
_svgaView.backgroundColor = [UIColor clearColor];
_svgaView.userInteractionEnabled = YES;
}
return _svgaView;
}
-(UIButton *)clickBtn{
if (!_clickBtn){
_clickBtn = [UIButton new];
[_clickBtn addTarget:self action:@selector(clickAction) forControlEvents:UIControlEventTouchUpInside];
}
return _clickBtn;
}
@end

View File

@@ -63,10 +63,11 @@
#import "XPTreasureFairyGiftView.h"
#import "XPRoomTarrowBannerView.h"
#import "PIRoomGiftBroadcastWindow.h"
#import "PIUniversalBannerModel.h"
#import "PIUniversalBannerView.h"
@interface XPRoomAnimationView ()<SVGAPlayerDelegate,NIMBroadcastManagerDelegate, XPRoomGiftBroadcastViewDelegate, HWDMP4PlayDelegate, XPRoomLuckyBigPrizeViewDelegate, XPRoomGraffitiGiftAnimationViewDelegate, XPRoomStarKitchenBannerViewDelegate,PAGViewListener,XPRoomAnchorRankBannerViewDelegate,PIRoomGiftBroadcastWindowDelegate>
@interface XPRoomAnimationView ()<SVGAPlayerDelegate,NIMBroadcastManagerDelegate, XPRoomGiftBroadcastViewDelegate, HWDMP4PlayDelegate, XPRoomLuckyBigPrizeViewDelegate, XPRoomGraffitiGiftAnimationViewDelegate, XPRoomStarKitchenBannerViewDelegate,PAGViewListener,XPRoomAnchorRankBannerViewDelegate,PIRoomGiftBroadcastWindowDelegate,PIUniversalBannerViewDelegate>
///
///
@property (nonatomic,strong) XPRoomAnimationHitView * lowLevelView;
@@ -254,6 +255,8 @@
[self receiveTarotBanner:attachment];
}else if (attachment.first == CustomMessageType_Common_H5 &&(attachment.second == Custom_Message_Sub_Common_H5_Novice || attachment.second == Custom_Message_Sub_Common_H5_Advanced)){
[self receiveCommonH5Banner:attachment];
}else if (attachment.first == CustomMessageType_General_Floating_Screen && attachment.second == Custom_Message_Sub_General_Floating_Screen_All_Room ){
[self receiveRoomGeneralFloatingScreen:attachment];
}
}
}
@@ -365,6 +368,8 @@
[self receiveTarotBanner:attachment];
}else if (attachment.first == CustomMessageType_Common_H5 &&(attachment.second == Custom_Message_Sub_Common_H5_Novice || attachment.second == Custom_Message_Sub_Common_H5_Advanced)){
[self receiveCommonH5Banner:attachment];
}else if (attachment.first == CustomMessageType_General_Floating_Screen && attachment.second == Custom_Message_Sub_General_Floating_Screen_One_Room){
[self receiveRoomGeneralFloatingScreen:attachment];
}
}
}
@@ -386,8 +391,102 @@
[self userEnterRoom:content ext:extModel];
}
}
#pragma mark -
-(void)receiveRoomGeneralFloatingScreen:(AttachmentModel *)attacment{
PIBaseAnimationViewModel *roomGraffiti = [PIBaseAnimationViewModel new];
roomGraffiti.data = attacment.data;
roomGraffiti.type = GiftBannerType_General_Floating_Screen;
roomGraffiti.first = attacment.first;
roomGraffiti.second = attacment.second;
if(self.animationListB.count == 0 && self.isPlayOfB == NO){
[self createGeneralFloatingScreenAnimation:roomGraffiti];
}
[self.animationListB addObject:roomGraffiti];
}
- (void)createGeneralFloatingScreenAnimation:(PIBaseAnimationViewModel *)attacment{
self.isPlayOfB = YES;
CGFloat top = self.isPlayOfA == YES ? (self.broadCastHieght + statusbarHeight) : (kNavigationHeight + 15);
PIUniversalBannerModel *model = [PIUniversalBannerModel modelWithDictionary:attacment.data];
BOOL isSvga = [model.resourceType isEqualToString:@"SVGA"];
__block PIUniversalBannerView *bannerView;
if (isSvga == YES) {
SVGAParser *parser = [SVGAParser new];
[parser parseWithURL:[NSURL URLWithString:model.resourceContent] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) {
model.videoItem = videoItem;
bannerView = [[PIUniversalBannerView alloc]initWithFrame:CGRectMake(0, top, model.resourceWidth, model.resourceHeight) ];
[self showGeneralFloatingScreenView:bannerView model:model];
} failureBlock:^(NSError * _Nonnull error) {
#pragma mark -
}];
}else{
NetImageView *imageView = [NetImageView new];
[imageView loadImageWithUrl:model.resourceContent completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) {
model.image = image;
CGFloat width = image.size.width <= 0 ? kGetScaleWidth(60) : image.size.width;
CGFloat height = image.size.height ;
CGFloat getHeigth = KScreenWidth * height / width;
bannerView = [[PIUniversalBannerView alloc]initWithFrame:CGRectMake(0, top, KScreenWidth, getHeigth) ];
[self showGeneralFloatingScreenView:bannerView model:model];
}];
}
}
-(void)showGeneralFloatingScreenView:(PIUniversalBannerView *)bannerView model:(PIUniversalBannerModel *)model{
BOOL isSvga = [model.resourceType isEqualToString:@"SVGA"];
bannerView.isSvga = isSvga;
bannerView.model = model;
bannerView.delegate = self;
[self.highLevleView addSubview:bannerView];
POPSpringAnimation *springAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPViewCenter];
springAnimation.springSpeed = 12;
springAnimation.springBounciness = 10.f;
springAnimation.fromValue = [NSValue valueWithCGPoint:bannerView.center];
springAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(bannerView.frame.size.width / 2, bannerView.center.y)];
[springAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) {
if (finished) {
POPBasicAnimation *moveAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewCenter];
moveAnimation.fromValue = [NSValue valueWithCGPoint:CGPointMake(0, bannerView.center.y)];
moveAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(-KScreenWidth/2, bannerView.center.y)];
moveAnimation.beginTime = CACurrentMediaTime() + 3;
moveAnimation.duration = 0.5;
moveAnimation.repeatCount = 1;
moveAnimation.removedOnCompletion = YES;
@kWeakify(self);
[moveAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) {
@kStrongify(self);
if (finished) {
[bannerView removeFromSuperview];
self.isPlayOfB = NO;
if(self.animationListB.count > 0){
[self.animationListB removeObjectAtIndex:0];
}
[self playAnimationWithModel];
}
}];
[bannerView pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"];
}
}];
[bannerView pop_addAnimation:springAnimation forKey:@"starKitchenOutAnimation"];
}
#pragma mark - PIUniversalBannerViewDelegate
- (void)pIUniversalBannerView:(PIUniversalBannerView *)view didClick:(PIUniversalBannerModel *)model{
if (model.skipType == 2){
[self.delegate exitRoom];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[XPRoomViewController openRoom:model.skipContent viewController:[XCCurrentVCStackManager shareManager].getCurrentVC];
});
}else if (model.skipType == 3){
XPWebViewController * webVC = [[XPWebViewController alloc] init];
webVC.isPush = YES;
webVC.url = model.skipContent;
[self.delegate.getCurrentNav pushViewController:webVC animated:YES];
}
}
#pragma mark -
-(void)receiveRoomGraffitiStarKitchen:(AttachmentModel *)attacment{
PIBaseAnimationViewModel *roomGraffiti = [PIBaseAnimationViewModel new];
roomGraffiti.data = attacment.data;
@@ -1719,6 +1818,8 @@
[self createCommonH5BannerAnimation:model];
}else if(model.type == GiftBannerType_Magic_House){
[self createGiftCompoundBannerAnimation:model];
}else if (model.type == GiftBannerType_General_Floating_Screen){
[self createGeneralFloatingScreenAnimation:model];
}
}

View File

@@ -104,9 +104,6 @@
#else
isTestEnv = NO;
#endif
if(isEnterprise == NO){
[[SudMGP getCfg]setBackgroundMode:NO];
}
[SudMGP initSDK:KeyWithType(KeyType_SudGameAppID) appKey:KeyWithType(KeyType_SudGameAppKey) isTestEnv:isTestEnv listener:^(int retCode, const NSString *retMsg) {
if (retCode == 0) {
if (!self.currentmgId) {

View File

@@ -191,7 +191,16 @@
[TTPopup actionSheetWithItems:@[inviteMic, lockMic, muteMic]];
} else if (member.type == NIMTeamMemberTypeManager) {//
[TTPopup actionSheetWithItems:@[lockMic, muteMic]];
// Ta
TTActionSheetConfig *inviteMic = [TTActionSheetConfig normalTitle:YMLocalizedString(@"AnchorStageView4") clickAction:^{
XPRoomInviteUserViewController * inviteUserMicVC = [[XPRoomInviteUserViewController alloc] init];
inviteUserMicVC.roomId = roomId;
inviteUserMicVC.position = position;
inviteUserMicVC.blindDateVipUid = roomInfo.blindDateVipUid;
[self.hostDelegate.getCurrentNav pushViewController:inviteUserMicVC animated:YES];
}];
[TTPopup actionSheetWithItems:@[inviteMic,lockMic, muteMic]];
} else {
// 2.2
NSString* selfUid = [NSString stringWithFormat:@"%ld", (long)self.hostDelegate.getUserInfo.uid];

View File

@@ -19,6 +19,7 @@ NS_ASSUME_NONNULL_BEGIN
-(void)receiveCommonH5Banner:(AttachmentModel *)attachment;
- (void)receiveAnchorHourRank:(AttachmentModel *)attachment;
- (void)receiveNobleLevelUp:(AttachmentModel *)attachment;
-(void)receiveRoomGeneralFloatingScreen:(AttachmentModel *)attacment;
@end
NS_ASSUME_NONNULL_END

View File

@@ -62,7 +62,9 @@
#import "XPTreasureFairyGiftView.h"
#import "XPRoomTarrowBannerView.h"
#import "PIRoomGiftBroadcastWindow.h"
@interface PIFullScreenBannerAnimation()<XPRoomGiftBroadcastViewDelegate,XPRoomLuckyBigPrizeViewDelegate, XPRoomStarKitchenBannerViewDelegate,XPRoomAnchorRankBannerViewDelegate,PIRoomGiftBroadcastWindowDelegate>
#import "PIUniversalBannerModel.h"
#import "PIUniversalBannerView.h"
@interface PIFullScreenBannerAnimation()<XPRoomGiftBroadcastViewDelegate,XPRoomLuckyBigPrizeViewDelegate, XPRoomStarKitchenBannerViewDelegate,XPRoomAnchorRankBannerViewDelegate,PIRoomGiftBroadcastWindowDelegate,PIUniversalBannerViewDelegate>
/// PresentAchieveAbstractMatrix
@property(nonatomic,strong) NSMutableArray<GiftReceiveInfoModel *> *animationListA;
/// YUMIPresentBigCaptureMatrix
@@ -222,8 +224,101 @@
[self createBigPrizeAnimation:model];
}else if(model.type == GiftBannerType_Common_H5){
[self createCommonH5BannerAnimation:model];
}else if (model.type == GiftBannerType_General_Floating_Screen){
[self createGeneralFloatingScreenAnimation:model];
}
}
#pragma mark -
-(void)receiveRoomGeneralFloatingScreen:(AttachmentModel *)attacment{
PIBaseAnimationViewModel *roomGraffiti = [PIBaseAnimationViewModel new];
roomGraffiti.data = attacment.data;
roomGraffiti.type = GiftBannerType_General_Floating_Screen;
roomGraffiti.first = attacment.first;
roomGraffiti.second = attacment.second;
if(self.animationListB.count == 0 && self.isPlayOfB == NO){
[self createGeneralFloatingScreenAnimation:roomGraffiti];
}
[self.animationListB addObject:roomGraffiti];
}
- (void)createGeneralFloatingScreenAnimation:(PIBaseAnimationViewModel *)attacment{
self.isPlayOfB = YES;
CGFloat top = self.isPlayOfA == YES ? (self.broadCastHieght + statusbarHeight) : (kNavigationHeight + 15);
PIUniversalBannerModel *model = [PIUniversalBannerModel modelWithDictionary:attacment.data];
BOOL isSvga = [model.resourceType isEqualToString:@"SVGA"];
__block PIUniversalBannerView *bannerView;
if (isSvga == YES) {
SVGAParser *parser = [SVGAParser new];
[parser parseWithURL:[NSURL URLWithString:model.resourceContent] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) {
model.videoItem = videoItem;
bannerView = [[PIUniversalBannerView alloc]initWithFrame:CGRectMake(0, top, model.resourceWidth, model.resourceHeight) ];
[self showGeneralFloatingScreenView:bannerView model:model];
} failureBlock:^(NSError * _Nonnull error) {
}];
}else{
NetImageView *imageView = [NetImageView new];
[imageView loadImageWithUrl:model.resourceContent completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) {
model.image = image;
CGFloat width = image.size.width <= 0 ? kGetScaleWidth(60) : image.size.width;
CGFloat height = image.size.height ;
CGFloat getHeigth = KScreenWidth * height / width;
bannerView = [[PIUniversalBannerView alloc]initWithFrame:CGRectMake(KScreenWidth, top, KScreenWidth, getHeigth) ];
[self showGeneralFloatingScreenView:bannerView model:model];
}];
}
}
-(void)showGeneralFloatingScreenView:(PIUniversalBannerView *)bannerView model:(PIUniversalBannerModel *)model{
BOOL isSvga = [model.resourceType isEqualToString:@"SVGA"];
bannerView.isSvga = isSvga;
bannerView.model = model;
bannerView.delegate = self;
[kWindow addSubview:bannerView];
POPSpringAnimation *springAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPViewCenter];
springAnimation.springSpeed = 12;
springAnimation.springBounciness = 10.f;
springAnimation.fromValue = [NSValue valueWithCGPoint:bannerView.center];
springAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(bannerView.frame.size.width / 2, bannerView.center.y)];
[springAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) {
if (finished) {
POPBasicAnimation *moveAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewCenter];
moveAnimation.fromValue = [NSValue valueWithCGPoint:CGPointMake(0, bannerView.center.y)];
moveAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(-KScreenWidth/2, bannerView.center.y)];
moveAnimation.beginTime = CACurrentMediaTime() + 3;
moveAnimation.duration = 0.5;
moveAnimation.repeatCount = 1;
moveAnimation.removedOnCompletion = YES;
@kWeakify(self);
[moveAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) {
@kStrongify(self);
if (finished) {
[bannerView removeFromSuperview];
self.isPlayOfB = NO;
if(self.animationListB.count > 0){
[self.animationListB removeObjectAtIndex:0];
}
[self playAnimationWithModel];
}
}];
[bannerView pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"];
}
}];
[bannerView pop_addAnimation:springAnimation forKey:@"starKitchenOutAnimation"];
}
#pragma mark - PIUniversalBannerViewDelegate
- (void)pIUniversalBannerView:(PIUniversalBannerView *)view didClick:(PIUniversalBannerModel *)model{
if (model.skipType == 2){
[XPRoomViewController openRoom:model.skipContent viewController:[XCCurrentVCStackManager shareManager].getCurrentVC];
}else if (model.skipType == 3){
XPWebViewController * webVC = [[XPWebViewController alloc] init];
webVC.isPush = YES;
webVC.url = model.skipContent;
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webVC animated:YES];
}
}
#pragma mark - h5
-(void)receiveCommonH5Banner:(AttachmentModel *)attachment{

View File

@@ -630,6 +630,9 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
if([XPSkillCardPlayerManager shareInstance].isInRoomVC == YES)return;
[self.roomAnimation receiveNobleLevelUp:attachment];
}else if (attachment.first == CustomMessageType_General_Floating_Screen && attachment.second == Custom_Message_Sub_General_Floating_Screen_All_Room){
if([XPSkillCardPlayerManager shareInstance].isInRoomVC == YES)return;
[self.roomAnimation receiveRoomGeneralFloatingScreen:attachment];
}
}
}

View File

@@ -0,0 +1,18 @@
//
// PIWebViewSavePhotoView.h
// YuMi
//
// Created by duoban on 2024/3/14.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface PIWebViewSavePhotoView : UIView
@property(nonatomic,copy) NSString *text;
@property(nonatomic,copy) UIImage *image;
@property(nonatomic,copy) NSString *code;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,180 @@
//
// PIWebViewSavePhotoView.m
// YuMi
//
// Created by duoban on 2024/3/14.
//
#import "PIWebViewSavePhotoView.h"
@interface PIWebViewSavePhotoView()
@property(nonatomic,strong) UIImageView *topView;
@property(nonatomic,strong) UIImageView *bottomView;
@property(nonatomic,strong) UIImageView *topTextImageView;
@property(nonatomic,strong) UIView *bgCodeView;
@property(nonatomic,strong) UIImageView *bgCodeText;
@property(nonatomic,strong) UILabel *codeText;
@property(nonatomic,strong) NetImageView *codeView;
@property(nonatomic,strong) UILabel *tipView;
@property(nonatomic,strong) UIButton *codeBtn;
@end
@implementation PIWebViewSavePhotoView
-(instancetype)initWithFrame:(CGRect)frame{
self = [super initWithFrame:frame];
if(self){
[self installUI];
[self installConstraints];
}
return self;
}
-(void)installUI{
[self addSubview:self.topView];
[self addSubview:self.bottomView];
[self addSubview:self.topTextImageView];
[self addSubview:self.bgCodeView];
[self.bgCodeView addSubview:self.bgCodeText];
[self.bgCodeText addSubview:self.codeText];
[self.bgCodeView addSubview:self.codeView];
[self.bgCodeView addSubview:self.tipView];
[self.bgCodeView addSubview:self.codeBtn];
}
-(void)installConstraints{
[self.topView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.leading.trailing.mas_equalTo(0);
make.height.mas_equalTo(kGetScaleWidth(326));
}];
[self.bottomView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.trailing.equalTo(self);
make.top.mas_equalTo(kGetScaleWidth(303));
make.height.mas_equalTo(kGetScaleWidth(509));
}];
[self.topTextImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(kGetScaleWidth(132));
make.width.mas_equalTo(kGetScaleWidth(297));
make.height.mas_equalTo(kGetScaleWidth(32.5));
make.centerX.equalTo(self);
}];
[self.bgCodeView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(kGetScaleWidth(345));
make.height.mas_equalTo(kGetScaleWidth(431));
make.top.equalTo(self.topTextImageView.mas_bottom).mas_offset(kGetScaleWidth(186.5));
make.centerX.equalTo(self);
}];
[self.bgCodeText mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.centerX.equalTo(self.bgCodeView);
make.width.mas_equalTo(kGetScaleWidth(290));
make.height.mas_equalTo(kGetScaleWidth(43));
}];
[self.codeText mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(kGetScaleWidth(3));
make.bottom.mas_equalTo(-kGetScaleWidth(3));
make.leading.trailing.equalTo(self.bgCodeText).inset(kGetScaleWidth(10));
}];
[self.codeView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(kGetScaleWidth(200));
make.centerX.equalTo(self.bgCodeView);
make.top.mas_equalTo(kGetScaleWidth(96));
}];
[self.tipView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(kGetScaleWidth(321));
make.height.mas_equalTo(kGetScaleWidth(14));
make.centerX.equalTo(self.bgCodeView);
}];
[self.codeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(kGetScaleWidth(355));
make.width.mas_equalTo(kGetScaleWidth(241));
make.height.mas_equalTo(kGetScaleWidth(46));
make.centerX.equalTo(self.bgCodeView);
}];
}
-(void)setText:(NSString *)text{
_text = text;
_codeText.text = text;
}
-(void)setImage:(UIImage *)image{
_image = image;
_codeView.image = _image;
}
- (void)setCode:(NSString *)code{
_code = code;
NSString *text = [NSString stringWithFormat:@"%@%@",YMLocalizedString(@"PIWebViewSavePhotoView1"),_code];
[_codeBtn setTitle:text forState:UIControlStateNormal];
}
#pragma mark -
- (UIImageView *)topView{
if(!_topView){
_topView = [UIImageView new];
_topView.image = kImage(@"pi_webView_code_top");
}
return _topView;
}
- (UIImageView *)bottomView{
if(!_bottomView){
_bottomView = [UIImageView new];
_bottomView.image = kImage(@"pi_webView_code_bottom");
}
return _bottomView;
}
- (UIImageView *)topTextImageView{
if(!_topTextImageView){
_topTextImageView = [UIImageView new];
_topTextImageView.image = kImage(@"pi_webView_code_top_text");
}
return _topTextImageView;
}
- (UIImageView *)bgCodeText{
if(!_bgCodeText){
_bgCodeText = [UIImageView new];
_bgCodeText.image = kImage(@"pi_webView_code_code_text");
}
return _bgCodeText;
}
- (UIView *)bgCodeView{
if(!_bgCodeView){
_bgCodeView = [UIView new];
_bgCodeView.layer.cornerRadius = kGetScaleWidth(20);
_bgCodeView.layer.masksToBounds = YES;
_bgCodeView.backgroundColor = [UIColor whiteColor];
}
return _bgCodeView;
}
- (UILabel *)codeText{
if(!_codeText){
_codeText = [UILabel labelInitWithText:@"掃碼下載PiKO並填寫我的邀請碼\n立得1000钻石" font:kFontRegular(12) textColor:[UIColor whiteColor]];
_codeText.textAlignment = NSTextAlignmentCenter;
_codeText.numberOfLines = 0;
}
return _codeText;
}
- (UILabel *)tipView{
if(!_tipView){
_tipView = [UILabel labelInitWithText:YMLocalizedString(@"PIWebViewSavePhotoView0") font:kFontRegular(10) textColor:UIColorFromRGB(0x999999)];
}
return _tipView;
}
- (UIButton *)codeBtn{
if(!_codeBtn){
_codeBtn = [UIButton new];
NSString *text = [NSString stringWithFormat:@"%@GHT32",YMLocalizedString(@"PIWebViewSavePhotoView1")];
[_codeBtn setTitle:text forState:UIControlStateNormal];
_codeBtn.titleLabel.font = kFontRegular(16);
[_codeBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[_codeBtn setBackgroundImage:kImage(@"pi_webView_code_btn_bg") forState:UIControlStateNormal];
}
return _codeBtn;
}
- (NetImageView *)codeView{
if(!_codeView){
_codeView = [NetImageView new];
}
return _codeView;
}
@end

View File

@@ -30,6 +30,9 @@
#import "XPIAPRechargeViewController.h"
#import "SessionViewController.h"
#import "XPMonentTopicContainerViewController.h"
#import "PIWebViewSavePhotoView.h"
typedef NS_ENUM(NSUInteger, RightNavigationPushType){
///h5
RightNavigationPushType_Web = 1,
@@ -77,10 +80,14 @@ typedef NS_ENUM(NSUInteger, RightNavigationPushType){
@property (nonatomic, strong) WKUserContentController *pi_userContentController;
///
@property (nonatomic,copy) NSDictionary *shareDic;
///
@property (nonatomic,copy) NSDictionary *savePhotoDic;
///
@property (nonatomic,strong) XPWebViewNavView *navView;
///
@property (nonatomic,assign) BOOL isCustom;
@property(nonatomic,strong) PIWebViewSavePhotoView *saveView;
@end
NSString * const kJSOpenPurse = @"openPurse";
@@ -103,7 +110,7 @@ NSString * const kJSOpenRoom = @"openRoom";
NSString * const kJSOpenRoomForGiftId = @"openRoomForGiftId";
NSString * const kJSOpenChatPage = @"geToChatPage";
NSString * const kJSOpenAppConcernedChat = @"openAppConcernedChat";
NSString * const kJSSavePictureShare = @"savePictureShare";
@implementation XPWebViewController
@@ -128,10 +135,56 @@ NSString * const kJSOpenAppConcernedChat = @"openAppConcernedChat";
- (void)viewDidLoad {
[super viewDidLoad];
[self.view addSubview:self.saveView];
self.saveView.hidden = YES;
[self initView];
}
- (void)saveImageToPhotoAlbum:(NSDictionary *)data{
if (data.allKeys.count == 0){
[self showSuccessToast:YMLocalizedString(@"PIWebViewSavePhotoView3")];
return;
}
NSString *qrCodeUrl = data[@"qrCodeUrl"];
if (qrCodeUrl.length == 0){
[self showSuccessToast:YMLocalizedString(@"PIWebViewSavePhotoView3")];
return;
}
[self showLoading];
NetImageView *imageView = [NetImageView new];
[imageView loadImageWithUrl:qrCodeUrl completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) {
[self hideHUD];
if (image != nil){
self.saveView.hidden = NO;
NSString *text = data[@"text"];
NSString *invitationCode = data[@"invitationCode"];
self.saveView.text = text;
self.saveView.image = image;
self.saveView.code = invitationCode;
UIImage *saveImage = [UIImage getImageFromView:self.saveView];
UIImageWriteToSavedPhotosAlbum(saveImage, self, @selector(image:didFinishSavingWithError:contextInfo:), NULL);
return;
}
[self showSuccessToast:YMLocalizedString(@"PIWebViewSavePhotoView3")];
}];
}
//
- (void)image: (UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo{
self.saveView.hidden = YES;
NSString *msg = YMLocalizedString(@"PIWebViewSavePhotoView2");
if(error != NULL){
msg = YMLocalizedString(@"PIWebViewSavePhotoView3");
}
[self showSuccessToast:msg];
}
- (void)initView {
if (self.navigationController.viewControllers.count > 1){
UIBarButtonItem *leftBarButtonItem = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"common_nav_back"] style:UIBarButtonItemStylePlain target:self action:@selector(backButtonClick)];
@@ -430,7 +483,21 @@ NSString * const kJSOpenAppConcernedChat = @"openAppConcernedChat";
});
}
}
}else if ([message.name isEqualToString:kJSSavePictureShare]){
NSDictionary *bodyDic;
if ([message.body isKindOfClass:[NSDictionary class]]) {
bodyDic = message.body;
} else if ([message.body isKindOfClass:[NSString class]]) {
bodyDic = [message.body toJSONObject];
}
NSString *type = [NSString stringWithFormat:@"%@",bodyDic[@"type"]];
if ([type isEqualToString:@"2"]){
[self saveImageToPhotoAlbum:bodyDic];
}else if ([type isEqualToString:@"1"]){
self.savePhotoDic = bodyDic;
[self showShareSavePhote];
}
}
}
}];
}
@@ -530,7 +597,36 @@ NSString * const kJSOpenAppConcernedChat = @"openAppConcernedChat";
[self.navigationController pushViewController:webVC animated:YES];
}
}
-(void)showShareSavePhote{
if (self.savePhotoDic.allKeys.count <= 0) {
return;
}
NSDictionary * dic = self.savePhotoDic;
XPShareInfoModel * shareInfo = [[XPShareInfoModel alloc] init];
shareInfo.shareContent = dic[@"shareText"];
shareInfo.type = ShareType_H5;
shareInfo.uid = [AccountInfoStorage instance].getUid;
NSString *urlStr = ((NSString *)dic[@"toUrl"]).length > 0 ? dic[@"toUrl"] : @"";
NSString *title = ((NSString *)dic[@"shareTitle"]).length > 0 ? dic[@"shareTitle"] : @"";
NSString *shareText = ((NSString *)dic[@"shareText"]).length > 0 ? dic[@"shareText"] : @"";
NSString *shareImg = ((NSString *)dic[@"shareImg"]).length > 0 ? dic[@"shareImg"] : @"";
shareInfo.shareUrl = [NSString stringWithFormat:@"%@&image=%@&title=%@&subTitle=%@",urlStr,shareImg,title,shareText];
XPShareItem *cycle = [XPShareItem itemWitTag:XPShareItemTagFaceBook title:@"FaceBook" imageName:@"share_fb" disableImageName:@"share_fb"];
XPShareItem *wechat = [XPShareItem itemWitTag:XPShareItemTagLine title:@"Line" imageName:@"share_line" disableImageName:@"share_line"];
wechat.isShareInvite = YES;
wechat.inviteTitle = title;
XPShareItem *qq = [XPShareItem itemWitTag:XPShareItemTagCopyLink title:YMLocalizedString(@"XPWebViewNavView1") imageName:@"share_copy_link" disableImageName:@"share_copy_link"];
XPShareItem *save = [XPShareItem itemWitTag:XPShareItemTagAppSaveAlbum title:YMLocalizedString(@"PIWebViewSavePhotoView4") imageName:@"share_save_icon" disableImageName:@"share_save_icon"];
NSArray * items = @[wechat,cycle, qq,save];
CGFloat margin = 15;
CGSize itemSize = CGSizeMake((KScreenWidth-2*margin)/4, 65);
XPShareView *shareView = [[XPShareView alloc] initWithItems:items itemSize:itemSize shareInfo:shareInfo];
shareView.delegate = self;
[TTPopup popupView:shareView style:TTPopupStyleActionSheet];
}
- (void)showSharePanel {
if (self.shareDic.allKeys.count <= 0) {
return;
@@ -554,7 +650,9 @@ NSString * const kJSOpenAppConcernedChat = @"openAppConcernedChat";
XPShareItem *cycle = [XPShareItem itemWitTag:XPShareItemTagFaceBook title:@"FaceBook" imageName:@"share_fb" disableImageName:@"share_fb"];
XPShareItem *wechat = [XPShareItem itemWitTag:XPShareItemTagLine title:@"Line" imageName:@"share_line" disableImageName:@"share_line"];
XPShareItem *qq = [XPShareItem itemWitTag:XPShareItemTagCopyLink title:YMLocalizedString(@"XPWebViewNavView1") imageName:@"share_copy_link" disableImageName:@"share_copy_link"];
NSArray * items = @[wechat,cycle, qq];
XPShareItem *save = [XPShareItem itemWitTag:XPShareItemTagAppSaveAlbum title:YMLocalizedString(@"PIWebViewSavePhotoView4") imageName:@"share_save_icon" disableImageName:@"share_save_icon"];
NSArray * items = @[wechat,cycle, qq,save];
CGFloat margin = 15;
CGSize itemSize = CGSizeMake((KScreenWidth-2*margin)/4, 65);
XPShareView *shareView = [[XPShareView alloc] initWithItems:items itemSize:itemSize shareInfo:shareInfo];
@@ -565,6 +663,9 @@ NSString * const kJSOpenAppConcernedChat = @"openAppConcernedChat";
}
#pragma mark - XCShareViewDelegate
- (void)shareView:(XPShareView *)shareView savePhoto:(XPShareInfoModel *)shareInfo{
[self saveImageToPhotoAlbum:self.savePhotoDic];
}
- (void)shareViewDidClickCancle:(XPShareView *)shareView {
[TTPopup dismiss];
}
@@ -744,6 +845,8 @@ NSString * const kJSOpenAppConcernedChat = @"openAppConcernedChat";
[_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSOpenChatPage];
///
[_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSOpenAppConcernedChat];
///
[_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSSavePictureShare];
}
return _pi_userContentController;
@@ -756,5 +859,10 @@ NSString * const kJSOpenAppConcernedChat = @"openAppConcernedChat";
}
return _navView;
}
- (PIWebViewSavePhotoView *)saveView{
if(!_saveView){
_saveView = [[PIWebViewSavePhotoView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)];
}
return _saveView;
}
@end

View File

@@ -62,4 +62,5 @@ public class PILineLoginManager: NSObject {
@objc public class func destroyLine() {
PILineLoginManager.manager = nil
}
}

View File

@@ -8,5 +8,9 @@
<array>
<string>Default</string>
</array>
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:cebg.t4m.cn</string>
</array>
</dict>
</plist>

View File

@@ -8,5 +8,9 @@
<array>
<string>Default</string>
</array>
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:cebg.t4m.cn</string>
</array>
</dict>
</plist>

View File

@@ -3184,6 +3184,12 @@
"PIGuildAnchorIncomeSectionView1"="主播(钻石)";
"PIGuildAnchorIncomeSectionView2"="房间(钻石)";
"PIGuildAnchorIncomeSectionView3"="直播时长";
///PIWebViewSavePhotoView
"PIWebViewSavePhotoView0"="记得注册时填写邀请码哦~";
"PIWebViewSavePhotoView1"="邀请码:";
"PIWebViewSavePhotoView2"="保存图片成功";
"PIWebViewSavePhotoView3"="保存图片失败";
"PIWebViewSavePhotoView4"="保存邀请图片";
///不能脚本生成的
"App_Common_And" = "和";
"App_Common_Male" = "男";

View File

@@ -3182,6 +3182,12 @@
"PIGuildAnchorIncomeSectionView1"="主播(鉆石)";
"PIGuildAnchorIncomeSectionView2"="房間(鉆石)";
"PIGuildAnchorIncomeSectionView3"="直播時長";
///PIWebViewSavePhotoView
"PIWebViewSavePhotoView0"="記得註冊時填寫邀請碼哦~";
"PIWebViewSavePhotoView1"="邀請碼:";
"PIWebViewSavePhotoView2"="保存圖片成功";
"PIWebViewSavePhotoView3"="保存圖片失敗";
"PIWebViewSavePhotoView4"="保存邀請圖片";
///不能腳本生成的
"App_Common_And" = "和";
"App_Common_Male" = "男";