贵族系统自动佩戴装扮逻辑优化
This commit is contained in:
22
xplan-ios/Assets.xcassets/Mine/Noble/noble_upgrade_dressBtn.imageset/Contents.json
vendored
Normal file
22
xplan-ios/Assets.xcassets/Mine/Noble/noble_upgrade_dressBtn.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "noble_upgrade_dressBtn@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "noble_upgrade_dressBtn@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
xplan-ios/Assets.xcassets/Mine/Noble/noble_upgrade_dressBtn.imageset/noble_upgrade_dressBtn@2x.png
vendored
Normal file
BIN
xplan-ios/Assets.xcassets/Mine/Noble/noble_upgrade_dressBtn.imageset/noble_upgrade_dressBtn@2x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.8 KiB |
BIN
xplan-ios/Assets.xcassets/Mine/Noble/noble_upgrade_dressBtn.imageset/noble_upgrade_dressBtn@3x.png
vendored
Normal file
BIN
xplan-ios/Assets.xcassets/Mine/Noble/noble_upgrade_dressBtn.imageset/noble_upgrade_dressBtn@3x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.9 KiB |
22
xplan-ios/Assets.xcassets/Mine/Noble/noble_upgrade_keepBtn.imageset/Contents.json
vendored
Normal file
22
xplan-ios/Assets.xcassets/Mine/Noble/noble_upgrade_keepBtn.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "noble_upgrade_keepBtn@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "noble_upgrade_keepBtn@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
xplan-ios/Assets.xcassets/Mine/Noble/noble_upgrade_keepBtn.imageset/noble_upgrade_keepBtn@2x.png
vendored
Normal file
BIN
xplan-ios/Assets.xcassets/Mine/Noble/noble_upgrade_keepBtn.imageset/noble_upgrade_keepBtn@2x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
BIN
xplan-ios/Assets.xcassets/Mine/Noble/noble_upgrade_keepBtn.imageset/noble_upgrade_keepBtn@3x.png
vendored
Normal file
BIN
xplan-ios/Assets.xcassets/Mine/Noble/noble_upgrade_keepBtn.imageset/noble_upgrade_keepBtn@3x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
@@ -33,6 +33,11 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
ticket:(NSString *)ticket
|
||||
deviceInfo:(NSString *)deviceInfo
|
||||
clientIp:(NSString *)clientIp;
|
||||
|
||||
/// 一键还原装扮
|
||||
/// @param completion 完成
|
||||
+ (void)requestRecoveryDress:(HttpRequestHelperCompletion)completion;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -41,4 +41,10 @@
|
||||
[self makeRequest:@"order/placeV2" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__,chargeProdId, uid, roomUid, ticket, deviceInfo, clientIp, nil];
|
||||
}
|
||||
|
||||
/// 一键还原装扮
|
||||
/// @param completion 完成
|
||||
+ (void)requestRecoveryDress:(HttpRequestHelperCompletion)completion {
|
||||
[self makeRequest:@"vip/recoveryDress" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, nil];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -8,6 +8,8 @@
|
||||
#import "XPNobleUpgradeLevelView.h"
|
||||
///tool
|
||||
#import "ThemeColor+NobleCenter.h"
|
||||
#import "Api+NobleCenter.h"
|
||||
#import "XCHUDTool.h"
|
||||
//SVGA动画播放
|
||||
#import "SVGA.h"
|
||||
#import "XPMacro.h"
|
||||
@@ -31,14 +33,16 @@
|
||||
@property (nonatomic, strong) UILabel *titleLabel;
|
||||
///等级提升标题
|
||||
@property (nonatomic, strong) UILabel *subTitleLabel;
|
||||
///描述
|
||||
@property (nonatomic, strong) UILabel *descLabel;
|
||||
///关闭按钮
|
||||
@property (nonatomic, strong) UIButton *closeButton;
|
||||
///跳转按钮
|
||||
///前往贵族中心
|
||||
@property (nonatomic, strong) UIButton *jumpButton;
|
||||
|
||||
@property (strong, nonatomic) SVGAParser *parser;
|
||||
///保留原有装扮
|
||||
@property (nonatomic, strong) UIButton *keepOriginalButton;
|
||||
///佩戴高等级装扮
|
||||
@property (nonatomic, strong) UIButton *dressHighLevelButton;
|
||||
|
||||
@end
|
||||
|
||||
@@ -70,19 +74,31 @@
|
||||
self.subTitleLabel = [[UILabel alloc] init];
|
||||
self.subTitleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightRegular];
|
||||
self.subTitleLabel.textColor = [ThemeColor hightNobleLightTextColor];
|
||||
self.subTitleLabel.numberOfLines = 0;
|
||||
self.subTitleLabel.textAlignment = NSTextAlignmentCenter;
|
||||
[self addSubview:self.subTitleLabel];
|
||||
|
||||
self.descLabel = [[UILabel alloc] init];
|
||||
self.descLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightRegular];
|
||||
self.descLabel.text = @"快去看看获得的专属权限吧!";
|
||||
self.descLabel.textColor = [ThemeColor normalNobleTextColor];
|
||||
[self addSubview:self.descLabel];
|
||||
|
||||
self.closeButton = [[UIButton alloc] init];
|
||||
[self.closeButton setBackgroundImage:[UIImage imageNamed:@"noble_time_close"] forState:UIControlStateNormal];
|
||||
[self addSubview:self.closeButton];
|
||||
[self.closeButton addTarget:self action:@selector(onCloseButtonClick:) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
self.keepOriginalButton = [[UIButton alloc] init];
|
||||
[self.keepOriginalButton setBackgroundImage:[UIImage imageNamed:@"noble_upgrade_keepBtn"] forState:UIControlStateNormal];
|
||||
[self.keepOriginalButton setTitle:@"保留原有装扮" forState:UIControlStateNormal];
|
||||
self.keepOriginalButton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
|
||||
[self.keepOriginalButton setTitleColor:[ThemeColor hightNobleLightTextColor] forState:UIControlStateNormal];
|
||||
[self.keepOriginalButton addTarget:self action:@selector(onKeepButtonClick:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[self addSubview:self.keepOriginalButton];
|
||||
|
||||
self.dressHighLevelButton = [[UIButton alloc] init];
|
||||
[self.dressHighLevelButton setBackgroundImage:[UIImage imageNamed:@"noble_upgrade_dressBtn"] forState:UIControlStateNormal];
|
||||
[self.dressHighLevelButton setTitle:@"佩戴高等级装扮" forState:UIControlStateNormal];
|
||||
self.dressHighLevelButton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
|
||||
[self.dressHighLevelButton setTitleColor:[ThemeColor mainTextColor] forState:UIControlStateNormal];
|
||||
[self.dressHighLevelButton addTarget:self action:@selector(onDressButtonClick:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[self addSubview:self.dressHighLevelButton];
|
||||
|
||||
self.jumpButton = [[UIButton alloc] init];
|
||||
[self.jumpButton setBackgroundImage:[UIImage imageNamed:@"noble_upgrade_jumpBtn"] forState:UIControlStateNormal];
|
||||
[self.jumpButton setTitle:@"前往贵族中心" forState:UIControlStateNormal];
|
||||
@@ -94,7 +110,8 @@
|
||||
|
||||
- (void)initConstraints {
|
||||
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(0);
|
||||
make.left.top.right.mas_equalTo(0);
|
||||
make.height.mas_equalTo(285);
|
||||
}];
|
||||
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
@@ -112,16 +129,26 @@
|
||||
[self.subTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.svgDisplayView.mas_bottom);
|
||||
make.centerX.mas_equalTo(self.bgImageView);
|
||||
make.height.mas_equalTo(22);
|
||||
make.height.mas_equalTo(44);
|
||||
make.left.mas_equalTo(self.bgImageView).mas_offset(15);
|
||||
}];
|
||||
[self.descLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.subTitleLabel.mas_bottom).mas_offset(4);
|
||||
make.centerX.mas_equalTo(self.bgImageView);
|
||||
make.height.mas_equalTo(14);
|
||||
|
||||
[self.keepOriginalButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.subTitleLabel.mas_bottom).mas_offset(14);
|
||||
make.width.mas_equalTo(130);
|
||||
make.height.mas_equalTo(44);
|
||||
make.right.mas_equalTo(self.mas_centerX).mas_offset(-4);
|
||||
}];
|
||||
|
||||
[self.dressHighLevelButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.keepOriginalButton);
|
||||
make.width.mas_equalTo(130);
|
||||
make.height.mas_equalTo(44);
|
||||
make.left.mas_equalTo(self.mas_centerX).mas_offset(4);
|
||||
}];
|
||||
|
||||
[self.jumpButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.descLabel.mas_bottom).mas_offset(20);
|
||||
make.top.mas_equalTo(self.bgImageView.mas_bottom).mas_offset(22);
|
||||
make.centerX.mas_equalTo(0);
|
||||
make.width.mas_equalTo(204);
|
||||
make.height.mas_equalTo(44);
|
||||
@@ -144,8 +171,19 @@
|
||||
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:nobleVC animated:YES];
|
||||
}
|
||||
|
||||
- (void)onKeepButtonClick:(UIButton *)button {
|
||||
[Api requestRecoveryDress:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
[XCHUDTool showErrorWithMessage:msg];
|
||||
[TTPopup dismiss];
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)onDressButtonClick:(UIButton *)button {
|
||||
[TTPopup dismiss];
|
||||
}
|
||||
|
||||
- (void)setLevelUpInfo:(NobleLevelUpModel *)levelUpInfo {
|
||||
self.subTitleLabel.text = [NSString stringWithFormat:@"恭喜贵族等级提升到『%@』", levelUpInfo.vipName];
|
||||
self.subTitleLabel.text = [NSString stringWithFormat:@"恭喜你成为『%@』!当前已自动佩戴该等级装扮,是否保留原有装扮?", levelUpInfo.vipName];
|
||||
@kWeakify(self);
|
||||
[self.parser parseWithURL:[NSURL URLWithString:levelUpInfo.vipLogo] completionBlock:^(SVGAVideoEntity * _Nullable videoItem) {
|
||||
@kStrongify(self);
|
||||
|
@@ -316,7 +316,7 @@
|
||||
}
|
||||
|
||||
- (void)receiveNobleLevelUp:(NSDictionary *)data {
|
||||
XPNobleUpgradeLevelView *view = [[XPNobleUpgradeLevelView alloc] initWithFrame:CGRectMake(0, 0, 300, 285)];
|
||||
XPNobleUpgradeLevelView *view = [[XPNobleUpgradeLevelView alloc] initWithFrame:CGRectMake(0, 0, 300, 285 + 22 + 44)];
|
||||
NobleLevelUpModel *receiveInfo = [NobleLevelUpModel modelWithDictionary:data[@"data"]];
|
||||
view.levelUpInfo = receiveInfo;
|
||||
[TTPopup popupView:view style:TTPopupStyleAlert];
|
||||
|
Reference in New Issue
Block a user