feat: 新 VIP 充值页

This commit is contained in:
eggmanQQQ
2024-08-16 21:14:11 +08:00
parent d555f5815c
commit 3d2fb62d19
33 changed files with 1008 additions and 10 deletions

View File

@@ -71,6 +71,7 @@ target 'YuMi' do
pod 'TABAnimated'
pod 'YuMi',:path=>'yum'
pod 'QCloudCOSXML'
pod 'TYCyclePagerView'
end
post_install do |installer|

View File

@@ -523,6 +523,7 @@
5412E0F42C4E460300FDD668 /* XPMineCenterAgencyView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5412E0F32C4E460300FDD668 /* XPMineCenterAgencyView.m */; };
5412E0FD2C52512100FDD668 /* RoomBottomEntranceModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 5412E0FC2C52512100FDD668 /* RoomBottomEntranceModel.m */; };
541DD9552C1EDEFB00B616C4 /* XPHomePagingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 541DD9542C1EDEFB00B616C4 /* XPHomePagingViewController.m */; };
5456F3C82C6EF962000E1805 /* VIPCenterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5456F3C72C6EF962000E1805 /* VIPCenterViewController.m */; };
5458319D2C2AE09300364026 /* XPRoomTypeSelectionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5458319C2C2AE09300364026 /* XPRoomTypeSelectionViewController.m */; };
545831A02C2AEFAF00364026 /* TenMicStageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5458319F2C2AEFAF00364026 /* TenMicStageView.m */; };
545831A32C2AF01100364026 /* FifteenMicStageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 545831A22C2AF01100364026 /* FifteenMicStageView.m */; };
@@ -2595,6 +2596,8 @@
5412E0FC2C52512100FDD668 /* RoomBottomEntranceModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RoomBottomEntranceModel.m; sourceTree = "<group>"; };
541DD9532C1EDEFB00B616C4 /* XPHomePagingViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomePagingViewController.h; sourceTree = "<group>"; };
541DD9542C1EDEFB00B616C4 /* XPHomePagingViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHomePagingViewController.m; sourceTree = "<group>"; };
5456F3C62C6EF962000E1805 /* VIPCenterViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VIPCenterViewController.h; sourceTree = "<group>"; };
5456F3C72C6EF962000E1805 /* VIPCenterViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VIPCenterViewController.m; sourceTree = "<group>"; };
5458319B2C2AE09300364026 /* XPRoomTypeSelectionViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomTypeSelectionViewController.h; sourceTree = "<group>"; };
5458319C2C2AE09300364026 /* XPRoomTypeSelectionViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomTypeSelectionViewController.m; sourceTree = "<group>"; };
5458319E2C2AEFAF00364026 /* TenMicStageView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TenMicStageView.h; sourceTree = "<group>"; };
@@ -5585,6 +5588,8 @@
2331C15E2A5EB71000E1D940 /* XPNobleCenterListViewController.m */,
2331C15F2A5EB71000E1D940 /* XPNobleCenterViewController.h */,
2331C1442A5EB71000E1D940 /* XPNobleCenterViewController.m */,
5456F3C62C6EF962000E1805 /* VIPCenterViewController.h */,
5456F3C72C6EF962000E1805 /* VIPCenterViewController.m */,
2331C15C2A5EB71000E1D940 /* XPNobleSettingViewController.h */,
2331C1412A5EB71000E1D940 /* XPNobleSettingViewController.m */,
);
@@ -12362,6 +12367,7 @@
9B6E8577281ABECC0041A321 /* XPRoomInsideRecommendEmptyCell.m in Sources */,
E85E7BC22A4EE82300B6D00A /* XPMineListCell.m in Sources */,
E880B3A6278BD69900A83B0D /* XPAcrossRoomPKTableViewCell.m in Sources */,
5456F3C82C6EF962000E1805 /* VIPCenterViewController.m in Sources */,
E8EEB90926FC579A007C6EBA /* XPMineUserInfoEditTableViewCell.m in Sources */,
E8F1559028125E2D00EE8C06 /* MessageAudioCenter.m in Sources */,
E8901CF628B38D89001E9A92 /* XPGraffitiGiftView.m in Sources */,

