移植十二星主的内容

This commit is contained in:
fengshuo
2022-12-07 15:05:14 +08:00
parent bf0e4e651f
commit 942fc0639e
18 changed files with 434 additions and 54 deletions

View File

@@ -19,6 +19,7 @@
#import "XPHtmlUrl.h"
#import "AccountInfoStorage.h"
#import "NSArray+Safe.h"
#import "XCCurrentVCStackManager.h"
///Model
#import "GiftInfoModel.h"
#import "XPGiftCountModel.h"
@@ -35,7 +36,7 @@
#import "XPGraffitiGiftView.h"
#import "XPGiftHeadTypeView.h"
#import "XPGiftLuckyGiftBroadcastView.h"
#import "XPGiftWeekStarBroadcastView.h"
#import "XPGiftTwelveStarBroadcastView.h"
///P
#import "XPGiftProtocol.h"
///VC
@@ -44,7 +45,7 @@
#import "XPFirstRechargeViewController.h"
#import "XPNobleCenterViewController.h"
@interface XPSendGiftView ()< XPGiftBarViewDelegate, XPGiftProtocol, XPGiftInfoViewDelegate, XPGraffitiGiftViewDelegate, XPGiftUsersViewDelegate, XPGiftHeadTypeViewDelegate, XPGiftWeekStarBroadcastViewDelegate, XPGiftLuckyGiftBroadcastViewDelegate>
@interface XPSendGiftView ()< XPGiftBarViewDelegate, XPGiftProtocol, XPGiftInfoViewDelegate, XPGraffitiGiftViewDelegate, XPGiftUsersViewDelegate, XPGiftHeadTypeViewDelegate, XPGiftLuckyGiftBroadcastViewDelegate, XPGiftTwelveStarBroadcastViewDelegate>
///
@property (nonatomic,strong) UIView * topView;
///
@@ -55,8 +56,8 @@
@property (nonatomic,strong) UIStackView *stackView;
///广
@property (nonatomic, strong) XPGiftLuckyGiftBroadcastView *luckyBroadcastView;
///广
@property (nonatomic, strong) XPGiftWeekStarBroadcastView *weekStarBroadcastView;
///广
@property (nonatomic, strong) XPGiftTwelveStarBroadcastView *constellationBanner;
////
@property (nonatomic, strong) XPGiftHeadTypeView *headTypeView;
///
@@ -151,6 +152,7 @@
[self.presenter getNormalGiftList:self.roomUid];
[self.presenter getPackGiftList];
[self.presenter luckyGiftBroadcastRecord];
[self.presenter getTwelveStarLastRankFirst:self.roomUid];
}
#pragma mark - Send Custom Message
@@ -404,15 +406,17 @@
///
- (void)xPGiftBarViewDidClickRecharge:(XPGiftBarView *)view {
[self dismissViewControllerAnimated:YES completion:nil];
XPMineRechargeViewController * rechargeVC = [[XPMineRechargeViewController alloc] init];
[self.delegate.getCurrentNav pushViewController:rechargeVC animated:YES];
[self dismissViewControllerAnimated:NO completion:^{
XPMineRechargeViewController * rechargeVC = [[XPMineRechargeViewController alloc] init];
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:rechargeVC animated:YES];
}];
}
- (void)xPGiftBarViewDidClickFirstRecharge:(XPGiftBarView *)view {
[self dismissViewControllerAnimated:YES completion:nil];
XPFirstRechargeViewController * firstRechargeVC = [[XPFirstRechargeViewController alloc] initWithNavigation:self.delegate.getCurrentNav];
[self.delegate.getCurrentNav presentViewController:firstRechargeVC animated:YES completion:nil];
[self dismissViewControllerAnimated:NO completion:^{
XPFirstRechargeViewController * firstRechargeVC = [[XPFirstRechargeViewController alloc] initWithNavigation:self.delegate.getCurrentNav];
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController presentViewController:firstRechargeVC animated:YES completion:nil];
}];
}
#pragma mark - XPGiftLuckyGiftBroadcastViewDelegate
@@ -432,26 +436,30 @@
#pragma mark - XPGiftWeekStarBroadcastViewDelegate
///
- (void)xPGiftWeekStarBroadcastViewWeekStarClick {
[self dismissViewControllerAnimated:YES completion:nil];
XPWebViewController * webVC = [[XPWebViewController alloc] init];
webVC.roomUid = self.roomUid;
webVC.url = URLWithType(kNewWeekStarURL);
[self.delegate.getCurrentNav pushViewController:webVC animated:YES];
[self dismissViewControllerAnimated:NO completion:^{
XPWebViewController * webVC = [[XPWebViewController alloc] init];
webVC.roomUid = self.roomUid;
webVC.url = URLWithType(kNewWeekStarURL);
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webVC animated:YES];
}];
}
#pragma mark - XPGiftHeadTypeViewDelegate
///
- (void)xPGiftHeadTypeViewDidClickNoble:(XPGiftHeadTypeView *)view {
[self dismissViewControllerAnimated:YES completion:nil];
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventvipEntranceGiftClick];
XPNobleCenterViewController * nobleVC = [[XPNobleCenterViewController alloc] initWithRoomUid:self.delegate.getRoomInfo.uid];
[self.delegate.getCurrentNav pushViewController:nobleVC animated:YES];
[self dismissViewControllerAnimated:NO completion:^{
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventvipEntranceGiftClick];
XPNobleCenterViewController * nobleVC = [[XPNobleCenterViewController alloc] initWithRoomUid:self.delegate.getRoomInfo.uid];
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:nobleVC animated:YES];
}];
}
///
- (void)xPGiftHeadTypeViewDidClickFirstRecharge:(XPGiftHeadTypeView *)view {
[self dismissViewControllerAnimated:YES completion:nil];
XPFirstRechargeViewController * firstRechargeVC = [[XPFirstRechargeViewController alloc] initWithNavigation:self.delegate.getCurrentNav];
[self.delegate.getCurrentNav presentViewController:firstRechargeVC animated:YES completion:nil];
[self dismissViewControllerAnimated:NO completion:^{
XPFirstRechargeViewController * firstRechargeVC = [[XPFirstRechargeViewController alloc] initWithNavigation:[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController];
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController presentViewController:firstRechargeVC animated:YES completion:nil];
}];
}
///
- (void)xPGiftHeadTypeViewDidClickGift:(XPGiftHeadTypeView *)view {
@@ -478,7 +486,7 @@
self.giftBarView.type = type;
self.giftBarView.drawGiftCount = 0;
if (type == GiftSegmentType_Lucky) {
[self.weekStarBroadcastView removeFromSuperview];
[self.constellationBanner removeFromSuperview];
// self.presenter
if (!self.luckyBroadcastView.superview) {
[self.view addSubview:self.luckyBroadcastView];
@@ -490,26 +498,20 @@
}
} else if(type == GiftSegmentType_WeekStar) {
[self.luckyBroadcastView removeFromSuperview];
if (!self.weekStarBroadcastView.superview) {
[self.view addSubview:self.weekStarBroadcastView];
[self.weekStarBroadcastView mas_makeConstraints:^(MASConstraintMaker *make) {
if (!self.constellationBanner.superview) {
[self.view addSubview:self.constellationBanner];
[self.constellationBanner mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self.contentView.mas_top);
make.left.right.mas_equalTo(0);
make.height.mas_equalTo(56);
make.height.mas_equalTo(75);
}];
}
} else {
[self.luckyBroadcastView removeFromSuperview];
[self.weekStarBroadcastView removeFromSuperview];
[self.constellationBanner removeFromSuperview];
}
}
///
- (void)xpGiftInfoViewDidClickWeekStarGift:(GiftInfoModel *)info {
self.weekStarBroadcastView.giftInfo = info;
}
- (void)xPGiftInfoView:(XPGiftInfoView *)view didClickItem:(GiftInfoModel *)info type:(GiftSegmentType)type {
if (type == GiftSegmentType_Graffiti) {
self.giftInfoView.hidden = YES;
@@ -554,6 +556,15 @@
self.giftBarView.drawGiftCount = self.graffitiPoint.count;
}
#pragma mark - XPGiftTwelveStarBroadcastViewDelegate
- (void)xPGiftTwelveStarBroadcastView:(XPGiftTwelveStarBroadcastView *)view didClickDetail:(UIButton *)sender {
[self dismissViewControllerAnimated:NO completion:^{
XPWebViewController * webVC = [[XPWebViewController alloc] init];
webVC.url = URLWithType(kXinZuoStarURL);
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webVC animated:YES];
}];
}
#pragma mark - XPGiftProtocol
- (void)onGetUserInfoSuccess:(UserInfoModel *)userInfo {
self.headTypeView.isShowFirstRecharge = userInfo.isFirstCharge;
@@ -633,9 +644,10 @@
///
- (void)showNotSufficientFundsWithToast:(NSString *)msg {
if (self.delegate.getUserInfo.isFirstCharge) {
[self dismissViewControllerAnimated:YES completion:nil];
XPFirstRechargeViewController * firstRechargeVC = [[XPFirstRechargeViewController alloc] initWithNavigation:self.delegate.getCurrentNav];
[self.delegate.getCurrentNav presentViewController:firstRechargeVC animated:YES completion:nil];
[self dismissViewControllerAnimated:NO completion:^{
XPFirstRechargeViewController * firstRechargeVC = [[XPFirstRechargeViewController alloc] initWithNavigation:XCCurrentVCStackManager.shareManager.getCurrentVC.navigationController];
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController presentViewController:firstRechargeVC animated:YES completion:nil];
}];
} else {
[self showErrorToast:msg];
}
@@ -647,6 +659,10 @@
self.luckyBroadcastView.records = records;
}
- (void)getTwelveStarLastRankFirstSuccess:(GiftTwelveStarFirstModel *)model {
self.constellationBanner.giftInfo = model;
}
#pragma mark - Event Response
- (void)disMissViewRecognizer:(UITapGestureRecognizer *)tap {
[self dismissViewControllerAnimated:YES completion:nil];
@@ -762,12 +778,12 @@
return _luckyBroadcastView;
}
- (XPGiftWeekStarBroadcastView *)weekStarBroadcastView {
if (!_weekStarBroadcastView) {
_weekStarBroadcastView = [[XPGiftWeekStarBroadcastView alloc] init];
_weekStarBroadcastView.delegate = self;
- (XPGiftTwelveStarBroadcastView *)constellationBanner {
if (!_constellationBanner) {
_constellationBanner = [[XPGiftTwelveStarBroadcastView alloc] init];
_constellationBanner.delegate = self;
}
return _weekStarBroadcastView;
return _constellationBanner;
}
- (UIVisualEffectView *)effectView {