提交
This commit is contained in:
@@ -40,12 +40,14 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
||||
@interface QXEffectContentView : UIView
|
||||
@property (nonatomic,assign) BOOL isShow;
|
||||
@property (nonatomic,assign) BOOL isOnece;
|
||||
@property (nonatomic,strong) VAPView *playerMp4View;
|
||||
@property (nonatomic, strong) dispatch_queue_t queue;
|
||||
-(void)previewEffectWith:(NSString *)play_image;
|
||||
- (void)displayEffectView:(NSString *)play_image;
|
||||
- (void)displayEffectViewWithMorePlayImages:(NSArray *)playImages;
|
||||
- (void)openOrCloseEffectViewWith:(BOOL)isShow;
|
||||
@property (nonatomic,assign) BOOL isShow;
|
||||
- (void)destroyEffectView;
|
||||
-(void)stopPlay;
|
||||
-(void)startPlay;
|
||||
|
||||
@@ -280,6 +280,35 @@ static NSString *PLAY_IMAGE = @"play_image";
|
||||
}
|
||||
});
|
||||
}
|
||||
-(void)previewEffectWith:(NSString *)play_image{
|
||||
self.isOnece = YES;
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if ([play_image hasSuffix:@"mp4"]) {
|
||||
__weak typeof(self)weakSelf = self;
|
||||
/// mp4格式下载播放
|
||||
[[QXRequset shareInstance] downloadVideoPlayerWithUrl:play_image completion:^(BOOL result, NSString * _Nonnull fileName) {
|
||||
NSString *videoPath = [QXFileManager getGiftVideoPath:fileName];
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
weakSelf.playerMp4View.hidden = NO;
|
||||
weakSelf.svagView.hidden = YES;
|
||||
});
|
||||
[weakSelf.playerMp4View stopHWDMP4];
|
||||
[weakSelf.playerMp4View playHWDMP4:videoPath delegate:self];
|
||||
}];
|
||||
}else if ([play_image hasSuffix:@"svg"] || [play_image hasSuffix:@"svga"]) {
|
||||
__weak typeof(self)weakSelf = self;
|
||||
/// svga下载播放
|
||||
[[QXRequset shareInstance] downloadVideoPlayerWithUrl:play_image completion:^(BOOL result, NSString * _Nonnull fileName) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
weakSelf.playerMp4View.hidden = YES;
|
||||
weakSelf.svagView.hidden = NO;
|
||||
});
|
||||
NSString *filePath = [QXFileManager getGiftVideoPath:fileName];
|
||||
[weakSelf.svagView loadSVGAPlayerWith:filePath];
|
||||
}];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
- (void)openOrCloseEffectViewWith:(BOOL)isShow {
|
||||
_isShow = isShow;
|
||||
@@ -307,9 +336,13 @@ static NSString *PLAY_IMAGE = @"play_image";
|
||||
[self loadStartSVGAPlayer];
|
||||
}
|
||||
-(void)viewDidFinishPlayMP4:(NSInteger)totalFrameCount view:(VAPView *)container{
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
self.playerMp4View.hidden = YES;
|
||||
});
|
||||
if (self.isOnece) {
|
||||
return;
|
||||
}
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self loadStartSVGAPlayer];
|
||||
});
|
||||
@@ -318,6 +351,9 @@ static NSString *PLAY_IMAGE = @"play_image";
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
self.playerMp4View.hidden = YES;
|
||||
});
|
||||
if (self.isOnece) {
|
||||
return;
|
||||
}
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self loadStartSVGAPlayer];
|
||||
});
|
||||
@@ -417,6 +453,9 @@ static NSString *PLAY_IMAGE = @"play_image";
|
||||
__weak typeof(self)weakSelf = self;
|
||||
_svagView.didFinishedDisplay = ^(QXEffectSvgaView * _Nonnull svgaView) {
|
||||
[svgaView destroySvga];
|
||||
if (weakSelf.isOnece) {
|
||||
return;
|
||||
}
|
||||
[weakSelf loadEndSvgaPlayer];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -497,6 +497,9 @@
|
||||
MJWeakSelf
|
||||
[QXLoginNetwork loginAccountWithUser_login:user_login successBlock:^(QXLoginModel * _Nonnull loginModel) {
|
||||
hideLoadingInView(self.view);
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:loginModel.is_can_chat forKey:kIsCanChat];
|
||||
[[NSUserDefaults standardUserDefaults] setObject:loginModel.can_chat_money forKey:kIsCanChatMoney];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
[[QXGlobal shareGlobal] saveLoginData:[loginModel yy_modelToJSONString]];
|
||||
AppDelegate *delegate = (AppDelegate*)[UIApplication sharedApplication].delegate;
|
||||
[delegate tencentLogin];
|
||||
|
||||
@@ -36,6 +36,10 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic,strong)NSString *dress;
|
||||
/// 各种卡片
|
||||
@property (nonatomic,strong)NSArray *icon;
|
||||
/// 1 能聊天 0不能聊天
|
||||
@property (nonatomic,assign)NSInteger is_can_chat;
|
||||
/// 需要充值金额
|
||||
@property (nonatomic,strong)NSString* can_chat_money;
|
||||
@end
|
||||
|
||||
|
||||
|
||||
@@ -9,12 +9,14 @@
|
||||
#import "QXDressCell.h"
|
||||
#import "QXMineNetwork.h"
|
||||
#import "QXSeatHeaderView.h"
|
||||
#import "QXGiftPlayerManager.h"
|
||||
|
||||
@interface QXDressSubViewController ()<UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout>
|
||||
@property (nonatomic,strong)QXSeatHeaderView *headerImageView;
|
||||
@property (nonatomic,strong)UICollectionView *collectionView;
|
||||
@property (nonatomic,strong)UIButton *commitBtn;
|
||||
@property (nonatomic,assign)NSInteger selectedIndex;
|
||||
@property (nonatomic,strong)QXEffectContentView *fullEffectView;
|
||||
@end
|
||||
|
||||
@implementation QXDressSubViewController
|
||||
@@ -40,6 +42,7 @@
|
||||
}
|
||||
[self.view addSubview:self.collectionView];
|
||||
[self.view addSubview:self.commitBtn];
|
||||
[self.view addSubview:self.fullEffectView];
|
||||
}
|
||||
|
||||
-(void)getData{
|
||||
@@ -84,7 +87,10 @@
|
||||
self.selectedIndex = indexPath.row;
|
||||
[collectionView reloadData];
|
||||
// MJWeakSelf
|
||||
|
||||
if ([self.model.id isEqualToString:@"2"]) {
|
||||
self.fullEffectView.hidden = NO;
|
||||
[self.fullEffectView previewEffectWith:model.play_image];
|
||||
}
|
||||
[self.headerImageView setHeadIcon:[QXGlobal shareGlobal].loginModel.avatar dress:model.play_image];
|
||||
|
||||
}
|
||||
@@ -144,4 +150,12 @@
|
||||
}
|
||||
return _headerImageView;
|
||||
}
|
||||
- (QXEffectContentView *)fullEffectView {
|
||||
if (!_fullEffectView) {
|
||||
_fullEffectView = [[QXEffectContentView alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
||||
_fullEffectView.queue = dispatch_queue_create("qx_room_full_preview_message.com", NULL);
|
||||
_fullEffectView.hidden = YES;
|
||||
}
|
||||
return _fullEffectView;
|
||||
}
|
||||
@end
|
||||
|
||||
@@ -39,6 +39,10 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic,strong)NSString *is_use_code;
|
||||
/// 在线状态
|
||||
@property (nonatomic,assign)BOOL is_online;
|
||||
/// 1 能聊天 0不能聊天
|
||||
@property (nonatomic,assign)NSInteger is_can_chat;
|
||||
/// 需要充值金额
|
||||
@property (nonatomic,strong)NSString* can_chat_money;
|
||||
@end
|
||||
|
||||
|
||||
|
||||
@@ -1040,6 +1040,13 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
+(void)roomGiftBagPricesuccessBlock:(void (^)(NSString* price))successBlock
|
||||
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
|
||||
|
||||
/**
|
||||
用户重连
|
||||
*/
|
||||
+(void)roomUserReconnectWithRoomId:(NSString*)roomId
|
||||
successBlock:(void (^)(NSDictionary* dict))successBlock
|
||||
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
@@ -18,6 +18,9 @@
|
||||
[QXGlobal shareGlobal].loginModel.dress = userModel.dress;
|
||||
[QXGlobal shareGlobal].loginModel.auth = userModel.auth.intValue;
|
||||
[[QXGlobal shareGlobal] updateUserInfoWithMolde:[QXGlobal shareGlobal].loginModel];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:userModel.is_can_chat forKey:kIsCanChat];
|
||||
[[NSUserDefaults standardUserDefaults] setObject:userModel.can_chat_money forKey:kIsCanChatMoney];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
if (successBlock) {
|
||||
successBlock(userModel);
|
||||
}
|
||||
@@ -2045,4 +2048,19 @@
|
||||
failBlock(error,msg);
|
||||
}];
|
||||
}
|
||||
|
||||
+(void)roomUserReconnectWithRoomId:(NSString*)roomId
|
||||
successBlock:(void (^)(NSDictionary* dict))successBlock
|
||||
failBlock:(void (^)(NSError * error, NSString * msg))failBlock{
|
||||
NSDictionary *parameters =@{
|
||||
@"room_id":roomId?roomId:@"",
|
||||
};
|
||||
[[QXRequset shareInstance] postWithUrl:QXRoomUserReconnect parameters:parameters needCache:NO success:^(id responseObject) {
|
||||
if (successBlock) {
|
||||
successBlock(responseObject[@"data"]);
|
||||
}
|
||||
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
|
||||
failBlock(error,msg);
|
||||
}];
|
||||
}
|
||||
@end
|
||||
|
||||
@@ -74,6 +74,14 @@
|
||||
-(void)onConnectSuccess{
|
||||
// showToast(@"腾讯重连服务器成功");
|
||||
// NSLog(@"腾讯重连服务器成功");
|
||||
if ([QXGlobal.shareGlobal.roomId isExist]) {
|
||||
return;
|
||||
}
|
||||
[QXMineNetwork roomUserReconnectWithRoomId:QXGlobal.shareGlobal.roomId successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
-(void)onConnecting{
|
||||
// NSLog(@"腾讯重连服务器中");
|
||||
|
||||
@@ -104,6 +104,10 @@ static NSString *const kIsOpenRecharge = @"kIsOpenRecharge";
|
||||
static NSString *const kChirldLocalPassword = @"kChirldLocalPassword";
|
||||
/// 是否开启飘屏
|
||||
static NSString *const kIsCloseDrifPop = @"kIsCloseDrifPop";
|
||||
/// 是否可以聊天
|
||||
static NSString *const kIsCanChat = @"kIsCanChat";
|
||||
/// 充值多少钱可以聊天
|
||||
static NSString *const kIsCanChatMoney = @"kIsCanChatMoney";
|
||||
|
||||
|
||||
// 微信登录
|
||||
|
||||
@@ -437,4 +437,8 @@ static NSString * QXRoomGiftBagClear = @"api/Room/room_gift_all_clear";
|
||||
/// 背包礼物价值
|
||||
static NSString * QXRoomGiftBagPrice = @"api/UserGiftPack/get_gift_pack_list_count";
|
||||
|
||||
/// 腾讯重连成功后更新在线列表
|
||||
static NSString * QXRoomUserReconnect = @"api/Room/user_reconnect";
|
||||
|
||||
|
||||
#endif /* Api_h */
|
||||
|
||||
@@ -17,6 +17,13 @@ typedef NS_ENUM(NSInteger) {
|
||||
/// 抽100次
|
||||
QXMeetDrawBtnTypeHundred = 100,
|
||||
}QXMeetDrawBtnType;
|
||||
|
||||
@protocol QXMeetActivityViewDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
-(void)timeDownDidFinished;
|
||||
|
||||
@end
|
||||
@interface QXMeetActivityView : UIView
|
||||
-(void)showInView:(UIView *)view;
|
||||
@property (nonatomic,strong)NSString *roomId;
|
||||
@@ -42,6 +49,8 @@ typedef NS_ENUM(NSInteger) {
|
||||
@property (nonatomic,assign)long long startTime;
|
||||
|
||||
@property (nonatomic,strong)QXTimer *timer;
|
||||
|
||||
@property (nonatomic,weak)id<QXMeetActivityViewDelegate>delegate;
|
||||
@end
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
#import "QXMeetLotteryView.h"
|
||||
#import "QXDiamondViewController.h"
|
||||
@interface QXMeetActivityView()<UIGestureRecognizerDelegate,QXMeetLotteryViewDelegate>
|
||||
@interface QXMeetActivityView()<UIGestureRecognizerDelegate,QXMeetLotteryViewDelegate,QXMeetActivityViewDelegate>
|
||||
@property (nonatomic,strong)UIView *bgView;
|
||||
@property (nonatomic,strong)UIImageView *bgImageView;
|
||||
/// 奖池
|
||||
@@ -146,6 +146,7 @@
|
||||
[self.bgView addSubview:self.recordBtn];
|
||||
|
||||
self.timeDownView = [[QXMeetTimeDownView alloc] initWithFrame:CGRectMake((self.bgView.width-ScaleWidth(122))/2, self.rankBtn.top-4, ScaleWidth(122), ScaleWidth(29))];
|
||||
self.timeDownView.delegate = self;
|
||||
[self.bgView addSubview:self.timeDownView];
|
||||
|
||||
self.giftImageView = [[UIImageView alloc] initWithFrame:CGRectMake((self.bgView.width-ScaleWidth(118))/2, self.timeDownView.bottom+11, ScaleWidth(118), ScaleWidth(118))];
|
||||
@@ -325,6 +326,9 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
-(void)timeDownDidFinished{
|
||||
[self hide];
|
||||
}
|
||||
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{
|
||||
return touch.view == self;
|
||||
}
|
||||
@@ -624,10 +628,10 @@
|
||||
|
||||
NSString *time = [NSString stringWithFormat:@"%02ld%02ld",min,second];
|
||||
if (time.length == 4) {
|
||||
self.timeLabel1.text = [time substringWithRange:NSMakeRange(0, 1)];
|
||||
self.timeLabel2.text = [time substringWithRange:NSMakeRange(1, 1)];
|
||||
self.timeLabel3.text = [time substringWithRange:NSMakeRange(2, 1)];
|
||||
self.timeLabel4.text = [time substringWithRange:NSMakeRange(3, 1)];
|
||||
weakSelf.timeLabel1.text = [time substringWithRange:NSMakeRange(0, 1)];
|
||||
weakSelf.timeLabel2.text = [time substringWithRange:NSMakeRange(1, 1)];
|
||||
weakSelf.timeLabel3.text = [time substringWithRange:NSMakeRange(2, 1)];
|
||||
weakSelf.timeLabel4.text = [time substringWithRange:NSMakeRange(3, 1)];
|
||||
}
|
||||
if (weakSelf.startTime<=0) {
|
||||
[weakSelf stopTimer];
|
||||
@@ -635,6 +639,9 @@
|
||||
weakSelf.timeLabel2.text = @"0";
|
||||
weakSelf.timeLabel3.text = @"0";
|
||||
weakSelf.timeLabel4.text = @"0";
|
||||
if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(timeDownDidFinished)]) {
|
||||
[weakSelf.delegate timeDownDidFinished];
|
||||
}
|
||||
}
|
||||
});
|
||||
}];
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
self.scrollView.showsHorizontalScrollIndicator = NO;
|
||||
self.scrollView.showsVerticalScrollIndicator = NO;
|
||||
self.scrollView.scrollEnabled = YES;
|
||||
self.scrollView.hidden = YES;
|
||||
// self.scrollView.hidden = YES;
|
||||
self.scrollView.decelerationRate = UIScrollViewDecelerationRateFast;
|
||||
[self addSubview:self.scrollView];
|
||||
_itemSpace = 25;
|
||||
@@ -76,7 +76,7 @@
|
||||
}
|
||||
|
||||
-(void)startLotteryAnimation{
|
||||
self.scrollView.hidden = NO;
|
||||
// self.scrollView.hidden = NO;
|
||||
[self.scrollView setContentOffset:CGPointZero animated:NO];
|
||||
MJWeakSelf
|
||||
[UIView animateWithDuration:6 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
|
||||
|
||||
Reference in New Issue
Block a user