礼物面板修改

This commit is contained in:
chenguilong
2022-09-29 18:39:08 +08:00
parent f4102596c0
commit 4be9c07a82
4 changed files with 247 additions and 1 deletions

View File

@@ -173,6 +173,7 @@
9B46B91728DDA893000E30DB /* XPHomeRedommendCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B46B91628DDA893000E30DB /* XPHomeRedommendCollectionViewCell.m */; }; 9B46B91728DDA893000E30DB /* XPHomeRedommendCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B46B91628DDA893000E30DB /* XPHomeRedommendCollectionViewCell.m */; };
9B4769AD28DB270F00CCD312 /* XPHomePartyNavView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B4769AC28DB270F00CCD312 /* XPHomePartyNavView.m */; }; 9B4769AD28DB270F00CCD312 /* XPHomePartyNavView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B4769AC28DB270F00CCD312 /* XPHomePartyNavView.m */; };
9B4D148127E485EB000AA0C1 /* XPRoomTrumpetView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B4D148027E485EB000AA0C1 /* XPRoomTrumpetView.m */; }; 9B4D148127E485EB000AA0C1 /* XPRoomTrumpetView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B4D148027E485EB000AA0C1 /* XPRoomTrumpetView.m */; };
9B4E920028E57A620033419E /* XPGiftHeadTypeView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B4E91FF28E57A620033419E /* XPGiftHeadTypeView.m */; };
9B53D57A28E2CF18005187A3 /* XPTeenagerHomeView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B53D57928E2CF18005187A3 /* XPTeenagerHomeView.m */; }; 9B53D57A28E2CF18005187A3 /* XPTeenagerHomeView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B53D57928E2CF18005187A3 /* XPTeenagerHomeView.m */; };
9B5BF8A827E1BED1005DD346 /* Api+RoomTrumpet.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B5BF8A727E1BED1005DD346 /* Api+RoomTrumpet.m */; }; 9B5BF8A827E1BED1005DD346 /* Api+RoomTrumpet.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B5BF8A727E1BED1005DD346 /* Api+RoomTrumpet.m */; };
9B5F1503280FF02600C3C2B1 /* anchorPk_crossPking.svga in Resources */ = {isa = PBXBuildFile; fileRef = 9B5F1502280FF02600C3C2B1 /* anchorPk_crossPking.svga */; }; 9B5F1503280FF02600C3C2B1 /* anchorPk_crossPking.svga in Resources */ = {isa = PBXBuildFile; fileRef = 9B5F1502280FF02600C3C2B1 /* anchorPk_crossPking.svga */; };
@@ -1517,6 +1518,8 @@
9B4769AC28DB270F00CCD312 /* XPHomePartyNavView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHomePartyNavView.m; sourceTree = "<group>"; }; 9B4769AC28DB270F00CCD312 /* XPHomePartyNavView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHomePartyNavView.m; sourceTree = "<group>"; };
9B4D147F27E485EB000AA0C1 /* XPRoomTrumpetView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomTrumpetView.h; sourceTree = "<group>"; }; 9B4D147F27E485EB000AA0C1 /* XPRoomTrumpetView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomTrumpetView.h; sourceTree = "<group>"; };
9B4D148027E485EB000AA0C1 /* XPRoomTrumpetView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomTrumpetView.m; sourceTree = "<group>"; }; 9B4D148027E485EB000AA0C1 /* XPRoomTrumpetView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomTrumpetView.m; sourceTree = "<group>"; };
9B4E91FE28E57A620033419E /* XPGiftHeadTypeView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPGiftHeadTypeView.h; sourceTree = "<group>"; };
9B4E91FF28E57A620033419E /* XPGiftHeadTypeView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPGiftHeadTypeView.m; sourceTree = "<group>"; };
9B53D57828E2CF18005187A3 /* XPTeenagerHomeView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPTeenagerHomeView.h; sourceTree = "<group>"; }; 9B53D57828E2CF18005187A3 /* XPTeenagerHomeView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPTeenagerHomeView.h; sourceTree = "<group>"; };
9B53D57928E2CF18005187A3 /* XPTeenagerHomeView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPTeenagerHomeView.m; sourceTree = "<group>"; }; 9B53D57928E2CF18005187A3 /* XPTeenagerHomeView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPTeenagerHomeView.m; sourceTree = "<group>"; };
9B5BF8A627E1BED1005DD346 /* Api+RoomTrumpet.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Api+RoomTrumpet.h"; sourceTree = "<group>"; }; 9B5BF8A627E1BED1005DD346 /* Api+RoomTrumpet.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Api+RoomTrumpet.h"; sourceTree = "<group>"; };
@@ -6612,6 +6615,8 @@
E8788949273A594C00BF1D57 /* Cell */, E8788949273A594C00BF1D57 /* Cell */,
E8788932273A53D700BF1D57 /* XPSendGiftView.h */, E8788932273A53D700BF1D57 /* XPSendGiftView.h */,
E8788933273A53D700BF1D57 /* XPSendGiftView.m */, E8788933273A53D700BF1D57 /* XPSendGiftView.m */,
9B4E91FE28E57A620033419E /* XPGiftHeadTypeView.h */,
9B4E91FF28E57A620033419E /* XPGiftHeadTypeView.m */,
E8788940273A55AD00BF1D57 /* XPGiftUsersView.h */, E8788940273A55AD00BF1D57 /* XPGiftUsersView.h */,
E8788941273A55AD00BF1D57 /* XPGiftUsersView.m */, E8788941273A55AD00BF1D57 /* XPGiftUsersView.m */,
E8788943273A55C200BF1D57 /* XPGiftInfoView.h */, E8788943273A55C200BF1D57 /* XPGiftInfoView.h */,
@@ -9699,6 +9704,7 @@
9BCF586227995426008401A4 /* XPSkillCardSelectPropCell.m in Sources */, 9BCF586227995426008401A4 /* XPSkillCardSelectPropCell.m in Sources */,
9B64BCB028E2A3D900778F13 /* XPMineHeadTeenagerView.m in Sources */, 9B64BCB028E2A3D900778F13 /* XPMineHeadTeenagerView.m in Sources */,
9BD2ECCE288F829600F5CD9A /* XPMineFootPrintViewController.m in Sources */, 9BD2ECCE288F829600F5CD9A /* XPMineFootPrintViewController.m in Sources */,
9B4E920028E57A620033419E /* XPGiftHeadTypeView.m in Sources */,
E86A16BF2856D4D5004228B8 /* XPSessionFindNewGreetListView.m in Sources */, E86A16BF2856D4D5004228B8 /* XPSessionFindNewGreetListView.m in Sources */,
E8E70D8F26F2F5DB00F03460 /* XPMineMenuTableViewCell.m in Sources */, E8E70D8F26F2F5DB00F03460 /* XPMineMenuTableViewCell.m in Sources */,
E80016422804228100D6D17A /* XPGuildIncomePresenter.m in Sources */, E80016422804228100D6D17A /* XPGuildIncomePresenter.m in Sources */,

