开通贵族折扣

This commit is contained in:
fengshuo
2022-10-26 18:41:49 +08:00
parent 79cf03a5f8
commit 8715dfd968
21 changed files with 523 additions and 58 deletions

View File

@@ -677,6 +677,8 @@
E83ABF00280EC45700322EE4 /* MessageContentApplicationShareView.m in Sources */ = {isa = PBXBuildFile; fileRef = E83ABEFF280EC45700322EE4 /* MessageContentApplicationShareView.m */; }; E83ABF00280EC45700322EE4 /* MessageContentApplicationShareView.m in Sources */ = {isa = PBXBuildFile; fileRef = E83ABEFF280EC45700322EE4 /* MessageContentApplicationShareView.m */; };
E83ABF03280EC90C00322EE4 /* ContentApplicationShareModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E83ABF02280EC90C00322EE4 /* ContentApplicationShareModel.m */; }; E83ABF03280EC90C00322EE4 /* ContentApplicationShareModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E83ABF02280EC90C00322EE4 /* ContentApplicationShareModel.m */; };
E83ABF06280EDE2B00322EE4 /* MessageContentLevelUpgradeView.m in Sources */ = {isa = PBXBuildFile; fileRef = E83ABF05280EDE2B00322EE4 /* MessageContentLevelUpgradeView.m */; }; E83ABF06280EDE2B00322EE4 /* MessageContentLevelUpgradeView.m in Sources */ = {isa = PBXBuildFile; fileRef = E83ABF05280EDE2B00322EE4 /* MessageContentLevelUpgradeView.m */; };
E83CD1982908D2FF00920A94 /* NobleRankListModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E83CD1972908D2FF00920A94 /* NobleRankListModel.m */; };
E83CD19E2909171900920A94 /* XPNobleDiscountView.m in Sources */ = {isa = PBXBuildFile; fileRef = E83CD19D2909171900920A94 /* XPNobleDiscountView.m */; };
E83DB47A27462C4500D8CBD1 /* XPGiftBigPrizeModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E83DB47927462C4500D8CBD1 /* XPGiftBigPrizeModel.m */; }; E83DB47A27462C4500D8CBD1 /* XPGiftBigPrizeModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E83DB47927462C4500D8CBD1 /* XPGiftBigPrizeModel.m */; };
E83DB47D2746372300D8CBD1 /* XPRoomGiftBannerView.m in Sources */ = {isa = PBXBuildFile; fileRef = E83DB47C2746372300D8CBD1 /* XPRoomGiftBannerView.m */; }; E83DB47D2746372300D8CBD1 /* XPRoomGiftBannerView.m in Sources */ = {isa = PBXBuildFile; fileRef = E83DB47C2746372300D8CBD1 /* XPRoomGiftBannerView.m */; };
E83DB481274649FB00D8CBD1 /* XPGiftBannerUserInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E83DB480274649FB00D8CBD1 /* XPGiftBannerUserInfoModel.m */; }; E83DB481274649FB00D8CBD1 /* XPGiftBannerUserInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E83DB480274649FB00D8CBD1 /* XPGiftBannerUserInfoModel.m */; };
@@ -2404,6 +2406,10 @@
E83ABF02280EC90C00322EE4 /* ContentApplicationShareModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ContentApplicationShareModel.m; sourceTree = "<group>"; }; E83ABF02280EC90C00322EE4 /* ContentApplicationShareModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ContentApplicationShareModel.m; sourceTree = "<group>"; };
E83ABF04280EDE2B00322EE4 /* MessageContentLevelUpgradeView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MessageContentLevelUpgradeView.h; sourceTree = "<group>"; }; E83ABF04280EDE2B00322EE4 /* MessageContentLevelUpgradeView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MessageContentLevelUpgradeView.h; sourceTree = "<group>"; };
E83ABF05280EDE2B00322EE4 /* MessageContentLevelUpgradeView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MessageContentLevelUpgradeView.m; sourceTree = "<group>"; }; E83ABF05280EDE2B00322EE4 /* MessageContentLevelUpgradeView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MessageContentLevelUpgradeView.m; sourceTree = "<group>"; };
E83CD1962908D2FF00920A94 /* NobleRankListModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NobleRankListModel.h; sourceTree = "<group>"; };
E83CD1972908D2FF00920A94 /* NobleRankListModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NobleRankListModel.m; sourceTree = "<group>"; };
E83CD19C2909171900920A94 /* XPNobleDiscountView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPNobleDiscountView.h; sourceTree = "<group>"; };
E83CD19D2909171900920A94 /* XPNobleDiscountView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPNobleDiscountView.m; sourceTree = "<group>"; };
E83DB47827462C4500D8CBD1 /* XPGiftBigPrizeModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPGiftBigPrizeModel.h; sourceTree = "<group>"; }; E83DB47827462C4500D8CBD1 /* XPGiftBigPrizeModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPGiftBigPrizeModel.h; sourceTree = "<group>"; };
E83DB47927462C4500D8CBD1 /* XPGiftBigPrizeModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPGiftBigPrizeModel.m; sourceTree = "<group>"; }; E83DB47927462C4500D8CBD1 /* XPGiftBigPrizeModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPGiftBigPrizeModel.m; sourceTree = "<group>"; };
E83DB47B2746372300D8CBD1 /* XPRoomGiftBannerView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomGiftBannerView.h; sourceTree = "<group>"; }; E83DB47B2746372300D8CBD1 /* XPRoomGiftBannerView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomGiftBannerView.h; sourceTree = "<group>"; };
@@ -4826,6 +4832,8 @@
E8A1F7A429068F500099C952 /* XPNobleMyInfoView.m */, E8A1F7A429068F500099C952 /* XPNobleMyInfoView.m */,
E8A1F7A6290690E00099C952 /* XPNobleRankUpdateView.h */, E8A1F7A6290690E00099C952 /* XPNobleRankUpdateView.h */,
E8A1F7A7290690E00099C952 /* XPNobleRankUpdateView.m */, E8A1F7A7290690E00099C952 /* XPNobleRankUpdateView.m */,
E83CD19C2909171900920A94 /* XPNobleDiscountView.h */,
E83CD19D2909171900920A94 /* XPNobleDiscountView.m */,
); );
path = SubViews; path = SubViews;
sourceTree = "<group>"; sourceTree = "<group>";
@@ -4864,6 +4872,8 @@
9BB549612782EA1D0090CD26 /* NobleInfo.m */, 9BB549612782EA1D0090CD26 /* NobleInfo.m */,
9B2A12E227846D7100CED41B /* NobleRechargeModel.h */, 9B2A12E227846D7100CED41B /* NobleRechargeModel.h */,
9B2A12E327846D7100CED41B /* NobleRechargeModel.m */, 9B2A12E327846D7100CED41B /* NobleRechargeModel.m */,
E83CD1962908D2FF00920A94 /* NobleRankListModel.h */,
E83CD1972908D2FF00920A94 /* NobleRankListModel.m */,
); );
path = Model; path = Model;
sourceTree = "<group>"; sourceTree = "<group>";
@@ -9452,6 +9462,7 @@
E8AB633328AE51470023B0D2 /* XPSailingPrizeView.m in Sources */, E8AB633328AE51470023B0D2 /* XPSailingPrizeView.m in Sources */,
9B2F72D328E45C5A0000E4FA /* XPRoomQuidkMessageCell.m in Sources */, 9B2F72D328E45C5A0000E4FA /* XPRoomQuidkMessageCell.m in Sources */,
E8A86E0527BA38DB001C21F9 /* NSString+RW.m in Sources */, E8A86E0527BA38DB001C21F9 /* NSString+RW.m in Sources */,
E83CD1982908D2FF00920A94 /* NobleRankListModel.m in Sources */,
E800162C2803FE4900D6D17A /* GuildIncomeRecordModel.m in Sources */, E800162C2803FE4900D6D17A /* GuildIncomeRecordModel.m in Sources */,
9BE01ACE28925F7D00B50299 /* XPMineNewUserRechargeView.m in Sources */, 9BE01ACE28925F7D00B50299 /* XPMineNewUserRechargeView.m in Sources */,
E83ABF03280EC90C00322EE4 /* ContentApplicationShareModel.m in Sources */, E83ABF03280EC90C00322EE4 /* ContentApplicationShareModel.m in Sources */,
@@ -9702,6 +9713,7 @@
9B1B72B828003772003FACE9 /* XPAnchorPKPresenter.m in Sources */, 9B1B72B828003772003FACE9 /* XPAnchorPKPresenter.m in Sources */,
E8EE827D272B9A2300A17217 /* XPRoomSendTextView.m in Sources */, E8EE827D272B9A2300A17217 /* XPRoomSendTextView.m in Sources */,
E8AB631928ADE2F40023B0D2 /* XPMonentsTopicRecommendPresenter.m in Sources */, E8AB631928ADE2F40023B0D2 /* XPMonentsTopicRecommendPresenter.m in Sources */,
E83CD19E2909171900920A94 /* XPNobleDiscountView.m in Sources */,
9BD63FAE277EE97A006EB744 /* XPReleaseRadioPresenter.m in Sources */, 9BD63FAE277EE97A006EB744 /* XPReleaseRadioPresenter.m in Sources */,
9B1FC3D827E49C36006EFFE0 /* XPMineDressBubbleCollectionViewCell.m in Sources */, 9B1FC3D827E49C36006EFFE0 /* XPMineDressBubbleCollectionViewCell.m in Sources */,
9BE01AEA2893CB4400B50299 /* XPDressSearchViewController.m in Sources */, 9BE01AEA2893CB4400B50299 /* XPDressSearchViewController.m in Sources */,

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

