房间心愿除了特效礼物都完成了
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
#import "XPRoomMiniManager.h"
|
||||
#import "Api+RoomPK.h"
|
||||
#import "Api+Room.h"
|
||||
#import "Api+WishGift.h"
|
||||
#import "StatisticsServiceHelper.h"
|
||||
///Model
|
||||
#import "RoomInfoModel.h"
|
||||
@@ -48,6 +49,7 @@
|
||||
#import "GiftInfoModel.h"
|
||||
#import "RoomPKTeamModel.h"
|
||||
#import "RoomNewUserGreetModel.h"
|
||||
#import "WishGiftInfoModel.h"
|
||||
///View
|
||||
#import "XPRoomHalfWebView.h"
|
||||
#import "XPAnchorAudienceUpMicView.h"
|
||||
@@ -78,6 +80,7 @@
|
||||
#import "XPAcrossRoomPKCountDownView.h"
|
||||
#import "XPNewUserRoomGiftView.h"
|
||||
#import "XPWishGiftViewController.h"
|
||||
#import "XPWishGiftEnterView.h"
|
||||
///个播PK
|
||||
#import "XPAnchorFansTeamEntranceView.h"
|
||||
#import "XPAnchorFansTeamViewController.h"
|
||||
@@ -86,7 +89,7 @@
|
||||
#import "XPWebViewController.h"
|
||||
#import "XPRoomPKProgressView.h"
|
||||
|
||||
@interface XPRoomFunctionContainerView ()<XPAcrpssRoomPKPanelViewDelegate, XPRoomLittleGameListViewDelegate, XPAnchorPkPanelViewDelegate, XPRoomBackMusicPlayerViewDelegate, XPRoomNewUserGreetViewDelegate>
|
||||
@interface XPRoomFunctionContainerView ()<XPAcrpssRoomPKPanelViewDelegate, XPRoomLittleGameListViewDelegate, XPAnchorPkPanelViewDelegate, XPRoomBackMusicPlayerViewDelegate, XPRoomNewUserGreetViewDelegate, XPWishGiftViewControllerDelegate>
|
||||
///host 代理
|
||||
@property (nonatomic,weak) id<RoomHostDelegate>delegate;
|
||||
///房间榜
|
||||
@@ -135,9 +138,8 @@
|
||||
@property (nonatomic,assign) BOOL isLoadGreet;
|
||||
///获取新用户礼物倒计时3s
|
||||
@property (nonatomic, strong) dispatch_source_t userGiftTimer;
|
||||
|
||||
///许愿礼物
|
||||
@property (nonatomic,strong) UIView *wishGiftView;
|
||||
@property (nonatomic,strong) XPWishGiftEnterView *wishGiftView;
|
||||
|
||||
@end
|
||||
|
||||
@@ -237,8 +239,6 @@
|
||||
[self addSubview:self.topicStackView];
|
||||
[self.topicStackView addArrangedSubview:self.topicLabel];
|
||||
[self.topicStackView addArrangedSubview:self.editButton];
|
||||
|
||||
[self addSubview:self.wishGiftView];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
@@ -254,12 +254,6 @@
|
||||
make.height.mas_equalTo(15);
|
||||
make.top.mas_equalTo(50 + 5 + 6 + 12 + 3 + kNavigationHeight);
|
||||
}];
|
||||
|
||||
[self.wishGiftView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(100, 40));
|
||||
make.right.mas_equalTo(self);
|
||||
make.top.mas_equalTo(self).offset(kNavigationHeight + 50);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)showLittleGameMiniView:(RoomType)type micCount:(NSInteger)micCount {
|
||||
@@ -606,6 +600,8 @@
|
||||
[self handleNewUserGreet];
|
||||
///新用户房间礼物
|
||||
[self handleNewUserRoomGift];
|
||||
///房间心愿礼物
|
||||
[self configWishGiftEnter];
|
||||
}
|
||||
|
||||
- (void)onRoomMiniEntered {
|
||||
@@ -1651,10 +1647,50 @@
|
||||
- (void)tapWishGift {
|
||||
NSString * roomUid = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.uid];
|
||||
XPWishGiftViewController * vc = [[XPWishGiftViewController alloc] initWithRoomUid:roomUid];
|
||||
vc.delegate = self;
|
||||
vc.modalPresentationStyle = UIModalPresentationOverFullScreen;
|
||||
[self.delegate.getCurrentNav presentViewController:vc animated:YES completion:nil];
|
||||
}
|
||||
|
||||
- (void)configWishGiftEnter {
|
||||
RoomInfoModel * roomInfo = self.delegate.getRoomInfo;
|
||||
NSString * roomUid = [NSString stringWithFormat:@"%ld", roomInfo.uid];
|
||||
roomInfo.hasOpenWishGift = YES;
|
||||
if (roomInfo.hasOpenWishGift) {
|
||||
if (!self.wishGiftView.superview) {
|
||||
[self addSubview:self.wishGiftView];
|
||||
[self.wishGiftView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self).offset(kNavigationHeight + 47);
|
||||
make.right.mas_equalTo(self.mas_right).offset(0);
|
||||
make.size.mas_equalTo(CGSizeMake(81, 30));
|
||||
}];
|
||||
}
|
||||
[Api wishGiftList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
if (code == 200) {
|
||||
NSArray * array = [WishGiftInfoModel modelsWithArray:data.data];
|
||||
self.wishGiftView.giftList = array;
|
||||
self.wishGiftView.hidden = NO;
|
||||
} else {
|
||||
self.wishGiftView.hidden = YES;
|
||||
}
|
||||
} roomUid:roomUid];
|
||||
} else {
|
||||
if (self.wishGiftView.superview) {
|
||||
[self.wishGiftView removeFromSuperview];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)xPWishGiftViewControllerSendClick:(NSString *)giftId {
|
||||
NSString * roomUid = [NSString stringWithFormat:@"%ld", [self.delegate getRoomInfo].uid];
|
||||
XPSendGiftView * giftView = [[XPSendGiftView alloc] initWithType:SendGiftType_Room uid:roomUid];
|
||||
giftView.delegate = self.delegate;
|
||||
NSArray * giftUses = [self configGiftUsers:[self.delegate getMicroQueue]];
|
||||
[giftView configGiftUsers:giftUses];
|
||||
giftView.selectGiftId = giftId;
|
||||
[self.delegate.getCurrentNav presentViewController:giftView animated:YES completion:nil];
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (XPRoomRankEntranceView *)contributeEnterView {
|
||||
if (!_contributeEnterView) {
|
||||
@@ -1817,10 +1853,9 @@
|
||||
return _acrossPKCountView;
|
||||
}
|
||||
|
||||
- (UIView *)wishGiftView {
|
||||
- (XPWishGiftEnterView *)wishGiftView {
|
||||
if (!_wishGiftView) {
|
||||
_wishGiftView = [[UIView alloc] init];
|
||||
_wishGiftView.backgroundColor = [UIColor clearColor];
|
||||
_wishGiftView = [[XPWishGiftEnterView alloc] init];
|
||||
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapWishGift)];
|
||||
[_wishGiftView addGestureRecognizer:tap];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user