航海完成了
@@ -5,12 +5,11 @@
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_sailing_prize_more@2x.png",
|
||||
"filename" : "room_sailiing_enter.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_sailing_prize_more@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
BIN
xplan-ios/Assets.xcassets/Room/Sailing/room_sailiing_enter.imageset/room_sailiing_enter.png
vendored
Normal file
After Width: | Height: | Size: 43 KiB |
22
xplan-ios/Assets.xcassets/Room/Sailing/room_sailing_animation_gift_bg.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_sailing_animation_gift_bg@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_sailing_animation_gift_bg@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 55 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 97 KiB |
22
xplan-ios/Assets.xcassets/Room/Sailing/room_sailing_prize_cowry_large.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_sailing_prize_cowry_large@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_sailing_prize_cowry_large@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 106 KiB |
After Width: | Height: | Size: 248 KiB |
22
xplan-ios/Assets.xcassets/Room/Sailing/room_sailing_prize_crowy.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_sailing_prize_crowy@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_sailing_prize_crowy@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 84 KiB |
Before Width: | Height: | Size: 159 KiB After Width: | Height: | Size: 159 KiB |
22
xplan-ios/Assets.xcassets/Room/Sailing/room_sailing_prize_normal_large.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_sailing_prize_normal_large@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_sailing_prize_normal_large@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 104 KiB |
After Width: | Height: | Size: 191 KiB |
@@ -5,12 +5,12 @@
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_sailing_prize_one@2x.png",
|
||||
"filename" : "room_sailing_prize_normal@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_sailing_prize_one@3x.png",
|
||||
"filename" : "room_sailing_prize_normal@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
|
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 88 KiB |
Before Width: | Height: | Size: 163 KiB After Width: | Height: | Size: 163 KiB |
22
xplan-ios/Assets.xcassets/Room/Sailing/room_sailing_sailing.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_sailing_sailing@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_sailing_sailing@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
xplan-ios/Assets.xcassets/Room/Sailing/room_sailing_sailing.imageset/room_sailing_sailing@2x.png
vendored
Normal file
After Width: | Height: | Size: 54 KiB |
BIN
xplan-ios/Assets.xcassets/Room/Sailing/room_sailing_sailing.imageset/room_sailing_sailing@3x.png
vendored
Normal file
After Width: | Height: | Size: 102 KiB |
Before Width: | Height: | Size: 179 B After Width: | Height: | Size: 264 B |
Before Width: | Height: | Size: 277 B After Width: | Height: | Size: 420 B |
Before Width: | Height: | Size: 289 B After Width: | Height: | Size: 362 B |
Before Width: | Height: | Size: 466 B After Width: | Height: | Size: 581 B |
@@ -66,6 +66,8 @@ typedef NS_ENUM(NSUInteger, CustomMessageType) {
|
||||
CustomMessageType_First_Recharge_Reward = 76,
|
||||
///访客记录
|
||||
CustomMessageType_First_VisitorRecord = 78,
|
||||
///航海
|
||||
CustomMessageType_Room_Sailing = 81,
|
||||
///跨房PK
|
||||
CustomMessageType_Across_Room_PK = 83,
|
||||
///贵族VIP
|
||||
@@ -354,6 +356,20 @@ typedef NS_ENUM(NSUInteger, CustomMessageSubVisitorRecord) {
|
||||
Custom_Message_Sub_Visitor_Record = 781,
|
||||
};
|
||||
|
||||
///first == CustomMessageType_Room_Sailing
|
||||
typedef NS_ENUM(NSInteger, CustomMessageSubSailing) {
|
||||
//自己可见 一级礼物(最小)
|
||||
Custom_Message_Sub_Sailing_Me = 811,
|
||||
//当前房间可见 二级礼物
|
||||
Custom_Message_Sub_Sailing_InRoom = 812,
|
||||
//所有房间可见 三级礼物
|
||||
Custom_Message_Sub_Sailing_AllRoom = 813,
|
||||
//所有房间可见+小秘书 四级礼物(最大)
|
||||
Custom_Message_Sub_Sailing_AllRoom_Notify = 814,
|
||||
//开箱子开到全麦送 (服务端发)
|
||||
Custom_Message_Sub_Sailing_InRoom_NeedAllMicSend = 815,
|
||||
};
|
||||
|
||||
///first = CustomMessageType_Across_Room_PK
|
||||
typedef NS_ENUM(NSUInteger, CustomMessageSubAcrossRoomPK) {
|
||||
/// 收到跨房PK邀请
|
||||
|
@@ -238,6 +238,7 @@
|
||||
if (roomInfo.type == RoomType_MiniGame) {
|
||||
self.firstRechargeImageView.hidden = YES;
|
||||
self.candyTreeImageView.hidden = YES;
|
||||
self.sailingImageView.hidden = YES;
|
||||
if (self.isLoadActivity) {
|
||||
[self configLittleGameActivity];
|
||||
} else {
|
||||
@@ -269,6 +270,12 @@
|
||||
} else {
|
||||
self.joinDatingView.hidden = YES;
|
||||
}
|
||||
|
||||
if ([ClientConfig shareConfig].configInfo.linearlyPoolOpenLevel <= self.hostDelegate.getUserInfo.userLevelVo.experLevelSeq) {
|
||||
self.sailingImageView.hidden = NO;
|
||||
} else {
|
||||
self.sailingImageView.hidden = YES;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -392,8 +399,8 @@
|
||||
}
|
||||
|
||||
- (void)sailTapRecognizer {
|
||||
XPSailingViewController * sailingVC = [[XPSailingViewController alloc] init];
|
||||
sailingVC.modalPresentationStyle = UIModalPresentationOverFullScreen;
|
||||
NSString * roomUid = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.uid];
|
||||
XPSailingViewController * sailingVC = [[XPSailingViewController alloc] initWithRoomUid:roomUid];
|
||||
[self.hostDelegate.getCurrentNav presentViewController:sailingVC animated:YES completion:nil];
|
||||
}
|
||||
|
||||
@@ -485,7 +492,7 @@
|
||||
- (UIImageView *)sailingImageView {
|
||||
if (!_sailingImageView) {
|
||||
_sailingImageView = [[UIImageView alloc] init];
|
||||
_sailingImageView.image = [UIImage imageNamed:@"room_first_recharge_enter"];
|
||||
_sailingImageView.image = [UIImage imageNamed:@"room_sailiing_enter"];
|
||||
_sailingImageView.userInteractionEnabled = YES;
|
||||
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(sailTapRecognizer)];
|
||||
[_sailingImageView addGestureRecognizer:tap];
|
||||
|
@@ -52,6 +52,7 @@
|
||||
#import "XPRoomLicneseHourRankView.h"
|
||||
#import "XPRoomLuckyBigPrizeView.h"
|
||||
#import "XPRoomGiftCompoundView.h"
|
||||
#import "XPSailingAnimationView.h"
|
||||
|
||||
@interface XPRoomAnimationView ()<SVGAPlayerDelegate,NIMBroadcastManagerDelegate, XPRoomGiftBroadcastViewDelegate, HWDMP4PlayDelegate, XPRoomLuckyBigPrizeViewDelegate,XPRoomLicneseHourRankViewDelegate>
|
||||
///展示的不同层级
|
||||
@@ -121,6 +122,8 @@
|
||||
@property (nonatomic,strong) SVGAImageView *datingEffectView;
|
||||
#pragma mark - 跨房PK
|
||||
@property (nonatomic, strong) NSMutableArray<AcrossRoomPKPrizeModel *> *acrossRoomPKQueue;
|
||||
#pragma mark - 航海
|
||||
@property (nonatomic, strong) NSMutableArray<AttachmentModel *> *sailingQueue;
|
||||
///幸运礼物动画是否在播放
|
||||
@property (nonatomic,assign) BOOL isLuckyGiftAnimation;
|
||||
@end
|
||||
@@ -272,7 +275,9 @@
|
||||
[self receiveLicneseHourRank:attachment];
|
||||
} else if (attachment.first == CustomMessageType_Gift_Compound && attachment.second == Custom_Message_Sub_Gift_Compound) {///魔法小屋合成礼物
|
||||
[self receiveGiftCompound:attachment];
|
||||
}
|
||||
} else if(attachment.first == CustomMessageType_Room_Sailing) {
|
||||
[self receiveRoomSailing:attachment];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -614,6 +619,51 @@
|
||||
[candyTreeView pop_addAnimation:springAnimation forKey:@"candyTreespingOutAnimation"];
|
||||
}
|
||||
|
||||
#pragma mark - 航海横幅
|
||||
- (void)receiveRoomSailing:(AttachmentModel *)attachment {
|
||||
if ([self isInSudGame]) {return;}
|
||||
if (self.sailingQueue.count == 0) {
|
||||
[self createSailingBannerAnimation:attachment];
|
||||
}
|
||||
[self.sailingQueue addObject:attachment];
|
||||
}
|
||||
|
||||
- (void)createSailingBannerAnimation:(AttachmentModel *)attatchment {
|
||||
CGFloat kscale = (CGFloat)60 / (CGFloat)375;
|
||||
XPSailingAnimationView *sailingView = [[XPSailingAnimationView alloc] initWithFrame:CGRectMake(KScreenWidth, kNavigationHeight + 15, KScreenWidth, KScreenWidth * kscale)];
|
||||
sailingView.prizeInfo = attatchment.data;
|
||||
[self.middleLevelView addSubview:sailingView];
|
||||
POPSpringAnimation *springAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPViewCenter];
|
||||
springAnimation.springSpeed = 12;
|
||||
springAnimation.springBounciness = 10.f;
|
||||
springAnimation.fromValue = [NSValue valueWithCGPoint:sailingView.center];
|
||||
springAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(sailingView.frame.size.width / 2, sailingView.center.y)];
|
||||
[springAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) {
|
||||
if (finished) {
|
||||
POPBasicAnimation *moveAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewCenter];
|
||||
moveAnimation.fromValue = [NSValue valueWithCGPoint:CGPointMake(0, sailingView.center.y)];
|
||||
moveAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(-KScreenWidth/2, sailingView.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) {
|
||||
[sailingView removeFromSuperview];
|
||||
[self.sailingQueue removeObjectAtIndex:0];
|
||||
if (self.sailingQueue.count > 0) {
|
||||
[self createSailingBannerAnimation:self.sailingQueue.firstObject];
|
||||
}
|
||||
}
|
||||
}];
|
||||
[sailingView pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"];
|
||||
}
|
||||
}];
|
||||
[sailingView pop_addAnimation:springAnimation forKey:@"candyTreespingOutAnimation"];
|
||||
}
|
||||
|
||||
#pragma mark - 贵族升级
|
||||
- (void)receiveNobleLevelUp:(AttachmentModel *)attachment {
|
||||
if (self.nobleLevelUpQueue.count == 0) {
|
||||
@@ -1765,5 +1815,12 @@
|
||||
return _acrossRoomPKQueue;
|
||||
}
|
||||
|
||||
- (NSMutableArray<AttachmentModel *> *)sailingQueue {
|
||||
if (!_sailingQueue) {
|
||||
_sailingQueue = [NSMutableArray array];
|
||||
}
|
||||
return _sailingQueue;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
@@ -35,6 +35,7 @@
|
||||
#import "CandyTreeResultModel.h"
|
||||
#import "XPGiftBigPrizeModel.h"
|
||||
#import "XPGiftCompoundModel.h"
|
||||
#import "RoomSailingPrizeModel.h"
|
||||
|
||||
#import "NetImageView.h"
|
||||
|
||||
@@ -111,7 +112,9 @@
|
||||
return [self createRoomLuckyBigPrizeAttribute:attachment];
|
||||
} else if(first == CustomMessageType_Gift_Compound) {///礼物合成
|
||||
return [self createRoomGiftCompoundAttribute:attachment];
|
||||
}
|
||||
} else if(first == CustomMessageType_Room_Sailing) {///航海
|
||||
return [self createRoomSailingAttribute:attachment];
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
@@ -267,6 +270,21 @@
|
||||
return nil;
|
||||
}
|
||||
|
||||
#pragma mark - 航海
|
||||
- (NSAttributedString *)createRoomSailingAttribute:(AttachmentModel *)attachment {
|
||||
RoomSailingPrizeModel *info = [RoomSailingPrizeModel modelWithDictionary:attachment.data];
|
||||
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];
|
||||
[attribute appendAttributedString:[self createTextAttribute:@"厉害了! " color:[ThemeColor messageTextColor] font:kRoomMessageDefalutFont]];
|
||||
[attribute appendAttributedString:[self createTextAttribute:info.nick color:[ThemeColor messageNickColor] font:kRoomMessageDefalutFont]];
|
||||
[attribute appendAttributedString:[self createTextAttribute:@"在航海冒险中获得" color:[ThemeColor messageTextColor] font:kRoomMessageDefalutFont]];
|
||||
[attribute appendAttributedString:[self createTextAttribute:info.prizeName color:[ThemeColor messageNickColor] font:kRoomMessageDefalutFont]];
|
||||
if (info.prizeNum>1) {
|
||||
[attribute appendAttributedString:[self createTextAttribute:[NSString stringWithFormat:@"x%d", info.prizeNum] color:[ThemeColor messageTextColor] font:kRoomMessageDefalutFont]];
|
||||
}
|
||||
[self attributeAddHihtLight:attribute uid:info.uid.integerValue];
|
||||
return attribute;
|
||||
}
|
||||
|
||||
#pragma mark - 礼物合成
|
||||
- (NSAttributedString *)createRoomGiftCompoundAttribute:(AttachmentModel *)attachment {
|
||||
XPGiftCompoundModel *info = [XPGiftCompoundModel modelWithDictionary:attachment.data];
|
||||
|
@@ -28,6 +28,8 @@
|
||||
#import "XPMessageRemoteExtModel.h"
|
||||
#import "RoomPKChooseUserModel.h"
|
||||
#import "CandyTreeResultModel.h"
|
||||
#import "RoomSailingPrizeModel.h"
|
||||
#import "UserInfoModel.h"
|
||||
///View
|
||||
#import "XPRoomMessageTableViewCell.h"
|
||||
#import "XPRoomMessageHeaderView.h"
|
||||
@@ -366,6 +368,11 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey";
|
||||
}
|
||||
}
|
||||
return NO;
|
||||
} else if(attachment.first == CustomMessageType_Room_Sailing && (attachment.second == Custom_Message_Sub_Sailing_AllRoom_Notify || attachment.second == Custom_Message_Sub_Sailing_InRoom_NeedAllMicSend)) {
|
||||
RoomSailingPrizeModel * prizeModel = [RoomSailingPrizeModel modelWithDictionary:attachment.data];
|
||||
if (self.hostDelegate.getUserInfo.userLevelVo.experLevelSeq > prizeModel.userLevelLimit) {
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
return [[[self supportMessageDic] objectForKey:@(attachment.first)] containsObject:@(attachment.second)];
|
||||
}
|
||||
@@ -466,7 +473,15 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey";
|
||||
nil],
|
||||
@(CustomMessageType_Gift_Compound):
|
||||
[NSSet setWithObjects:@(Custom_Message_Sub_Gift_Compound),
|
||||
nil]
|
||||
nil],
|
||||
@(CustomMessageType_Room_Sailing):
|
||||
[NSSet setWithObjects:
|
||||
@(Custom_Message_Sub_Sailing_Me),
|
||||
@(Custom_Message_Sub_Sailing_InRoom),
|
||||
@(Custom_Message_Sub_Sailing_AllRoom),
|
||||
@(Custom_Message_Sub_Sailing_AllRoom_Notify),
|
||||
@(Custom_Message_Sub_Sailing_InRoom_NeedAllMicSend),
|
||||
nil]
|
||||
};
|
||||
}
|
||||
|
||||
|
@@ -14,6 +14,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic,strong) NSArray<RoomSailingPrizeModel *> *prizeItemList;
|
||||
///剩余钥匙数
|
||||
@property (nonatomic,assign) NSInteger remainKeyNum;
|
||||
///是否有元宝礼物
|
||||
@property (nonatomic,assign) BOOL specialStatus;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -40,6 +40,11 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic, assign) SailingPrizeLevel prizeLevel;//奖品等级
|
||||
@property (nonatomic, assign) NSInteger referenceId;//相关实体id
|
||||
@property (nonatomic, assign) NSInteger prizeId;//奖品id
|
||||
@property (nonatomic,copy) NSString *nick;
|
||||
///等级限制 大于这个等级才能加到公屏
|
||||
@property (nonatomic,assign) NSInteger userLevelLimit;
|
||||
///用户的uid
|
||||
@property (nonatomic,copy) NSString *uid;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -33,7 +33,7 @@
|
||||
[[self getView] openSailingSuccess:listModel];
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
[[self getView] openSailingFail:msg];
|
||||
} showLoading:YES] uid:uid keyNum:keyNumStr sendMessage:sendMessageStr roomUid:roomUid];
|
||||
} ] uid:uid keyNum:keyNumStr sendMessage:sendMessageStr roomUid:roomUid];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -66,6 +66,7 @@
|
||||
_logoImageView = [[NetImageView alloc] initWithConfig:config];
|
||||
_logoImageView.layer.masksToBounds = YES;
|
||||
_logoImageView.layer.cornerRadius = 8;
|
||||
_logoImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
}
|
||||
return _logoImageView;
|
||||
}
|
||||
|
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// XPSailingAnimationView.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/8/19.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@interface XPSailingAnimationView : UIView
|
||||
@property (nonatomic,strong) NSDictionary *prizeInfo;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,95 @@
|
||||
//
|
||||
// XPSailingAnimationView.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/8/19.
|
||||
//
|
||||
|
||||
#import "XPSailingAnimationView.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
#import "XPMacro.h"
|
||||
#import "ThemeColor.h"
|
||||
#import "RoomSailingPrizeModel.h"
|
||||
#import "NSObject+MJExtension.h"
|
||||
@interface XPSailingAnimationView ()
|
||||
///背景图
|
||||
@property (nonatomic,strong) UIImageView *backImageView;
|
||||
///显示文本内容
|
||||
@property (nonatomic,strong) UILabel *titleLabel;
|
||||
@end
|
||||
|
||||
@implementation XPSailingAnimationView
|
||||
|
||||
- (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.titleLabel];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.backImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self);
|
||||
}];
|
||||
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.backImageView).offset(89);
|
||||
make.top.mas_equalTo(self.backImageView).offset(29);
|
||||
make.right.mas_lessThanOrEqualTo(self.backImageView);
|
||||
}];
|
||||
}
|
||||
|
||||
- (NSAttributedString *)createAttribute:(NSString * )text color:(UIColor *)color fontSize:(CGFloat)fonSize {
|
||||
NSDictionary * attribute = @{NSFontAttributeName:[UIFont systemFontOfSize:fonSize], NSForegroundColorAttributeName:color};
|
||||
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:text attributes:attribute];
|
||||
return attr;
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setPrizeInfo:(NSDictionary *)prizeInfo {
|
||||
_prizeInfo = prizeInfo;
|
||||
if (_prizeInfo) {
|
||||
RoomSailingPrizeModel * info = [RoomSailingPrizeModel modelWithDictionary:_prizeInfo];
|
||||
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];
|
||||
CGFloat fontSize = 12;
|
||||
[attribute appendAttributedString:[self createAttribute:@"厉害了! " color:[UIColor whiteColor] fontSize:fontSize]];
|
||||
NSString * nick = info.nick;
|
||||
if (nick.length > 6) {
|
||||
nick = [nick substringToIndex:6];
|
||||
}
|
||||
[attribute appendAttributedString:[self createAttribute:nick color:UIColorFromRGB(0xFFFE95) fontSize:fontSize]];
|
||||
[attribute appendAttributedString:[self createAttribute:@"在航海冒险中获得 " color:[UIColor whiteColor] fontSize:fontSize]];
|
||||
[attribute appendAttributedString:[self createAttribute:info.prizeName color:[ThemeColor appEmphasizeColor] fontSize:fontSize]];
|
||||
if (info.prizeNum > 1) {
|
||||
[attribute appendAttributedString:[self createAttribute:[NSString stringWithFormat:@" X%d", info.prizeNum] color:[UIColor whiteColor] fontSize:fontSize]];
|
||||
}
|
||||
self.titleLabel.attributedText = attribute;
|
||||
}
|
||||
}
|
||||
|
||||
- (UIImageView *)backImageView {
|
||||
if (!_backImageView) {
|
||||
_backImageView = [[UIImageView alloc] init];
|
||||
_backImageView.userInteractionEnabled = YES;
|
||||
_backImageView.image = [UIImage imageNamed:@"room_sailing_animation_gift_bg"];
|
||||
}
|
||||
return _backImageView;
|
||||
}
|
||||
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
|
||||
@end
|
16
xplan-ios/Main/Room/View/Sailing/View/XPSailingGiftView.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// XPSailingGiftView.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/8/19.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class RoomSailingPrizeModel;
|
||||
@interface XPSailingGiftView : UIView
|
||||
@property (nonatomic,strong) RoomSailingPrizeModel *prizeInfo;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
88
xplan-ios/Main/Room/View/Sailing/View/XPSailingGiftView.m
Normal file
@@ -0,0 +1,88 @@
|
||||
//
|
||||
// XPSailingGiftView.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/8/19.
|
||||
//
|
||||
|
||||
#import "XPSailingGiftView.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
#import "RoomSailingPrizeModel.h"
|
||||
#import "XPCandyTreeAnimationModel.h"
|
||||
|
||||
@interface XPSailingGiftView ()
|
||||
///礼物背景
|
||||
@property (nonatomic,strong) UIImageView *backImageView;
|
||||
///显示文字
|
||||
@property (nonatomic,strong) UILabel *titleLabel;
|
||||
///动画完成
|
||||
@property (nonatomic,copy) void(^FinishBlock)(BOOL finish);
|
||||
@end
|
||||
|
||||
@implementation XPSailingGiftView
|
||||
|
||||
- (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 addSubview:self.titleLabel];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.backImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.mas_equalTo(self);
|
||||
make.height.mas_equalTo(19);
|
||||
}];
|
||||
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.backImageView.mas_left).offset(3);
|
||||
make.centerY.mas_equalTo(self.backImageView);
|
||||
}];
|
||||
}
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setPrizeInfo:(RoomSailingPrizeModel *)prizeInfo {
|
||||
_prizeInfo = prizeInfo;
|
||||
if (_prizeInfo) {
|
||||
NSString * backImage= @"candy_tree_levle_third";
|
||||
if(_prizeInfo.prizeLevel == SailingPrizeLevelThree) {
|
||||
backImage = @"candy_tree_levle_fourth";
|
||||
} else if(_prizeInfo.prizeLevel == SailingPrizeLevelFour) {
|
||||
backImage = @"candy_tree_levle_fifth";
|
||||
}
|
||||
self.backImageView.image = [UIImage imageNamed:backImage];
|
||||
if (_prizeInfo.prizeName.length > 7) {
|
||||
_prizeInfo.prizeName = [_prizeInfo.prizeName substringToIndex:7];
|
||||
}
|
||||
NSString * giftTitle = [NSString stringWithFormat:@"%@ x %d", _prizeInfo.prizeName, _prizeInfo.prizeNum];
|
||||
self.titleLabel.text = giftTitle;
|
||||
}
|
||||
[self layoutIfNeeded];
|
||||
}
|
||||
|
||||
- (UIImageView *)backImageView {
|
||||
if (!_backImageView) {
|
||||
_backImageView = [[UIImageView alloc] init];
|
||||
_backImageView.userInteractionEnabled = YES;
|
||||
}
|
||||
return _backImageView;
|
||||
}
|
||||
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:10];
|
||||
_titleLabel.textAlignment = NSTextAlignmentCenter;
|
||||
_titleLabel.textColor = [UIColor whiteColor];
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
@end
|
@@ -8,9 +8,10 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class RoomSailingPrizeModel;
|
||||
@class RoomSailingPrizeListModel;
|
||||
@interface XPSailingPrizeView : UIView
|
||||
@property (nonatomic,strong) NSArray<RoomSailingPrizeModel *> *prizeItemList;
|
||||
@property (nonatomic,strong) RoomSailingPrizeListModel * prizeInfo;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -11,7 +11,7 @@
|
||||
///Tool
|
||||
#import "ThemeColor.h"
|
||||
///Model
|
||||
#import "RoomSailingPrizeModel.h"
|
||||
#import "RoomSailingPrizeListModel.h"
|
||||
///View
|
||||
#import "XPSailingPrizeCollectionViewCell.h"
|
||||
|
||||
@@ -21,12 +21,6 @@
|
||||
@property (nonatomic,strong) UIImageView *backImageView;
|
||||
///列表
|
||||
@property (nonatomic,strong) UICollectionView *collectionView;
|
||||
///提示
|
||||
@property (nonatomic,strong) UIStackView *tipsStackView;
|
||||
///
|
||||
@property (nonatomic,strong) UIButton *boxButton;
|
||||
///
|
||||
@property (nonatomic,strong) UILabel *tipLabel;
|
||||
@end
|
||||
|
||||
|
||||
@@ -45,10 +39,6 @@
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.backImageView];
|
||||
[self.backImageView addSubview:self.collectionView];
|
||||
[self.backImageView addSubview:self.tipsStackView];
|
||||
|
||||
[self.tipsStackView addArrangedSubview:self.boxButton];
|
||||
[self.tipsStackView addArrangedSubview:self.tipLabel];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
@@ -60,48 +50,35 @@
|
||||
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.backImageView).offset(75);
|
||||
make.left.right.mas_equalTo(self.backImageView);
|
||||
make.bottom.mas_equalTo(self.tipsStackView.mas_top).offset(-10);
|
||||
}];
|
||||
|
||||
[self.tipsStackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.backImageView);
|
||||
make.bottom.mas_equalTo(self.backImageView).offset(-16.5);
|
||||
make.height.mas_equalTo(10);
|
||||
}];
|
||||
|
||||
[self.boxButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(10);
|
||||
make.bottom.mas_equalTo(self).offset(-10);
|
||||
}];
|
||||
}
|
||||
|
||||
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
|
||||
return self.prizeItemList.count;
|
||||
return self.prizeInfo.prizeItemList.count;
|
||||
}
|
||||
|
||||
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||
XPSailingPrizeCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPSailingPrizeCollectionViewCell class]) forIndexPath:indexPath];
|
||||
cell.prizeModel = [self.prizeItemList objectAtIndex:indexPath.row];
|
||||
cell.prizeModel = [self.prizeInfo.prizeItemList objectAtIndex:indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
|
||||
#pragma mark - Event Response
|
||||
- (void)boxButtonAction:(UIButton *)sender {
|
||||
sender.selected = !sender.selected;
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setPrizeItemList:(NSArray<RoomSailingPrizeModel *> *)prizeItemList {
|
||||
_prizeItemList = prizeItemList;
|
||||
- (void)setPrizeInfo:(RoomSailingPrizeListModel *)prizeInfo{
|
||||
_prizeInfo = prizeInfo;
|
||||
[self.collectionView reloadData];
|
||||
if (_prizeItemList.count == 1) {
|
||||
self.backImageView.image = [UIImage imageNamed:@"room_sailing_prize_one"];
|
||||
} else {
|
||||
if (_prizeItemList.count > 5) {
|
||||
self.backImageView.image = [UIImage imageNamed:@"room_sailing_prize_one"];
|
||||
} else {
|
||||
self.backImageView.image = [UIImage imageNamed:@"room_sailing_prize_more"];
|
||||
if (_prizeInfo.specialStatus) {
|
||||
if (_prizeInfo.prizeItemList.count > 5) {
|
||||
self.backImageView.image = [UIImage imageNamed:@"room_sailing_prize_cowry_large"];
|
||||
}else {
|
||||
self.backImageView.image = [UIImage imageNamed:@"room_sailing_prize_crowy"];
|
||||
}
|
||||
} else {
|
||||
if (prizeInfo.prizeItemList.count > 5) {
|
||||
self.backImageView.image = [UIImage imageNamed:@"room_sailing_prize_normal_large"];
|
||||
}else {
|
||||
self.backImageView.image = [UIImage imageNamed:@"room_sailing_prize_one"];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,37 +107,4 @@
|
||||
return _collectionView;
|
||||
}
|
||||
|
||||
- (UIStackView *)tipsStackView {
|
||||
if (!_tipsStackView) {
|
||||
_tipsStackView = [[UIStackView alloc] init];
|
||||
_tipsStackView.axis = UILayoutConstraintAxisHorizontal;
|
||||
_tipsStackView.distribution = UIStackViewDistributionFill;
|
||||
_tipsStackView.alignment = UIStackViewAlignmentFill;
|
||||
_tipsStackView.spacing = 5;
|
||||
}
|
||||
return _tipsStackView;
|
||||
}
|
||||
|
||||
- (UIButton *)boxButton {
|
||||
if (!_boxButton) {
|
||||
_boxButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_boxButton setImage:[UIImage imageNamed:@"room_sailing_tips_normal"] forState:UIControlStateNormal];
|
||||
[_boxButton setImage:[UIImage imageNamed:@"room_sailing_tips_select"] forState:UIControlStateSelected];
|
||||
[_boxButton addTarget:self action:@selector(boxButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _boxButton;
|
||||
}
|
||||
|
||||
- (UILabel *)tipLabel {
|
||||
if (!_tipLabel) {
|
||||
_tipLabel = [[UILabel alloc] init];
|
||||
_tipLabel.font = [UIFont systemFontOfSize:10];
|
||||
_tipLabel.textColor = UIColorFromRGB(0xE9C57B);
|
||||
_tipLabel.text = @"下次不用提示";
|
||||
}
|
||||
return _tipLabel;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
@@ -9,28 +9,41 @@
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <NIMSDK/NIMSDK.h>
|
||||
#import <SVGA.h>
|
||||
///Tool
|
||||
#import "ThemeColor.h"
|
||||
#import "XPMacro.h"
|
||||
#import "TTPopup.h"
|
||||
#import "XPHtmlUrl.h"
|
||||
#import "UIButton+EnlargeTouchArea.h"
|
||||
///Model
|
||||
#import "RoomSailingInfoModel.h"
|
||||
#import "RoomSailingPrizeListModel.h"
|
||||
#import "AttachmentModel.h"
|
||||
#import "AccountInfoStorage.h"
|
||||
///View
|
||||
#import "XPSailingRankView.h"
|
||||
#import "XPRoomHalfWebView.h"
|
||||
#import "XPSailingPrizeView.h"
|
||||
#import "XPSailingGiftView.h"
|
||||
///P
|
||||
#import "XPSailingPresenter.h"
|
||||
#import "XPSailingProtocol.h"
|
||||
|
||||
NSString * const kSailingPrizeAlertKey = @"kSailingPrizeAlertKey";
|
||||
|
||||
#define KitemHeight (20 + 5)
|
||||
@interface XPSailingViewController ()<XPSailingProtocol, NIMSystemNotificationManagerDelegate>
|
||||
///顶部的View
|
||||
@property (nonatomic,strong) UIView * topView;
|
||||
///背景图
|
||||
@property (nonatomic,strong) UIImageView *backImageView;
|
||||
///
|
||||
@property (nonatomic,strong) UIImageView *sailingImageView;
|
||||
///动画管理类
|
||||
@property (strong, nonatomic) SVGAParser *parser;
|
||||
///航海特效
|
||||
@property (nonatomic,strong) SVGAImageView *sailingView;
|
||||
///排行榜
|
||||
@property (nonatomic,strong) UIButton *rankButton;
|
||||
///h获取燃油
|
||||
@@ -55,6 +68,14 @@
|
||||
@property (nonatomic,strong) UIButton *exploreButton;
|
||||
///消耗燃油
|
||||
@property (nonatomic,strong) UILabel *consumLabel;
|
||||
///提示
|
||||
@property (nonatomic,strong) UIStackView *tipsStackView;
|
||||
///
|
||||
@property (nonatomic,strong) UIButton *boxButton;
|
||||
///
|
||||
@property (nonatomic,strong) UILabel *tipLabel;
|
||||
|
||||
@property (nonatomic,strong) UIView * animationView;
|
||||
@property (nonatomic,assign) NSInteger exploreCount;
|
||||
///航海的信息
|
||||
@property (nonatomic,strong) RoomSailingInfoModel *sailingInfo;
|
||||
@@ -73,6 +94,7 @@
|
||||
- (instancetype)initWithRoomUid:(NSString *)roomUid {
|
||||
if (self = [super init]) {
|
||||
self.roomUid = roomUid;
|
||||
self.modalPresentationStyle = UIModalPresentationOverFullScreen;
|
||||
[[NIMSDK sharedSDK].systemNotificationManager addDelegate:self];
|
||||
}
|
||||
return self;
|
||||
@@ -97,16 +119,24 @@
|
||||
[self.view addSubview:self.topView];
|
||||
[self.view addSubview:self.backImageView];
|
||||
|
||||
[self.backImageView addSubview:self.sailingView];
|
||||
[self.backImageView addSubview:self.sailingImageView];
|
||||
[self.backImageView addSubview:self.rankButton];
|
||||
[self.backImageView addSubview:self.getFuleButton];
|
||||
[self.backImageView addSubview:self.recordButton];
|
||||
[self.backImageView addSubview:self.contentImageView];
|
||||
|
||||
[self.contentImageView addSubview:self.descriptionButton];
|
||||
[self.contentImageView addSubview:self.animationView];
|
||||
[self.contentImageView addSubview:self.fuleButton];
|
||||
[self.contentImageView addSubview:self.numberView];
|
||||
[self.contentImageView addSubview:self.exploreButton];
|
||||
[self.contentImageView addSubview:self.consumLabel];
|
||||
[self.contentImageView addSubview:self.tipsStackView];
|
||||
|
||||
[self.exploreButton addSubview:self.consumLabel];
|
||||
|
||||
[self.tipsStackView addArrangedSubview:self.boxButton];
|
||||
[self.tipsStackView addArrangedSubview:self.tipLabel];
|
||||
|
||||
[self.numberView addArrangedSubview:self.reduButton];
|
||||
[self.numberView addArrangedSubview:self.textField];
|
||||
@@ -124,6 +154,14 @@
|
||||
make.height.mas_equalTo(515);
|
||||
}];
|
||||
|
||||
[self.sailingView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self.backImageView);
|
||||
}];
|
||||
|
||||
[self.sailingImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self.backImageView);
|
||||
}];
|
||||
|
||||
[self.rankButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(41, 32));
|
||||
make.top.mas_equalTo(self.backImageView).offset(129);
|
||||
@@ -159,34 +197,63 @@
|
||||
|
||||
[self.numberView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.contentImageView);
|
||||
make.top.mas_equalTo(self.contentImageView).offset(77);
|
||||
make.height.mas_equalTo(30);
|
||||
make.top.mas_equalTo(self.contentImageView).offset(77 * kScreenScale);
|
||||
make.height.mas_equalTo(30 * kScreenScale);
|
||||
}];
|
||||
|
||||
[self.reduButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(27);
|
||||
make.height.mas_equalTo(27);
|
||||
make.width.mas_equalTo(30 * kScreenScale);;
|
||||
}];
|
||||
|
||||
[self.addButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(27);
|
||||
make.height.mas_equalTo(27);
|
||||
make.width.mas_equalTo(30 * kScreenScale);
|
||||
}];
|
||||
|
||||
[self.textField mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(75);
|
||||
make.height.mas_equalTo(30);
|
||||
make.width.mas_equalTo(75 * kScreenScale);
|
||||
}];
|
||||
|
||||
[self.exploreButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(150, 47));
|
||||
make.size.mas_equalTo(CGSizeMake(150 * kScreenScale, 47 * kScreenScale));
|
||||
make.centerX.mas_equalTo(self.contentImageView);
|
||||
make.top.mas_equalTo(self.numberView.mas_bottom).offset(12);
|
||||
make.top.mas_equalTo(self.numberView.mas_bottom).offset(12 * kScreenScale);
|
||||
}];
|
||||
|
||||
[self.consumLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.exploreButton);
|
||||
make.bottom.mas_equalTo(self.exploreButton.mas_bottom).offset(-7 * kScreenScale);
|
||||
}];
|
||||
|
||||
[self.animationView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.contentImageView).offset(10);
|
||||
make.bottom.mas_equalTo(self.contentImageView).offset(-50);
|
||||
make.width.mas_equalTo(150);
|
||||
make.height.mas_equalTo(KitemHeight * 5);
|
||||
}];
|
||||
|
||||
[self.tipsStackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.contentImageView);
|
||||
make.top.mas_equalTo(self.exploreButton.mas_bottom).offset(1);
|
||||
make.bottom.mas_equalTo(self.contentImageView).offset(-20);
|
||||
make.height.mas_equalTo(10);
|
||||
}];
|
||||
|
||||
[self.boxButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(10);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)startSailingSVGA {
|
||||
@kWeakify(self);
|
||||
[self.parser parseWithNamed:@"sailing_prize" inBundle:[NSBundle mainBundle] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) {
|
||||
@kStrongify(self);
|
||||
self.sailingView.layer.masksToBounds = YES;
|
||||
self.sailingView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
self.sailingView.loops = 1;
|
||||
self.sailingView.clearsAfterStop = YES;
|
||||
self.sailingView.videoItem = videoItem;
|
||||
[self.sailingView startAnimation];
|
||||
} failureBlock:^(NSError * _Nonnull error) {
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
@@ -198,24 +265,65 @@
|
||||
}
|
||||
|
||||
- (void)openSailingSuccess:(RoomSailingPrizeListModel *)model {
|
||||
[self.sailingView stopAnimation];
|
||||
self.sailingImageView.hidden = NO;
|
||||
self.sailingInfo.keyNum = model.remainKeyNum;
|
||||
NSString * fuleStr = [NSString stringWithFormat:@"%ld", self.sailingInfo.keyNum];
|
||||
[self.fuleButton setTitle:fuleStr forState:UIControlStateNormal];
|
||||
self.exploreButton.userInteractionEnabled = YES;
|
||||
if (model.prizeItemList.count > 0) {
|
||||
NSString * key = [NSString stringWithFormat:@"%@_%@", kSailingPrizeAlertKey, [AccountInfoStorage instance].getUid];
|
||||
if (![[NSUserDefaults standardUserDefaults] boolForKey:key] && model.prizeItemList.count > 0) {
|
||||
CGFloat height = 180;
|
||||
if (model.prizeItemList.count> 5) {
|
||||
height = height + 70 + 10;
|
||||
height = 255;
|
||||
}
|
||||
XPSailingPrizeView * prizeView = [[XPSailingPrizeView alloc] initWithFrame:CGRectMake(0, 0, 283, height)];
|
||||
prizeView.prizeItemList = model.prizeItemList;
|
||||
prizeView.prizeInfo = model;
|
||||
[TTPopup popupView:prizeView style:TTPopupStyleAlert];
|
||||
}
|
||||
|
||||
|
||||
[model.prizeItemList enumerateObjectsUsingBlock:^(RoomSailingPrizeModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
if (obj.prizeLevel > 2) {
|
||||
///取消所有的延迟加载的方法
|
||||
[NSObject cancelPreviousPerformRequestsWithTarget:self];
|
||||
|
||||
XPSailingGiftView * newAnimaView = [[XPSailingGiftView alloc] init];
|
||||
newAnimaView.prizeInfo = obj;
|
||||
NSString * giftTitle = [NSString stringWithFormat:@"%@ x %d", obj.prizeName, obj.prizeNum];
|
||||
CGFloat widht = [giftTitle boundingRectWithSize:CGSizeMake(200, CGFLOAT_MAX) options:NSStringDrawingUsesFontLeading | NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:10]} context:nil].size.width + 10;
|
||||
newAnimaView.frame = CGRectMake(0, 4 * (KitemHeight), widht, KitemHeight);
|
||||
[self.animationView addSubview:newAnimaView];
|
||||
|
||||
if (self.animationView.subviews.count > 5) {
|
||||
[self.animationView.subviews.firstObject removeFromSuperview];
|
||||
}
|
||||
for (int i=0; i < self.animationView.subviews.count; i++) {
|
||||
XPSailingGiftView * view = [self.animationView.subviews objectAtIndex:i];
|
||||
NSInteger offsetY= (self.animationView.subviews.count - i) * KitemHeight;
|
||||
[UIView animateWithDuration:0.1 animations:^{
|
||||
CGRect rect = view.frame;
|
||||
rect.origin.y = KitemHeight * 5 - offsetY;
|
||||
view.frame = rect;
|
||||
} completion:^(BOOL finished) {
|
||||
if (i == (self.animationView.subviews.count -1)) {
|
||||
[self.animationView.subviews enumerateObjectsUsingBlock:^(__kindof UIView * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
[self performSelector:@selector(giftViewRemoveFromSuperView:) withObject:obj afterDelay:3];
|
||||
}];
|
||||
}
|
||||
}];
|
||||
}
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)giftViewRemoveFromSuperView:(UIView *)view {
|
||||
[view removeFromSuperview];
|
||||
}
|
||||
|
||||
- (void)openSailingFail:(NSString *)message {
|
||||
[self.sailingView stopAnimation];
|
||||
self.sailingImageView.hidden = NO;
|
||||
self.exploreButton.userInteractionEnabled = YES;
|
||||
}
|
||||
|
||||
@@ -277,13 +385,24 @@
|
||||
|
||||
}];
|
||||
} else {
|
||||
NSString * roomUid = [NSString stringWithFormat:@""];
|
||||
self.sailingImageView.hidden = YES;
|
||||
[self startSailingSVGA];
|
||||
NSString * roomUid = self.roomUid;
|
||||
[self.presenter openSailing:roomUid sendMessage:YES keyNum:self.textField.text.integerValue];
|
||||
self.exploreButton.userInteractionEnabled = NO;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
- (void)boxButtonAction:(UIButton *)sender {
|
||||
sender.selected = !sender.selected;
|
||||
if (sender.selected) {
|
||||
NSString * key = [NSString stringWithFormat:@"%@_%@", kSailingPrizeAlertKey, [AccountInfoStorage instance].getUid];
|
||||
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:key];
|
||||
} else {
|
||||
NSString * key = [NSString stringWithFormat:@"%@_%@", kSailingPrizeAlertKey, [AccountInfoStorage instance].getUid];
|
||||
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:key];
|
||||
}
|
||||
}
|
||||
#pragma mark - NIMSystemNotificationManagerDelegate
|
||||
- (void)onReceiveCustomSystemNotification:(NIMCustomSystemNotification *)notification {
|
||||
if (notification.receiverType == NIMSessionTypeP2P) {
|
||||
@@ -310,7 +429,9 @@
|
||||
} else {
|
||||
self.addButton.enabled = YES;
|
||||
}
|
||||
self.textField.text = [self.levelArray objectAtIndex:_exploreCount];
|
||||
NSString * count = [self.levelArray objectAtIndex:_exploreCount];
|
||||
self.textField.text = count;
|
||||
self.consumLabel.text = [NSString stringWithFormat:@"消耗%@燃油连续探索", count];
|
||||
}
|
||||
|
||||
- (UIView *)topView {
|
||||
@@ -390,6 +511,7 @@
|
||||
[_fuleButton setTitle:@"0" forState:UIControlStateNormal];
|
||||
[_fuleButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
_fuleButton.titleLabel.font = [UIFont systemFontOfSize:10];
|
||||
_fuleButton.titleEdgeInsets = UIEdgeInsetsMake(0, 15, 0, 0);
|
||||
[_fuleButton setTitleColor:[ThemeColor colorWithHexString:@"#643B29"] forState:UIControlStateNormal];
|
||||
[_fuleButton setBackgroundImage:[UIImage imageNamed:@"room_sailing_rule_bg"] forState:UIControlStateNormal];
|
||||
}
|
||||
@@ -401,7 +523,7 @@
|
||||
_numberView = [[UIStackView alloc] init];
|
||||
_numberView.axis = UILayoutConstraintAxisHorizontal;
|
||||
_numberView.distribution = UIStackViewDistributionFill;
|
||||
_numberView.alignment = UIStackViewAlignmentCenter;
|
||||
_numberView.alignment = UIStackViewAlignmentFill;
|
||||
_numberView.spacing = 6;
|
||||
}
|
||||
return _numberView;
|
||||
@@ -428,6 +550,7 @@
|
||||
_addButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_addButton setImage:[UIImage imageNamed:@"room_sailing_add"] forState:UIControlStateNormal];
|
||||
[_addButton setImage:[UIImage imageNamed:@"room_sailing_add"] forState:UIControlStateSelected];
|
||||
[_addButton setEnlargeEdgeWithTop:10 right:10 bottom:10 left:10];
|
||||
[_addButton addTarget:self action:@selector(addButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _addButton;
|
||||
@@ -438,6 +561,7 @@
|
||||
_reduButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_reduButton setImage:[UIImage imageNamed:@"room_sailing_redu"] forState:UIControlStateNormal];
|
||||
[_reduButton setImage:[UIImage imageNamed:@"room_sailing_redu"] forState:UIControlStateSelected];
|
||||
[_reduButton setEnlargeEdgeWithTop:10 right:10 bottom:10 left:10];
|
||||
[_reduButton addTarget:self action:@selector(reduButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _reduButton;
|
||||
@@ -464,4 +588,72 @@
|
||||
return _consumLabel;
|
||||
}
|
||||
|
||||
- (UIView *)animationView {
|
||||
if (!_animationView) {
|
||||
_animationView = [[UIView alloc] init];
|
||||
_animationView.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
return _animationView;
|
||||
}
|
||||
|
||||
- (SVGAImageView *)sailingView {
|
||||
if (!_sailingView) {
|
||||
_sailingView = [[SVGAImageView alloc]init];
|
||||
_sailingView.backgroundColor = [UIColor clearColor];
|
||||
_sailingView.userInteractionEnabled = NO;
|
||||
}
|
||||
return _sailingView;
|
||||
}
|
||||
|
||||
- (SVGAParser *)parser {
|
||||
if (!_parser) {
|
||||
_parser = [[SVGAParser alloc]init];
|
||||
}
|
||||
return _parser;
|
||||
}
|
||||
|
||||
- (UIImageView *)sailingImageView {
|
||||
if (!_sailingImageView) {
|
||||
_sailingImageView = [[UIImageView alloc] init];
|
||||
_sailingImageView.userInteractionEnabled = YES;
|
||||
_sailingImageView.image = [UIImage imageNamed:@"room_sailing_sailing"];
|
||||
}
|
||||
return _sailingImageView;
|
||||
}
|
||||
|
||||
- (UIStackView *)tipsStackView {
|
||||
if (!_tipsStackView) {
|
||||
_tipsStackView = [[UIStackView alloc] init];
|
||||
_tipsStackView.axis = UILayoutConstraintAxisHorizontal;
|
||||
_tipsStackView.distribution = UIStackViewDistributionFill;
|
||||
_tipsStackView.alignment = UIStackViewAlignmentFill;
|
||||
_tipsStackView.spacing = 5;
|
||||
}
|
||||
return _tipsStackView;
|
||||
}
|
||||
|
||||
- (UIButton *)boxButton {
|
||||
if (!_boxButton) {
|
||||
_boxButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_boxButton setImage:[UIImage imageNamed:@"room_sailing_tips_normal"] forState:UIControlStateNormal];
|
||||
[_boxButton setImage:[UIImage imageNamed:@"room_sailing_tips_select"] forState:UIControlStateSelected];
|
||||
[_boxButton addTarget:self action:@selector(boxButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[_boxButton setEnlargeEdgeWithTop:10 right:10 bottom:10 left:10];
|
||||
NSString * key = [NSString stringWithFormat:@"%@_%@", kSailingPrizeAlertKey, [AccountInfoStorage instance].getUid];
|
||||
_boxButton.selected = ![[NSUserDefaults standardUserDefaults] boolForKey:key];
|
||||
}
|
||||
return _boxButton;
|
||||
}
|
||||
|
||||
- (UILabel *)tipLabel {
|
||||
if (!_tipLabel) {
|
||||
_tipLabel = [[UILabel alloc] init];
|
||||
_tipLabel.font = [UIFont systemFontOfSize:10];
|
||||
_tipLabel.textColor = UIColorFromRGB(0xE9C57B);
|
||||
_tipLabel.text = @"显示中奖窗口";
|
||||
}
|
||||
return _tipLabel;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
@@ -32,6 +32,8 @@
|
||||
#import "RoomFaceSendInfoModel.h"
|
||||
#import "MicroInviteExtModel.h"
|
||||
#import "Music+CoreDataClass.h"
|
||||
#import "RoomPKChooseUserModel.h"
|
||||
#import "RoomSailingPrizeModel.h"
|
||||
///View
|
||||
#import "XPRoomViewController.h"
|
||||
#import "XPNoteView.h"
|
||||
@@ -236,6 +238,21 @@ UIKIT_EXTERN NSString * kRoomBackMusicPlayMusicOrderKey;
|
||||
}
|
||||
}
|
||||
}
|
||||
}else if (attachment.first == CustomMessageType_Room_PK && attachment.second == Custom_Message_Sub_Room_PK_Manager_Up_Mic) {
|
||||
if (attachment.data && [attachment.data allKeys].count > 0) {
|
||||
for (NSDictionary * dic in [attachment.data allValues]) {
|
||||
RoomPKChooseUserModel * userModel = [RoomPKChooseUserModel modelWithDictionary:dic];
|
||||
if (userModel.groupType == GroupType_Red || userModel.groupType == GroupType_Blue) {
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
}
|
||||
return NO;
|
||||
} else if(attachment.first == CustomMessageType_Room_Sailing && (attachment.second == Custom_Message_Sub_Sailing_AllRoom_Notify || attachment.second == Custom_Message_Sub_Sailing_InRoom_NeedAllMicSend)) {
|
||||
RoomSailingPrizeModel * prizeModel = [RoomSailingPrizeModel modelWithDictionary:attachment.data];
|
||||
if (self.userInfo.userLevelVo.experLevelSeq > prizeModel.userLevelLimit) {
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
return [[[self supportMessageDic] objectForKey:@(attachment.first)] containsObject:@(attachment.second)];
|
||||
}
|
||||
@@ -333,7 +350,18 @@ UIKIT_EXTERN NSString * kRoomBackMusicPlayMusicOrderKey;
|
||||
@(CustomMessageType_LuckyBag):
|
||||
[NSSet setWithObjects:
|
||||
@(Custom_Message_Sub_Room_Gift_LuckBag_Server),
|
||||
nil]
|
||||
nil],
|
||||
@(CustomMessageType_Gift_Compound):
|
||||
[NSSet setWithObjects:@(Custom_Message_Sub_Gift_Compound),
|
||||
nil],
|
||||
@(CustomMessageType_Room_Sailing):
|
||||
[NSSet setWithObjects:
|
||||
@(Custom_Message_Sub_Sailing_Me),
|
||||
@(Custom_Message_Sub_Sailing_InRoom),
|
||||
@(Custom_Message_Sub_Sailing_AllRoom),
|
||||
@(Custom_Message_Sub_Sailing_AllRoom_Notify),
|
||||
@(Custom_Message_Sub_Sailing_InRoom_NeedAllMicSend),
|
||||
nil]
|
||||
};
|
||||
}
|
||||
|
||||
|
@@ -22,6 +22,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic,assign) NSInteger findNewbieCharmLevel;
|
||||
///送礼物隐藏座驾动画的值
|
||||
@property (nonatomic,assign) double hideCarEffectGiftPrice;
|
||||
//航海等级限制
|
||||
@property (nonatomic, assign) NSInteger linearlyPoolOpenLevel;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|