View File

@@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
+ (void)nobleCenterLevelList:(HttpRequestHelperCompletion)completion; + (void)nobleCenterLevelList:(HttpRequestHelperCompletion)completion;
///获取开通贵族产品列表 ///获取开通贵族产品列表
+ (void)getChargeList:(HttpRequestHelperCompletion)completion channelType:(NSString *)channelType; + (void)getChargeList:(HttpRequestHelperCompletion)completion;
/// 苹果下单 /// 苹果下单
/// @param completion 完成 /// @param completion 完成
@@ -43,6 +43,13 @@ NS_ASSUME_NONNULL_BEGIN
/// @param open 是否打开 /// @param open 是否打开
+ (void)changeEnterHidCompletion:(HttpRequestHelperCompletion)complection open:(NSString *)open; + (void)changeEnterHidCompletion:(HttpRequestHelperCompletion)complection open:(NSString *)open;
/// 获取贵族升级轮播表
/// @param complection 完成回调
+ (void)vipUpgradeList:(HttpRequestHelperCompletion)complection;
/// 获取贵族排行榜
/// @param complection 完成回调
+ (void)vipRankList:(HttpRequestHelperCompletion)complection;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -16,8 +16,8 @@
} }
/// ///
+ (void)getChargeList:(HttpRequestHelperCompletion)completion channelType:(NSString *)channelType { + (void)getChargeList:(HttpRequestHelperCompletion)completion{
[self makeRequest:@"chargeprod/listV2" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, channelType, nil]; [self makeRequest:@"vip/getOpenVipProd" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, nil];
} }
/// ///
@@ -54,4 +54,18 @@
[self makeRequest:@"vip/changeInvisibleInRoom" method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__,open, nil]; [self makeRequest:@"vip/changeInvisibleInRoom" method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__,open, nil];
} }
///
/// @param complection
+ (void)vipUpgradeList:(HttpRequestHelperCompletion)complection {
[self makeRequest:@"vip/listUpgrade" method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__, nil];
}
///
/// @param complection
+ (void)vipRankList:(HttpRequestHelperCompletion)complection {
[self makeRequest:@"vip/listRank" method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__, nil];
}
@end @end