View File

@@ -0,0 +1,35 @@
//
// XPGiftHeadTypeView.h
// xplan-ios
//
// Created by GreenLand on 2022/9/29.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@class XPGiftHeadTypeView;
@protocol XPGiftHeadTypeViewDelegate <NSObject>
///点击了贵族
- (void)xPGiftHeadTypeViewDidClickNoble:(XPGiftHeadTypeView *)view;
///点击了首充
- (void)xPGiftHeadTypeViewDidClickFirstRecharge:(XPGiftHeadTypeView *)view;
///点击了礼物
- (void)xPGiftHeadTypeViewDidClickGift:(XPGiftHeadTypeView *)view;
///点击了互动
- (void)xPGiftHeadTypeViewDidClickInteraction:(XPGiftHeadTypeView *)view;
@end
@interface XPGiftHeadTypeView : UIView
///是否展示首充
@property (nonatomic,assign) BOOL isShowFirstRecharge;
@property (nonatomic, weak) id<XPGiftHeadTypeViewDelegate> delegate;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,169 @@
//
// XPGiftHeadTypeView.m
// xplan-ios
//
// Created by GreenLand on 2022/9/29.
//
#import "XPGiftHeadTypeView.h"
///Third
#import <Masonry/Masonry.h>
#import <SDCycleScrollView/SDCycleScrollView.h>
///
#import "ThemeColor.h"
@interface XPGiftHeadTypeView()<SDCycleScrollViewDelegate>
///
@property (nonatomic, strong) UIButton *giftButton;
///
@property (nonatomic, strong) UIButton *interactButton;
///
@property (nonatomic,strong) SDCycleScrollView *cycleScrollView;
@property (nonatomic, strong) NSMutableArray *titleArray;
@end
@implementation XPGiftHeadTypeView
- (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.giftButton];
[self addSubview:self.interactButton];
[self addSubview:self.cycleScrollView];
}
- (void)initSubViewConstraints {
[self mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(44);
}];
[self.giftButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(16);
make.centerY.mas_equalTo(self);
make.width.mas_equalTo(50);
}];
[self.interactButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self);
make.left.mas_equalTo(self.giftButton.mas_right).mas_offset(8);
make.width.mas_equalTo(50);
}];
[self.cycleScrollView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-16);
make.centerY.mas_equalTo(self);
make.width.mas_equalTo(60);
make.height.mas_equalTo(30);
}];
}
#pragma mark - SDCycleScrollViewDelegate
- (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didSelectItemAtIndex:(NSInteger)index {
if (self.titleArray.count > index) {
NSString *str = self.titleArray[index];
if([str isEqualToString:@"首充有礼"]) {
if (self.delegate && [self.delegate respondsToSelector:@selector(xPGiftHeadTypeViewDidClickFirstRecharge:)]) {
[self.delegate xPGiftHeadTypeViewDidClickFirstRecharge:self];
}
} else {
if (self.delegate && [self.delegate respondsToSelector:@selector(xPGiftHeadTypeViewDidClickNoble:)]) {
[self.delegate xPGiftHeadTypeViewDidClickNoble:self];
}
}
}
}
#pragma mark - Response
- (void)giftButtonAction:(UIButton *)sender {
if (!sender.isSelected) {
if (self.delegate && [self.delegate respondsToSelector:@selector(xPGiftHeadTypeViewDidClickGift:)]) {
[self.delegate xPGiftHeadTypeViewDidClickGift:self];
}
}
sender.selected = YES;
self.interactButton.selected = NO;
}
- (void)interactButtonAction:(UIButton *)sender {
if (!sender.isSelected) {
if (self.delegate && [self.delegate respondsToSelector:@selector(xPGiftHeadTypeViewDidClickInteraction:)]) {
[self.delegate xPGiftHeadTypeViewDidClickInteraction:self];
}
}
sender.selected = YES;
self.giftButton.selected = NO;
}
#pragma mark - setter
- (void)setIsShowFirstRecharge:(BOOL)isShowFirstRecharge {
if (isShowFirstRecharge) {
self.titleArray = [NSMutableArray arrayWithObjects:@"首充有礼", @"贵族特权", nil];
self.cycleScrollView.imageURLStringsGroup = @[@"gift_first_recharge_bg", @"room_gift_noble_entrance"];
} else {
self.titleArray = [NSMutableArray arrayWithObjects:@"贵族特权", nil];
self.cycleScrollView.imageURLStringsGroup = @[@"room_gift_noble_entrance"];
}
}
#pragma mark - getter
- (UIButton *)giftButton {
if (!_giftButton) {
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
button.titleLabel.font = [UIFont systemFontOfSize:13];
[button addTarget:self action:@selector(giftButtonAction:) forControlEvents:UIControlEventTouchUpInside];
[button setTitle:@"礼物" forState:UIControlStateNormal];
[button setTitleColor:[ThemeColor textThirdColor] forState:UIControlStateNormal];
[button setTitleColor:[ThemeColor appMainColor] forState:UIControlStateSelected];
button.selected = YES;
_giftButton = button;
}
return _giftButton;
}
- (UIButton *)interactButton {
if (!_interactButton) {
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
button.titleLabel.font = [UIFont systemFontOfSize:13];
[button addTarget:self action:@selector(interactButtonAction:) forControlEvents:UIControlEventTouchUpInside];
[button setTitle:@"互动" forState:UIControlStateNormal];
[button setTitleColor:[ThemeColor textThirdColor] forState:UIControlStateNormal];
[button setTitleColor:[ThemeColor appMainColor] forState:UIControlStateSelected];
_interactButton = button;
}
return _interactButton;
}
- (SDCycleScrollView *)cycleScrollView {
if (!_cycleScrollView) {
_cycleScrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectZero delegate:self placeholderImage:nil];
_cycleScrollView.pageControlAliment = SDCycleScrollViewPageContolAlimentCenter;
_cycleScrollView.currentPageDotColor = [UIColor whiteColor];
_cycleScrollView.pageDotColor = [UIColor colorWithWhite:1 alpha:0.15];
_cycleScrollView.currentPageDotImage = [UIImage imageNamed:@"room_activity_banner_select"];
_cycleScrollView.pageDotImage = [UIImage imageNamed:@"room_activity_banner_normal"];
_cycleScrollView.backgroundColor = [UIColor colorWithWhite:1 alpha:0.00];
_cycleScrollView.bannerImageViewContentMode = UIViewContentModeScaleAspectFit;
_cycleScrollView.pageControlBottomOffset = -10;
_cycleScrollView.autoScrollTimeInterval = 5;
}
return _cycleScrollView;
}
- (NSMutableArray *)titleArray {
if (!_titleArray) {
_titleArray = [NSMutableArray array];
}
return _titleArray;
}
@end

