Compare commits
8 Commits
enterprise
...
appstore_2
Author | SHA1 | Date | |
---|---|---|---|
![]() |
1498c4b91c | ||
![]() |
c1da0893de | ||
![]() |
f9eb216bd3 | ||
![]() |
84af03be39 | ||
![]() |
8d27e307e9 | ||
![]() |
c90c726b53 | ||
![]() |
6d450443d0 | ||
![]() |
17346ffedf |
@@ -210,6 +210,7 @@
|
||||
235A451A2B04A352009753F5 /* PIRoomActivityWebView.m in Sources */ = {isa = PBXBuildFile; fileRef = 235A45192B04A352009753F5 /* PIRoomActivityWebView.m */; };
|
||||
235A451D2B04A452009753F5 /* PIRoomActivityWebCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 235A451C2B04A452009753F5 /* PIRoomActivityWebCell.m */; };
|
||||
235A45232B04BEB6009753F5 /* PIBaseModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 235A45222B04BEB6009753F5 /* PIBaseModel.m */; };
|
||||
23630BA62BAC3888003AD25D /* PIGiftSuperGiftBroadcastView.m in Sources */ = {isa = PBXBuildFile; fileRef = 23630BA52BAC3888003AD25D /* PIGiftSuperGiftBroadcastView.m */; };
|
||||
236896A02AE6720600EED5F2 /* PIRoomGiftBroadcastWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 2368969F2AE6720600EED5F2 /* PIRoomGiftBroadcastWindow.m */; };
|
||||
2369F9912A89CE0E00563B48 /* PIUserSexView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2369F9902A89CE0E00563B48 /* PIUserSexView.m */; };
|
||||
2369F9932A8B21EB00563B48 /* pi_treasure_fairy_gift_bg.svga in Resources */ = {isa = PBXBuildFile; fileRef = 2369F9922A8B21EA00563B48 /* pi_treasure_fairy_gift_bg.svga */; };
|
||||
@@ -908,7 +909,6 @@
|
||||
E83ABF03280EC90C00322EE4 /* ContentApplicationShareModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E83ABF02280EC90C00322EE4 /* ContentApplicationShareModel.m */; };
|
||||
E83ABF06280EDE2B00322EE4 /* MessageContentLevelUpgradeView.m in Sources */ = {isa = PBXBuildFile; fileRef = E83ABF05280EDE2B00322EE4 /* MessageContentLevelUpgradeView.m */; };
|
||||
E83DB47A27462C4500D8CBD1 /* XPGiftBigPrizeModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E83DB47927462C4500D8CBD1 /* XPGiftBigPrizeModel.m */; };
|
||||
E83DB47D2746372300D8CBD1 /* XPRoomGiftBannerView.m in Sources */ = {isa = PBXBuildFile; fileRef = E83DB47C2746372300D8CBD1 /* XPRoomGiftBannerView.m */; };
|
||||
E83DB481274649FB00D8CBD1 /* XPGiftBannerUserInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E83DB480274649FB00D8CBD1 /* XPGiftBannerUserInfoModel.m */; };
|
||||
E83DB4842746661800D8CBD1 /* XPRoomGiftBroadcastView.m in Sources */ = {isa = PBXBuildFile; fileRef = E83DB4832746661800D8CBD1 /* XPRoomGiftBroadcastView.m */; };
|
||||
E8412F9627795E34006E1101 /* XPRoomInviteFansView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8412F9527795E34006E1101 /* XPRoomInviteFansView.m */; };
|
||||
@@ -1890,6 +1890,8 @@
|
||||
235A451C2B04A452009753F5 /* PIRoomActivityWebCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIRoomActivityWebCell.m; sourceTree = "<group>"; };
|
||||
235A45212B04BEB6009753F5 /* PIBaseModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIBaseModel.h; sourceTree = "<group>"; };
|
||||
235A45222B04BEB6009753F5 /* PIBaseModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIBaseModel.m; sourceTree = "<group>"; };
|
||||
23630BA42BAC3888003AD25D /* PIGiftSuperGiftBroadcastView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIGiftSuperGiftBroadcastView.h; sourceTree = "<group>"; };
|
||||
23630BA52BAC3888003AD25D /* PIGiftSuperGiftBroadcastView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIGiftSuperGiftBroadcastView.m; sourceTree = "<group>"; };
|
||||
2368969E2AE6720600EED5F2 /* PIRoomGiftBroadcastWindow.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIRoomGiftBroadcastWindow.h; sourceTree = "<group>"; };
|
||||
2368969F2AE6720600EED5F2 /* PIRoomGiftBroadcastWindow.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIRoomGiftBroadcastWindow.m; sourceTree = "<group>"; };
|
||||
2369F98F2A89CE0E00563B48 /* PIUserSexView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIUserSexView.h; sourceTree = "<group>"; };
|
||||
@@ -3111,8 +3113,6 @@
|
||||
E83ABF05280EDE2B00322EE4 /* MessageContentLevelUpgradeView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MessageContentLevelUpgradeView.m; sourceTree = "<group>"; };
|
||||
E83DB47827462C4500D8CBD1 /* XPGiftBigPrizeModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPGiftBigPrizeModel.h; sourceTree = "<group>"; };
|
||||
E83DB47927462C4500D8CBD1 /* XPGiftBigPrizeModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPGiftBigPrizeModel.m; sourceTree = "<group>"; };
|
||||
E83DB47B2746372300D8CBD1 /* XPRoomGiftBannerView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomGiftBannerView.h; sourceTree = "<group>"; };
|
||||
E83DB47C2746372300D8CBD1 /* XPRoomGiftBannerView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomGiftBannerView.m; sourceTree = "<group>"; };
|
||||
E83DB47F274649FB00D8CBD1 /* XPGiftBannerUserInfoModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPGiftBannerUserInfoModel.h; sourceTree = "<group>"; };
|
||||
E83DB480274649FB00D8CBD1 /* XPGiftBannerUserInfoModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPGiftBannerUserInfoModel.m; sourceTree = "<group>"; };
|
||||
E83DB4822746661800D8CBD1 /* XPRoomGiftBroadcastView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomGiftBroadcastView.h; sourceTree = "<group>"; };
|
||||
@@ -7497,8 +7497,6 @@
|
||||
E8C21500274B76F60079E6BF /* XPRoomAnimationHitView.m */,
|
||||
9B8DE0E2289CF7AA00FB6EC2 /* XPRoomGiftCompoundView.h */,
|
||||
9B8DE0E3289CF7AA00FB6EC2 /* XPRoomGiftCompoundView.m */,
|
||||
E83DB47B2746372300D8CBD1 /* XPRoomGiftBannerView.h */,
|
||||
E83DB47C2746372300D8CBD1 /* XPRoomGiftBannerView.m */,
|
||||
232C43E82AB15F4100D4B2ED /* XPRoomTarrowBannerView.h */,
|
||||
232C43E92AB15F4100D4B2ED /* XPRoomTarrowBannerView.m */,
|
||||
E83DB4822746661800D8CBD1 /* XPRoomGiftBroadcastView.h */,
|
||||
@@ -8797,6 +8795,8 @@
|
||||
E8901CF528B38D89001E9A92 /* XPGraffitiGiftView.m */,
|
||||
9B4D449128F15765002572D5 /* XPGiftLuckyGiftBroadcastView.h */,
|
||||
9B4D449228F15765002572D5 /* XPGiftLuckyGiftBroadcastView.m */,
|
||||
23630BA42BAC3888003AD25D /* PIGiftSuperGiftBroadcastView.h */,
|
||||
23630BA52BAC3888003AD25D /* PIGiftSuperGiftBroadcastView.m */,
|
||||
E8D4DE422940462C00EC788D /* XPGiftTwelveStarBroadcastView.h */,
|
||||
E8D4DE432940462C00EC788D /* XPGiftTwelveStarBroadcastView.m */,
|
||||
);
|
||||
@@ -11252,6 +11252,7 @@
|
||||
E8E70D8326F2F51A00F03460 /* XPMineHeadView.m in Sources */,
|
||||
E80EC81128ACD84000D133C5 /* QEmotionHelper.m in Sources */,
|
||||
E8EEB90C26FC5EBC007C6EBA /* XPMineUserInfoEditModel.m in Sources */,
|
||||
23630BA62BAC3888003AD25D /* PIGiftSuperGiftBroadcastView.m in Sources */,
|
||||
18E7B31826F097E00064BC9B /* UserInfoModel.m in Sources */,
|
||||
E87DF4F22A42CBEC009C1185 /* XPHomeUserView.m in Sources */,
|
||||
E83ABEF6280E9AD800322EE4 /* MessageContentUnSupportView.m in Sources */,
|
||||
@@ -11768,7 +11769,6 @@
|
||||
E8B846C526FDB41A00A777FE /* XPMineUserInfolbumPresenter.m in Sources */,
|
||||
9BFB101F2897CC4300B3985E /* XPAnchorCardView.m in Sources */,
|
||||
1427218F29A75F6F00C7C423 /* HTTPConnection.m in Sources */,
|
||||
E83DB47D2746372300D8CBD1 /* XPRoomGiftBannerView.m in Sources */,
|
||||
9BAA5FED277A1BBE007453F3 /* XPPrivacyViewController.m in Sources */,
|
||||
E873EB02280922720071030D /* XPMineUserInfoEmptyCollectionViewCell.m in Sources */,
|
||||
E872309326E8D31500B90D4F /* LoginVerifCodeView.m in Sources */,
|
||||
@@ -12207,7 +12207,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 20.20.14;
|
||||
MARKETING_VERSION = 20.20.15;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.peko.enterprise.ios;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
@@ -12243,7 +12243,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 20.20.14;
|
||||
MARKETING_VERSION = 20.20.15;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.peko.enterprise.ios;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
|
@@ -70,7 +70,11 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
|
||||
|
||||
- (void) IMLSDKWillRestoreScene:(MLSDKScene *)scene Restore:(void (^)(BOOL, RestoreStyle))restoreHandler
|
||||
{
|
||||
|
||||
NSString *inviteCode = scene.params[@"inviteCode"];
|
||||
if (inviteCode != nil && [[AccountInfoStorage instance]getUid].length == 0){
|
||||
ClientConfig *config = [ClientConfig shareConfig];
|
||||
config.inviteCode = inviteCode;
|
||||
}
|
||||
|
||||
restoreHandler(YES, MLDefault);
|
||||
|
||||
|
@@ -5,12 +5,12 @@
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_gift_banner_high_bg@2x.png",
|
||||
"filename" : "room_gift_super_gift_icon@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_gift_banner_high_bg@3x.png",
|
||||
"filename" : "room_gift_super_gift_icon@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
BIN
YuMi/Assets.xcassets/middle/room_gift_super_gift_icon.imageset/room_gift_super_gift_icon@2x.png
vendored
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
YuMi/Assets.xcassets/middle/room_gift_super_gift_icon.imageset/room_gift_super_gift_icon@3x.png
vendored
Normal file
After Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 74 KiB |
@@ -1,22 +0,0 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_gift_banner_low_bg@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_gift_banner_low_bg@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 50 KiB |
@@ -1,22 +0,0 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_gift_banner_middle_bg@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_gift_banner_middle_bg@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 63 KiB |
@@ -11,7 +11,8 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef void(^LoadCompletion)(UIImage *image, NSURL * url);
|
||||
typedef void(^LoadCompletion)(UIImage *_Nullable image, NSURL * url);
|
||||
typedef void(^LoadFail)(NSError *error);
|
||||
|
||||
typedef NS_ENUM(NSInteger, NetImageState){
|
||||
NetImageStateUnload = 1,
|
||||
@@ -30,7 +31,7 @@ typedef NS_ENUM(NSInteger, NetImageState){
|
||||
|
||||
- (void)loadImage:(LoadCompletion _Nullable)completion;
|
||||
- (void)loadImageWithUrl:(NSString * _Nonnull)imageUrl completion:(LoadCompletion _Nullable)completion;
|
||||
|
||||
- (void)loadImageWithUrl:(NSString * _Nonnull)imageUrl completion:(LoadCompletion)completion fail:(LoadFail)fail;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -72,12 +72,30 @@
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)loadImage:(LoadCompletion)completion fail:(LoadFail)fail{
|
||||
self.state = NetImageStateLoading;
|
||||
[self sd_setImageWithURL:[NSURL URLWithString:_innerConfigedUrl] placeholderImage:self.config.placeHolder options:SDWebImageRetryFailed completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
|
||||
if (error) {
|
||||
self.state = NetImageStateUnload;
|
||||
if (fail){
|
||||
fail(error);
|
||||
}
|
||||
} else {
|
||||
self.state = NetImageStateLoaded;
|
||||
if (completion) {
|
||||
completion(image, imageURL);
|
||||
};
|
||||
}
|
||||
}];
|
||||
}
|
||||
- (void)loadImageWithUrl:(NSString * _Nonnull)imageUrl completion:(LoadCompletion)completion {
|
||||
[self initImageUrl:imageUrl];
|
||||
[self loadImage:completion];
|
||||
}
|
||||
|
||||
- (void)loadImageWithUrl:(NSString * _Nonnull)imageUrl completion:(LoadCompletion)completion fail:(LoadFail)fail{
|
||||
[self initImageUrl:imageUrl];
|
||||
[self loadImage:completion fail:fail];
|
||||
}
|
||||
- (NetImageConfig *)config {
|
||||
if (!_config) {
|
||||
_config = [[NetImageConfig alloc] init];
|
||||
|
@@ -49,7 +49,7 @@ isPhoneXSeries = [[UIApplication sharedApplication] delegate].window.safeAreaIns
|
||||
|
||||
|
||||
///内置版本号
|
||||
#define PI_App_Version @"2.6.4"
|
||||
#define PI_App_Version @"2.6.5"
|
||||
///渠道
|
||||
#define PI_App_Source @"appstore"
|
||||
//#define PI_App_Source @"pi_tf"
|
||||
|
@@ -49,7 +49,7 @@
|
||||
<string>Editor</string>
|
||||
<key>CFBundleURLSchemes</key>
|
||||
<array>
|
||||
<string>pikoApp</string>
|
||||
<string>pikoapp</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
@@ -96,10 +96,10 @@
|
||||
</dict>
|
||||
<key>NSCameraUsageDescription</key>
|
||||
<string>“Piko”需要您的同意,才可以访问进行拍照并上传您的图片,然后展示在您的个人主页上,便于他人查看</string>
|
||||
<key>NSLocationWhenInUseUsageDescription</key>
|
||||
<string>“Piko”需要您的同意,才可以进行定位服务,推荐附近好友</string>
|
||||
<key>NSLocalNetworkUsageDescription</key>
|
||||
<string>此App将可发现和连接到您所用网络上的设备。</string>
|
||||
<key>NSLocationWhenInUseUsageDescription</key>
|
||||
<string>“Piko”需要您的同意,才可以进行定位服务,推荐附近好友</string>
|
||||
<key>NSMicrophoneUsageDescription</key>
|
||||
<string>“Piko”需要您的同意,才可以进行语音聊天</string>
|
||||
<key>NSPhotoLibraryAddUsageDescription</key>
|
||||
|
@@ -115,8 +115,11 @@ typedef NS_ENUM(NSUInteger, CustomMessageType) {
|
||||
CustomMessageType_General_Public_Screen = 103,
|
||||
///疯狂动物园飘屏
|
||||
CustomMessageType_Graffiti_Star_Kitchen = 104,
|
||||
|
||||
///超级礼物
|
||||
CustomMessageType_Super_Gift = 106,
|
||||
///通用飘屏
|
||||
CustomMessageType_General_Floating_Screen = 105,
|
||||
CustomMessageType_General_Floating_Screen = 107,
|
||||
};
|
||||
|
||||
|
||||
@@ -635,12 +638,20 @@ typedef NS_ENUM(NSUInteger, CustomMessageTypeGeneralPublicScreen) {
|
||||
Custom_Message_Sub_General_Public_Screen_One_Room = 1031,//单房间
|
||||
Custom_Message_Sub_General_Public_Screen_All_Room = 1032,///全部房间
|
||||
};
|
||||
|
||||
///超级礼物
|
||||
//CustomMessageType_Super_Gift = 106,
|
||||
typedef NS_ENUM(NSUInteger, CustomMessageTypeSuperGift) {
|
||||
///所有房间
|
||||
Custom_Message_Sub_Super_Gift = 1061,
|
||||
|
||||
};
|
||||
///通用飘屏
|
||||
//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,///全部房间
|
||||
Custom_Message_Sub_General_Floating_Screen_One_Room = 1071,//单房间
|
||||
Custom_Message_Sub_General_Floating_Screen_All_Room = 1072,///全部房间
|
||||
};
|
||||
@interface AttachmentModel : PIBaseModel<NIMCustomAttachment>
|
||||
@property (nonatomic,assign) int first;
|
||||
|
@@ -46,7 +46,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
//是否为周榜top1
|
||||
@property(nonatomic,assign) BOOL isWeekTop1;
|
||||
@property(nonatomic,copy) NSString *inRoomUid;
|
||||
|
||||
//是否在麦位
|
||||
@property(nonatomic,assign) BOOL inMic;
|
||||
///是否在线
|
||||
|
@@ -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;
|
||||
|
@@ -243,15 +243,8 @@
|
||||
-(void)setPlaySoundTime:(NSInteger)time{
|
||||
_audioView.voiceDura = @(time).stringValue;
|
||||
}
|
||||
- (void)setRoomInfo1:(HomeRecommendRoomModel *)roomInfo1 {
|
||||
_roomInfo1 = roomInfo1;
|
||||
if (_roomInfo1) {
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
-(void)didSelectItemAction{
|
||||
|
||||
if(self.delegate && [self.delegate respondsToSelector:@selector(xPNewHomePartyTableViewCell:didSelectItem:)]){
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -23,6 +23,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property(nonatomic,assign) CGFloat resourceHeight;
|
||||
@property(nonatomic,strong) SVGAVideoEntity *videoItem;
|
||||
@property(nonatomic,strong) UIImage *image;
|
||||
@property(nonatomic,assign) CGFloat resourceTop;
|
||||
@end
|
||||
|
||||
|
||||
|
@@ -18,6 +18,7 @@
|
||||
@property (nonatomic,strong) UILabel *titleView;
|
||||
@property (nonatomic,strong) UIButton *clickBtn;
|
||||
@property(nonatomic,strong) SVGAVideoEntity *videoItem;
|
||||
|
||||
@end
|
||||
@implementation PIUniversalBannerView
|
||||
|
||||
@@ -62,15 +63,21 @@
|
||||
if(textDic.allKeys.count == 0)return ;
|
||||
NSString *title = textDic[@"zh-CHT"] == nil ? textDic[textDic.allKeys.firstObject] : textDic[@"zh-CHT"];
|
||||
if(title.length == 0)return;
|
||||
[title stringByReplacingOccurrencesOfString:@"\n" withString:@""];
|
||||
|
||||
CGFloat font = _isSvga == YES ? _model.fontSize / 2 : _model.fontSize;
|
||||
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] initWithString:title attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:font],NSForegroundColorAttributeName:[DJDKMIMOMColor colorWithHexString:_model.textColor]}];
|
||||
|
||||
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];
|
||||
NSAttributedString *attText = [[NSAttributedString alloc]initWithString:subText attributes:@{NSForegroundColorAttributeName:[DJDKMIMOMColor colorWithHexString:model.textColor],NSFontAttributeName:[UIFont systemFontOfSize:font]}];
|
||||
if ([attribute.string containsString:[NSString stringWithFormat:@"{%@}",model.key]]){
|
||||
[attribute replaceCharactersInRange:[attribute.string rangeOfString:[NSString stringWithFormat:@"{%@}",model.key]] withAttributedString:attText];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -79,12 +86,17 @@
|
||||
if(_isSvga == YES){
|
||||
self.bgImageView.hidden = YES;
|
||||
self.svgaView.hidden = NO;
|
||||
self.titleView.hidden = YES;
|
||||
self.titleView.hidden = NO;
|
||||
self.svgaView.loops = 1;
|
||||
self.titleView.attributedText = attribute;
|
||||
self.svgaView.clearsAfterStop = NO;
|
||||
self.svgaView.videoItem = _model.videoItem;
|
||||
[self.svgaView setAttributedText:attribute forKey:_model.svgaTextKey];
|
||||
// [self.svgaView setAttributedText:attribute forKey:_model.svgaTextKey];
|
||||
[self.svgaView startAnimation];
|
||||
[self.titleView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(kGetScaleWidth(self.model.resourceTop));
|
||||
make.leading.trailing.equalTo(self).inset(kGetScaleWidth(70));
|
||||
}];
|
||||
}else{
|
||||
self.bgImageView.hidden = NO;
|
||||
self.bgImageView.image = _model.image;
|
||||
|
@@ -42,7 +42,7 @@
|
||||
#import "RoomHalfHourRankModel.h"
|
||||
#import "ClientConfig.h"
|
||||
///View
|
||||
#import "XPRoomGiftBannerView.h"
|
||||
|
||||
#import "XPRoomGiftBroadcastView.h"
|
||||
#import "XPRoomCandyGiftView.h"
|
||||
#import "XPRoomDatingAnimationView.h"
|
||||
@@ -409,20 +409,26 @@
|
||||
|
||||
PIUniversalBannerModel *model = [PIUniversalBannerModel modelWithDictionary:attacment.data];
|
||||
BOOL isSvga = [model.resourceType isEqualToString:@"SVGA"];
|
||||
__block PIUniversalBannerView *bannerView;
|
||||
__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) ];
|
||||
bannerView = [[PIUniversalBannerView alloc]initWithFrame:CGRectMake(KScreenWidth, top, kGetScaleWidth(model.resourceWidth), kGetScaleWidth(model.resourceHeight)) ];
|
||||
[self showGeneralFloatingScreenView:bannerView model:model];
|
||||
} failureBlock:^(NSError * _Nonnull error) {
|
||||
|
||||
[bannerView removeFromSuperview];
|
||||
self.isPlayOfB = NO;
|
||||
if(self.animationListB.count > 0){
|
||||
[self.animationListB removeObjectAtIndex:0];
|
||||
}
|
||||
[self playAnimationWithModel];
|
||||
}];
|
||||
}else{
|
||||
NetImageView *imageView = [NetImageView new];
|
||||
[imageView loadImageWithUrl:model.resourceContent completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) {
|
||||
|
||||
model.image = image;
|
||||
CGFloat width = image.size.width <= 0 ? kGetScaleWidth(60) : image.size.width;
|
||||
CGFloat height = image.size.height ;
|
||||
@@ -430,7 +436,15 @@
|
||||
bannerView = [[PIUniversalBannerView alloc]initWithFrame:CGRectMake(0, top, KScreenWidth, getHeigth) ];
|
||||
[self showGeneralFloatingScreenView:bannerView model:model];
|
||||
|
||||
}fail:^(NSError * _Nonnull error) {
|
||||
[bannerView removeFromSuperview];
|
||||
self.isPlayOfB = NO;
|
||||
if(self.animationListB.count > 0){
|
||||
[self.animationListB removeObjectAtIndex:0];
|
||||
}
|
||||
[self playAnimationWithModel];
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1991,69 +2005,6 @@
|
||||
|
||||
[self createGiftBroadcastViewAnimation:receiveInfo];
|
||||
|
||||
// GiftInfoModel *giftInfo = receiveInfo.gift != nil ? receiveInfo.gift : receiveInfo.giftInfo;
|
||||
// if (!giftInfo) {
|
||||
// giftInfo = [[XPGiftStorage shareStorage] findGiftInfo: receiveInfo.giftId];
|
||||
// }
|
||||
// NSInteger giftTotal = 0;
|
||||
// if (receiveInfo.targetUids.count > 0) {
|
||||
// giftTotal = receiveInfo.giftNum * giftInfo.goldPrice * receiveInfo.targetUids.count;
|
||||
// } else {
|
||||
// giftTotal = receiveInfo.giftNum * giftInfo.goldPrice;
|
||||
// }
|
||||
// if (giftTotal >= 520) {
|
||||
// self.isPlayOfA = YES;
|
||||
// __block XPRoomGiftBannerView *view = [self.bannerDequePool anyObject];
|
||||
// if (view == nil) {
|
||||
// view = [[XPRoomGiftBannerView alloc] init];
|
||||
// [self.bannerVisiablePool addObject:view];
|
||||
// }else{
|
||||
// [self.bannerDequePool removeObject:view];
|
||||
// }
|
||||
// [self removeGiftBannerView:view];
|
||||
// [view configGiftBanner:receiveInfo users:[self makeBannerUsers]];
|
||||
// view.frame = CGRectMake(KScreenWidth, 80, KScreenWidth, 153);
|
||||
// [self.highLevleView addSubview:view];
|
||||
// POPSpringAnimation *springAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPViewCenter];
|
||||
// springAnimation.springSpeed = 12;
|
||||
// springAnimation.springBounciness = 10.f;
|
||||
// springAnimation.fromValue = [NSValue valueWithCGPoint:view.center];
|
||||
// springAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(view.frame.size.width / 2, view.center.y)];
|
||||
// @kWeakify(self);
|
||||
// [springAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) {
|
||||
// @kStrongify(self);
|
||||
// if (finished) {
|
||||
// [self removeAnimation:view];
|
||||
// }
|
||||
// }];
|
||||
//
|
||||
// [springAnimation setAnimationDidStartBlock:^(POPAnimation *anim) {
|
||||
// @kStrongify(self);
|
||||
//
|
||||
//// if (giftInfo.otherViewType == GiftOtherViewTypeMp4 && giftInfo.viewUrl.length > 0 && [self.delegate getRoomInfo].hasAnimationEffect) {
|
||||
//// [self largeGiftStopCarEffect:giftInfo.goldPrice];
|
||||
//// [self playGiftEffectWithVapUrl:giftInfo.viewUrl];
|
||||
//// }
|
||||
//// if (giftInfo.hasVggPic && giftInfo.vggUrl.length > 0 && [self.delegate getRoomInfo].hasAnimationEffect) {
|
||||
//// [self largeGiftStopCarEffect:giftInfo.goldPrice];
|
||||
//// [self playGiftEffect:giftInfo.vggUrl];
|
||||
//// }
|
||||
// }];
|
||||
//
|
||||
// [view pop_addAnimation:springAnimation forKey:@"spingOutAnimation"];
|
||||
// } else {
|
||||
//
|
||||
//// if (giftInfo.otherViewType == GiftOtherViewTypeMp4 && receiveInfo.viewUrl.length > 0) {//播放vap动效
|
||||
//// [self largeGiftStopCarEffect:giftInfo.goldPrice];
|
||||
//// [self playGiftEffectWithVapUrl:receiveInfo.viewUrl];
|
||||
//// }
|
||||
//// if (receiveInfo.vggUrl.length > 0) {///如果有特效的话就播放特效
|
||||
////
|
||||
//// [self largeGiftStopCarEffect:giftInfo.goldPrice];
|
||||
//// [self playGiftEffect:receiveInfo.vggUrl];
|
||||
//// }
|
||||
// [self.animationListA removeObjectAtIndex:0];
|
||||
// }
|
||||
}
|
||||
|
||||
- (void)largeGiftStopCarEffect:(double)goldPrice {
|
||||
@@ -2066,39 +2017,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
//移除特效动画
|
||||
- (void)removeAnimation:(XPRoomGiftBannerView *)view{
|
||||
POPBasicAnimation *moveAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewCenter];
|
||||
moveAnimation.fromValue = [NSValue valueWithCGPoint:view.center];
|
||||
moveAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(view.center.x - KScreenWidth, view.center.y)];
|
||||
moveAnimation.beginTime = CACurrentMediaTime() +5;
|
||||
moveAnimation.duration = 0.5;
|
||||
moveAnimation.repeatCount = 1;
|
||||
moveAnimation.removedOnCompletion = YES;
|
||||
moveAnimation.completionBlock = ^(POPAnimation *anim, BOOL finished) {
|
||||
if(finished){
|
||||
[view removeFromSuperview];
|
||||
self.isPlayOfA = NO;
|
||||
if(self.animationListA.count > 0){
|
||||
[self.animationListA removeObjectAtIndex:0];
|
||||
}
|
||||
|
||||
|
||||
if(self.animationListB.count > 0){
|
||||
// self.isAnimationListAFinish = YES;
|
||||
[self playAnimationWithModel];
|
||||
return;
|
||||
}
|
||||
if(self.animationListA.count > 0 && self.isPlayOfB == NO && self.isPlayOfA == NO){
|
||||
[self createGiftBannerViewAnimation:self.animationListA.firstObject];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
} ;
|
||||
[view pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"];
|
||||
}
|
||||
|
||||
- (NSArray<XPGiftBannerUserInfoModel *> *)makeBannerUsers {
|
||||
NSArray<MicroQueueModel *> * microArray = [self.delegate getMicroQueue].allValues;
|
||||
NSMutableArray * array = [NSMutableArray array];
|
||||
@@ -2378,16 +2298,7 @@
|
||||
}
|
||||
|
||||
|
||||
///移除横幅的veiw 添加到复用池中
|
||||
- (void)removeGiftBannerView:(XPRoomGiftBannerView *)view {
|
||||
[view removeFromSuperview];
|
||||
[view resetData];
|
||||
[self.bannerVisiablePool removeObject:view];
|
||||
[self.bannerDequePool addObject:view];
|
||||
///svga的处理
|
||||
[self.giftEffectView stopAnimation];
|
||||
self.giftEffectView.hidden = YES;
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
- (void)svgaPlayerDidFinishedAnimation:(SVGAPlayer *)player {
|
||||
if (player == self.giftEffectView) {
|
||||
|
@@ -1,21 +0,0 @@
|
||||
//
|
||||
// YMRoomGiftBannerView.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/11/18.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class GiftReceiveInfoModel, XPGiftBannerUserInfoModel;
|
||||
@interface XPRoomGiftBannerView : UIView
|
||||
///配上飘屏的数据
|
||||
- (void)configGiftBanner:(GiftReceiveInfoModel *)receiveInfo users:(NSArray<XPGiftBannerUserInfoModel *> *)users;
|
||||
- (void)configGiftBanner:(GiftReceiveInfoModel *)receiveInfo;
|
||||
///重置数据
|
||||
- (void)resetData;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,369 +0,0 @@
|
||||
//
|
||||
// YMRoomGiftBannerView.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/11/18.
|
||||
//
|
||||
|
||||
#import "XPRoomGiftBannerView.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
///Tool
|
||||
#import "ThemeColor+Room.h"
|
||||
///Model
|
||||
#import "GiftReceiveInfoModel.h"
|
||||
#import "GiftInfoModel.h"
|
||||
#import "XPGiftBannerUserInfoModel.h"
|
||||
///View
|
||||
#import "NetImageView.h"
|
||||
|
||||
@interface XPRoomAvatarNickView : UIView
|
||||
///
|
||||
@property (nonatomic,strong) NetImageView *avatImageView;
|
||||
///
|
||||
@property (nonatomic,strong) UILabel *nickLabel;
|
||||
@end
|
||||
|
||||
@implementation XPRoomAvatarNickView
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
if (self = [super initWithFrame:frame]) {
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)layoutSubviews {
|
||||
[super layoutSubviews];
|
||||
self.avatImageView.layer.cornerRadius = self.avatImageView.bounds.size.width / 2;
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.avatImageView];
|
||||
[self addSubview:self.nickLabel];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(self.nickLabel.mas_bottom);
|
||||
}];
|
||||
|
||||
[self.avatImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.mas_equalTo(self);
|
||||
make.height.mas_equalTo(self.avatImageView.mas_width);
|
||||
}];
|
||||
|
||||
[self.nickLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self);
|
||||
make.top.mas_equalTo(self.avatImageView.mas_bottom).offset(2);
|
||||
make.width.mas_lessThanOrEqualTo(80);
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (NetImageView *)avatImageView {
|
||||
if (!_avatImageView) {
|
||||
NetImageConfig * config = [[NetImageConfig alloc]init];
|
||||
config.imageType = ImageTypeUserIcon;
|
||||
_avatImageView = [[NetImageView alloc] initWithConfig:config];
|
||||
_avatImageView.userInteractionEnabled = YES;
|
||||
_avatImageView.layer.masksToBounds = YES;
|
||||
}
|
||||
return _avatImageView;
|
||||
}
|
||||
|
||||
- (UILabel *)nickLabel {
|
||||
if (!_nickLabel) {
|
||||
_nickLabel = [[UILabel alloc] init];
|
||||
_nickLabel.font = [UIFont systemFontOfSize:12];
|
||||
_nickLabel.textColor = [UIColor whiteColor];
|
||||
_nickLabel.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
return _nickLabel;
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
|
||||
@interface XPRoomGiftBannerView ()
|
||||
///背景图
|
||||
@property (nonatomic,strong) UIImageView *backImageView;
|
||||
///赠送
|
||||
@property (nonatomic,strong) XPRoomAvatarNickView *sendView;
|
||||
///接收者
|
||||
@property (nonatomic,strong) XPRoomAvatarNickView *receiveView;
|
||||
///礼物
|
||||
@property (nonatomic,strong) XPRoomAvatarNickView *giftView;
|
||||
///光圈
|
||||
@property (nonatomic,strong) UIImageView *lightImageView;
|
||||
///礼物的个数
|
||||
@property (nonatomic,strong) UILabel *giftCountLabel;
|
||||
///赠送
|
||||
@property (nonatomic,strong) UILabel *sendLabel;
|
||||
@end
|
||||
|
||||
|
||||
@implementation XPRoomGiftBannerView
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.backImageView];
|
||||
|
||||
[self.backImageView addSubview:self.sendView];
|
||||
[self.backImageView addSubview:self.sendLabel];
|
||||
[self.backImageView addSubview:self.receiveView];
|
||||
[self.backImageView addSubview:self.lightImageView];
|
||||
[self.backImageView addSubview:self.giftView];
|
||||
[self.backImageView addSubview:self.giftCountLabel];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.backImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self);
|
||||
}];
|
||||
|
||||
[self.sendView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.backImageView).offset(49);
|
||||
make.top.equalTo(self).offset(49);
|
||||
make.width.mas_equalTo(40);
|
||||
}];
|
||||
|
||||
[self.sendLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.sendView.mas_right).offset(24);
|
||||
make.centerY.equalTo(self.sendView);
|
||||
}];
|
||||
|
||||
[self.receiveView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.sendLabel.mas_right).offset(24);
|
||||
make.centerY.width.equalTo(self.sendView);
|
||||
}];
|
||||
|
||||
[self.lightImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.receiveView.mas_right).offset(4);
|
||||
make.centerY.equalTo(self.sendView);
|
||||
make.width.height.equalTo(@100);
|
||||
}];
|
||||
|
||||
[self.giftView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.equalTo(self.sendView);
|
||||
make.center.equalTo(self.lightImageView);
|
||||
}];
|
||||
|
||||
|
||||
[self.giftCountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.equalTo(self.giftView);
|
||||
make.right.equalTo(self.backImageView).offset(-36);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)startLightCircleAnimation {
|
||||
CABasicAnimation * animation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
|
||||
animation.toValue = [NSNumber numberWithFloat: M_PI * 2.0 ];
|
||||
animation.duration = 1;
|
||||
animation.cumulative = YES;
|
||||
animation.repeatCount = MAXFLOAT;
|
||||
[self.lightImageView.layer addAnimation:animation forKey:@"rotationAnimation"];
|
||||
}
|
||||
|
||||
#pragma mark - Public Method
|
||||
- (void)resetData {
|
||||
self.sendView.avatImageView.image = nil;
|
||||
self.sendView.nickLabel.text = nil;
|
||||
self.receiveView.avatImageView.image = nil;
|
||||
self.receiveView.nickLabel.text = nil;
|
||||
self.giftView.avatImageView.image = nil;
|
||||
self.giftView.nickLabel.text = nil;
|
||||
self.giftCountLabel.text = nil;
|
||||
[self.lightImageView stopAnimating];
|
||||
}
|
||||
- (void)configGiftBanner:(GiftReceiveInfoModel *)receiveInfo{
|
||||
if (receiveInfo) {
|
||||
[self startLightCircleAnimation];
|
||||
NSInteger giftTotal = receiveInfo.giftGolds;
|
||||
GiftInfoModel *giftInfo = receiveInfo.gift;
|
||||
self.sendView.avatImageView.imageUrl = receiveInfo.sendUserAvatar;
|
||||
self.sendView.nickLabel.text = receiveInfo.sendUserNick;
|
||||
self.receiveView.nickLabel.text = receiveInfo.recvUserNick;
|
||||
self.receiveView.avatImageView.imageUrl = receiveInfo.recvUserAvatar;
|
||||
self.giftView.avatImageView.imageUrl = giftInfo.giftUrl;
|
||||
self.giftView.nickLabel.text = giftInfo.giftName;
|
||||
|
||||
self.giftCountLabel.text = [NSString stringWithFormat:@" x %ld",receiveInfo.giftNum];
|
||||
|
||||
[self configAnimateImageByGiftTotal:giftTotal];
|
||||
}
|
||||
}
|
||||
- (void)configGiftBanner:(GiftReceiveInfoModel *)receiveInfo users:(NSArray<XPGiftBannerUserInfoModel *> *)users {
|
||||
if (receiveInfo) {
|
||||
[self startLightCircleAnimation];
|
||||
NSInteger giftTotal = 0;
|
||||
GiftInfoModel *giftInfo = receiveInfo.gift;
|
||||
self.sendView.avatImageView.imageUrl = receiveInfo.avatar ?: receiveInfo.sendUserAvatar;
|
||||
self.sendView.nickLabel.text = receiveInfo.nick;
|
||||
|
||||
self.giftView.avatImageView.imageUrl = giftInfo.giftUrl;
|
||||
self.giftView.nickLabel.text = giftInfo.giftName;
|
||||
|
||||
self.giftCountLabel.text = [NSString stringWithFormat:@" x %ld",receiveInfo.giftNum];
|
||||
/*1. 普通单人 targetUid
|
||||
2. 普通多人 targetUsers
|
||||
3. 普通全麦 targetUids
|
||||
4. 福袋 targetUid 不懂请参考此协议*/
|
||||
if (receiveInfo.targetUsers.count > 0) {
|
||||
if (receiveInfo.isBatch) { // 非全麦 多人送礼
|
||||
NSString *subTitle = @"";
|
||||
NSArray *targetUids = receiveInfo.targetUsers;
|
||||
for (GiftReceiveUserInfoModel *targetUid in targetUids) {
|
||||
NSInteger position = [self findPositionByUid:targetUid.uid users:users];
|
||||
if (position == 0) {
|
||||
continue; // 收礼人已经下麦了, 则不展示
|
||||
}
|
||||
position += 1;
|
||||
if (subTitle.length > 0) {
|
||||
subTitle = [subTitle stringByAppendingFormat:YMLocalizedString(@"XPRoomGiftBannerView0"), position];
|
||||
} else {
|
||||
subTitle = [subTitle stringByAppendingFormat:YMLocalizedString(@"XPRoomGiftBannerView1"), position];
|
||||
}
|
||||
}
|
||||
if (receiveInfo.targetUsers.count == 1) {
|
||||
self.receiveView.nickLabel.text = [receiveInfo.targetUsers firstObject].nick;
|
||||
self.receiveView.avatImageView.imageUrl = [receiveInfo.targetUsers firstObject].avatar;
|
||||
} else {
|
||||
self.receiveView.avatImageView.image = [UIImage imageNamed:@"common_avatar"];
|
||||
self.receiveView.nickLabel.text = subTitle;
|
||||
}
|
||||
|
||||
giftTotal = receiveInfo.giftNum * giftInfo.goldPrice * receiveInfo.targetUsers.count;
|
||||
} else { // 全麦
|
||||
self.receiveView.avatImageView.image = [UIImage imageNamed:@"common_avatar"];
|
||||
self.receiveView.nickLabel.text = YMLocalizedString(@"XPRoomGiftBannerView2");
|
||||
giftTotal = receiveInfo.giftNum * giftInfo.goldPrice * receiveInfo.targetUsers.count;
|
||||
}
|
||||
}else if (receiveInfo.targetUids.count > 0) {///根据协议 普通情况
|
||||
if (receiveInfo.isBatch) {
|
||||
NSString *subTitle = @"";
|
||||
NSArray *targetUids = receiveInfo.targetUids;
|
||||
for (NSString * targetUid in targetUids) {
|
||||
NSInteger position = [self findPositionByUid:targetUid.integerValue users:users];
|
||||
if (position == 0) {
|
||||
continue; // 收礼人已经下麦了, 则不展示
|
||||
}
|
||||
position+= 1;
|
||||
if (subTitle.length > 0) {
|
||||
subTitle = [subTitle stringByAppendingFormat:YMLocalizedString(@"XPRoomGiftBannerView3"), position];
|
||||
} else {
|
||||
subTitle = [subTitle stringByAppendingFormat:YMLocalizedString(@"XPRoomGiftBannerView4"), position];
|
||||
}
|
||||
}
|
||||
self.receiveView.avatImageView.image = [UIImage imageNamed:@"common_avatar"];
|
||||
self.receiveView.nickLabel.text = subTitle;
|
||||
giftTotal = receiveInfo.giftNum * giftInfo.goldPrice * receiveInfo.targetUids.count;
|
||||
} else { // 全麦
|
||||
self.receiveView.avatImageView.image = [UIImage imageNamed:@"common_avatar"];
|
||||
self.receiveView.nickLabel.text = YMLocalizedString(@"XPRoomGiftBannerView5");
|
||||
giftTotal = receiveInfo.giftNum * giftInfo.goldPrice * receiveInfo.targetUids.count;
|
||||
}
|
||||
}else {
|
||||
self.receiveView.avatImageView.imageUrl = receiveInfo.targetAvatar;
|
||||
self.receiveView.nickLabel.text = receiveInfo.targetNick;
|
||||
giftTotal = receiveInfo.giftNum * giftInfo.goldPrice;
|
||||
}
|
||||
[self configAnimateImageByGiftTotal:giftTotal];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)configAnimateImageByGiftTotal:(NSInteger)giftTotal {
|
||||
if (giftTotal >= 520 && giftTotal < 4999) {
|
||||
self.backImageView.image = [UIImage imageNamed:@"room_gift_banner_low_bg"];
|
||||
}else if (giftTotal >= 4999 && giftTotal < 9999) {
|
||||
self.backImageView.image = [UIImage imageNamed:@"room_gift_banner_middle_bg"];
|
||||
}else if (giftTotal >= 9999) {
|
||||
self.backImageView.image = [UIImage imageNamed:@"room_gift_banner_high_bg"];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
- (int)findPositionByUid:(NSInteger)uid users:(NSArray<XPGiftBannerUserInfoModel *> *)users{
|
||||
if (uid > 0) {
|
||||
for (XPGiftBannerUserInfoModel *userInfo in users) {
|
||||
if (userInfo.uid == uid) {
|
||||
return userInfo.position;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#pragma mark - Getters And Setters
|
||||
|
||||
|
||||
- (UIImageView *)backImageView {
|
||||
if (!_backImageView) {
|
||||
_backImageView = [[UIImageView alloc] init];
|
||||
_backImageView.userInteractionEnabled = YES;
|
||||
}
|
||||
return _backImageView;
|
||||
}
|
||||
|
||||
- (XPRoomAvatarNickView *)sendView {
|
||||
if (!_sendView) {
|
||||
_sendView = [[XPRoomAvatarNickView alloc] init];
|
||||
}
|
||||
return _sendView;
|
||||
}
|
||||
|
||||
- (XPRoomAvatarNickView *)receiveView {
|
||||
if (!_receiveView) {
|
||||
_receiveView = [[XPRoomAvatarNickView alloc] init];
|
||||
}
|
||||
return _receiveView;
|
||||
}
|
||||
|
||||
- (XPRoomAvatarNickView *)giftView {
|
||||
if (!_giftView) {
|
||||
_giftView = [[XPRoomAvatarNickView alloc] init];
|
||||
}
|
||||
return _giftView;
|
||||
}
|
||||
|
||||
- (UILabel *)sendLabel {
|
||||
if (!_sendLabel) {
|
||||
_sendLabel = [[UILabel alloc] init];
|
||||
_sendLabel.text = YMLocalizedString(@"XPRoomGiftBannerView6");
|
||||
_sendLabel.font = [UIFont systemFontOfSize:12];
|
||||
_sendLabel.textColor = [UIColor whiteColor];
|
||||
}
|
||||
return _sendLabel;
|
||||
}
|
||||
|
||||
- (UIImageView *)lightImageView {
|
||||
if (!_lightImageView) {
|
||||
_lightImageView = [[UIImageView alloc] init];
|
||||
_lightImageView.userInteractionEnabled = YES;
|
||||
_lightImageView.image = [UIImage imageNamed:@"room_gift_banner_light"];
|
||||
}
|
||||
return _lightImageView;
|
||||
}
|
||||
|
||||
- (UILabel *)giftCountLabel {
|
||||
if (!_giftCountLabel) {
|
||||
_giftCountLabel = [[UILabel alloc] init];
|
||||
_giftCountLabel.font = [UIFont systemFontOfSize:20.f weight:UIFontWeightBold];
|
||||
_giftCountLabel.textColor = [DJDKMIMOMColor animationGiftNumberColor];
|
||||
}
|
||||
return _giftCountLabel;
|
||||
}
|
||||
|
||||
|
||||
@end
|
@@ -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) {
|
||||
|
@@ -114,7 +114,6 @@
|
||||
XPMessageRemoteExtModel * model = [XPMessageRemoteExtModel modelWithJSON:message.remoteExt[message.from]];
|
||||
messageInfo.bubbleImageUrl = [self parseMessageBubble:message];
|
||||
int first = attachment.first;
|
||||
int second = attachment.second;
|
||||
if (first == CustomMessageType_Gift) {///单人送
|
||||
return [self createSendGiftAttribute:attachment sendInfo:model messageInfo:messageInfo];
|
||||
} else if(first == CustomMessageType_AllMicroSend) {///全麦送 多人送
|
||||
@@ -183,7 +182,10 @@
|
||||
return [self createGuardianPlanetAttribute:attachment messageInfo:messageInfo];
|
||||
}else if(first == CustomMessageType_General_Public_Screen){
|
||||
return [self createGeneralPublicScreenAttribute:attachment messageInfo:messageInfo];
|
||||
}else if(first == CustomMessageType_Super_Gift){
|
||||
return [self createGeneralPublicScreenAttribute:attachment messageInfo:messageInfo];
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
@@ -479,7 +481,9 @@
|
||||
if(subTextDic.allKeys.count > 0){
|
||||
NSString *subText = subTextDic[@"zh-CHT"] == nil ? subTextDic[subTextDic.allKeys.firstObject] : subTextDic[@"zh-CHT"];
|
||||
NSAttributedString *attText = [[NSAttributedString alloc]initWithString:subText attributes:@{NSForegroundColorAttributeName:[DJDKMIMOMColor colorWithHexString:model.textColor]}];
|
||||
[attribute replaceCharactersInRange:[attribute.string rangeOfString:[NSString stringWithFormat:@"{%@}",model.key]] withAttributedString:attText];
|
||||
if ([attribute.string containsString:[NSString stringWithFormat:@"{%@}",model.key]]){
|
||||
[attribute replaceCharactersInRange:[attribute.string rangeOfString:[NSString stringWithFormat:@"{%@}",model.key]] withAttributedString:attText];
|
||||
}
|
||||
|
||||
@kWeakify(self)
|
||||
[attribute yy_setTextHighlightRange:[attribute.string rangeOfString:subText] color:nil backgroundColor:nil tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
|
||||
@@ -494,7 +498,10 @@
|
||||
}else if ([model.type isEqualToString:@"IMAGE"]){
|
||||
NSMutableAttributedString *attImage = [self createUrlImageAttribute:model.image size:CGSizeMake(model.width, model.height)];
|
||||
[attImage appendAttributedString:[self createSapceAttribute:2]];
|
||||
[attribute replaceCharactersInRange:[attribute.string rangeOfString:[NSString stringWithFormat:@"{%@}",model.key]] withAttributedString:attImage];
|
||||
if ([attribute.string containsString:[NSString stringWithFormat:@"{%@}",model.key]]){
|
||||
[attribute replaceCharactersInRange:[attribute.string rangeOfString:[NSString stringWithFormat:@"{%@}",model.key]] withAttributedString:attImage];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
messageInfo.content = attribute;
|
||||
@@ -1042,6 +1049,8 @@
|
||||
if (giftInfo == nil) {
|
||||
giftInfo = [[XPGiftStorage shareStorage] findGiftInfo:info.giftId];
|
||||
}
|
||||
|
||||
|
||||
///官方新用户
|
||||
[attribute appendAttributedString:[self createOfficalAndNewuserAttribute:sendInfo.defUser newUser:sendInfo.newUser fromSayHelloChannel:sendInfo.fromSayHelloChannel]];
|
||||
//nick
|
||||
|
@@ -39,12 +39,18 @@
|
||||
}
|
||||
|
||||
- (NSMutableAttributedString*)updateNetImageAttribute:(NetImageView*)imageView attributes:(NSMutableAttributedString*)attributes range:(NSRange)range{
|
||||
UIImage* image = imageView.image;
|
||||
CGFloat scale = image.size.width / image.size.height;
|
||||
// 目前是根据原高度(imageView.bounds.size.height)等比例缩放图片。
|
||||
CGSize size = CGSizeMake(imageView.bounds.size.height * scale, imageView.bounds.size.height);
|
||||
imageView.bounds = CGRectMake(0, 0, size.width, size.height);
|
||||
|
||||
UIImage* image = imageView.image;
|
||||
CGSize size;
|
||||
if (image != nil){
|
||||
CGFloat scale = image.size.width / image.size.height;
|
||||
// 目前是根据原高度(imageView.bounds.size.height)等比例缩放图片。
|
||||
size = CGSizeMake(imageView.bounds.size.height * scale, imageView.bounds.size.height);
|
||||
imageView.bounds = CGRectMake(0, 0, size.width, size.height);
|
||||
}else{
|
||||
size = CGSizeMake(16, 16);
|
||||
imageView.bounds = CGRectMake(0, 0, 16, 16);
|
||||
}
|
||||
NSMutableAttributedString * replaceAttr = [NSMutableAttributedString yy_attachmentStringWithContent:imageView contentMode:UIViewContentModeScaleAspectFit attachmentSize:size alignToFont:[UIFont systemFontOfSize:15.0] alignment:YYTextVerticalAlignmentCenter];
|
||||
[attributes replaceCharactersInRange:range withAttributedString:replaceAttr];
|
||||
return attributes;
|
||||
|
@@ -33,6 +33,8 @@
|
||||
#import "RoomSailingPrizeModel.h"
|
||||
#import "UserInfoModel.h"
|
||||
#import "XPMessageInfoModel.h"
|
||||
#import "GiftReceiveInfoModel.h"
|
||||
#import "XPGiftStorage.h"
|
||||
///View
|
||||
#import "XPRoomMessageTableViewCell.h"
|
||||
#import "XPRoomMessageHeaderView.h"
|
||||
@@ -392,7 +394,26 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey";
|
||||
}
|
||||
|
||||
}
|
||||
GiftReceiveInfoModel *info = [GiftReceiveInfoModel modelWithJSON:attachment.data];
|
||||
GiftInfoModel *giftInfo = info.gift == nil ? info.giftInfo : info.gift;
|
||||
if (giftInfo == nil) {
|
||||
giftInfo = [[XPGiftStorage shareStorage] findGiftInfo:info.giftId];
|
||||
}
|
||||
if (giftInfo.giftType == GiftType_super){
|
||||
return NO;
|
||||
}
|
||||
}else if(attachment.first == CustomMessageType_AllMicroSend){
|
||||
GiftReceiveInfoModel *info = [GiftReceiveInfoModel modelWithJSON:attachment.data];
|
||||
GiftInfoModel *giftInfo = info.gift == nil ? info.giftInfo : info.gift;
|
||||
if (giftInfo == nil) {
|
||||
giftInfo = [[XPGiftStorage shareStorage] findGiftInfo:info.giftId];
|
||||
}
|
||||
if (giftInfo.giftType == GiftType_super){
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return [[[self supportMessageDic] objectForKey:@(attachment.first)] containsObject:@(attachment.second)];
|
||||
}
|
||||
return NO;
|
||||
@@ -538,6 +559,10 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey";
|
||||
@(Custom_Message_Sub_General_Public_Screen_One_Room),
|
||||
@(Custom_Message_Sub_General_Public_Screen_All_Room),
|
||||
nil],
|
||||
@(CustomMessageType_Super_Gift):
|
||||
[NSSet setWithObjects:
|
||||
@(Custom_Message_Sub_Super_Gift),
|
||||
nil],
|
||||
};
|
||||
}
|
||||
|
||||
|
@@ -219,9 +219,15 @@
|
||||
}
|
||||
}
|
||||
if (self.roomPKInfo.voteMode == RoomPKVoteModeType_NumberPerson) { // 按送礼人数计算
|
||||
[self canculeRoomPKSendGiftNumPerson:targetUids sendUid:giftReceiveInfo.uid];
|
||||
if (giftInfo.giftType != GiftType_super){
|
||||
[self canculeRoomPKSendGiftNumPerson:targetUids sendUid:giftReceiveInfo.uid];
|
||||
}
|
||||
|
||||
} else {
|
||||
[self canculeRoomGiftValueReceiveInfo:targetUids giftPrice:giftInfo.goldPrice * giftReceiveInfo.giftNum];
|
||||
if (giftInfo.giftType != GiftType_super){
|
||||
[self canculeRoomGiftValueReceiveInfo:targetUids giftPrice:giftInfo.goldPrice * giftReceiveInfo.giftNum];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -23,8 +23,8 @@
|
||||
/// @param complection 完成
|
||||
/// @param roomUid 房间的roomuid
|
||||
+ (void)requestNormalGiftList:(HttpRequestHelperCompletion)complection roomUid:(NSString *)roomUid {
|
||||
NSString * fang = [NSString stringFromBase64String:@"Z2lmdC9saXN0VjQ="];///gift/listV4
|
||||
[self makeRequest:fang method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__, roomUid, nil];
|
||||
|
||||
[self makeRequest:@"gift/listV5" method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__, roomUid, nil];
|
||||
}
|
||||
/// 请求缓存列表
|
||||
/// @param complection 完成
|
||||
|
@@ -21,6 +21,7 @@ typedef NS_ENUM(NSUInteger, GiftType) {
|
||||
GiftType_Anchor = 11, //个播礼物
|
||||
GiftType_Punish = 12, //惩罚礼物
|
||||
GiftType_Twelve_Star = 13, //星座礼物
|
||||
GiftType_super = 16, //超级礼物
|
||||
};
|
||||
|
||||
//礼物类型
|
||||
@@ -119,6 +120,9 @@ typedef NS_ENUM(NSUInteger, RoomSendGiftType) {
|
||||
///上周对应礼物豪气榜第一
|
||||
@property (nonatomic, strong) XPWeekStarRankUserModel *firstLevelRankUser;
|
||||
@property (nonatomic,assign) BOOL isEmpty;
|
||||
//超级幸运礼物新增字段
|
||||
@property(nonatomic,copy) NSString *bannerUrl;
|
||||
@property(nonatomic,copy) NSString *skipUrl;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -58,7 +58,7 @@
|
||||
[[self getView] getNormalGiftListSuccess:arrary];
|
||||
}
|
||||
[Api requestNormalGiftList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
NSArray *luckyBagGift = [GiftInfoModel modelsWithArray:data.data[@"luckyBagGift"]]; // 福袋礼物
|
||||
NSArray *luckyBagGift = [GiftInfoModel modelsWithArray:data.data[@"luckyGift"]]; // 福袋礼物
|
||||
NSArray *vipGift = [GiftInfoModel modelsWithArray:data.data[@"vipGift"]]; // 贵族礼物
|
||||
NSArray *luckyPoolGift = [GiftInfoModel modelsWithArray:data.data[@"luckyPoolGift"]];// 福袋奖池礼物
|
||||
NSArray *normalGift = [GiftInfoModel modelsWithArray:data.data[@"normalGift"]]; // 普通面板礼物
|
||||
|
@@ -43,7 +43,8 @@
|
||||
@property (nonatomic, strong) NetImageView *nobleIconImageView;
|
||||
///贵族礼物锁
|
||||
@property (nonatomic, strong) UIImageView *lockImageView;
|
||||
|
||||
///超级礼物icon
|
||||
@property(nonatomic,strong) UIImageView *superGiftView;
|
||||
@end
|
||||
|
||||
@implementation XPGiftItemCollectionViewCell
|
||||
@@ -67,6 +68,7 @@
|
||||
[self.contentView addSubview:self.giftNumLabel];
|
||||
[self.contentView addSubview:self.lockImageView];
|
||||
[self.contentView addSubview:self.tagStackView];
|
||||
[self.contentView addSubview:self.superGiftView];
|
||||
|
||||
[self.tagStackView addArrangedSubview:self.nobleIconImageView];
|
||||
[self.tagStackView addArrangedSubview:self.exclusiveImageView];
|
||||
@@ -135,6 +137,12 @@
|
||||
make.right.bottom.mas_equalTo(self.contentView).mas_offset(-4);
|
||||
make.width.height.mas_equalTo(16);
|
||||
}];
|
||||
[self.superGiftView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(46);
|
||||
make.height.mas_equalTo(12);
|
||||
make.left.mas_equalTo(10);
|
||||
make.bottom.equalTo(self.giftImageView.mas_bottom);
|
||||
}];
|
||||
}
|
||||
|
||||
- (UIImageView *)createImageView:(NSString *)imageName {
|
||||
@@ -182,6 +190,10 @@
|
||||
self.nobleIconImageView.hidden = YES;
|
||||
self.lockImageView.hidden = YES;
|
||||
}
|
||||
_superGiftView.hidden = YES;
|
||||
if (giftInfo.giftType == GiftType_super){
|
||||
_superGiftView.hidden = NO;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -314,5 +326,12 @@
|
||||
}
|
||||
return _lockImageView;
|
||||
}
|
||||
|
||||
- (UIImageView *)superGiftView{
|
||||
if(!_superGiftView){
|
||||
_superGiftView = [UIImageView new];
|
||||
_superGiftView.image = kImage(@"room_gift_super_gift_icon");
|
||||
_superGiftView.hidden = YES;
|
||||
}
|
||||
return _superGiftView;
|
||||
}
|
||||
@end
|
||||
|
@@ -227,7 +227,7 @@
|
||||
NSMutableArray * nobleArray = [NSMutableArray array];
|
||||
NSMutableArray * anchorArray = [NSMutableArray array];
|
||||
[_normalOriginArray enumerateObjectsUsingBlock:^(GiftInfoModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
if (obj.giftType == GiftType_Lucky) {
|
||||
if (obj.giftType == GiftType_Lucky || obj.giftType == GiftType_super) {
|
||||
[luckyArray addObject:obj];
|
||||
} else if(obj.giftType == GiftType_Game) {
|
||||
[normaleArray addObject:obj];
|
||||
|
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// PIGiftSuperGiftBroadcastView.h
|
||||
// YuMi
|
||||
//
|
||||
// Created by duoban on 2024/3/21.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "GiftInfoModel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@protocol PIGiftSuperGiftBroadcastViewDelegate <NSObject>
|
||||
|
||||
///点击了玩法说明
|
||||
- (void)pIGiftSuperGiftBroadcastViewClickWithModel:(GiftInfoModel *)giftModel;
|
||||
|
||||
@end
|
||||
@interface PIGiftSuperGiftBroadcastView : UIView
|
||||
@property(nonatomic,strong) GiftInfoModel *giftModel;
|
||||
@property(nonatomic,weak) id<PIGiftSuperGiftBroadcastViewDelegate>delegate;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,60 @@
|
||||
//
|
||||
// PIGiftSuperGiftBroadcastView.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by duoban on 2024/3/21.
|
||||
//
|
||||
|
||||
#import "PIGiftSuperGiftBroadcastView.h"
|
||||
@interface PIGiftSuperGiftBroadcastView()
|
||||
@property(nonatomic,strong) NetImageView *bgImageView;
|
||||
@property(nonatomic,strong) UIButton *clickBtn;
|
||||
@end
|
||||
@implementation PIGiftSuperGiftBroadcastView
|
||||
|
||||
-(instancetype)initWithFrame:(CGRect)frame{
|
||||
self = [super initWithFrame:frame];
|
||||
if(self){
|
||||
[self installUI];
|
||||
[self installConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
-(void)installUI{
|
||||
[self addSubview:self.bgImageView];
|
||||
[self addSubview:self.clickBtn];
|
||||
}
|
||||
-(void)installConstraints{
|
||||
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self);
|
||||
}];
|
||||
[self.clickBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self);
|
||||
}];
|
||||
}
|
||||
-(void)setGiftModel:(GiftInfoModel *)giftModel{
|
||||
_giftModel = giftModel;
|
||||
_bgImageView.imageUrl = _giftModel.bannerUrl;
|
||||
}
|
||||
-(void)clickBtnAction{
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(pIGiftSuperGiftBroadcastViewClickWithModel:)]){
|
||||
[self.delegate pIGiftSuperGiftBroadcastViewClickWithModel:self.giftModel];
|
||||
}
|
||||
}
|
||||
#pragma mark - 懒加载
|
||||
- (NetImageView *)bgImageView{
|
||||
if(!_bgImageView){
|
||||
_bgImageView = [NetImageView new];
|
||||
_bgImageView.userInteractionEnabled = YES;
|
||||
}
|
||||
return _bgImageView;
|
||||
}
|
||||
- (UIButton *)clickBtn{
|
||||
if(!_clickBtn){
|
||||
_clickBtn = [UIButton new];
|
||||
[_clickBtn addTarget:self action:@selector(clickBtnAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _clickBtn;
|
||||
}
|
||||
|
||||
@end
|
@@ -46,10 +46,11 @@
|
||||
#import "XPMineRechargeViewController.h"
|
||||
#import "XPIAPRechargeViewController.h"
|
||||
#import "XPWebViewController.h"
|
||||
#import "PIGiftSuperGiftBroadcastView.h"
|
||||
UIKIT_EXTERN NSString * const kFreeGiftCountdownNotification;
|
||||
UIKIT_EXTERN NSString * kShowFirstRechargeView;
|
||||
|
||||
@interface XPSendGiftView ()< XPGiftBarViewDelegate, XPGiftProtocol, XPGraffitiGiftViewDelegate, XPGiftUsersViewDelegate, XPGiftHeadTypeViewDelegate, XPGiftLuckyGiftBroadcastViewDelegate, XPGiftTwelveStarBroadcastViewDelegate,PIGiftInfoSegmentedViewDelegate>
|
||||
@interface XPSendGiftView ()< XPGiftBarViewDelegate, XPGiftProtocol, XPGraffitiGiftViewDelegate, XPGiftUsersViewDelegate, XPGiftHeadTypeViewDelegate, XPGiftLuckyGiftBroadcastViewDelegate, XPGiftTwelveStarBroadcastViewDelegate,PIGiftInfoSegmentedViewDelegate,PIGiftSuperGiftBroadcastViewDelegate>
|
||||
///顶部的区域
|
||||
@property (nonatomic,strong) UIView * topView;
|
||||
///内容区域
|
||||
@@ -62,6 +63,9 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
|
||||
@property (nonatomic, strong) XPGiftLuckyGiftBroadcastView *luckyBroadcastView;
|
||||
///星座礼物广播
|
||||
@property (nonatomic, strong) XPGiftTwelveStarBroadcastView *constellationBanner;
|
||||
|
||||
///超级礼物
|
||||
@property(nonatomic,strong) PIGiftSuperGiftBroadcastView *superGiftView;
|
||||
///礼物类型(普通/互动)
|
||||
@property (nonatomic, strong) XPGiftHeadTypeView *headTypeView;
|
||||
///送礼物的人
|
||||
@@ -475,7 +479,12 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
|
||||
webView.url = giftExplainUrl;
|
||||
[TTPopup popupView:webView style:TTPopupStyleActionSheet];
|
||||
}
|
||||
|
||||
#pragma mark - PIGiftSuperGiftBroadcastViewDelegate
|
||||
- (void)pIGiftSuperGiftBroadcastViewClickWithModel:(GiftInfoModel *)giftModel{
|
||||
XPRoomHalfWebView * webView = [[XPRoomHalfWebView alloc] init];
|
||||
webView.url = giftModel.skipUrl;
|
||||
[TTPopup popupView:webView style:TTPopupStyleActionSheet];
|
||||
}
|
||||
#pragma mark - XPGiftWeekStarBroadcastViewDelegate
|
||||
///点击了周星榜入口
|
||||
- (void)xPGiftWeekStarBroadcastViewWeekStarClick {
|
||||
@@ -506,6 +515,7 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
|
||||
///点击了礼物
|
||||
- (void)xPGiftHeadTypeViewDidClickGift:(XPGiftHeadTypeView *)view {
|
||||
[self.luckyBroadcastView removeFromSuperview];
|
||||
[self.superGiftView removeFromSuperview];
|
||||
// [self.giftInfoView giftHeadTypeHadChange:1];
|
||||
if (!self.graffitiView.hidden) {//清空涂鸦礼物
|
||||
[self.graffitiView clearData];
|
||||
@@ -519,6 +529,7 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
|
||||
///点击了互动
|
||||
- (void)xPGiftHeadTypeViewDidClickInteraction:(XPGiftHeadTypeView *)view {
|
||||
[self.luckyBroadcastView removeFromSuperview];
|
||||
[self.superGiftView removeFromSuperview];
|
||||
// [self.giftInfoView giftHeadTypeHadChange:2];
|
||||
}
|
||||
|
||||
@@ -530,16 +541,31 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
|
||||
self.giftBarView.drawGiftCount = 10;
|
||||
if (type == GiftSegmentType_Lucky) {
|
||||
[self.constellationBanner removeFromSuperview];
|
||||
if (!self.luckyBroadcastView.superview) {
|
||||
[self.view addSubview:self.luckyBroadcastView];
|
||||
[self.luckyBroadcastView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(self.contentView.mas_top);
|
||||
make.left.right.mas_equalTo(0);
|
||||
make.height.mas_equalTo(kGetScaleWidth(56));
|
||||
}];
|
||||
if (view.lastSelectGift.giftType == GiftType_super){
|
||||
[self.luckyBroadcastView removeFromSuperview];
|
||||
if (!self.superGiftView.superview) {
|
||||
[self.view addSubview:self.superGiftView];
|
||||
[self.superGiftView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(self.contentView.mas_top);
|
||||
make.left.right.mas_equalTo(0);
|
||||
make.height.mas_equalTo(kGetScaleWidth(90));
|
||||
}];
|
||||
}
|
||||
}else{
|
||||
[self.superGiftView removeFromSuperview];
|
||||
if (!self.luckyBroadcastView.superview) {
|
||||
[self.view addSubview:self.luckyBroadcastView];
|
||||
[self.luckyBroadcastView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(self.contentView.mas_top);
|
||||
make.left.right.mas_equalTo(0);
|
||||
make.height.mas_equalTo(kGetScaleWidth(56));
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
} else if(type == GiftSegmentType_WeekStar) {
|
||||
[self.luckyBroadcastView removeFromSuperview];
|
||||
[self.superGiftView removeFromSuperview];
|
||||
if (!self.constellationBanner.superview) {
|
||||
[self.view addSubview:self.constellationBanner];
|
||||
[self.constellationBanner mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
@@ -549,6 +575,7 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
|
||||
}];
|
||||
}
|
||||
} else {
|
||||
[self.superGiftView removeFromSuperview];
|
||||
[self.luckyBroadcastView removeFromSuperview];
|
||||
[self.constellationBanner removeFromSuperview];
|
||||
}
|
||||
@@ -556,7 +583,32 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
|
||||
|
||||
///点击了某个item
|
||||
- (void)pIGiftInfoSegmentedView:(PIGiftInfoSegmentedView *)view didClickItem:(GiftInfoModel *)info type:(GiftSegmentType)type{
|
||||
if (type == GiftSegmentType_Graffiti) {
|
||||
if (type == GiftSegmentType_Lucky){
|
||||
[self.constellationBanner removeFromSuperview];
|
||||
if (info.giftType == GiftType_super){
|
||||
[self.luckyBroadcastView removeFromSuperview];
|
||||
if (!self.superGiftView.superview) {
|
||||
self.superGiftView.giftModel = info;
|
||||
[self.view addSubview:self.superGiftView];
|
||||
[self.superGiftView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(self.contentView.mas_top);
|
||||
make.left.right.mas_equalTo(0);
|
||||
make.height.mas_equalTo(kGetScaleWidth(90));
|
||||
}];
|
||||
}
|
||||
}else{
|
||||
[self.superGiftView removeFromSuperview];
|
||||
if (!self.luckyBroadcastView.superview) {
|
||||
[self.view addSubview:self.luckyBroadcastView];
|
||||
[self.luckyBroadcastView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(self.contentView.mas_top);
|
||||
make.left.right.mas_equalTo(0);
|
||||
make.height.mas_equalTo(kGetScaleWidth(56));
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
}else if (type == GiftSegmentType_Graffiti) {
|
||||
self.giftInfoView.hidden = YES;
|
||||
self.graffitiView.hidden = NO;
|
||||
self.graffitiView.price = info.goldPrice;
|
||||
@@ -876,5 +928,11 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
|
||||
}
|
||||
return _effectView;
|
||||
}
|
||||
|
||||
- (PIGiftSuperGiftBroadcastView *)superGiftView{
|
||||
if(!_superGiftView){
|
||||
_superGiftView = [[PIGiftSuperGiftBroadcastView alloc]initWithFrame:CGRectZero];
|
||||
_superGiftView.delegate = self;
|
||||
}
|
||||
return _superGiftView;
|
||||
}
|
||||
@end
|
||||
|
@@ -1678,6 +1678,8 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
isHave = YES;
|
||||
}else if(attachment.first == CustomMessageType_Guardian_Planet && attachment.second == Custom_Message_Sub_Guardian_Planet_All_Room){
|
||||
isHave = YES;
|
||||
}else if(attachment.first == CustomMessageType_Super_Gift && attachment.second == Custom_Message_Sub_Super_Gift){
|
||||
isHave = YES;
|
||||
}else if(attachment.first == CustomMessageType_General_Public_Screen && attachment.second == Custom_Message_Sub_General_Public_Screen_All_Room){
|
||||
isHave = YES;
|
||||
}else if (attachment.first == CustomMessageType_Treasure_Fairy && (attachment.second == Custom_Message_Sub_Treasure_Fairy_Draw_Gift_L4 || attachment.second == Custom_Message_Sub_Treasure_Fairy_Draw_Gift_L5 || attachment.second == Custom_Message_Sub_Treasure_Fairy_Convert_L1 || attachment.second == Custom_Message_Sub_Treasure_Fairy_Convert_L2 || attachment.second == Custom_Message_Sub_Treasure_Fairy_Convert_L3)) { //夺宝精灵
|
||||
|
@@ -40,7 +40,7 @@
|
||||
#import "RoomHalfHourRankModel.h"
|
||||
#import "ClientConfig.h"
|
||||
///View
|
||||
#import "XPRoomGiftBannerView.h"
|
||||
|
||||
#import "XPRoomGiftBroadcastView.h"
|
||||
#import "XPRoomCandyGiftView.h"
|
||||
#import "XPRoomDatingAnimationView.h"
|
||||
@@ -252,11 +252,17 @@
|
||||
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) ];
|
||||
bannerView = [[PIUniversalBannerView alloc]initWithFrame:CGRectMake(KScreenWidth, top, kGetScaleWidth(model.resourceWidth), kGetScaleWidth(model.resourceHeight)) ];
|
||||
[self showGeneralFloatingScreenView:bannerView model:model];
|
||||
} failureBlock:^(NSError * _Nonnull error) {
|
||||
|
||||
[bannerView removeFromSuperview];
|
||||
self.isPlayOfB = NO;
|
||||
if(self.animationListB.count > 0){
|
||||
[self.animationListB removeObjectAtIndex:0];
|
||||
}
|
||||
[self playAnimationWithModel];
|
||||
}];
|
||||
|
||||
}else{
|
||||
NetImageView *imageView = [NetImageView new];
|
||||
[imageView loadImageWithUrl:model.resourceContent completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) {
|
||||
@@ -266,7 +272,14 @@
|
||||
CGFloat getHeigth = KScreenWidth * height / width;
|
||||
bannerView = [[PIUniversalBannerView alloc]initWithFrame:CGRectMake(KScreenWidth, top, KScreenWidth, getHeigth) ];
|
||||
[self showGeneralFloatingScreenView:bannerView model:model];
|
||||
} fail:^(NSError * _Nonnull error) {
|
||||
self.isPlayOfB = NO;
|
||||
if(self.animationListB.count > 0){
|
||||
[self.animationListB removeObjectAtIndex:0];
|
||||
}
|
||||
[self playAnimationWithModel];
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1612,13 +1612,7 @@
|
||||
|
||||
"XPRoomAnimationView0" = "【%@】进入了房间";
|
||||
|
||||
"XPRoomGiftBannerView0" = ",%ld麦";
|
||||
"XPRoomGiftBannerView1" = "%ld麦";
|
||||
"XPRoomGiftBannerView2" = "全麦";
|
||||
"XPRoomGiftBannerView3" = ",%ld麦";
|
||||
"XPRoomGiftBannerView4" = "%ld麦";
|
||||
"XPRoomGiftBannerView5" = "全麦";
|
||||
"XPRoomGiftBannerView6" = "赠送";
|
||||
|
||||
|
||||
"XPRoomYearActivityView0" = "送给";
|
||||
|
||||
|
@@ -1612,13 +1612,7 @@
|
||||
|
||||
"XPRoomAnimationView0" = "【%@】進入了房間";
|
||||
|
||||
"XPRoomGiftBannerView0" = ",%ld麥";
|
||||
"XPRoomGiftBannerView1" = "%ld麥";
|
||||
"XPRoomGiftBannerView2" = "全麥";
|
||||
"XPRoomGiftBannerView3" = ",%ld麥";
|
||||
"XPRoomGiftBannerView4" = "%ld麥";
|
||||
"XPRoomGiftBannerView5" = "全麥";
|
||||
"XPRoomGiftBannerView6" = "贈送";
|
||||
|
||||
|
||||
"XPRoomYearActivityView0" = "送給";
|
||||
|
||||
|