开通贵族公屏消息,贵族升级飘屏
This commit is contained in:
@@ -137,6 +137,8 @@
|
|||||||
9B2A12E427846D7100CED41B /* NobleRechargeModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B2A12E327846D7100CED41B /* NobleRechargeModel.m */; };
|
9B2A12E427846D7100CED41B /* NobleRechargeModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B2A12E327846D7100CED41B /* NobleRechargeModel.m */; };
|
||||||
9B6B3AA5278BDA20005551EC /* MicroFaceView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B6B3AA4278BDA20005551EC /* MicroFaceView.m */; };
|
9B6B3AA5278BDA20005551EC /* MicroFaceView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B6B3AA4278BDA20005551EC /* MicroFaceView.m */; };
|
||||||
9B6B3AA8278BE821005551EC /* FaceImageTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B6B3AA6278BE821005551EC /* FaceImageTool.m */; };
|
9B6B3AA8278BE821005551EC /* FaceImageTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B6B3AA6278BE821005551EC /* FaceImageTool.m */; };
|
||||||
|
9B6B3AAB278C2EA7005551EC /* XPRoomNobleLevelUpView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B6B3AAA278C2EA7005551EC /* XPRoomNobleLevelUpView.m */; };
|
||||||
|
9B6B3AAD278C425D005551EC /* noble_levelUp_banner.svga in Resources */ = {isa = PBXBuildFile; fileRef = 9B6B3AAC278C425D005551EC /* noble_levelUp_banner.svga */; };
|
||||||
9B7D804A2753783D003DAC0C /* SessionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B7D80492753783D003DAC0C /* SessionViewController.m */; };
|
9B7D804A2753783D003DAC0C /* SessionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B7D80492753783D003DAC0C /* SessionViewController.m */; };
|
||||||
9B7D804D27537950003DAC0C /* MessageCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B7D804C27537950003DAC0C /* MessageCell.m */; };
|
9B7D804D27537950003DAC0C /* MessageCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B7D804C27537950003DAC0C /* MessageCell.m */; };
|
||||||
9B7D80502753AA9D003DAC0C /* UITableView+NIMScrollToBottom.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B7D804E2753AA9D003DAC0C /* UITableView+NIMScrollToBottom.m */; };
|
9B7D80502753AA9D003DAC0C /* UITableView+NIMScrollToBottom.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B7D804E2753AA9D003DAC0C /* UITableView+NIMScrollToBottom.m */; };
|
||||||
@@ -775,6 +777,9 @@
|
|||||||
9B6B3AA4278BDA20005551EC /* MicroFaceView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MicroFaceView.m; sourceTree = "<group>"; };
|
9B6B3AA4278BDA20005551EC /* MicroFaceView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MicroFaceView.m; sourceTree = "<group>"; };
|
||||||
9B6B3AA6278BE821005551EC /* FaceImageTool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FaceImageTool.m; sourceTree = "<group>"; };
|
9B6B3AA6278BE821005551EC /* FaceImageTool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FaceImageTool.m; sourceTree = "<group>"; };
|
||||||
9B6B3AA7278BE821005551EC /* FaceImageTool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FaceImageTool.h; sourceTree = "<group>"; };
|
9B6B3AA7278BE821005551EC /* FaceImageTool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FaceImageTool.h; sourceTree = "<group>"; };
|
||||||
|
9B6B3AA9278C2EA7005551EC /* XPRoomNobleLevelUpView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomNobleLevelUpView.h; sourceTree = "<group>"; };
|
||||||
|
9B6B3AAA278C2EA7005551EC /* XPRoomNobleLevelUpView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomNobleLevelUpView.m; sourceTree = "<group>"; };
|
||||||
|
9B6B3AAC278C425D005551EC /* noble_levelUp_banner.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = noble_levelUp_banner.svga; sourceTree = "<group>"; };
|
||||||
9B7D80482753783D003DAC0C /* SessionViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SessionViewController.h; sourceTree = "<group>"; };
|
9B7D80482753783D003DAC0C /* SessionViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SessionViewController.h; sourceTree = "<group>"; };
|
||||||
9B7D80492753783D003DAC0C /* SessionViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SessionViewController.m; sourceTree = "<group>"; };
|
9B7D80492753783D003DAC0C /* SessionViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SessionViewController.m; sourceTree = "<group>"; };
|
||||||
9B7D804B27537950003DAC0C /* MessageCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MessageCell.h; sourceTree = "<group>"; };
|
9B7D804B27537950003DAC0C /* MessageCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MessageCell.h; sourceTree = "<group>"; };
|
||||||
@@ -2892,6 +2897,8 @@
|
|||||||
E8A03DFE27635F960098D9EA /* XPRoomCandyGiftView.m */,
|
E8A03DFE27635F960098D9EA /* XPRoomCandyGiftView.m */,
|
||||||
E8899C832785CC69007944BE /* XPRoomDatingAnimationView.h */,
|
E8899C832785CC69007944BE /* XPRoomDatingAnimationView.h */,
|
||||||
E8899C842785CC69007944BE /* XPRoomDatingAnimationView.m */,
|
E8899C842785CC69007944BE /* XPRoomDatingAnimationView.m */,
|
||||||
|
9B6B3AA9278C2EA7005551EC /* XPRoomNobleLevelUpView.h */,
|
||||||
|
9B6B3AAA278C2EA7005551EC /* XPRoomNobleLevelUpView.m */,
|
||||||
E838D99E275E1BF60079E0B5 /* XPRoomAnimationView.h */,
|
E838D99E275E1BF60079E0B5 /* XPRoomAnimationView.h */,
|
||||||
E838D99F275E1BF60079E0B5 /* XPRoomAnimationView.m */,
|
E838D99F275E1BF60079E0B5 /* XPRoomAnimationView.m */,
|
||||||
);
|
);
|
||||||
@@ -3610,6 +3617,7 @@
|
|||||||
E8DEC98A27637EA50078CB70 /* candyTree_transform.svga */,
|
E8DEC98A27637EA50078CB70 /* candyTree_transform.svga */,
|
||||||
E8A1E45D276220DA00B294CA /* candyTree_banner.svga */,
|
E8A1E45D276220DA00B294CA /* candyTree_banner.svga */,
|
||||||
E8A1E45F276220DA00B294CA /* candyTree_light.svga */,
|
E8A1E45F276220DA00B294CA /* candyTree_light.svga */,
|
||||||
|
9B6B3AAC278C425D005551EC /* noble_levelUp_banner.svga */,
|
||||||
E8A1E45E276220DA00B294CA /* candyTree.svga */,
|
E8A1E45E276220DA00B294CA /* candyTree.svga */,
|
||||||
9BE29A6927D1BFF700446AB5 /* anchor_room_speak.svga */,
|
9BE29A6927D1BFF700446AB5 /* anchor_room_speak.svga */,
|
||||||
9BE29A6C27D210A500446AB5 /* anchor_room_bg.svga */,
|
9BE29A6C27D210A500446AB5 /* anchor_room_bg.svga */,
|
||||||
@@ -4319,6 +4327,7 @@
|
|||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
E8937AC7276C3EDE00B2C7E1 /* svga_member_in_lv40.svga in Resources */,
|
E8937AC7276C3EDE00B2C7E1 /* svga_member_in_lv40.svga in Resources */,
|
||||||
|
9B6B3AAD278C425D005551EC /* noble_levelUp_banner.svga in Resources */,
|
||||||
E8A1E461276220DA00B294CA /* candyTree.svga in Resources */,
|
E8A1E461276220DA00B294CA /* candyTree.svga in Resources */,
|
||||||
E8937AC9276C3EDE00B2C7E1 /* svga_member_in_lv90.svga in Resources */,
|
E8937AC9276C3EDE00B2C7E1 /* svga_member_in_lv90.svga in Resources */,
|
||||||
E8937ACC276C3EDE00B2C7E1 /* svga_member_in_lv80.svga in Resources */,
|
E8937ACC276C3EDE00B2C7E1 /* svga_member_in_lv80.svga in Resources */,
|
||||||
@@ -4631,6 +4640,7 @@
|
|||||||
E8B825C226EA00DF009E8E9F /* LoginVerifCodePresent.m in Sources */,
|
E8B825C226EA00DF009E8E9F /* LoginVerifCodePresent.m in Sources */,
|
||||||
E88B5CB026FB1C6500DA9178 /* XPMineTeenagerPresenter.m in Sources */,
|
E88B5CB026FB1C6500DA9178 /* XPMineTeenagerPresenter.m in Sources */,
|
||||||
E899C68927508F4E00E189E5 /* XPUserCardInfoModel.m in Sources */,
|
E899C68927508F4E00E189E5 /* XPUserCardInfoModel.m in Sources */,
|
||||||
|
9B6B3AAB278C2EA7005551EC /* XPRoomNobleLevelUpView.m in Sources */,
|
||||||
E8A03DE9276301CC0098D9EA /* XPCandyRankContainerView.m in Sources */,
|
E8A03DE9276301CC0098D9EA /* XPCandyRankContainerView.m in Sources */,
|
||||||
186A534B26FC6ED900D67B2C /* TTPopupManagerService.m in Sources */,
|
186A534B26FC6ED900D67B2C /* TTPopupManagerService.m in Sources */,
|
||||||
18E7B1B226E8AF980064BC9B /* MainPresenter.m in Sources */,
|
18E7B1B226E8AF980064BC9B /* MainPresenter.m in Sources */,
|
||||||
|
@@ -82,6 +82,12 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
@property (nonatomic,assign) int selectMicPosition;
|
@property (nonatomic,assign) int selectMicPosition;
|
||||||
///贵族信息
|
///贵族信息
|
||||||
@property (nonatomic, strong) UserVipInfoVo *userVipInfoVO;
|
@property (nonatomic, strong) UserVipInfoVo *userVipInfoVO;
|
||||||
|
///当前使用的资料卡装扮
|
||||||
|
@property (nonatomic, copy) NSString *userInfoCardPic;
|
||||||
|
///麦位光圈链接
|
||||||
|
@property (nonatomic, copy) NSString *micCircle;
|
||||||
|
///麦位昵称颜色
|
||||||
|
@property (nonatomic, copy) NSString *micNickColor;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@@ -216,13 +216,13 @@ typedef NS_ENUM(NSUInteger, CustomMessageSubFirstRecharge) {
|
|||||||
|
|
||||||
///first = CustomMessageType_Noble_VIP
|
///first = CustomMessageType_Noble_VIP
|
||||||
typedef NS_ENUM(NSUInteger, CustomMessageSubNobleVIP) {
|
typedef NS_ENUM(NSUInteger, CustomMessageSubNobleVIP) {
|
||||||
/// 开通贵族房内消息
|
/// 开通贵族房内消息(公屏显示)
|
||||||
Custom_Message_Sub_Room_Open_Noble_VIP = 851,
|
Custom_Message_Sub_Room_Open_Noble_VIP = 851,
|
||||||
/// 开通贵族成功消息
|
/// 开通贵族成功消息
|
||||||
Custom_Message_Sub_Open_Noble_Success = 852,
|
Custom_Message_Sub_Open_Noble_Success = 852,
|
||||||
/// 贵族升级房内消息
|
/// 贵族升级房内消息(公屏显示)
|
||||||
Custom_Message_Sub_Room_Noble_LevelUp = 853,
|
Custom_Message_Sub_Room_Noble_LevelUp = 853,
|
||||||
/// 贵族升级用户通知消息
|
/// 贵族升级用户通知消息(弹窗)
|
||||||
Custom_Message_Sub_Noble_LevelUp_User = 854,
|
Custom_Message_Sub_Noble_LevelUp_User = 854,
|
||||||
/// 贵族升级全服飘屏通知消息
|
/// 贵族升级全服飘屏通知消息
|
||||||
Custom_Message_Sub_Room_Noble_LevelUp_Suspend = 855,
|
Custom_Message_Sub_Room_Noble_LevelUp_Suspend = 855,
|
||||||
|
@@ -23,6 +23,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
@property (nonatomic, strong) NSArray<NobleAuthInfo *> *vipAuthInfos;
|
@property (nonatomic, strong) NSArray<NobleAuthInfo *> *vipAuthInfos;
|
||||||
///贵族信息列表
|
///贵族信息列表
|
||||||
@property (nonatomic, strong) NSArray<NobleInfo *> *vipInfos;
|
@property (nonatomic, strong) NSArray<NobleInfo *> *vipInfos;
|
||||||
|
///当前是否为最高等级
|
||||||
|
@property (nonatomic, assign) BOOL isMaxLevel;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@@ -34,6 +34,7 @@
|
|||||||
#import "XPRoomGiftBroadcastView.h"
|
#import "XPRoomGiftBroadcastView.h"
|
||||||
#import "XPRoomCandyGiftView.h"
|
#import "XPRoomCandyGiftView.h"
|
||||||
#import "XPRoomDatingAnimationView.h"
|
#import "XPRoomDatingAnimationView.h"
|
||||||
|
#import "XPRoomNobleLevelUpView.h"
|
||||||
|
|
||||||
|
|
||||||
@interface XPRoomAnimationView ()<SVGAPlayerDelegate,NIMBroadcastManagerDelegate, XPRoomGiftBroadcastViewDelegate>
|
@interface XPRoomAnimationView ()<SVGAPlayerDelegate,NIMBroadcastManagerDelegate, XPRoomGiftBroadcastViewDelegate>
|
||||||
@@ -77,6 +78,8 @@
|
|||||||
@property (nonatomic,strong) NSMutableSet<NetImageView *> * giftVisibleArray;
|
@property (nonatomic,strong) NSMutableSet<NetImageView *> * giftVisibleArray;
|
||||||
///糖果树礼物的队列
|
///糖果树礼物的队列
|
||||||
@property (nonatomic,strong) NSMutableArray *candyTreegiftQueue;
|
@property (nonatomic,strong) NSMutableArray *candyTreegiftQueue;
|
||||||
|
///贵族升级的队列
|
||||||
|
@property (nonatomic, strong) NSMutableArray *nobleLevelUpQueue;
|
||||||
#pragma mark - 进房座驾动画的
|
#pragma mark - 进房座驾动画的
|
||||||
@property (nonatomic, strong) NSMutableArray<NSString *> *carEffectQueue;
|
@property (nonatomic, strong) NSMutableArray<NSString *> *carEffectQueue;
|
||||||
@property (nonatomic,strong) SVGAImageView *carEffectView;
|
@property (nonatomic,strong) SVGAImageView *carEffectView;
|
||||||
@@ -162,7 +165,9 @@
|
|||||||
[self receiveDriveCarEnterRoom:attachment];
|
[self receiveDriveCarEnterRoom:attachment];
|
||||||
} else if(attachment.first == CustomMessageType_RoomPlay_Dating && attachment.second == Custom_Message_Sub_Room_Play_Dating_Public_Result) {
|
} else if(attachment.first == CustomMessageType_RoomPlay_Dating && attachment.second == Custom_Message_Sub_Room_Play_Dating_Public_Result) {
|
||||||
[self roomDatingPublicResult:attachment];
|
[self roomDatingPublicResult:attachment];
|
||||||
}
|
} else if (attachment.first == CustomMessageType_Noble_VIP && attachment.second == Custom_Message_Sub_Room_Noble_LevelUp_Suspend) { ///贵族升级飘屏
|
||||||
|
[self receiveNobleLevelUp:attachment];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -370,6 +375,49 @@
|
|||||||
[candyTreeView pop_addAnimation:springAnimation forKey:@"candyTreespingOutAnimation"];
|
[candyTreeView pop_addAnimation:springAnimation forKey:@"candyTreespingOutAnimation"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma mark - 贵族升级
|
||||||
|
- (void)receiveNobleLevelUp:(AttachmentModel *)attachment {
|
||||||
|
if (self.nobleLevelUpQueue.count == 0) {
|
||||||
|
[self createNobleLevelUpBannerAnimation:attachment.data];
|
||||||
|
}
|
||||||
|
[self.nobleLevelUpQueue addObject:attachment.data];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)createNobleLevelUpBannerAnimation:(NSDictionary *)dic {
|
||||||
|
XPRoomNobleLevelUpView *nobleLevelUpView = [[XPRoomNobleLevelUpView alloc] initWithFrame:CGRectMake(KScreenWidth, kNavigationHeight + 15, KScreenWidth, 90)];
|
||||||
|
nobleLevelUpView.nobleInfo = dic;
|
||||||
|
[self.middleLevelView addSubview:nobleLevelUpView];
|
||||||
|
POPSpringAnimation *springAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPViewCenter];
|
||||||
|
springAnimation.springSpeed = 12;
|
||||||
|
springAnimation.springBounciness = 10.f;
|
||||||
|
springAnimation.fromValue = [NSValue valueWithCGPoint:nobleLevelUpView.center];
|
||||||
|
springAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(nobleLevelUpView.frame.size.width / 2, nobleLevelUpView.center.y)];
|
||||||
|
[springAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) {
|
||||||
|
if (finished) {
|
||||||
|
POPBasicAnimation *moveAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewCenter];
|
||||||
|
moveAnimation.fromValue = [NSValue valueWithCGPoint:CGPointMake(0, nobleLevelUpView.center.y)];
|
||||||
|
moveAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(-KScreenWidth/2, nobleLevelUpView.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) {
|
||||||
|
[nobleLevelUpView removeFromSuperview];
|
||||||
|
[self.nobleLevelUpQueue removeObjectAtIndex:0];
|
||||||
|
if (self.nobleLevelUpQueue.count > 0) {
|
||||||
|
[self createNobleLevelUpBannerAnimation:self.nobleLevelUpQueue.firstObject];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
[nobleLevelUpView pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"];
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
[nobleLevelUpView pop_addAnimation:springAnimation forKey:@"candyTreespingOutAnimation"];
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark - 收到礼物展示动画
|
#pragma mark - 收到礼物展示动画
|
||||||
- (void)receiveGiftHandleSendGiftAnimation:(AttachmentModel *)attachment {
|
- (void)receiveGiftHandleSendGiftAnimation:(AttachmentModel *)attachment {
|
||||||
if (!self.delegate.getRoomInfo.hasAnimationEffect) {return;}
|
if (!self.delegate.getRoomInfo.hasAnimationEffect) {return;}
|
||||||
@@ -1051,6 +1099,13 @@
|
|||||||
return _candyTreegiftQueue;
|
return _candyTreegiftQueue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSMutableArray *)nobleLevelUpQueue {
|
||||||
|
if (!_nobleLevelUpQueue) {
|
||||||
|
_nobleLevelUpQueue = [NSMutableArray array];
|
||||||
|
}
|
||||||
|
return _nobleLevelUpQueue;
|
||||||
|
}
|
||||||
|
|
||||||
- (NSMutableArray<NSString *> *)carEffectQueue {
|
- (NSMutableArray<NSString *> *)carEffectQueue {
|
||||||
if (_carEffectQueue == nil) {
|
if (_carEffectQueue == nil) {
|
||||||
_carEffectQueue = [NSMutableArray array];
|
_carEffectQueue = [NSMutableArray array];
|
||||||
|
@@ -0,0 +1,19 @@
|
|||||||
|
//
|
||||||
|
// XPRoomNobleLevelUpView.h
|
||||||
|
// xplan-ios
|
||||||
|
//
|
||||||
|
// Created by GreenLand on 2022/1/10.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface XPRoomNobleLevelUpView : UIView
|
||||||
|
|
||||||
|
///贵族升级的信息
|
||||||
|
@property (nonatomic,copy) NSDictionary * nobleInfo;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
117
xplan-ios/Main/Room/View/AnimationView/XPRoomNobleLevelUpView.m
Normal file
117
xplan-ios/Main/Room/View/AnimationView/XPRoomNobleLevelUpView.m
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
//
|
||||||
|
// XPRoomNobleLevelUpView.m
|
||||||
|
// xplan-ios
|
||||||
|
//
|
||||||
|
// Created by GreenLand on 2022/1/10.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "XPRoomNobleLevelUpView.h"
|
||||||
|
///Third
|
||||||
|
#import <Masonry/Masonry.h>
|
||||||
|
#import <SVGA.h>
|
||||||
|
#import "XPMacro.h"
|
||||||
|
#import "ThemeColor+Room.h"
|
||||||
|
|
||||||
|
@interface XPRoomNobleLevelUpView ()
|
||||||
|
///动画管理类
|
||||||
|
@property (strong, nonatomic) SVGAParser *parser;
|
||||||
|
///糖果树特效
|
||||||
|
@property (nonatomic,strong) SVGAImageView *nobleView;
|
||||||
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
@implementation XPRoomNobleLevelUpView
|
||||||
|
|
||||||
|
- (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.nobleView];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)initSubViewConstraints {
|
||||||
|
[self.nobleView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.left.right.top.mas_equalTo(self);
|
||||||
|
make.height.mas_equalTo(90);
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSAttributedString *)createAttribute:(NSString * )text color:(UIColor *)color {
|
||||||
|
NSDictionary * attribute = @{NSFontAttributeName:[UIFont systemFontOfSize:22], NSForegroundColorAttributeName:color};
|
||||||
|
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:text attributes:attribute];
|
||||||
|
return attr;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSAttributedString *)createImageAttrribute:(NSString *)imageName {
|
||||||
|
NSTextAttachment * attachment = [[NSTextAttachment alloc] init];
|
||||||
|
attachment.bounds = CGRectMake(0, 0, 12, 12);
|
||||||
|
attachment.image = [UIImage imageNamed:@"mine_normal_my_dressup"];
|
||||||
|
NSAttributedString * starAttribute = [NSMutableAttributedString attributedStringWithAttachment:(NSTextAttachment *)attachment];
|
||||||
|
return starAttribute;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - Getters And Setters
|
||||||
|
- (void)setNobleInfo:(NSDictionary *)nobleInfo {
|
||||||
|
if (nobleInfo) {
|
||||||
|
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];
|
||||||
|
[attribute appendAttributedString:[self createAttribute:@"引爆全场!恭喜" color:[UIColor whiteColor]]];
|
||||||
|
[attribute appendAttributedString:[self createImageAttrribute:@""]];
|
||||||
|
[attribute appendAttributedString:[self createAttribute:nobleInfo[@"nick"] color:[ThemeColor messageNickColor]]];
|
||||||
|
[attribute appendAttributedString:[self createAttribute:@"贵族身份升级为" color:[UIColor whiteColor]]];
|
||||||
|
[attribute appendAttributedString:[self createAttribute:nobleInfo[@"vipName"] color:[ThemeColor appMainColor]]];
|
||||||
|
[attribute appendAttributedString:[self createAttribute:@"!" color:[UIColor whiteColor]]];
|
||||||
|
|
||||||
|
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
|
||||||
|
paragraphStyle.lineSpacing = 3;
|
||||||
|
paragraphStyle.alignment = NSTextAlignmentCenter;
|
||||||
|
[attribute addAttributes:@{NSParagraphStyleAttributeName : paragraphStyle} range:NSMakeRange(0, [attribute length])];
|
||||||
|
|
||||||
|
@kWeakify(self);
|
||||||
|
[self.parser parseWithURL:[NSURL URLWithString:nobleInfo[@"floatPic"]] completionBlock:^(SVGAVideoEntity * _Nullable videoItem) {
|
||||||
|
@kStrongify(self);
|
||||||
|
self.nobleView.loops = 1;
|
||||||
|
self.nobleView.clearsAfterStop = NO;
|
||||||
|
self.nobleView.videoItem = videoItem;
|
||||||
|
[self.nobleView setAttributedText:attribute forKey:@"noble_text_tx"];
|
||||||
|
[self.nobleView startAnimation];
|
||||||
|
} failureBlock:^(NSError * _Nullable error) {
|
||||||
|
|
||||||
|
}];
|
||||||
|
|
||||||
|
// [self.parser parseWithNamed:@"noble_levelUp_banner" inBundle:[NSBundle mainBundle] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) {
|
||||||
|
// @kStrongify(self);
|
||||||
|
// self.nobleView.loops = 1;
|
||||||
|
// self.nobleView.clearsAfterStop = NO;
|
||||||
|
// self.nobleView.videoItem = videoItem;
|
||||||
|
// [self.nobleView setAttributedText:attribute forKey:@"noble_text_tx"];
|
||||||
|
// [self.nobleView startAnimation];
|
||||||
|
// } failureBlock:^(NSError * _Nonnull error) {
|
||||||
|
//
|
||||||
|
// }];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (SVGAImageView *)nobleView {
|
||||||
|
if (!_nobleView) {
|
||||||
|
_nobleView = [[SVGAImageView alloc]init];
|
||||||
|
_nobleView.backgroundColor = [UIColor clearColor];
|
||||||
|
_nobleView.userInteractionEnabled = NO;
|
||||||
|
}
|
||||||
|
return _nobleView;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (SVGAParser *)parser {
|
||||||
|
if (!_parser) {
|
||||||
|
_parser = [[SVGAParser alloc]init];
|
||||||
|
}
|
||||||
|
return _parser;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
@@ -77,7 +77,9 @@
|
|||||||
return [self createCollectRoomAttribute:attachment];
|
return [self createCollectRoomAttribute:attachment];
|
||||||
} else if(first == CustomMessageType_RoomPlay_Dating) {
|
} else if(first == CustomMessageType_RoomPlay_Dating) {
|
||||||
return [self createRoomDatingAttribute:attachment];
|
return [self createRoomDatingAttribute:attachment];
|
||||||
}
|
} else if (first == CustomMessageType_Noble_VIP) {//贵族
|
||||||
|
return [self createNobleLevelAttribute:attachment];
|
||||||
|
}
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -279,6 +281,33 @@
|
|||||||
[self attributeAddHihtLight:attribute uid:uid];
|
[self attributeAddHihtLight:attribute uid:uid];
|
||||||
return attribute;
|
return attribute;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma mark - 贵族
|
||||||
|
- (NSAttributedString *)createNobleLevelAttribute:(AttachmentModel *)attachment {
|
||||||
|
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];
|
||||||
|
NSInteger uid = 0;
|
||||||
|
if ([attachment.data[@"uid"] isKindOfClass:[NSNumber class]]) {
|
||||||
|
uid = ((NSNumber *)attachment.data[@"uid"]).integerValue;
|
||||||
|
} else if ([attachment.data[@"uid"] isKindOfClass:[NSString class]]) {
|
||||||
|
uid = ((NSString *)attachment.data[@"uid"]).integerValue;
|
||||||
|
}
|
||||||
|
if (attachment.second == Custom_Message_Sub_Room_Open_Noble_VIP) {/// 开通贵族房内消息 851
|
||||||
|
[attribute appendAttributedString:[self createTextAttribute:@"贵族降临!恭喜" color:[ThemeColor messageDefaultTextColor] font:kRoomMessageDefalutFont]];
|
||||||
|
[attribute appendAttributedString:[self createTextAttribute:attachment.data[@"nick"] color:[ThemeColor messageNickColor] font:kRoomMessageDefalutFont]];
|
||||||
|
[attribute appendAttributedString:[self createTextAttribute:@"开通贵族系统,获得" color:[ThemeColor messageDefaultTextColor] font:kRoomMessageDefalutFont]];
|
||||||
|
[attribute appendAttributedString:[self createTextAttribute:attachment.data[@"vipName"] color:[ThemeColor messageTextColor] font:kRoomMessageDefalutFont]];
|
||||||
|
[attribute appendAttributedString:[self createTextAttribute:@"贵族身份!" color:[ThemeColor messageDefaultTextColor] font:kRoomMessageDefalutFont]];
|
||||||
|
} else if (attachment.second == Custom_Message_Sub_Room_Noble_LevelUp || attachment.second == Custom_Message_Sub_AllRoom_Noble_LevelUp_Suspend) {///贵族升级
|
||||||
|
[attribute appendAttributedString:[self createTextAttribute:@"全场欢呼!!恭喜" color:[ThemeColor messageDefaultTextColor] font:kRoomMessageDefalutFont]];
|
||||||
|
[attribute appendAttributedString:[self createTextAttribute:attachment.data[@"nick"] color:[ThemeColor messageNickColor] font:kRoomMessageDefalutFont]];
|
||||||
|
[attribute appendAttributedString:[self createTextAttribute:@"的贵族身份成功升级为" color:[ThemeColor messageDefaultTextColor] font:kRoomMessageDefalutFont]];
|
||||||
|
[attribute appendAttributedString:[self createTextAttribute:attachment.data[@"vipName"] color:[ThemeColor messageTextColor] font:kRoomMessageDefalutFont]];
|
||||||
|
[attribute appendAttributedString:[self createTextAttribute:@"!" color:[ThemeColor messageDefaultTextColor] font:kRoomMessageDefalutFont]];
|
||||||
|
}
|
||||||
|
[self attributeAddHihtLight:attribute uid:uid];
|
||||||
|
return attribute;
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark - 踢出房间/拉黑/下麦
|
#pragma mark - 踢出房间/拉黑/下麦
|
||||||
- (NSAttributedString *)createKickUserAttribute:(AttachmentModel *)attachment info:(XPKickUserModel *)info {
|
- (NSAttributedString *)createKickUserAttribute:(AttachmentModel *)attachment info:(XPKickUserModel *)info {
|
||||||
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];
|
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];
|
||||||
|
@@ -229,6 +229,12 @@
|
|||||||
@(Custom_Message_Sub_Room_Play_Dating_Result_Mutual),
|
@(Custom_Message_Sub_Room_Play_Dating_Result_Mutual),
|
||||||
@(Custom_Message_Sub_Room_Play_Dating_Result_Not_Mutual),
|
@(Custom_Message_Sub_Room_Play_Dating_Result_Not_Mutual),
|
||||||
nil],
|
nil],
|
||||||
|
@(CustomMessageType_Noble_VIP):
|
||||||
|
[NSSet setWithObjects:
|
||||||
|
@(Custom_Message_Sub_Room_Open_Noble_VIP),
|
||||||
|
@(Custom_Message_Sub_Room_Noble_LevelUp),
|
||||||
|
@(Custom_Message_Sub_AllRoom_Noble_LevelUp_Suspend),
|
||||||
|
nil],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BIN
xplan-ios/Sources/noble_levelUp_banner.svga
Normal file
BIN
xplan-ios/Sources/noble_levelUp_banner.svga
Normal file
Binary file not shown.
Reference in New Issue
Block a user