BIN
YuMi/Assets.xcassets/5.imageset/5@3x.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 725 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "5@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "切图 25@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 963 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 725 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "5@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "返回 1@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "矩形 3048@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "图层 716 拷贝@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "vip_center_level_1@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "vip_center_level_2@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "vip_center_level_3@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "vip_center_level_4@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "vip_center_level_5@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "vip_center_level_6@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

View File

@@ -31,7 +31,6 @@ isPhoneXSeries = [[UIApplication sharedApplication] delegate].window.safeAreaIns
#define kHalfScreenHeight KScreenHeight * 0.65
#define kGetScaleWidth(width) kRoundValue(width)
#define kRoundValue(value) round(kScreenScale * value)
#define kScreenHeightScale ((CGFloat)KScreenHeight / (CGFloat)812)
#define kWeakify(o) try{}@finally{} __weak typeof(o) o##Weak = o;
#define kStrongify(o) autoreleasepool{} __strong typeof(o) o = o##Weak;
///keyWindow

View File

@@ -0,0 +1,16 @@
//
// VIPCenterViewController.h
// YuMi
//
// Created by P on 2024/8/16.
//
#import "MvpViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface VIPCenterViewController : MvpViewController
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,726 @@
//
// VIPCenterViewController.m
// YuMi
//
// Created by P on 2024/8/16.
//
#import "VIPCenterViewController.h"
#import <SVGA.h>
#import "XPWebViewController.h"
#import "Api+Main.h"
#import "Api+NobleCenter.h"
#import "XPNobleCenterPresenter.h"
#import "SVGAImageView.h"
#import "TYCyclePagerView.h"
#import "NobleInfo.h"
#import "UserInfoModel.h"
#import "WalletInfoModel.h"
#import "NobleCenterModel.h"
#import "RechargeListModel.h"
@interface VIPIdentificationCard : UIView
@property (nonatomic, strong) NetImageView *imageView;
@property (nonatomic, strong) UILabel *titleLabel;
- (void)updateTitle:(NSString *)title;
- (void)updateImage:(NSString *)imagePath;
@end
@implementation VIPIdentificationCard
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
UIImageView *bg = [[UIImageView alloc] initWithImage:kImage(@"vip_center_identification_card")];
[self addSubview:bg];
[bg mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self);
}];
[self addSubview:self.imageView];
[self.imageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.leading.right.mas_equalTo(self);
make.height.mas_equalTo(kGetScaleWidth(90));
}];
[self addSubview:self.titleLabel];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self);
make.bottom.mas_equalTo(-13);
}];
}
return self;
}
- (void)updateTitle:(NSString *)title {
self.titleLabel.text = title;
}
- (void)updateImage:(NSString *)imagePath {
self.imageView.imageUrl = imagePath;
}
- (UILabel *)titleLabel {
if (!_titleLabel) {
_titleLabel = [UILabel labelInitWithText:@""
font:kFontRegular(13)
textColor:[DJDKMIMOMColor colorWithHexString:@"#FFE3AF"]];
}
return _titleLabel;
}
- (NetImageView *)imageView {
if (!_imageView) {
_imageView = [[NetImageView alloc] init];
_imageView.contentMode = UIViewContentModeScaleAspectFit;
}
return _imageView;
}
@end
@interface VIPCardCyclePagerCell : UICollectionViewCell
@property (nonatomic, assign) NSInteger cellIndex;
@property (nonatomic, copy) NSString *placeHolderPath;
@property (nonatomic, copy) NSString *svgaPath;
@property (nonatomic, strong) UIImageView *levelBgImageView;
@property (nonatomic, strong) UILabel *statusLabel;
@property (nonatomic, strong) NetImageView *placeHolderImageView;
@property (nonatomic, strong) SVGAImageView *svgaImageView;
@end
@implementation VIPCardCyclePagerCell
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self setupCell];
}
return self;
}
- (void)setupCell {
_levelBgImageView = [[UIImageView alloc] init];
[self.contentView addSubview:_levelBgImageView];
[_levelBgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.contentView);
}];
_statusLabel = [UILabel labelInitWithText:@""
font:kFontMedium(12)
textColor:[DJDKMIMOMColor colorWithHexString:@"#4d1c1c"]];
[self.contentView addSubview:_statusLabel];
[_statusLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(18);
make.bottom.mas_equalTo(-26);
make.height.mas_equalTo(18);
}];
_placeHolderImageView = [[NetImageView alloc] init];
_placeHolderImageView.contentMode = UIViewContentModeScaleAspectFill;
[self.contentView addSubview:_placeHolderImageView];
[_placeHolderImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.trailing.mas_equalTo(-13);
make.bottom.mas_equalTo(-25);
make.width.height.mas_equalTo(kGetScaleWidth(130));
}];
_svgaImageView = [[SVGAImageView alloc] init];
_svgaImageView.clearsAfterStop = NO;
_svgaImageView.loops = INT_MAX;
_svgaImageView.contentMode = UIViewContentModeScaleAspectFill;
[self.contentView addSubview:_svgaImageView];
[_svgaImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.placeHolderImageView);
}];
}
- (void)setCellIndex:(NSInteger)cellIndex {
_cellIndex = cellIndex;
NSString *imageName = [NSString stringWithFormat:@"vip_center_level_%ld", (long)(cellIndex+1)];
[self.levelBgImageView setImage:kImage(imageName)];
}
- (void)setPlaceHolderPath:(NSString *)placeHolderPath {
_placeHolderPath = placeHolderPath;
_placeHolderImageView.imageUrl = placeHolderPath;
}
- (void)setSvgaPath:(NSString *)svgaPath {
_svgaPath = svgaPath;
if (svgaPath.length == 0) {
return;
}
@kWeakify(self);
SVGAParser *parser = [[SVGAParser alloc] init];
[parser parseWithURL:[NSURL URLWithString:svgaPath]
completionBlock:^(SVGAVideoEntity * _Nullable videoItem) {
@kStrongify(self);
self.svgaImageView.videoItem = videoItem;
[self.svgaImageView startAnimation];
self.placeHolderImageView.hidden = YES;
}
failureBlock:^(NSError * _Nullable error) {}];
}
@end
@interface VIPCenterViewController () <TYCyclePagerViewDataSource, TYCyclePagerViewDelegate>
@property (nonatomic, strong) UIButton *backButton;
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UIButton *helpButton;
@property (nonatomic, strong) TYCyclePagerView *vipCardCyclePager;
@property (nonatomic, strong) UIView *headerContentView;
@property (nonatomic, strong) UIScrollView *mainScrollView;
@property (nonatomic, strong) UIView *scrollContentView;
@property (nonatomic, strong) NobleCenterModel *vipModel;
@property (nonatomic, strong) UserInfoModel *userInfo;
@property (nonatomic, strong) WalletInfoModel *walletInfo;
@property (nonatomic, copy) NSArray <RechargeListModel *> *rechargeList;
@property (nonatomic, strong) UIStackView *identificationStack;
@property (nonatomic, strong) VIPIdentificationCard *identificationCard_vipIdentity;
@property (nonatomic, strong) VIPIdentificationCard *identificationCard_roomCard;
@property (nonatomic, strong) VIPIdentificationCard *identificationCard_entryAnimation;
@property (nonatomic, strong) VIPIdentificationCard *identificationCard_exclusiveHeadwear;
@property (nonatomic, strong) VIPIdentificationCard *identificationCard_micSoundWave;
@property (nonatomic, strong) VIPIdentificationCard *identificationCard_exclusiveBubbles;
@property (nonatomic, strong) UIStackView *exclusivePrivilegesStack;
@end
@implementation VIPCenterViewController
- (BOOL)isHiddenNavBar {
return YES;
}
- (void)viewDidLoad {
[super viewDidLoad];
[self setupUI];
[self setupData];
}
- (XPNobleCenterPresenter *)createPresenter {
return [[XPNobleCenterPresenter alloc] init];
}
#pragma mark - Setup
- (void)setupUI {
[self setupBG];
[self setupNavigationBar];
[self setupVIPCardCyclePager];
[self setupScrollContent];
[self setupVipIdentificationArea];
[self setupExclusivePrivilegesArea];
}
- (void)setupBG {
self.view.backgroundColor = [DJDKMIMOMColor colorWithHexString:@"#150c00"];
UIImageView *bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"vip_center_background"]];
[self.view addSubview:bgImageView];
[bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.leading.trailing.mas_equalTo(self.view);
make.height.mas_equalTo(kGetScaleWidth(350));
}];
}
- (void)setupVIPCardCyclePager {
[self.view addSubview:self.vipCardCyclePager];
[self.vipCardCyclePager mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(11);
make.leading.trailing.mas_equalTo(self.view);
make.height.mas_equalTo(kGetScaleWidth(136 + 36 + 51));
}];
}
- (void)setupNavigationBar {
[self.view addSubview:self.titleLabel];
[self.view addSubview:self.backButton];
[self.view addSubview:self.helpButton];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.view);
make.top.mas_equalTo(self.view).offset(44 + 11);
make.height.mas_equalTo(22);
}];
[self.backButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(self.view).offset(16);
make.centerY.mas_equalTo(self.titleLabel);
make.size.mas_equalTo(CGSizeMake(22, 22));
}];
[self.helpButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.trailing.mas_equalTo(self.view).offset(-16);
make.centerY.mas_equalTo(self.titleLabel);
make.size.mas_equalTo(CGSizeMake(22, 22));
}];
}
- (void)setupScrollContent {
[self.view addSubview:self.mainScrollView];
[self.mainScrollView addSubview:self.scrollContentView];
[self.mainScrollView mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.leading.trailing.mas_equalTo(self.view);
make.top.mas_equalTo(self.vipCardCyclePager.mas_bottom);
}];
[self.scrollContentView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.mainScrollView);
make.width.mas_equalTo(self.mainScrollView);
}];
// UIView *v = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, 1000)];
// CAGradientLayer *gradientLayer = [CAGradientLayer layer];
// gradientLayer.startPoint = CGPointMake(0.5, 0.0);
// gradientLayer.endPoint = CGPointMake(0.5, 1.0);
// gradientLayer.colors = @[
// (id)[UIColor redColor].CGColor,
// (id)[UIColor blueColor].CGColor
// ];
// gradientLayer.frame = self.view.bounds;
// [v.layer insertSublayer:gradientLayer atIndex:0];
// [self.scrollContentView addSubview:v];
//
// UILabel *label2 = [[UILabel alloc] init];
// label2.text = @"Label 2";
// label2.backgroundColor = [UIColor greenColor];
// [self.scrollContentView addSubview:label2];
//
// [v mas_makeConstraints:^(MASConstraintMaker *make) {
// make.top.leading.trailing.mas_equalTo(self.scrollContentView);
// make.height.mas_equalTo(1000);
// }];
//
// [label2 mas_makeConstraints:^(MASConstraintMaker *make) {
// make.top.equalTo(v.mas_bottom).offset(20); // label1 20
// make.left.right.equalTo(self.scrollContentView).insets(UIEdgeInsetsMake(0, 20, 0, 20)); // 20
// make.height.mas_equalTo(50); // 50
// make.bottom.equalTo(self.scrollContentView).offset(-20); // contentView contentView 20
// }];
}
- (void)setupVipIdentificationArea {
UILabel *titleLabel = [UILabel labelInitWithText:@"Identification"
font:kFontBold(16)
textColor:[DJDKMIMOMColor colorWithHexString:@"#FFE3AF"]];
[self.scrollContentView addSubview:titleLabel];
[titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.centerX.mas_equalTo(self.scrollContentView);
make.height.mas_equalTo(22);
}];
UIImageView *leftDecorateImageView = [[UIImageView alloc] initWithImage:kImage(@"vip_center_label_decorate")];
[self.scrollContentView addSubview:leftDecorateImageView];
[leftDecorateImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(titleLabel);
make.trailing.mas_equalTo(titleLabel.mas_leading).offset(-12);
make.size.mas_equalTo(CGSizeMake(43, 16));
}];
UIImageView *rightDecorateImageView = [[UIImageView alloc] initWithImage:kImage(@"vip_center_label_decorate")];
rightDecorateImageView.transform = CGAffineTransformMakeScale(-1.0, 1.0);
[self.scrollContentView addSubview:rightDecorateImageView];
[rightDecorateImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(titleLabel);
make.leading.mas_equalTo(titleLabel.mas_trailing).offset(12);
make.size.mas_equalTo(CGSizeMake(43, 16));
}];
UIStackView *identificationStack = [[UIStackView alloc] init];
identificationStack.spacing = 12;
identificationStack.distribution = UIStackViewDistributionEqualSpacing;
[self.scrollContentView addSubview:identificationStack];
[identificationStack mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(titleLabel.mas_bottom).offset(16);
make.leading.mas_equalTo(self.scrollContentView).offset(16);
make.trailing.mas_equalTo(self.scrollContentView).offset(-16);
// make.bottom.mas_equalTo(self.scrollContentView);
}];
_identificationStack = identificationStack;
UIStackView *identificationStack_left = [[UIStackView alloc] init];
identificationStack_left.axis = UILayoutConstraintAxisVertical;
identificationStack_left.spacing = 12;
UIStackView *identificationStack_right = [[UIStackView alloc] init];
identificationStack_right.axis = UILayoutConstraintAxisVertical;
identificationStack_right.spacing = 12;
[identificationStack addArrangedSubview:identificationStack_left];
[identificationStack addArrangedSubview:identificationStack_right];
[identificationStack_left addArrangedSubview:self.identificationCard_vipIdentity];
[identificationStack_left addArrangedSubview:self.identificationCard_entryAnimation];
[identificationStack_left addArrangedSubview:self.identificationCard_micSoundWave];
[identificationStack_right addArrangedSubview:self.identificationCard_roomCard];
[identificationStack_right addArrangedSubview:self.identificationCard_exclusiveHeadwear];
[identificationStack_right addArrangedSubview:self.identificationCard_exclusiveBubbles];
[self.identificationCard_vipIdentity mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(kGetScaleWidth(166), kGetScaleWidth(120)));
}];
[self.identificationCard_entryAnimation mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(kGetScaleWidth(166), kGetScaleWidth(120)));
}];
[self.identificationCard_micSoundWave mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(kGetScaleWidth(166), kGetScaleWidth(120)));
}];
[self.identificationCard_roomCard mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(kGetScaleWidth(166), kGetScaleWidth(120)));
}];
[self.identificationCard_exclusiveHeadwear mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(kGetScaleWidth(166), kGetScaleWidth(120)));
}];
[self.identificationCard_exclusiveBubbles mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(kGetScaleWidth(166), kGetScaleWidth(120)));
}];
}
- (void)setupExclusivePrivilegesArea {
UILabel *titleLabel = [UILabel labelInitWithText:@"Exclusive Privileges"
font:kFontBold(16)
textColor:[DJDKMIMOMColor colorWithHexString:@"#FFE3AF"]];
[self.scrollContentView addSubview:titleLabel];
[titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.identificationStack.mas_bottom).offset(24);
make.centerX.mas_equalTo(self.identificationStack);
make.height.mas_equalTo(22);
}];
UIImageView *leftDecorateImageView = [[UIImageView alloc] initWithImage:kImage(@"vip_center_label_decorate")];
[self.scrollContentView addSubview:leftDecorateImageView];
[leftDecorateImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(titleLabel);
make.trailing.mas_equalTo(titleLabel.mas_leading).offset(-12);
make.size.mas_equalTo(CGSizeMake(43, 16));
}];
UIImageView *rightDecorateImageView = [[UIImageView alloc] initWithImage:kImage(@"vip_center_label_decorate")];
rightDecorateImageView.transform = CGAffineTransformMakeScale(-1.0, 1.0);
[self.scrollContentView addSubview:rightDecorateImageView];
[rightDecorateImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(titleLabel);
make.leading.mas_equalTo(titleLabel.mas_trailing).offset(12);
make.size.mas_equalTo(CGSizeMake(43, 16));
}];
self.exclusivePrivilegesStack = [[UIStackView alloc] init];
self.exclusivePrivilegesStack.axis = UILayoutConstraintAxisVertical; //
self.exclusivePrivilegesStack.distribution = UIStackViewDistributionEqualSpacing;
self.exclusivePrivilegesStack.spacing = 10; //
[self.scrollContentView addSubview:self.exclusivePrivilegesStack];
[self.exclusivePrivilegesStack mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(titleLabel.mas_bottom);
make.leading.trailing.mas_equalTo(self.scrollContentView);
make.bottom.mas_equalTo(self.scrollContentView).offset(-40);
}];
// UIView *bottomV = [[UIView alloc] init];
// [self.scrollContentView addSubview:bottomV];
// [bottomV mas_makeConstraints:^(MASConstraintMaker *make) {
// make.top.mas_equalTo(titleLabel.mas_bottom);
// make.height.width.mas_equalTo(100);
// make.bottom.mas_equalTo(self.scrollContentView).offset(-20);
// }];
}
- (void)configVIPCards {
[self.vipCardCyclePager reloadData];
}
- (void)configIdentificationCards {
for (NobleAuthInfo *info in self.vipModel.vipAuthInfos) {
switch (info.authType) {
case 1:
[self.identificationCard_vipIdentity updateImage:info.descPic];
[self.identificationCard_vipIdentity updateTitle:info.authName];
break;
case 5:
[self.identificationCard_roomCard updateImage:info.descPic];
[self.identificationCard_roomCard updateTitle:info.authName];
break;
case 11:
[self.identificationCard_exclusiveBubbles updateImage:info.descPic];
[self.identificationCard_exclusiveBubbles updateTitle:info.authName];
break;
// case 4: //
// [self.identificationCard_exclusiveHeadwear updateImage:info.descPic];
// [self.identificationCard_exclusiveHeadwear updateTitle:info.authName];
// break;
case 8:
[self.identificationCard_micSoundWave updateImage:info.descPic];
[self.identificationCard_micSoundWave updateTitle:info.authName];
break;
case 12:
[self.identificationCard_entryAnimation updateImage:info.descPic];
[self.identificationCard_entryAnimation updateTitle:info.authName];
break;
default:
break;
}
}
}
- (void)configExclusivePrivilegesArea {
int itemsPerRow = 3;
for (int row = 0; row < (self.vipModel.vipAuthInfos.count + itemsPerRow - 1)/itemsPerRow; row++) {
UIStackView *horizontalStackView = [[UIStackView alloc] init];
horizontalStackView.axis = UILayoutConstraintAxisHorizontal; //
horizontalStackView.distribution = UIStackViewDistributionFillEqually;
horizontalStackView.spacing = 60;
for (int col = 0; col < itemsPerRow; col++) {
int index = row * itemsPerRow + col;
if (index < self.vipModel.vipAuthInfos.count) {
UIView *v = [[UIView alloc] init];
v.backgroundColor = [UIColor whiteColor];
[horizontalStackView addArrangedSubview:v];
[v mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(48);
}];
} else {
//
UIView *placeholderView = [[UIView alloc] init];
placeholderView.backgroundColor = [UIColor clearColor];
[horizontalStackView addArrangedSubview:placeholderView];
}
}
[self.exclusivePrivilegesStack addArrangedSubview:horizontalStackView];
}
}
#pragma mark - Load Data from API
- (void)setupData {
[self loadUserInfo];
[self loadWalletInfo];
[self loadVIPProductsInfo];
}
- (void)loadUserInfo {
NSString * uid = [[AccountInfoStorage instance] getUid];
@kWeakify(self);
[Api getUserInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
@kStrongify(self);
if (code == 200) {
UserInfoModel *infoModel = [UserInfoModel modelWithDictionary:data.data];
self.userInfo = infoModel;
[self loadVIPCenterInfo];
}
} uid:uid];
}
- (void)loadVIPProductsInfo {
@kWeakify(self);
[Api getChargeList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
@kStrongify(self);
if(code == 200){
NSArray *list = [RechargeListModel modelsWithArray:data.data];
self.rechargeList = list;
}
} type:@"9"];
}
- (void)loadWalletInfo {
NSString * uid = [AccountInfoStorage instance].getUid;
NSString * ticket = [AccountInfoStorage instance].getTicket;
@kWeakify(self);
[Api getUserWalletInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
@kStrongify(self);
if(code == 200){
WalletInfoModel *infoModel = [WalletInfoModel modelWithDictionary:data.data];
self.walletInfo = infoModel;
}
} uid:uid ticket:ticket];
}
- (void)loadVIPCenterInfo {
@kWeakify(self);
[Api nobleCenterLevelList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
@kStrongify(self);
if (code == 200) {
NobleCenterModel *model = [NobleCenterModel modelWithDictionary:data.data];
self.vipModel = model;
[self configVIPCards];
[self configIdentificationCards];
[self configExclusivePrivilegesArea];
}
}];
}
#pragma mark - Button Actions
- (void)didTapBackButton {
[self.navigationController popViewControllerAnimated:YES];
}
- (void)didTapHelpButton {
XPWebViewController * webVC =[[XPWebViewController alloc] init];
webVC.url = URLWithType(kNobleRuleURL);
[self.navigationController pushViewController:webVC animated:YES];
}
#pragma mark - API Response
#pragma mark - TYCyclePagerView Delegate & DataSource
- (NSInteger)numberOfItemsInPagerView:(TYCyclePagerView *)pageView {
return 9;
}
- (TYCyclePagerViewLayout *)layoutForPagerView:(TYCyclePagerView *)pageView {
TYCyclePagerViewLayout *layout = [[TYCyclePagerViewLayout alloc]init];
layout.layoutType = TYCyclePagerTransformLayoutLinear;
layout.itemSize = CGSizeMake(kGetScaleWidth(320), kGetScaleWidth(136));
layout.itemSpacing = 15;
return layout;
}
- (__kindof UICollectionViewCell *)pagerView:(TYCyclePagerView *)pagerView
cellForItemAtIndex:(NSInteger)index {
VIPCardCyclePagerCell *cell = [pagerView dequeueReusableCellWithReuseIdentifier:@"VIPCardCyclePagerCell" forIndex:index];
cell.cellIndex = index;
if (self.vipModel) {
NobleInfo *info = [self.vipModel.vipInfos xpSafeObjectAtIndex:index];
if (info) {
cell.placeHolderPath = info.vipIcon;
cell.svgaPath = info.vipLogo;
}
}
return cell;
}
#pragma mark - properties
- (UIButton *)backButton {
if (!_backButton) {
_backButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_backButton setImage:[kImage(@"vip_center_back_button") ms_SetImageForRTL]
forState:UIControlStateNormal];
[_backButton addTarget:self
action:@selector(didTapBackButton)
forControlEvents:UIControlEventTouchUpInside];
}
return _backButton;
}
- (UIButton *)helpButton {
if (!_helpButton) {
_helpButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_helpButton setImage:kImage(@"vip_center_help_button")
forState:UIControlStateNormal];
[_helpButton addTarget:self
action:@selector(didTapHelpButton)
forControlEvents:UIControlEventTouchUpInside];
}
return _helpButton;
}
- (UILabel *)titleLabel {
if (!_titleLabel) {
_titleLabel = [[UILabel alloc] init];
_titleLabel.textAlignment = NSTextAlignmentCenter;
_titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
_titleLabel.text = YMLocalizedString(@"XPNobleCenterNavView0");
_titleLabel.textColor = [DJDKMIMOMColor colorWithHexString:@"#FFE3AF"];
}
return _titleLabel;
}
- (TYCyclePagerView *)vipCardCyclePager {
if (!_vipCardCyclePager) {
_vipCardCyclePager = [[TYCyclePagerView alloc] init];
_vipCardCyclePager.backgroundColor = [UIColor clearColor];
_vipCardCyclePager.backgroundView = nil;
_vipCardCyclePager.layer.borderWidth = 1;
_vipCardCyclePager.isInfiniteLoop = NO;
_vipCardCyclePager.autoScrollInterval = -1;
_vipCardCyclePager.dataSource = self;
_vipCardCyclePager.delegate = self;
[_vipCardCyclePager registerClass:[VIPCardCyclePagerCell class]
forCellWithReuseIdentifier:@"VIPCardCyclePagerCell"];
}
return _vipCardCyclePager;
}
- (UIScrollView *)mainScrollView {
if (!_mainScrollView) {
_mainScrollView = [[UIScrollView alloc] init];
}
return _mainScrollView;
}
- (UIView *)scrollContentView {
if (!_scrollContentView) {
_scrollContentView = [[UIView alloc] init];
}
return _scrollContentView;
}
- (VIPIdentificationCard *)identificationCard_vipIdentity {
if (!_identificationCard_vipIdentity) {
_identificationCard_vipIdentity = [[VIPIdentificationCard alloc] initWithFrame:CGRectMake(0, 0, kGetScaleWidth(166), kGetScaleWidth(120))];
}
return _identificationCard_vipIdentity;
}
- (VIPIdentificationCard *)identificationCard_roomCard {
if (!_identificationCard_roomCard) {
_identificationCard_roomCard = [[VIPIdentificationCard alloc] initWithFrame:CGRectMake(0, 0, kGetScaleWidth(166), kGetScaleWidth(120))];
}
return _identificationCard_roomCard;
}
- (VIPIdentificationCard *)identificationCard_entryAnimation {
if (!_identificationCard_entryAnimation) {
_identificationCard_entryAnimation = [[VIPIdentificationCard alloc] initWithFrame:CGRectMake(0, 0, kGetScaleWidth(166), kGetScaleWidth(120))];
}
return _identificationCard_entryAnimation;
}
- (VIPIdentificationCard *)identificationCard_exclusiveHeadwear {
if (!_identificationCard_exclusiveHeadwear) {
_identificationCard_exclusiveHeadwear = [[VIPIdentificationCard alloc] initWithFrame:CGRectMake(0, 0, kGetScaleWidth(166), kGetScaleWidth(120))];
}
return _identificationCard_exclusiveHeadwear;
}
- (VIPIdentificationCard *)identificationCard_micSoundWave {
if (!_identificationCard_micSoundWave) {
_identificationCard_micSoundWave = [[VIPIdentificationCard alloc] initWithFrame:CGRectMake(0, 0, kGetScaleWidth(166), kGetScaleWidth(120))];
}
return _identificationCard_micSoundWave;
}
- (VIPIdentificationCard *)identificationCard_exclusiveBubbles {
if (!_identificationCard_exclusiveBubbles) {
_identificationCard_exclusiveBubbles = [[VIPIdentificationCard alloc] initWithFrame:CGRectMake(0, 0, kGetScaleWidth(166), kGetScaleWidth(120))];
}
return _identificationCard_exclusiveBubbles;
}
@end

View File

@@ -208,10 +208,7 @@
[self.presenter openVipWithDiamondRoomUid:roomUid vipLevel:vipLevel];
return;
}
[XNDJTDDLoadingTool showOnlyView:kWindow];
[self.presenter requestNobleIAPRechargeOrderWithChargeProdId:self.rechargeModel.chargeProdId roomUid:self.roomUid ? [NSString stringWithFormat:@"%zd", self.roomUid] : nil];
}
@@ -378,7 +375,6 @@
[self.myNobleView mas_updateConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(91+kSafeAreaBottomHeight);
}];
}
}

View File

@@ -1714,8 +1714,6 @@
[self createBigPrizeAnimation:prizeModel];
}
[self.animationListB addObject:prizeModel];
}

View File

@@ -100,8 +100,6 @@
[view.layer pop_addAnimation:animation2 forKey:@"animation2"];
[view.layer pop_addAnimation:animation3 forKey:@"animation3"];
[view.layer pop_addAnimation:animation4 forKey:@"animation4"];
}
#pragma mark - Getters And Setters
- (UIView *)firstView {