View File

@@ -32,6 +32,7 @@
#import "XPGiftBarView.h" #import "XPGiftBarView.h"
#import "XPRoomHalfWebView.h" #import "XPRoomHalfWebView.h"
#import "XPGraffitiGiftView.h" #import "XPGraffitiGiftView.h"
#import "XPGiftHeadTypeView.h"
///P ///P
#import "XPGiftProtocol.h" #import "XPGiftProtocol.h"
///VC ///VC
@@ -40,13 +41,15 @@
#import "XPFirstRechargeViewController.h" #import "XPFirstRechargeViewController.h"
#import "XPNobleCenterViewController.h" #import "XPNobleCenterViewController.h"
@interface XPSendGiftView ()< XPGiftBarViewDelegate, XPGiftProtocol, XPGiftInfoViewDelegate, XPGraffitiGiftViewDelegate, XPGiftUsersViewDelegate> @interface XPSendGiftView ()< XPGiftBarViewDelegate, XPGiftProtocol, XPGiftInfoViewDelegate, XPGraffitiGiftViewDelegate, XPGiftUsersViewDelegate, XPGiftHeadTypeViewDelegate>
/// ///
@property (nonatomic,strong) UIView * topView; @property (nonatomic,strong) UIView * topView;
/// ///
@property (nonatomic,strong) UIView *contentView; @property (nonatomic,strong) UIView *contentView;
/// ///
@property (nonatomic,strong) UIStackView *stackView; @property (nonatomic,strong) UIStackView *stackView;
////
@property (nonatomic, strong) XPGiftHeadTypeView *headTypeView;
/// ///
@property (nonatomic,strong) XPGiftUsersView *userView; @property (nonatomic,strong) XPGiftUsersView *userView;
/// ///
@@ -100,6 +103,7 @@
[self.view addSubview:self.contentView]; [self.view addSubview:self.contentView];
[self.contentView addSubview:self.stackView]; [self.contentView addSubview:self.stackView];
[self.stackView addArrangedSubview:self.graffitiView]; [self.stackView addArrangedSubview:self.graffitiView];
[self.stackView addArrangedSubview:self.headTypeView];
[self.stackView addArrangedSubview:self.userView]; [self.stackView addArrangedSubview:self.userView];
[self.stackView addArrangedSubview:self.giftInfoView]; [self.stackView addArrangedSubview:self.giftInfoView];
[self.stackView addArrangedSubview:self.giftBarView]; [self.stackView addArrangedSubview:self.giftBarView];
@@ -394,6 +398,29 @@
[self.delegate.getCurrentNav presentViewController:firstRechargeVC animated:YES completion:nil]; [self.delegate.getCurrentNav presentViewController:firstRechargeVC animated:YES completion:nil];
} }
#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];
}
///
- (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];
}
///
- (void)xPGiftHeadTypeViewDidClickGift:(XPGiftHeadTypeView *)view {
}
///
- (void)xPGiftHeadTypeViewDidClickInteraction:(XPGiftHeadTypeView *)view {
}
#pragma mark - XPGiftInfoViewDelegate #pragma mark - XPGiftInfoViewDelegate
- (void)xPGiftInfoView:(XPGiftInfoView *)view didClickPlayRule:(NSString *)ruleUrl { - (void)xPGiftInfoView:(XPGiftInfoView *)view didClickPlayRule:(NSString *)ruleUrl {
XPRoomHalfWebView * webView = [[XPRoomHalfWebView alloc] init]; XPRoomHalfWebView * webView = [[XPRoomHalfWebView alloc] init];
@@ -468,6 +495,7 @@
#pragma mark - XPGiftProtocol #pragma mark - XPGiftProtocol
- (void)onGetUserInfoSuccess:(UserInfoModel *)userInfo { - (void)onGetUserInfoSuccess:(UserInfoModel *)userInfo {
self.headTypeView.isShowFirstRecharge = userInfo.isFirstCharge;
self.giftBarView.isShowFirstRecharge = userInfo.isFirstCharge; self.giftBarView.isShowFirstRecharge = userInfo.isFirstCharge;
self.giftInfoView.curUserNobleLevel = userInfo.userVipInfoVO.vipLevel; self.giftInfoView.curUserNobleLevel = userInfo.userVipInfoVO.vipLevel;
} }
@@ -639,4 +667,12 @@
return _graffitiView; return _graffitiView;
} }
- (XPGiftHeadTypeView *)headTypeView {
if (!_headTypeView) {
_headTypeView = [[XPGiftHeadTypeView alloc] init];
_headTypeView.delegate = self;
}
return _headTypeView;
}
@end @end