View File

@@ -0,0 +1,42 @@
//
// NobleRankListModel.h
// xplan-ios
//
// Created by 冯硕 on 2022/10/26.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@class NObleRankUserModel;
@interface NobleRankListModel : NSObject
///我的排名
@property (nonatomic,strong) NObleRankUserModel *myRank;
///排行
@property (nonatomic,strong) NSArray<NObleRankUserModel *> *ranks;
@end
@interface NObleRankUserModel : NSObject
///头像
@property (nonatomic,copy) NSString *avatar;
///uid
@property (nonatomic,copy) NSString *uid;
///id
@property (nonatomic,copy) NSString *erbanNo;
///姓名
@property (nonatomic,copy) NSString *nick;
///贵族等级
@property (nonatomic,copy) NSString *vipLogo;
///权利值
@property (nonatomic,copy) NSString *score;
///排名
@property (nonatomic,assign) NSInteger rankNo;
///贵族的名称
@property (nonatomic,copy) NSString *vipName;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,21 @@
//
// NobleRankListModel.m
// xplan-ios
//
// Created by on 2022/10/26.
//
#import "NobleRankListModel.h"
@implementation NobleRankListModel
@end
@implementation NObleRankUserModel
@end

View File

@@ -17,6 +17,13 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, assign) NSInteger defaultPayH5; @property (nonatomic, assign) NSInteger defaultPayH5;
@property (nonatomic, assign) NSInteger defaultPay; @property (nonatomic, assign) NSInteger defaultPay;
///产品id
@property (nonatomic,strong) NSString *chargeProdId;
///现价
@property (nonatomic,assign) CGFloat money;
///原价
@property (nonatomic,assign) CGFloat oriPrice;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -38,6 +38,11 @@ NS_ASSUME_NONNULL_BEGIN
/// @param enterHide 隐身进房 /// @param enterHide 隐身进房
- (void)changeEnterHide:(BOOL)enterHide; - (void)changeEnterHide:(BOOL)enterHide;
///获取贵族排行
- (void)getNobleRankList;
///获取贵族升级列表
- (void)getNobleUpgradeList;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -17,6 +17,7 @@
#import "NobleCenterModel.h" #import "NobleCenterModel.h"
#import "UserInfoModel.h" #import "UserInfoModel.h"
#import "NobleRechargeModel.h" #import "NobleRechargeModel.h"
#import "NobleRankListModel.h"
///P ///P
#import "XPNobleCenterProtocol.h" #import "XPNobleCenterProtocol.h"
@@ -46,7 +47,7 @@
[Api getChargeList:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api getChargeList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
NobleRechargeModel *model = [NobleRechargeModel modelWithDictionary:data.data]; NobleRechargeModel *model = [NobleRechargeModel modelWithDictionary:data.data];
[[self getView] onGetNobleRechargeDataSuccess:model]; [[self getView] onGetNobleRechargeDataSuccess:model];
}] channelType:channelType]; }]];
} }
/// ///
@@ -95,4 +96,20 @@
}] open:[NSString stringWithFormat:@"%d", enterHide]]; }] open:[NSString stringWithFormat:@"%d", enterHide]];
} }
///
- (void)getNobleRankList {
[Api vipRankList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
NobleRankListModel * listInfo = [NobleRankListModel modelWithDictionary:data.data];
[[self getView] getNobleRankListSuccess:listInfo];
}]];
}
///
- (void)getNobleUpgradeList {
[Api vipUpgradeList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
NSArray * list= [NObleRankUserModel modelsWithArray:data.data];
[[self getView] getNobleUpgradeListSuccess:list];
}]];
}
@end @end

View File

@@ -7,9 +7,9 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
@class NobleCenterModel, UserInfoModel, NobleRechargeModel; @class NobleCenterModel, UserInfoModel, NobleRechargeModel, NobleRankListModel;
@protocol XPNobleCenterProtocol <NSObject> @protocol XPNobleCenterProtocol <NSObject>
@optional
///获取贵族信息成功 ///获取贵族信息成功
- (void)getNobleCenterInfoSuccess:(NobleCenterModel *)model; - (void)getNobleCenterInfoSuccess:(NobleCenterModel *)model;
@@ -35,4 +35,9 @@
///开关隐身进房失败 ///开关隐身进房失败
- (void)changeEnterHideFail; - (void)changeEnterHideFail;
///获取升级信息
- (void)getNobleUpgradeListSuccess:(NSArray *)array;
///获取排行
- (void)getNobleRankListSuccess:(NobleRankListModel *)rankInfo;
@end @end

