1.0.18 feat:增加 VIP 权限设置页面 & API
This commit is contained in:
@@ -560,6 +560,7 @@
|
||||
54E82EAB2CA9261000C931D9 /* Api+Boom.m in Sources */ = {isa = PBXBuildFile; fileRef = 54E82EAA2CA9261000C931D9 /* Api+Boom.m */; };
|
||||
54E82EAE2CA9293C00C931D9 /* BoomInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 54E82EAD2CA9293C00C931D9 /* BoomInfoModel.m */; };
|
||||
54E82EB12CA93BE200C931D9 /* BoomInfoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 54E82EB02CA93BE200C931D9 /* BoomInfoViewController.m */; };
|
||||
54E8C4D62CC78DA900646C44 /* VipSettingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 54E8C4D52CC78DA900646C44 /* VipSettingViewController.m */; };
|
||||
54F179072C8EA48C00CB5219 /* Combo_Boom.svga in Resources */ = {isa = PBXBuildFile; fileRef = 54F179062C8EA48C00CB5219 /* Combo_Boom.svga */; };
|
||||
54F1790A2C8EDDF400CB5219 /* CountdownRingView.m in Sources */ = {isa = PBXBuildFile; fileRef = 54F179092C8EDDF400CB5219 /* CountdownRingView.m */; };
|
||||
54F469352C29711400A83655 /* XPMomentUserDataViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 54F469342C29711400A83655 /* XPMomentUserDataViewController.m */; };
|
||||
@@ -2680,6 +2681,8 @@
|
||||
54E82EAD2CA9293C00C931D9 /* BoomInfoModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BoomInfoModel.m; sourceTree = "<group>"; };
|
||||
54E82EAF2CA93BE200C931D9 /* BoomInfoViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BoomInfoViewController.h; sourceTree = "<group>"; };
|
||||
54E82EB02CA93BE200C931D9 /* BoomInfoViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BoomInfoViewController.m; sourceTree = "<group>"; };
|
||||
54E8C4D42CC78DA900646C44 /* VipSettingViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VipSettingViewController.h; sourceTree = "<group>"; };
|
||||
54E8C4D52CC78DA900646C44 /* VipSettingViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VipSettingViewController.m; sourceTree = "<group>"; };
|
||||
54F179062C8EA48C00CB5219 /* Combo_Boom.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = Combo_Boom.svga; sourceTree = "<group>"; };
|
||||
54F179082C8EDDF400CB5219 /* CountdownRingView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CountdownRingView.h; sourceTree = "<group>"; };
|
||||
54F179092C8EDDF400CB5219 /* CountdownRingView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CountdownRingView.m; sourceTree = "<group>"; };
|
||||
@@ -10915,6 +10918,8 @@
|
||||
54C9A1122C3D5A2300C6D970 /* XPGameOrdersListViewController.m */,
|
||||
23CEFB6A2AFB803B00576D89 /* PISwitchingEnvironmentVC.h */,
|
||||
23CEFB6B2AFB803B00576D89 /* PISwitchingEnvironmentVC.m */,
|
||||
54E8C4D42CC78DA900646C44 /* VipSettingViewController.h */,
|
||||
54E8C4D52CC78DA900646C44 /* VipSettingViewController.m */,
|
||||
23E9EA932A84BE4800B792F2 /* XPGiftUserDataViewController.h */,
|
||||
23E9EA922A84BE4800B792F2 /* XPGiftUserDataViewController.m */,
|
||||
54F469332C29711400A83655 /* XPMomentUserDataViewController.h */,
|
||||
@@ -11627,6 +11632,7 @@
|
||||
238B37B52AC55A2C00BFC9D5 /* XPTreasureFailyResultGiftCell.m in Sources */,
|
||||
23E9E9982A80C3A100B792F2 /* XPMineGuildPersonalBillStatisVC.m in Sources */,
|
||||
9B86D886281942D200494FCD /* SocialMicroView.m in Sources */,
|
||||
54E8C4D62CC78DA900646C44 /* VipSettingViewController.m in Sources */,
|
||||
E8664ED027E42238000171BA /* XPRoomPKTimePickerView.m in Sources */,
|
||||
E85E7B2B2A4EB0D300B6D00A /* XPNewGuildTimePickView.m in Sources */,
|
||||
E824544826F5945300BE8163 /* XPMinePayPwdProtocol.h in Sources */,
|
||||
|
@@ -39,15 +39,32 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// 一键还原装扮
|
||||
/// @param completion 完成
|
||||
+ (void)requestRecoveryDress:(HttpRequestHelperCompletion)completion;
|
||||
|
||||
/// 开关隐身进房
|
||||
/// @param complection 完成回调
|
||||
/// @param open 是否打开
|
||||
+ (void)changeEnterHidCompletion:(HttpRequestHelperCompletion)complection open:(NSString *)open;
|
||||
/// 使用钻石开通VIP
|
||||
/// @param complection 完成回调
|
||||
/// @param roomUid 房主的uid
|
||||
+(void)openWithDiamond:(HttpRequestHelperCompletion)complection roomUid:(NSString *)roomUid vipLevel:(NSString *)vipLevel;
|
||||
|
||||
/// VIP 隐身进房开关
|
||||
/// @param complection 完成回调
|
||||
/// @param open 是否打开
|
||||
+ (void)changeEnterHideCompletion:(HttpRequestHelperCompletion)complection open:(NSString *)open;
|
||||
|
||||
/// VIP 防关注开关
|
||||
/// @param completion 完成回调
|
||||
/// @param open 是否打开
|
||||
+ (void)changePreventFollowCompletion:(HttpRequestHelperCompletion)completion open:(NSString *)open;
|
||||
|
||||
/// VIP 防跟随开关
|
||||
/// @param completion 完成回调
|
||||
/// @param open 是否打开
|
||||
+ (void)changePreventTraceCompletion:(HttpRequestHelperCompletion)completion open:(NSString *)open;
|
||||
|
||||
/// VIP 防被踢开关
|
||||
/// @param completion 完成回调
|
||||
/// @param open 是否打开
|
||||
+ (void)changePreventKickCompletion:(HttpRequestHelperCompletion)completion open:(NSString *)open;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -57,12 +57,6 @@
|
||||
[self makeRequest:@"vip/recoveryDress" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, nil];
|
||||
}
|
||||
|
||||
/// 开关隐身进房
|
||||
/// @param complection 完成回调
|
||||
/// @param open 是否打开
|
||||
+ (void)changeEnterHidCompletion:(HttpRequestHelperCompletion)complection open:(NSString *)open {
|
||||
[self makeRequest:@"vip/changeInvisibleInRoom" method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__,open, nil];
|
||||
}
|
||||
/// 使用钻石开通VIP
|
||||
/// @param complection 完成回调
|
||||
/// @param roomUid 房主的uid
|
||||
@@ -76,4 +70,24 @@
|
||||
}
|
||||
[HttpRequestHelper request:@"vip/openWithDiamond" method:HttpRequestHelperMethodPOST params:dic completion:complection];
|
||||
}
|
||||
|
||||
/// 开关隐身进房
|
||||
/// @param complection 完成回调
|
||||
/// @param open 是否打开
|
||||
+ (void)changeEnterHideCompletion:(HttpRequestHelperCompletion)complection open:(NSString *)open {
|
||||
[self makeRequest:@"vip/changeInvisibleInRoom" method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__,open, nil];
|
||||
}
|
||||
|
||||
+ (void)changePreventFollowCompletion:(HttpRequestHelperCompletion)completion open:(NSString *)open {
|
||||
[self makeRequest:@"vip/changePreventFollow" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__,open, nil];
|
||||
}
|
||||
|
||||
+ (void)changePreventTraceCompletion:(HttpRequestHelperCompletion)completion open:(NSString *)open {
|
||||
[self makeRequest:@"vip/changePreventTrace" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__,open, nil];
|
||||
}
|
||||
|
||||
+ (void)changePreventKickCompletion:(HttpRequestHelperCompletion)completion open:(NSString *)open; {
|
||||
[self makeRequest:@"vip/changePreventKick" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__,open, nil];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -34,9 +34,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// @param transcations 凭据的数组
|
||||
- (void)checkTranscationIds:(NSArray *)transcations;
|
||||
|
||||
/// 切换隐身进房
|
||||
/// @param enterHide 隐身进房
|
||||
- (void)changeEnterHide:(BOOL)enterHide;
|
||||
|
||||
/// 使用钻石开通VIP
|
||||
|
||||
/// @param roomUid 房主的uid
|
||||
@@ -45,6 +43,13 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
//联系客服
|
||||
-(void)getContactCustomerService;
|
||||
|
||||
|
||||
/// 切换隐身进房
|
||||
/// @param enterHide 隐身进房
|
||||
- (void)changeEnterHide:(BOOL)enterHide;
|
||||
- (void)changePreventFollow:(BOOL)preventFollow;
|
||||
- (void)changePreventTrace:(BOOL)preventTrace;
|
||||
- (void)changePreventKick:(BOOL)preventKick;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -115,15 +115,47 @@
|
||||
/// @param enterHide 隐身进房
|
||||
- (void)changeEnterHide:(BOOL)enterHide {
|
||||
@kWeakify(self);
|
||||
[Api changeEnterHidCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[Api changeEnterHideCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
@kStrongify(self);
|
||||
[[self getView] changeEnterHideSuccess];
|
||||
[[self getView] changeEnterHideSuccess:YES];
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
@kStrongify(self);
|
||||
[[self getView] changeEnterHideFail];
|
||||
}] open:[NSString stringWithFormat:@"%d", enterHide]];
|
||||
} showLoading:YES errorToast:YES] open:[NSString stringWithFormat:@"%d", enterHide]];
|
||||
}
|
||||
|
||||
- (void)changePreventFollow:(BOOL)preventFollow {
|
||||
@kWeakify(self);
|
||||
[Api changePreventFollowCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
@kStrongify(self);
|
||||
[[self getView] changePreventFollowSuccess:YES];
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
@kStrongify(self);
|
||||
[[self getView] changePreventFollowFail];
|
||||
} showLoading:YES errorToast:YES] open:[NSString stringWithFormat:@"%d", preventFollow]];
|
||||
}
|
||||
|
||||
- (void)changePreventTrace:(BOOL)preventTrace {
|
||||
@kWeakify(self);
|
||||
[Api changePreventTraceCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
@kStrongify(self);
|
||||
[[self getView] changePreventTraceSuccess:YES];
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
@kStrongify(self);
|
||||
[[self getView] changePreventTraceFail];
|
||||
} showLoading:YES errorToast:YES] open:[NSString stringWithFormat:@"%d", preventTrace]];
|
||||
}
|
||||
|
||||
- (void)changePreventKick:(BOOL)preventKick {
|
||||
@kWeakify(self);
|
||||
[Api changePreventKickCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
@kStrongify(self);
|
||||
[[self getView] changePreventKickSuccess:YES];
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
@kStrongify(self);
|
||||
[[self getView] changePreventKickFail];
|
||||
} showLoading:YES errorToast:YES] open:[NSString stringWithFormat:@"%d", preventKick]];
|
||||
}
|
||||
/// 使用钻石开通VIP
|
||||
|
||||
/// @param roomUid 房主的uid
|
||||
- (void)openVipWithDiamondRoomUid:(NSString *)roomUid vipLevel:(NSString *)vipLevel{
|
||||
@@ -147,4 +179,7 @@
|
||||
|
||||
} showLoading:YES errorToast:NO]];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
@@ -32,10 +32,22 @@
|
||||
///批量验证凭据成功
|
||||
- (void)checkTranscationIdsSuccess;
|
||||
|
||||
///开关隐身进房成功
|
||||
- (void)changeEnterHideSuccess;
|
||||
///开关隐身进房失败
|
||||
///VIP 开关隐身进房成功
|
||||
- (void)changeEnterHideSuccess:(BOOL)switchStatus;
|
||||
///VIP 开关隐身进房失败
|
||||
- (void)changeEnterHideFail;
|
||||
///VIP 防关注开关修改成功
|
||||
- (void)changePreventFollowSuccess:(BOOL)switchStatus;
|
||||
///VIP 防关注开关修改失败
|
||||
- (void)changePreventFollowFail;
|
||||
///VIP 防跟随开关修改成功
|
||||
- (void)changePreventTraceSuccess:(BOOL)switchStatus;
|
||||
///VIP 防跟随开关修改失败
|
||||
- (void)changePreventTraceFail;
|
||||
///VIP 防被踢开关修改成功
|
||||
- (void)changePreventKickSuccess:(BOOL)switchStatus;
|
||||
///VIP 防被踢开关修改失败
|
||||
- (void)changePreventKickFail;
|
||||
///钻石开通会员成功
|
||||
-(void)openVipWithDiamondSuccess;
|
||||
///钻石开通会员失败
|
||||
|
@@ -340,9 +340,7 @@
|
||||
@property (nonatomic, strong) NobleInfo *currentVIPInfo;
|
||||
@property (nonatomic, strong) NobleCenterModel *vipModel;
|
||||
@property (nonatomic, strong) WalletInfoModel *walletInfo;
|
||||
//@property(nonatomic,strong) RechargeListModel *rechargeModel;
|
||||
|
||||
//@property (nonatomic, copy) NSArray <RechargeListModel *> *rechargeList;
|
||||
@property (nonatomic, copy) NSArray <VIPExclusivePrivilegesCard *> *exclusivePrivilegesCards;
|
||||
|
||||
@property (nonatomic, strong) UIStackView *identificationStack;
|
||||
@@ -751,8 +749,6 @@
|
||||
}
|
||||
|
||||
- (void)updateExclusivePrivilegesArea {
|
||||
// NSInteger currentPage = self.vipCardCyclePager.curIndex;
|
||||
// NobleInfo *currentInfo = [self.vipModel.vipInfos xpSafeObjectAtIndex:currentPage];
|
||||
NSInteger enableCount = 0;
|
||||
if (self.currentVIPInfo) {
|
||||
for (VIPExclusivePrivilegesCard *v in self.exclusivePrivilegesCards) {
|
||||
@@ -849,8 +845,8 @@
|
||||
NobleCenterModel *model = [NobleCenterModel modelWithDictionary:data.data];
|
||||
self.vipModel = model;
|
||||
|
||||
NSMutableArray *tempArray_1 = @[].mutableCopy;
|
||||
NSMutableArray *tempArray_2 = @[].mutableCopy;
|
||||
__block NSMutableArray *tempArray_1 = @[].mutableCopy;
|
||||
__block NSMutableArray *tempArray_2 = @[].mutableCopy;
|
||||
[model.vipAuthInfos enumerateObjectsUsingBlock:^(NobleAuthInfo * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
if (obj.authType == 1 || obj.authType == 5 || obj.authType == 8 || obj.authType == 11 || obj.authType == 12) {
|
||||
[tempArray_1 addObject:obj];
|
||||
|
@@ -7,7 +7,182 @@
|
||||
|
||||
#import "VipSettingViewController.h"
|
||||
|
||||
@interface VipSettingViewController ()
|
||||
#import "Api.h"
|
||||
#import "UserInfoModel.h"
|
||||
#import "XPNobleCenterProtocol.h"
|
||||
#import "XPNobleCenterPresenter.h"
|
||||
|
||||
@interface VipSettingCell : UITableViewCell
|
||||
|
||||
@property (nonatomic, copy) NSString *title;
|
||||
@property (nonatomic, assign) NSInteger minLevel;
|
||||
@property (nonatomic, assign) NSInteger maxLevel;
|
||||
|
||||
@property (nonatomic, strong) UIStackView *stack;
|
||||
@property (nonatomic, strong) UIImageView *vip_5;
|
||||
@property (nonatomic, strong) UIImageView *vip_6;
|
||||
@property (nonatomic, strong) UIImageView *vip_7;
|
||||
@property (nonatomic, strong) UIImageView *vip_8;
|
||||
@property (nonatomic, strong) UIImageView *vip_9;
|
||||
@property (nonatomic, strong) UILabel *titleLabel;
|
||||
@property (nonatomic, strong) UISwitch *vipSwitch;
|
||||
@property (nonatomic, assign) NSInteger index;
|
||||
@property (nonatomic, assign) BOOL switchStatus;
|
||||
|
||||
@property (nonatomic, copy) void(^switchUpdate)(BOOL switchState, NSInteger index);
|
||||
|
||||
@end
|
||||
|
||||
@implementation VipSettingCell
|
||||
|
||||
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
|
||||
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
|
||||
self.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
|
||||
UIView *container = [[UIView alloc] init];
|
||||
container.backgroundColor = UIColorFromRGB(0xF2F3F7);
|
||||
container.layer.cornerRadius = 8;
|
||||
container.layer.masksToBounds = YES;
|
||||
[self.contentView addSubview:container];
|
||||
[container mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(self.contentView.mas_width).offset(-16);
|
||||
make.height.mas_equalTo(64);
|
||||
make.top.mas_equalTo(self.contentView).offset(20);
|
||||
}];
|
||||
|
||||
[self.stack addArrangedSubview:self.vip_5];
|
||||
[self.stack addArrangedSubview:self.vip_6];
|
||||
[self.stack addArrangedSubview:self.vip_7];
|
||||
[self.stack addArrangedSubview:self.vip_8];
|
||||
[self.stack addArrangedSubview:self.vip_9];
|
||||
[container addSubview:self.stack];
|
||||
[self.stack mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.leading.mas_equalTo(10);
|
||||
make.height.mas_equalTo(20);
|
||||
}];
|
||||
|
||||
[self.vip_5 mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(42, 20));
|
||||
}];
|
||||
[self.vip_6 mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(42, 20));
|
||||
}];
|
||||
[self.vip_7 mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(42, 20));
|
||||
}];
|
||||
[self.vip_8 mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(42, 20));
|
||||
}];
|
||||
[self.vip_9 mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(42, 20));
|
||||
}];
|
||||
|
||||
[container addSubview:self.vipSwitch];
|
||||
[self.vipSwitch mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.mas_equalTo(container);
|
||||
make.trailing.mas_equalTo(container).offset(-20);
|
||||
make.size.mas_equalTo(CGSizeMake(34, 20));
|
||||
}];
|
||||
|
||||
[container addSubview:self.titleLabel];
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.mas_equalTo(10);
|
||||
make.top.mas_equalTo(self.stack.mas_bottom).offset(10);
|
||||
}];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)setMaxLevel:(NSInteger)maxLevel {
|
||||
_maxLevel = maxLevel;
|
||||
self.titleLabel.text = self.title;
|
||||
self.vip_5.hidden = self.minLevel>5;
|
||||
self.vip_6.hidden = self.minLevel>6;
|
||||
self.vip_7.hidden = self.minLevel>7;
|
||||
self.vip_8.hidden = self.minLevel>8;
|
||||
self.vipSwitch.on = self.switchStatus;
|
||||
}
|
||||
|
||||
- (void)onSwitchChange:(UISwitch *)sender {
|
||||
if (self.switchUpdate) {
|
||||
self.switchUpdate(sender.isOn, self.index);
|
||||
}
|
||||
}
|
||||
|
||||
- (UIStackView *)stack {
|
||||
if (!_stack) {
|
||||
_stack = [[UIStackView alloc] init];
|
||||
_stack.spacing = 5;
|
||||
_stack.alignment = UIStackViewAlignmentLeading;
|
||||
}
|
||||
return _stack;
|
||||
}
|
||||
|
||||
- (UIImageView *)vip_5 {
|
||||
if (!_vip_5) {
|
||||
_vip_5 = [[UIImageView alloc] initWithImage:kImage(@"vip_setting_level_5")];
|
||||
_vip_5.contentMode = UIViewContentModeScaleAspectFill;
|
||||
}
|
||||
return _vip_5;
|
||||
}
|
||||
- (UIImageView *)vip_6 {
|
||||
if (!_vip_6) {
|
||||
_vip_6 = [[UIImageView alloc] initWithImage:kImage(@"vip_setting_level_6")];
|
||||
_vip_6.contentMode = UIViewContentModeScaleAspectFill;
|
||||
}
|
||||
return _vip_6;
|
||||
}
|
||||
- (UIImageView *)vip_7 {
|
||||
if (!_vip_7) {
|
||||
_vip_7 = [[UIImageView alloc] initWithImage:kImage(@"vip_setting_level_7")];
|
||||
_vip_7.contentMode = UIViewContentModeScaleAspectFill;
|
||||
}
|
||||
return _vip_7;
|
||||
}
|
||||
- (UIImageView *)vip_8 {
|
||||
if (!_vip_8) {
|
||||
_vip_8 = [[UIImageView alloc] initWithImage:kImage(@"vip_setting_level_8")];
|
||||
_vip_8.contentMode = UIViewContentModeScaleAspectFill;
|
||||
}
|
||||
return _vip_8;
|
||||
}
|
||||
- (UIImageView *)vip_9 {
|
||||
if (!_vip_9) {
|
||||
_vip_9 = [[UIImageView alloc] initWithImage:kImage(@"vip_setting_level_9")];
|
||||
_vip_9.contentMode = UIViewContentModeScaleAspectFill;
|
||||
}
|
||||
return _vip_9;
|
||||
}
|
||||
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [UILabel labelInitWithText:@""
|
||||
font:kFontMedium(14)
|
||||
textColor:UIColorFromRGB(0x313131)];
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
- (UISwitch *)vipSwitch {
|
||||
if (!_vipSwitch) {
|
||||
_vipSwitch = [[UISwitch alloc] init];
|
||||
_vipSwitch.onTintColor = UIColorFromRGB(0xff8c03);
|
||||
[_vipSwitch addTarget:self
|
||||
action:@selector(onSwitchChange:)
|
||||
forControlEvents:UIControlEventValueChanged];
|
||||
_vipSwitch.transform = CGAffineTransformMakeScale(0.8, 0.8);
|
||||
}
|
||||
return _vipSwitch;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@interface VipSettingViewController () <UITableViewDelegate, UITableViewDataSource, XPNobleCenterProtocol>
|
||||
|
||||
@property (nonatomic, strong) UserInfoModel *userInfo;
|
||||
@property (nonatomic, strong) UITableView *tableView;
|
||||
|
||||
@end
|
||||
|
||||
@@ -15,17 +190,181 @@
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
|
||||
self.title = YMLocalizedString(@"VipSettin_1.0.17_0");
|
||||
self.view.backgroundColor = [UIColor whiteColor];
|
||||
|
||||
[self.view addSubview:self.tableView];
|
||||
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.mas_equalTo(self.view).offset(16);
|
||||
make.top.trailing.bottom.mas_equalTo(self.view);
|
||||
}];
|
||||
|
||||
[self showLoading];
|
||||
@kWeakify(self);
|
||||
[Api getUserInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
@kStrongify(self);
|
||||
if (code == 200) {
|
||||
[self hideHUD];
|
||||
self.userInfo = [UserInfoModel modelWithDictionary:data.data];
|
||||
[self.tableView reloadData];
|
||||
} else {
|
||||
[self showErrorToast:msg];
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
}
|
||||
} uid:[[AccountInfoStorage instance] getUid]];
|
||||
}
|
||||
|
||||
/*
|
||||
#pragma mark - Navigation
|
||||
|
||||
// In a storyboard-based application, you will often want to do a little preparation before navigation
|
||||
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
|
||||
// Get the new view controller using [segue destinationViewController].
|
||||
// Pass the selected object to the new view controller.
|
||||
- (XPNobleCenterPresenter *)createPresenter {
|
||||
return [[XPNobleCenterPresenter alloc] init];;
|
||||
}
|
||||
|
||||
- (void)handleSwitchUpdate:(BOOL)switchStatus atIndex:(NSInteger)index {
|
||||
self.tableView.userInteractionEnabled = false;
|
||||
switch (index) {
|
||||
case 0:
|
||||
/// 防关注
|
||||
[self.presenter changePreventFollow:switchStatus];
|
||||
break;
|
||||
case 1:
|
||||
/// 防跟随
|
||||
[self.presenter changePreventTrace:switchStatus];
|
||||
break;
|
||||
case 2:
|
||||
/// 隐身
|
||||
[self.presenter changeEnterHide:switchStatus];
|
||||
break;
|
||||
case 3:
|
||||
/// 防被踢
|
||||
[self.presenter changePreventKick:switchStatus];
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
///开关隐身进房成功
|
||||
- (void)changeEnterHideSuccess:(BOOL)switchStatus {
|
||||
[self switchUpdateEnd];
|
||||
// [self.userInfo.userVipInfoVO setEnterHide:<#(BOOL)#>]
|
||||
}
|
||||
|
||||
///开关隐身进房失败
|
||||
- (void)changeEnterHideFail {
|
||||
[self switchUpdateEnd];
|
||||
}
|
||||
|
||||
///防关注开关修改成功
|
||||
- (void)changePreventFollowSuccess:(BOOL)switchStatus {
|
||||
[self switchUpdateEnd];
|
||||
}
|
||||
|
||||
///防关注开关修改失败
|
||||
- (void)changePreventFollowFail {
|
||||
[self switchUpdateEnd];
|
||||
}
|
||||
|
||||
///防跟随开关修改成功
|
||||
- (void)changePreventTraceSuccess:(BOOL)switchStatus {
|
||||
[self switchUpdateEnd];
|
||||
}
|
||||
|
||||
///防跟随开关修改失败
|
||||
- (void)changePreventTraceFail {
|
||||
[self switchUpdateEnd];
|
||||
}
|
||||
|
||||
///VIP 防被踢开关修改成功
|
||||
- (void)changePreventKickSuccess:(BOOL)switchStatus {
|
||||
[self switchUpdateEnd];
|
||||
}
|
||||
|
||||
///VIP 防被踢开关修改失败
|
||||
- (void)changePreventKickFail {
|
||||
[self switchUpdateEnd];
|
||||
}
|
||||
|
||||
- (void)switchUpdateEnd {
|
||||
[self.tableView reloadData];
|
||||
self.tableView.userInteractionEnabled = YES;
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
|
||||
return 20;
|
||||
}
|
||||
|
||||
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
|
||||
return [UILabel labelInitWithText:YMLocalizedString(@"VipSettin_1.0.17_1")
|
||||
font:kFontSemibold(16)
|
||||
textColor:UIColorFromRGB(0x313131)];
|
||||
}
|
||||
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
return 84;
|
||||
}
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
||||
return 4;
|
||||
}
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
VipSettingCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([VipSettingCell class])];
|
||||
switch (indexPath.row) {
|
||||
case 0:
|
||||
// 关注
|
||||
cell.title = YMLocalizedString(@"VipSettin_1.0.17_2");
|
||||
cell.switchStatus = self.userInfo.userVipInfoVO.preventFollow;
|
||||
cell.minLevel = 5;
|
||||
break;
|
||||
case 1:
|
||||
// 跟随进房
|
||||
cell.title = YMLocalizedString(@"VipSettin_1.0.17_3");
|
||||
cell.switchStatus = self.userInfo.userVipInfoVO.preventTrace;
|
||||
cell.minLevel = 6;
|
||||
break;
|
||||
case 2:
|
||||
// 隐身进房
|
||||
cell.title = YMLocalizedString(@"VipSettin_1.0.17_4");
|
||||
cell.switchStatus = self.userInfo.userVipInfoVO.enterHide;
|
||||
cell.minLevel = 7;
|
||||
break;
|
||||
case 3:
|
||||
// 防被踢
|
||||
cell.title = YMLocalizedString(@"VipSettin_1.0.17_5");
|
||||
cell.switchStatus = self.userInfo.userVipInfoVO.preventKick;
|
||||
cell.minLevel = 8;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
cell.maxLevel = 9;
|
||||
cell.index = indexPath.row;
|
||||
|
||||
@kWeakify(self);
|
||||
[cell setSwitchUpdate:^(BOOL switchState, NSInteger index) {
|
||||
@kStrongify(self);
|
||||
[self handleSwitchUpdate:switchState atIndex:index];
|
||||
}];
|
||||
|
||||
return cell;
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
- (UITableView *)tableView {
|
||||
if (!_tableView) {
|
||||
_tableView = [[UITableView alloc] initWithFrame:CGRectZero
|
||||
style:UITableViewStylePlain];
|
||||
_tableView.scrollEnabled = NO;
|
||||
_tableView.delegate = self;
|
||||
_tableView.dataSource = self;
|
||||
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
[_tableView registerClass:[VipSettingCell class]
|
||||
forCellReuseIdentifier:NSStringFromClass([VipSettingCell class])];
|
||||
}
|
||||
return _tableView;
|
||||
}
|
||||
*/
|
||||
|
||||
@end
|
||||
|
@@ -29,6 +29,14 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic,assign) BOOL lookHomepageHide;
|
||||
|
||||
@property (nonatomic, copy) NSString *userCardBG;
|
||||
/// 是否可以上传动态头像
|
||||
@property (nonatomic, assign) BOOL uploadGifAvatar;
|
||||
/// 过期时间
|
||||
@property (nonatomic, assign) NSTimeInterval expireTime;
|
||||
/// 是否防跟踪
|
||||
@property (nonatomic, assign) BOOL preventTrace;
|
||||
/// 是否防关注
|
||||
@property (nonatomic, assign) BOOL preventFollow;
|
||||
|
||||
@end
|
||||
|
||||
|
@@ -3954,3 +3954,10 @@ ineHeadView12" = "الحمل";
|
||||
"RoomMicState_2" = "لقد أوقفت الموسيقى والميكروفون.";
|
||||
|
||||
"UserInfoEdit_1.0.17_0" = "Gif 头像";
|
||||
"RoomSetting_1.0.17_0" = "房间头像";
|
||||
"VipSettin_1.0.17_0" = "VIP 设置";
|
||||
"VipSettin_1.0.17_1" = "VIP privilege";
|
||||
"VipSettin_1.0.17_2" = "Not being Followed";
|
||||
"VipSettin_1.0.17_3" = "Anti-Entering Room";
|
||||
"VipSettin_1.0.17_4" = "Invisibility";
|
||||
"VipSettin_1.0.17_5" = "Anti-Kick";
|
||||
|
@@ -3750,3 +3750,10 @@
|
||||
"RoomMicState_2" = "You turned off the music and the mic.";
|
||||
|
||||
"UserInfoEdit_1.0.17_0" = "Gif 头像";
|
||||
"RoomSetting_1.0.17_0" = "房间头像";
|
||||
"VipSettin_1.0.17_0" = "VIP 设置";
|
||||
"VipSettin_1.0.17_1" = "VIP privilege";
|
||||
"VipSettin_1.0.17_2" = "Not being Followed";
|
||||
"VipSettin_1.0.17_3" = "Anti-Entering Room";
|
||||
"VipSettin_1.0.17_4" = "Invisibility";
|
||||
"VipSettin_1.0.17_5" = "Anti-Kick";
|
||||
|
@@ -3415,3 +3415,9 @@
|
||||
|
||||
"UserInfoEdit_1.0.17_0" = "Gif 头像";
|
||||
"RoomSetting_1.0.17_0" = "房间头像";
|
||||
"VipSettin_1.0.17_0" = "VIP 设置";
|
||||
"VipSettin_1.0.17_1" = "VIP privilege";
|
||||
"VipSettin_1.0.17_2" = "Not being Followed";
|
||||
"VipSettin_1.0.17_3" = "Anti-Entering Room";
|
||||
"VipSettin_1.0.17_4" = "Invisibility";
|
||||
"VipSettin_1.0.17_5" = "Anti-Kick";
|
||||
|
@@ -3406,3 +3406,11 @@
|
||||
"RoomMicState_2" = "你關掉了音樂和麥克風。";
|
||||
|
||||
"UserInfoEdit_1.0.17_0" = "Gif 头像";
|
||||
"RoomSetting_1.0.17_0" = "房间头像";
|
||||
"VipSettin_1.0.17_0" = "VIP 设置";
|
||||
"VipSettin_1.0.17_1" = "VIP privilege";
|
||||
"VipSettin_1.0.17_2" = "Not being Followed";
|
||||
"VipSettin_1.0.17_3" = "Anti-Entering Room";
|
||||
"VipSettin_1.0.17_4" = "Invisibility";
|
||||
"VipSettin_1.0.17_5" = "Anti-Kick";
|
||||
|
||||
|
Reference in New Issue
Block a user