View File

@@ -0,0 +1,16 @@
//
// XPNobleDiscountView.h
// xplan-ios
//
// Created by 冯硕 on 2022/10/26.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@class NobleRechargeModel;
@interface XPNobleDiscountView : UIView
@property (nonatomic,strong) NobleRechargeModel *info;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,217 @@
//
// XPNobleDiscountView.m
// xplan-ios
//
// Created by on 2022/10/26.
//
#import "XPNobleDiscountView.h"
///Third
#import <Masonry/Masonry.h>
///Tool
#import "ThemeColor.h"
///Model
#import "NobleRechargeModel.h"
@interface XPNobleDiscountView ()
///
@property (nonatomic,strong) UIImageView *firstOpenImgView;
///
@property (nonatomic,strong) UIImageView *backImagView;
///
@property (nonatomic,strong) UILabel *moneyLabel;
///
@property (nonatomic,strong) UILabel *discountLabel;
///
@property (nonatomic,strong) UILabel *titleLabel;
///
@property (nonatomic,strong) UIStackView *openStackView;
///
@property (nonatomic,strong) UIImageView *coinImageView;
///
@property (nonatomic,strong) UILabel *coinLabe;;
@end
@implementation XPNobleDiscountView
- (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.backImagView];
[self addSubview:self.firstOpenImgView];
[self.openStackView addArrangedSubview:self.coinImageView];
[self.openStackView addArrangedSubview:self.coinLabe];
[self.backImagView addSubview:self.moneyLabel];
[self.backImagView addSubview:self.discountLabel];
[self.backImagView addSubview:self.titleLabel];
[self.backImagView addSubview:self.openStackView];
}
- (void)initSubViewConstraints {
[self.firstOpenImgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(80, 23));
make.left.mas_equalTo(self.backImagView.mas_left).offset(21);
make.top.mas_equalTo(self);
}];
[self.backImagView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(300, 44));
make.centerX.mas_equalTo(self);
make.top.mas_equalTo(self.firstOpenImgView.mas_bottom).offset(-4);
}];
[self.moneyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self.backImagView.mas_centerY).offset(-1);
make.centerX.mas_equalTo(self.backImagView);
}];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.backImagView);
make.top.mas_equalTo(self.backImagView.mas_centerY).offset(1);
}];
[self.discountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.moneyLabel.mas_right).offset(7);
make.centerY.mas_equalTo(self.moneyLabel);
make.size.mas_equalTo(CGSizeMake(20, 16));
}];
[self.openStackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.backImagView);
make.height.mas_equalTo(18);
make.centerY.mas_equalTo(self.backImagView);
}];
[self.coinImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(18);
}];
}
#pragma mark - Getters And Setters
- (void)setInfo:(NobleRechargeModel *)info {
_info = info;
if (_info) {
if(_info.oriPrice > 0 && _info.oriPrice != _info.money) {
self.firstOpenImgView.hidden = NO;
self.moneyLabel.hidden = NO;
self.discountLabel.hidden = NO;
self.titleLabel.hidden = NO;
self.openStackView.hidden = YES;
self.moneyLabel.text = [NSString stringWithFormat:@"仅需%0.f¥", _info.money];
self.discountLabel.text = [NSString stringWithFormat:@"%0.f", _info.oriPrice];
} else {
self.firstOpenImgView.hidden = YES;
self.moneyLabel.hidden = YES;
self.discountLabel.hidden = YES;
self.titleLabel.hidden = YES;
self.openStackView.hidden = NO;
NSString *title = [NSString stringWithFormat:@"%.0f立刻成为魔力贵族", _info.money];
self.coinLabe.text = title;
}
}
}
- (UIImageView *)firstOpenImgView {
if (!_firstOpenImgView) {
_firstOpenImgView = [[UIImageView alloc] init];
_firstOpenImgView.userInteractionEnabled = YES;
_firstOpenImgView.image = [UIImage imageNamed:@"noble_first_open_bg"];
_firstOpenImgView.hidden = YES;
}
return _firstOpenImgView;
}
- (UIImageView *)backImagView {
if (!_backImagView) {
_backImagView = [[UIImageView alloc] init];
_backImagView.userInteractionEnabled = YES;
_backImagView.image = [UIImage imageNamed:@"noble_open_btn_bg"];
}
return _backImagView;
}
- (UILabel *)moneyLabel {
if (!_moneyLabel) {
_moneyLabel = [[UILabel alloc] init];
_moneyLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightBold];
_moneyLabel.textColor = [ThemeColor colorWithHexString:@"#EA2B0D"];
}
return _moneyLabel;
}
- (UILabel *)discountLabel {
if (!_discountLabel) {
_discountLabel = [[UILabel alloc] init];
_discountLabel.font = [UIFont systemFontOfSize:16];
_discountLabel.textColor = [ThemeColor colorWithHexString:@"#BABBCD"];
UIBezierPath *path = [UIBezierPath bezierPath];
[path moveToPoint:CGPointMake(0, 5)];
[path addLineToPoint:CGPointMake(20, 12)];
CAShapeLayer * shapeLayer = [CAShapeLayer layer];
shapeLayer.strokeColor = [ThemeColor colorWithHexString:@"#BABBCD"].CGColor;
shapeLayer.fillColor = [UIColor clearColor].CGColor;
shapeLayer.path = path.CGPath;
shapeLayer.lineWidth = 1;
[_discountLabel.layer addSublayer:shapeLayer];
}
return _discountLabel;
}
- (UILabel *)titleLabel {
if (!_titleLabel) {
_titleLabel = [[UILabel alloc] init];
_titleLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
_titleLabel.textColor = [ThemeColor mainTextColor];
_titleLabel.text = @"即刻体验魔力贵族";
}
return _titleLabel;
}
- (UIStackView *)openStackView {
if (!_openStackView) {
_openStackView = [[UIStackView alloc] init];
_openStackView.axis = UILayoutConstraintAxisHorizontal;
_openStackView.distribution = UIStackViewDistributionFill;
_openStackView.alignment = UIStackViewAlignmentFill;
_openStackView.spacing = 4;
_openStackView.hidden = YES;
}
return _openStackView;
}
- (UIImageView *)coinImageView {
if (!_coinImageView) {
_coinImageView = [[UIImageView alloc] init];
_coinImageView.userInteractionEnabled = YES;
_coinImageView.image = [UIImage imageNamed:@"noble_open_btn"];
}
return _coinImageView;
}
- (UILabel *)coinLabe {
if (!_coinLabe) {
_coinLabe = [[UILabel alloc] init];
_coinLabe.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
_coinLabe.textColor = [ThemeColor mainTextColor];
}
return _coinLabe;
}
@end

View File

@@ -6,11 +6,12 @@
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "NobleRankListModel.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface XPNobleMyInfoView : UIView @interface XPNobleMyInfoView : UIView
///用户信息
@property (nonatomic,strong) NObleRankUserModel *userInfo;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -98,6 +98,16 @@
} }
#pragma mark - Getters And Setters #pragma mark - Getters And Setters
- (void)setUserInfo:(NObleRankUserModel *)userInfo {
_userInfo = userInfo;
if (_userInfo) {
self.avatarImageView.imageUrl = _userInfo.avatar;
self.nickLabel.text = _userInfo.nick;
self.rightsValueLabel.text = _userInfo.score;
}
}
- (UIView *)contentView { - (UIView *)contentView {
if (!_contentView) { if (!_contentView) {
_contentView = [[UIView alloc] init]; _contentView = [[UIView alloc] init];

View File

@@ -6,11 +6,12 @@
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "NobleRankListModel.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface XPNobleRankTableViewCell : UITableViewCell @interface XPNobleRankTableViewCell : UITableViewCell
///用户信息
@property (nonatomic,strong) NObleRankUserModel *userInfo;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -12,6 +12,7 @@
#import "ThemeColor.h" #import "ThemeColor.h"
#import "NetImageView.h" #import "NetImageView.h"
@interface XPNobleRankTableViewCell () @interface XPNobleRankTableViewCell ()
/// ///
@property (nonatomic,strong) UIButton *rankButton; @property (nonatomic,strong) UIButton *rankButton;
@@ -88,6 +89,29 @@
} }
#pragma mark - Getters And Setters #pragma mark - Getters And Setters
- (void)setUserInfo:(NObleRankUserModel *)userInfo {
_userInfo = userInfo;
if (_userInfo) {
self.avatarImageView.imageUrl = _userInfo.avatar;
self.nickLabel.text = _userInfo.nick;
self.rightsValueLabel.text = _userInfo.score;
if (_userInfo.rankNo == 1) {
[self.rankButton setTitle:@"" forState:UIControlStateNormal];
[self.rankButton setImage:[UIImage imageNamed:@"nobel_rank_first"] forState:UIControlStateNormal];
} else if(_userInfo.rankNo == 2) {
[self.rankButton setTitle:@"" forState:UIControlStateNormal];
[self.rankButton setImage:[UIImage imageNamed:@"nobel_rank_second"] forState:UIControlStateNormal];
} else if(_userInfo.rankNo == 3) {
[self.rankButton setTitle:@"" forState:UIControlStateNormal];
[self.rankButton setImage:[UIImage imageNamed:@"nobel_rank_third"] forState:UIControlStateNormal];
} else {
[self.rankButton setTitle:[NSString stringWithFormat:@"%ld", _userInfo.rankNo] forState:UIControlStateNormal];
[self.rankButton setImage:nil forState:UIControlStateNormal];
}
}
}
- (UIButton *)rankButton { - (UIButton *)rankButton {
if (!_rankButton) { if (!_rankButton) {
_rankButton = [UIButton buttonWithType:UIButtonTypeCustom]; _rankButton = [UIButton buttonWithType:UIButtonTypeCustom];

View File

@@ -12,13 +12,14 @@
#import <YYText.h> #import <YYText.h>
///Tool ///Tool
#import "ThemeColor.h" #import "ThemeColor.h"
#import "NetImageView.h"
///Model ///Model
#import "GiftLuckyBroadcastModel.h" #import "NobleRankListModel.h"
@interface XPNobleRankUpdateViewCell : UICollectionViewCell @interface XPNobleRankUpdateViewCell : UICollectionViewCell
@property (nonatomic,strong) YYLabel *titleLabel; @property (nonatomic,strong) YYLabel *titleLabel;
@property (nonatomic,strong) GiftLuckyBroadcastModel *giftInfo; @property (nonatomic,strong) NObleRankUserModel *userInfo;
@end @end
@implementation XPNobleRankUpdateViewCell @implementation XPNobleRankUpdateViewCell
@@ -53,24 +54,40 @@
return attribute; return attribute;
} }
#pragma mark - Getters And Setters - (NSMutableAttributedString *)createUrlImageAttribute:(NSString *)imageUrl cornerRadius:(CGFloat)cornerRadius {
- (void)setGiftInfo:(GiftLuckyBroadcastModel *)giftInfo { NetImageConfig *config = [[NetImageConfig alloc]init];
_giftInfo = giftInfo; ///
if (_giftInfo) { config.autoLoad = YES;
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init]; NetImageView *imageView = [[NetImageView alloc]initWithUrl:imageUrl config:config];
[attribute appendAttributedString:[self createTextAttribute:@"恭喜 " color:[UIColor whiteColor]]]; UIImage* image = imageView.image;
NSString * nick = _giftInfo.nick; if (image) {
if (nick.length > 6) { CGFloat scale = image.size.width / image.size.height;
nick = [nick substringToIndex:6]; imageView.bounds = CGRectMake(0, 0, 20 * scale, 20);
} } else {
[attribute appendAttributedString:[self createTextAttribute:[NSString stringWithFormat:@"%@ " , nick] color:[ThemeColor colorWithHexString:@"#FFD436"]]]; imageView.bounds = CGRectMake(0, 0, 20, 20);
[attribute appendAttributedString:[self createTextAttribute:@"开出幸运福袋获得 " color:[UIColor whiteColor]]];
[attribute appendAttributedString:[self createTextAttribute:[NSString stringWithFormat:@"%@ " , _giftInfo.luckyBagName] color:[ThemeColor colorWithHexString:@"#6FE3FF"]]];
self.titleLabel.attributedText = attribute;
} }
imageView.layer.masksToBounds = YES;
imageView.layer.cornerRadius = cornerRadius;
imageView.contentMode = UIViewContentModeScaleAspectFit;
NSMutableAttributedString * attrString = [NSMutableAttributedString yy_attachmentStringWithContent:imageView contentMode:UIViewContentModeScaleAspectFit attachmentSize:CGSizeMake(imageView.bounds.size.width, imageView.bounds.size.height) alignToFont:[UIFont systemFontOfSize:15.0] alignment:YYTextVerticalAlignmentCenter];
return attrString;
} }
#pragma mark - Getters And Setters
- (void)setUserInfo:(NObleRankUserModel *)userInfo {
_userInfo = userInfo;
if (_userInfo) {
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];
[attribute appendAttributedString:[self createTextAttribute:@"恭喜贵族" color:[UIColor whiteColor]]];
[attribute appendAttributedString:[self createUrlImageAttribute:_userInfo.avatar cornerRadius:10]];
[attribute appendAttributedString:[self createTextAttribute:_userInfo.nick color:[ThemeColor colorWithHexString:@"#F7DA94"]]];
[attribute appendAttributedString:[self createTextAttribute:@"升级为" color:[UIColor whiteColor]]];
[attribute appendAttributedString:[self createUrlImageAttribute:_userInfo.vipLogo cornerRadius:0]];
[attribute appendAttributedString:[self createTextAttribute:[NSString stringWithFormat:@"%@!", _userInfo.vipName] color:[UIColor whiteColor]]];
self.titleLabel.attributedText = attribute;
self.titleLabel.textAlignment = NSTextAlignmentCenter;
}
}
- (YYLabel *)titleLabel { - (YYLabel *)titleLabel {
if (!_titleLabel) { if (!_titleLabel) {
@@ -125,8 +142,8 @@
- (void)setupCustomCell:(UICollectionViewCell *)cell forIndex:(NSInteger)index cycleScrollView:(SDCycleScrollView *)view { - (void)setupCustomCell:(UICollectionViewCell *)cell forIndex:(NSInteger)index cycleScrollView:(SDCycleScrollView *)view {
XPNobleRankUpdateViewCell *myCell = (XPNobleRankUpdateViewCell *)cell; XPNobleRankUpdateViewCell *myCell = (XPNobleRankUpdateViewCell *)cell;
GiftLuckyBroadcastModel * info = [self.nobleList objectAtIndex:index]; NObleRankUserModel * info = [self.nobleList objectAtIndex:index];
myCell.giftInfo = info; myCell.userInfo = info;
} }
#pragma mark - Getters And Setters #pragma mark - Getters And Setters
@@ -134,8 +151,8 @@
_nobleList = nobleList; _nobleList = nobleList;
if (_nobleList.count > 0) { if (_nobleList.count > 0) {
NSMutableArray * array = [NSMutableArray array]; NSMutableArray * array = [NSMutableArray array];
for (GiftLuckyBroadcastModel * item in _nobleList) { for (NObleRankUserModel * item in _nobleList) {
[array addObject:item.giftName]; [array addObject:item.avatar];
} }
if (array.count > 0) { if (array.count > 0) {
self.cycleScrollView.imageURLStringsGroup = array; self.cycleScrollView.imageURLStringsGroup = array;

View File

@@ -32,6 +32,7 @@
#import "XPWebViewController.h" #import "XPWebViewController.h"
#import "XPNobleSettingViewController.h" #import "XPNobleSettingViewController.h"
#import "XPNobleRankViewController.h" #import "XPNobleRankViewController.h"
#import "XPNobleDiscountView.h"
///P ///P
#import "XPNobleCenterPresenter.h" #import "XPNobleCenterPresenter.h"
///model ///model
@@ -39,6 +40,7 @@
#import "UserInfoModel.h" #import "UserInfoModel.h"
#import "NobleRechargeModel.h" #import "NobleRechargeModel.h"
#import "AttachmentModel.h" #import "AttachmentModel.h"
#import "XPNobleDiscountView.h"
@interface XPNobleCenterViewController ()<JXCategoryViewDelegate, JXCategoryListContainerViewDelegate,XPNobleCenterNavViewDelegate, XPIAPHelperDelegate, NIMSystemNotificationManagerDelegate> @interface XPNobleCenterViewController ()<JXCategoryViewDelegate, JXCategoryListContainerViewDelegate,XPNobleCenterNavViewDelegate, XPIAPHelperDelegate, NIMSystemNotificationManagerDelegate>
/// ///
@@ -59,13 +61,12 @@
@property (nonatomic, strong) NobleCenterModel *model; @property (nonatomic, strong) NobleCenterModel *model;
/// ///
@property (nonatomic, strong) UserInfoModel *userInfo; @property (nonatomic, strong) UserInfoModel *userInfo;
///
@property (nonatomic, strong) UIButton *openNobleButton;
///- ///-
@property (nonatomic, strong) XPNobleCenterMyNobleView *myNobleView; @property (nonatomic, strong) XPNobleCenterMyNobleView *myNobleView;
/// ///
@property (nonatomic, assign) BOOL needUpdateUserInfo; @property (nonatomic, assign) BOOL needUpdateUserInfo;
///view
@property (nonatomic,strong) XPNobleDiscountView *openView;
///----- ///-----
@property (nonatomic, strong) NobleRechargeModel *rechargeModel; @property (nonatomic, strong) NobleRechargeModel *rechargeModel;
/// ///
@@ -121,7 +122,7 @@
[self.view addSubview:self.navView]; [self.view addSubview:self.navView];
[self.view addSubview:self.titleView]; [self.view addSubview:self.titleView];
[self.view addSubview:self.lineView]; [self.view addSubview:self.lineView];
[self.view addSubview:self.openNobleButton]; [self.view addSubview:self.openView];
[self.view addSubview:self.myNobleView]; [self.view addSubview:self.myNobleView];
[self.view addSubview:self.nobleRankButton]; [self.view addSubview:self.nobleRankButton];
} }
@@ -147,11 +148,11 @@
make.left.right.bottom.mas_equalTo(self.view); make.left.right.bottom.mas_equalTo(self.view);
make.top.mas_equalTo(self.titleView.mas_bottom); make.top.mas_equalTo(self.titleView.mas_bottom);
}]; }];
[self.openNobleButton mas_makeConstraints:^(MASConstraintMaker *make) { [self.openView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.view); make.centerX.mas_equalTo(self.view);
make.bottom.mas_equalTo(-kSafeAreaBottomHeight - 5); make.bottom.mas_equalTo(-kSafeAreaBottomHeight - 5);
make.width.mas_equalTo(300); make.width.mas_equalTo(300);
make.height.mas_equalTo(44); make.height.mas_equalTo(63);
}]; }];
[self.myNobleView mas_makeConstraints:^(MASConstraintMaker *make) { [self.myNobleView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(91+kSafeAreaBottomHeight); make.height.mas_equalTo(91+kSafeAreaBottomHeight);
@@ -202,7 +203,7 @@
} }
self.titles = names.copy; self.titles = names.copy;
self.titleView.titles = self.titles; self.titleView.titles = self.titles;
self.openNobleButton.hidden = self.userInfo.userVipInfoVO.vipLevel; self.openView.hidden = self.userInfo.userVipInfoVO.vipLevel;
self.myNobleView.hidden = !self.userInfo.userVipInfoVO.vipLevel; self.myNobleView.hidden = !self.userInfo.userVipInfoVO.vipLevel;
if (self.userInfo.userVipInfoVO) { if (self.userInfo.userVipInfoVO) {
self.myNobleView.model = model; self.myNobleView.model = model;
@@ -216,9 +217,7 @@
/// ///
- (void)onGetNobleRechargeDataSuccess:(NobleRechargeModel *)rechargeInfo { - (void)onGetNobleRechargeDataSuccess:(NobleRechargeModel *)rechargeInfo {
self.rechargeModel = rechargeInfo; self.rechargeModel = rechargeInfo;
RechargeListModel *rechargeModel = [self.rechargeModel.list objectAtIndex:0]; self.openView.info = rechargeInfo;
NSString *title = [NSString stringWithFormat:@"%@立刻成为魔力贵族", rechargeModel.money];
[self.openNobleButton setTitle:title forState:UIControlStateNormal];
} }
///id ///id
@@ -368,7 +367,7 @@
} }
#pragma mark - events #pragma mark - events
- (void)onOpenNobleButtonClick:(UIButton *)button { - (void)onOpenNobleButtonClick:(UITapGestureRecognizer *)button {
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventVipOpenClick]; [StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventVipOpenClick];
RechargeListModel *rechargeModel = [self.rechargeModel.list objectAtIndex:0]; RechargeListModel *rechargeModel = [self.rechargeModel.list objectAtIndex:0];
[self showLoading]; [self showLoading];
@@ -445,19 +444,6 @@
return _navView; return _navView;
} }
- (UIButton *)openNobleButton {
if (!_openNobleButton) {
_openNobleButton = [[UIButton alloc] init];
[_openNobleButton setImage:[UIImage imageNamed:@"noble_open_btn"] forState:UIControlStateNormal];
[_openNobleButton setBackgroundImage:[UIImage imageNamed:@"noble_open_btn_bg"] forState:UIControlStateNormal];
_openNobleButton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
[_openNobleButton setTitleColor:[ThemeColor mainTextColor] forState:UIControlStateNormal];
[_openNobleButton addTarget:self action:@selector(onOpenNobleButtonClick:) forControlEvents:UIControlEventTouchUpInside];
_openNobleButton.hidden = YES;
}
return _openNobleButton;
}
- (XPNobleCenterMyNobleView *)myNobleView { - (XPNobleCenterMyNobleView *)myNobleView {
if (!_myNobleView) { if (!_myNobleView) {
_myNobleView = [[XPNobleCenterMyNobleView alloc] init]; _myNobleView = [[XPNobleCenterMyNobleView alloc] init];
@@ -485,4 +471,13 @@
return _nobleRankButton; return _nobleRankButton;
} }
- (XPNobleDiscountView *)openView {
if(!_openView) {
_openView = [[XPNobleDiscountView alloc] init];
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onOpenNobleButtonClick:)];
[_openView addGestureRecognizer:tap];
}
return _openView;
}
@end @end

View File

@@ -15,7 +15,10 @@
#import "XPNobleRankTableViewCell.h" #import "XPNobleRankTableViewCell.h"
#import "XPNobleMyInfoView.h" #import "XPNobleMyInfoView.h"
#import "XPNobleRankUpdateView.h" #import "XPNobleRankUpdateView.h"
@interface XPNobleRankViewController ()<UITableViewDelegate, UITableViewDataSource> ///P
#import "XPNobleCenterPresenter.h"
#import "XPNobleCenterProtocol.h"
@interface XPNobleRankViewController ()<UITableViewDelegate, UITableViewDataSource,XPNobleCenterProtocol>
/// ///
@property (nonatomic,strong) UIButton *backButton; @property (nonatomic,strong) UIButton *backButton;
/// ///
@@ -29,7 +32,7 @@
/// ///
@property (nonatomic,strong) XPNobleMyInfoView *myInfoView; @property (nonatomic,strong) XPNobleMyInfoView *myInfoView;
/// ///
@property (nonatomic,strong) NSMutableArray *datasource; @property (nonatomic,strong) NSArray *datasource;
@end @end
@implementation XPNobleRankViewController @implementation XPNobleRankViewController
@@ -38,14 +41,24 @@
return YES; return YES;
} }
- (__kindof id)createPresenter {
return [[XPNobleCenterPresenter alloc] init];
}
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
[self initNobelRankData];
[self initSubViews]; [self initSubViews];
[self initSubViewConstraints]; [self initSubViewConstraints];
} }
#pragma mark - Private Method #pragma mark - Private Method
- (void)initNobelRankData {
[self.presenter getNobleRankList];
[self.presenter getNobleUpgradeList];
}
- (void)initSubViews { - (void)initSubViews {
self.view.backgroundColor = [ThemeColor colorWithHexString:@"#151515"]; self.view.backgroundColor = [ThemeColor colorWithHexString:@"#151515"];
[self.view addSubview:self.topImageView]; [self.view addSubview:self.topImageView];
@@ -73,7 +86,8 @@
[self.updateView mas_makeConstraints:^(MASConstraintMaker *make) { [self.updateView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.topImageView.mas_bottom).offset(8); make.top.mas_equalTo(self.topImageView.mas_bottom).offset(8);
make.centerX.mas_equalTo(self.view); make.centerX.mas_equalTo(self.view);
make.size.mas_equalTo(CGSizeMake(335, 40)); make.width.mas_equalTo(335);
make.height.mas_equalTo(40);;
}]; }];
[self.contentImageView mas_makeConstraints:^(MASConstraintMaker *make) { [self.contentImageView mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -107,6 +121,8 @@
if (cell == nil) { if (cell == nil) {
cell = [[XPNobleRankTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPNobleRankTableViewCell class])]; cell = [[XPNobleRankTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPNobleRankTableViewCell class])];
} }
NObleRankUserModel * userInfo = self.datasource[indexPath.row];
cell.userInfo = userInfo;
return cell; return cell;
} }
@@ -114,6 +130,22 @@
[tableView deselectRowAtIndexPath:indexPath animated:YES]; [tableView deselectRowAtIndexPath:indexPath animated:YES];
} }
#pragma mark - XPNobleCenterProtocol
- (void)getNobleRankListSuccess:(NobleRankListModel *)rankInfo {
self.datasource = rankInfo.ranks;
self.myInfoView.userInfo = rankInfo.myRank;
[self.tableView reloadData];
}
- (void)getNobleUpgradeListSuccess:(NSArray *)array {
self.updateView.nobleList = array;
if (array.count <= 0) {
[self.updateView mas_updateConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(0);
}];
}
}
#pragma mark - Event Response #pragma mark - Event Response
- (void)backButtonAction:(UIButton *)sender { - (void)backButtonAction:(UIButton *)sender {
[self.navigationController popViewControllerAnimated:YES]; [self.navigationController popViewControllerAnimated:YES];