feat: 更新 UI

This commit is contained in:
eggmanQQQ
2024-09-04 16:11:11 +08:00
parent 4dbc7422ec
commit cf0a0a87c7
19 changed files with 253 additions and 84 deletions

View File

@@ -165,8 +165,8 @@
- (void)layoutSubviews { - (void)layoutSubviews {
[super layoutSubviews]; [super layoutSubviews];
self.badgeView.nim_right = isMSRTL() ? 15 + self.badgeView.mj_w : self.nim_width - 15; self.badgeView.nim_right = isMSRTL() ? 35 + self.badgeView.mj_w : self.nim_width - 35;
self.badgeView.nim_top = 20; self.badgeView.nim_top = 4;
} }
- (NetImageView *)avatarImageView { - (NetImageView *)avatarImageView {

View File

@@ -9,6 +9,7 @@
#import "SessionListCell.h" #import "SessionListCell.h"
#import "SessionDiscoverNewTableViewCell.h" #import "SessionDiscoverNewTableViewCell.h"
#import "SessionViewController.h" #import "SessionViewController.h"
#import "XPMineFriendEmptyTableViewCell.h"
#import "ClientConfig.h" #import "ClientConfig.h"
#import "Api+Mine.h" #import "Api+Mine.h"
@@ -151,11 +152,11 @@ NSString * const kMessageShowReadDotKey = @"kMessageShowReadDotKey";
} }
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
return 92.f; return self.recentSessions.count == 0 ? (KScreenHeight - 200 - kNavigationHeight) : 92.f;
} }
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
return YES; return self.recentSessions.count == 0 ? NO : YES;
} }
- (NSArray<UITableViewRowAction *> *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath { - (NSArray<UITableViewRowAction *> *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath {
@@ -174,18 +175,27 @@ NSString * const kMessageShowReadDotKey = @"kMessageShowReadDotKey";
} }
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return self.recentSessions.count; return self.recentSessions.count == 0 ? 1 : self.recentSessions.count;
} }
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString * cellId = @"cellId"; if (self.recentSessions.count == 0) {
SessionListCell * cell = [tableView dequeueReusableCellWithIdentifier:cellId]; XPMineFriendEmptyTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineFriendEmptyTableViewCell class])];
if (!cell) { if (cell == nil) {
cell = [[SessionListCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellId]; cell = [[XPMineFriendEmptyTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMineFriendEmptyTableViewCell class])];
}
cell.emptyTitle = YMLocalizedString(@"XPMineAttentionViewController0");
return cell;
} else {
static NSString * cellId = @"cellId";
SessionListCell * cell = [tableView dequeueReusableCellWithIdentifier:cellId];
if (!cell) {
cell = [[SessionListCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellId];
}
NIMRecentSession *recent = [self.recentSessions xpSafeObjectAtIndex:indexPath.row];
[cell renderWithSession:recent];
return cell;
} }
NIMRecentSession *recent = [self.recentSessions xpSafeObjectAtIndex:indexPath.row];
[cell renderWithSession:recent];
return cell;
} }
#pragma mark - NIMConversationManagerDelegate #pragma mark - NIMConversationManagerDelegate
- (void)didLoadAllRecentSessionCompletion { - (void)didLoadAllRecentSessionCompletion {

View File

@@ -7,10 +7,14 @@
#import "XPMineMedalsTableViewCell.h" #import "XPMineMedalsTableViewCell.h"
#import "MedalModel.h" #import "MedalModel.h"
#import <QGVAPWrapView.h>
#import "XPRoomGiftAnimationParser.h"
@interface XPMineMedalCell : UICollectionViewCell @interface XPMineMedalCell : UICollectionViewCell
@property (nonatomic, strong) NetImageView *imageView; @property (nonatomic, strong) NetImageView *imageView;
@property (nonatomic, strong) VAPView *vapView;
@property (nonatomic, strong) XPRoomGiftAnimationParser *vapParser;
@end @end
@@ -30,10 +34,30 @@
[_imageView mas_makeConstraints:^(MASConstraintMaker *make) { [_imageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.contentView); make.edges.mas_equalTo(self.contentView);
}]; }];
[self.contentView addSubview:self.vapView];
[self.vapView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.contentView);
}];
} }
return self; return self;
} }
- (VAPView *)vapView {
if (!_vapView) {
_vapView = [[VAPView alloc] init];
_vapView.contentMode = UIViewContentModeScaleAspectFill;
}
return _vapView;
}
- (XPRoomGiftAnimationParser *)vapParser {
if (!_vapParser) {
_vapParser = [[XPRoomGiftAnimationParser alloc] init];
}
return _vapParser;
}
@end @end
@interface XPMineMedalsTableViewCell() <UICollectionViewDelegateFlowLayout, UICollectionViewDataSource> @interface XPMineMedalsTableViewCell() <UICollectionViewDelegateFlowLayout, UICollectionViewDataSource>
@@ -84,6 +108,20 @@
UserMedalModel *userMedal = [self.medalsDataSource xpSafeObjectAtIndex:indexPath.row]; UserMedalModel *userMedal = [self.medalsDataSource xpSafeObjectAtIndex:indexPath.row];
if (userMedal) { if (userMedal) {
cell.imageView.imageUrl = userMedal.picUrl; cell.imageView.imageUrl = userMedal.picUrl;
NSString *resourcePath = [userMedal.picUrl stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
if (resourcePath.length > 0) {
NSString *encodingUrl = [resourcePath stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet characterSetWithCharactersInString:@"`#%^{}\"[]|\\<> "].invertedSet];
@kWeakify(cell);
[cell.vapParser parseWithURL:encodingUrl completionBlock:^(NSString * _Nullable videoUrl) {
@kStrongify(cell);
if (videoUrl.length) {
[cell.vapView setMute:YES];
[cell.vapView playHWDMP4:videoUrl repeatCount:-1 delegate:nil];
}
} failureBlock:^(NSError * _Nullable error) {
}];
}
} }
return cell; return cell;
} }
@@ -91,7 +129,7 @@
#pragma mark - UICollectionViewDelegateFlowLayout #pragma mark - UICollectionViewDelegateFlowLayout
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath { - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
return CGSizeMake(80, 80); return CGSizeMake(140, 140);
} }
#pragma mark - #pragma mark -
@@ -102,7 +140,7 @@
layout.minimumInteritemSpacing = 10; layout.minimumInteritemSpacing = 10;
layout.minimumLineSpacing = 10; layout.minimumLineSpacing = 10;
_medalsCollectionView = [[UICollectionView alloc] initWithFrame:CGRectZero _medalsCollectionView = [[UICollectionView alloc] initWithFrame:CGRectZero
collectionViewLayout:layout]; collectionViewLayout:layout];
_medalsCollectionView.backgroundColor = [UIColor clearColor]; _medalsCollectionView.backgroundColor = [UIColor clearColor];
_medalsCollectionView.delegate = self; _medalsCollectionView.delegate = self;
_medalsCollectionView.dataSource = self; _medalsCollectionView.dataSource = self;

View File

@@ -8,10 +8,12 @@
#import "XPMineNobleCardTableViewCell.h" #import "XPMineNobleCardTableViewCell.h"
///Third ///Third
#import <Masonry/Masonry.h> #import <Masonry/Masonry.h>
#import <QGVAPWrapView.h>
///Tool ///Tool
#import "DJDKMIMOMColor.h" #import "DJDKMIMOMColor.h"
#import "NetImageView.h" #import "NetImageView.h"
#import "UIImage+Utils.h" #import "UIImage+Utils.h"
#import "XPRoomGiftAnimationParser.h"
///Model ///Model
#import "NobleCardModel.h" #import "NobleCardModel.h"
@@ -25,6 +27,8 @@
@property (nonatomic, strong) UIImageView *userCardBackImageView; @property (nonatomic, strong) UIImageView *userCardBackImageView;
/// ///
@property (nonatomic, strong) NetImageView *nobleImageView; @property (nonatomic, strong) NetImageView *nobleImageView;
@property (nonatomic, strong) VAPView *vapView;
@property (nonatomic, strong) XPRoomGiftAnimationParser *vapParser;
/// ///
@property (nonatomic, strong) UILabel *titleLabel; @property (nonatomic, strong) UILabel *titleLabel;
/// ///
@@ -55,6 +59,8 @@
[self.mainView addSubview:self.useButton]; [self.mainView addSubview:self.useButton];
[self.mainView addSubview:self.userCardBackImageView]; [self.mainView addSubview:self.userCardBackImageView];
[self.mainView addSubview:self.nobleImageView]; [self.mainView addSubview:self.nobleImageView];
[self.contentView addSubview:self.vapView];
} }
- (void)initSubViewConstraints { - (void)initSubViewConstraints {
@@ -98,6 +104,10 @@
make.bottom.mas_equalTo(self.userCardBackImageView); make.bottom.mas_equalTo(self.userCardBackImageView);
make.centerX.mas_equalTo(self.mainView); make.centerX.mas_equalTo(self.mainView);
}]; }];
[self.vapView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.nobleImageView);
}];
} }
#pragma mark - private #pragma mark - private
@@ -122,6 +132,22 @@
[_useButton setTitleColor:[DJDKMIMOMColor confirmButtonTextColor] forState:UIControlStateNormal]; [_useButton setTitleColor:[DJDKMIMOMColor confirmButtonTextColor] forState:UIControlStateNormal];
[_useButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor confirmButtonGradientStartColor], [DJDKMIMOMColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal]; [_useButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor confirmButtonGradientStartColor], [DJDKMIMOMColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal];
} }
NSString *resourcePath = [nobleCardModel.pic stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
if (resourcePath.length == 0) {
return;
}
NSString *encodingUrl = [resourcePath stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet characterSetWithCharactersInString:@"`#%^{}\"[]|\\<> "].invertedSet];
@kWeakify(self);
[self.vapParser parseWithURL:encodingUrl completionBlock:^(NSString * _Nullable videoUrl) {
@kStrongify(self);
if (videoUrl.length) {
[self.vapView setMute:YES];
[self.vapView playHWDMP4:videoUrl repeatCount:-1 delegate:nil];
}
} failureBlock:^(NSError * _Nullable error) {
}];
} }
} }
@@ -202,4 +228,20 @@
} }
return _userCardBackImageView;; return _userCardBackImageView;;
} }
- (VAPView *)vapView {
if (!_vapView) {
_vapView = [[VAPView alloc] init];
_vapView.contentMode = UIViewContentModeScaleAspectFill;
}
return _vapView;
}
- (XPRoomGiftAnimationParser *)vapParser {
if (!_vapParser) {
_vapParser = [[XPRoomGiftAnimationParser alloc] init];
}
return _vapParser;
}
@end @end

View File

@@ -45,11 +45,20 @@
[self showLoading]; [self showLoading];
[self.presenter getExchangeDiamondInformation]; [self.presenter getExchangeDiamondInformation];
} }
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
}
#pragma mark - XPIncomeRecordProtocol #pragma mark - XPIncomeRecordProtocol
-(void)getExchangeDiamondInformation:(XPExchangeDiamondsModel *)model{ -(void)getExchangeDiamondInformation:(XPExchangeDiamondsModel *)model{
[self hideHUD]; [self hideHUD];
self.model = model; self.model = model;
self.exchangeView.model = self.model; self.exchangeView.model = self.model;
[self.exchangeView showKeyboard];
} }
- (void)confirmExchangeDiamondSuccessWithDiamondNum:(NSString *)diamondNum goldNum:(NSString *)goldNum{ - (void)confirmExchangeDiamondSuccessWithDiamondNum:(NSString *)diamondNum goldNum:(NSString *)goldNum{
[self hideHUD]; [self hideHUD];

View File

@@ -23,15 +23,10 @@ typedef void(^ExchangeDiamondsItemViewHandle)(NSString *goldNum,NSString *diamon
@interface XPExchangeDiamondsView : UIView @interface XPExchangeDiamondsView : UIView
@property (nonatomic,weak) id<XPExchangeDiamondsViewDelegate> delegate; @property (nonatomic,weak) id<XPExchangeDiamondsViewDelegate> delegate;
@property (nonatomic,strong) XPExchangeDiamondsModel *model; @property (nonatomic,strong) XPExchangeDiamondsModel *model;
- (void)showKeyboard;
@end @end
/*******************************************************华丽分割线***************************************************************/ /*******************************************************华丽分割线***************************************************************/
@interface XPExchangeDiamondsItemView : UIView @interface XPExchangeDiamondsItemView : UIView
@@ -42,6 +37,7 @@ typedef void(^ExchangeDiamondsItemViewHandle)(NSString *goldNum,NSString *diamon
@property (nonatomic,strong) XPExchangeDiamondsModel *model; @property (nonatomic,strong) XPExchangeDiamondsModel *model;
@property (nonatomic,copy) NSString *count; @property (nonatomic,copy) NSString *count;
-(instancetype)initWithFrame:(CGRect)frame type:(IncomeRecordViewType)type; -(instancetype)initWithFrame:(CGRect)frame type:(IncomeRecordViewType)type;
-(void)becomeResponder;
-(void)resignResponder; -(void)resignResponder;
@end @end

View File

@@ -33,30 +33,35 @@
return self; return self;
} }
- (void)showKeyboard {
[self.myDiamondsView becomeResponder];
}
#pragma mark - Private Method #pragma mark - Private Method
- (void)initSubViews { - (void)initSubViews {
self.backgroundColor = [UIColor clearColor]; self.backgroundColor = [UIColor clearColor];
[self addSubview:self.myGoldView];
[self addSubview:self.myDiamondsView]; [self addSubview:self.myDiamondsView];
[self addSubview:self.myGoldView];
[self addSubview:self.confirmBtn]; [self addSubview:self.confirmBtn];
@kWeakify(self) @kWeakify(self)
self.myGoldView.inputCounthandle = ^(NSString *_Nonnull goldNum,NSString *_Nonnull diamondNum) { // self.myGoldView.inputCounthandle = ^(NSString *_Nonnull goldNum,NSString *_Nonnull diamondNum) {
@kStrongify(self) // @kStrongify(self)
if(goldNum.integerValue == 0 && diamondNum.integerValue == 0){ // if(goldNum.integerValue == 0 && diamondNum.integerValue == 0){
self.confirmBtn.enabled = NO; // self.confirmBtn.enabled = NO;
self.myGoldView.text = @""; // self.myGoldView.text = @"";
self.myDiamondsView.text = @""; // self.myDiamondsView.text = @"";
return; // return;
} // }
self.chooseType = IncomeRecord_Gold; // self.chooseType = IncomeRecord_Gold;
self.confirmBtn.enabled = YES; // self.confirmBtn.enabled = YES;
self.goldNum = goldNum; // self.goldNum = goldNum;
self.diamondNum = diamondNum; // self.diamondNum = diamondNum;
self.myDiamondsView.count = diamondNum; // self.myDiamondsView.count = diamondNum;
//
}; // };
self.myDiamondsView.inputCounthandle = ^(NSString *_Nonnull goldNum,NSString *_Nonnull diamondNum) { self.myDiamondsView.inputCounthandle = ^(NSString *_Nonnull goldNum,NSString *_Nonnull diamondNum) {
@kStrongify(self) @kStrongify(self)
if(goldNum.integerValue == 0 && diamondNum.integerValue == 0){ if(goldNum.integerValue == 0 && diamondNum.integerValue == 0){
@@ -69,7 +74,7 @@
self.confirmBtn.enabled = YES; self.confirmBtn.enabled = YES;
self.goldNum = goldNum; self.goldNum = goldNum;
self.diamondNum = diamondNum; self.diamondNum = diamondNum;
self.myGoldView.count = goldNum; self.myGoldView.count = diamondNum;
self.chooseType = IncomeRecord_Diamond; self.chooseType = IncomeRecord_Diamond;
}; };
@@ -240,6 +245,11 @@
-(void)resignResponder{ -(void)resignResponder{
[_numberView resignFirstResponder]; [_numberView resignFirstResponder];
} }
-(void)becomeResponder {
[_numberView becomeFirstResponder];
}
-(void)setText:(NSString *)text{ -(void)setText:(NSString *)text{
_text = text; _text = text;
_numberView.text = _text; _numberView.text = _text;
@@ -258,13 +268,13 @@
} }
NSInteger count = textField.text.integerValue; NSInteger count = textField.text.integerValue;
if(self.type == IncomeRecord_Gold){ // if(self.type == IncomeRecord_Gold){
NSString *goldNum = [NSString stringWithFormat:@"%.0f",ceilf(count / _model.rate)]; // NSString *goldNum = [NSString stringWithFormat:@"%.0f",ceilf(count / _model.rate)];
if(self.inputCounthandle){ // if(self.inputCounthandle){
self.inputCounthandle(goldNum, textField.text); // self.inputCounthandle(goldNum, textField.text);
} // }
return; // return;
} // }
NSString *diamondNum = [NSString stringWithFormat:@"%.0f",floorf(count * _model.rate)]; NSString *diamondNum = [NSString stringWithFormat:@"%.0f",floorf(count * _model.rate)];
if(self.inputCounthandle){ if(self.inputCounthandle){
self.inputCounthandle(textField.text,diamondNum); self.inputCounthandle(textField.text,diamondNum);
@@ -311,12 +321,16 @@
_numberView = [[XPTextField alloc]initWithFrame:CGRectZero]; _numberView = [[XPTextField alloc]initWithFrame:CGRectZero];
_numberView.keyboardType = UIKeyboardTypeNumberPad; _numberView.keyboardType = UIKeyboardTypeNumberPad;
_numberView.isValidation = YES; _numberView.isValidation = YES;
NSMutableAttributedString *attStr = [[NSMutableAttributedString alloc]initWithString:YMLocalizedString(@"XPExchangeDiamondsView6") attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:16 weight:UIFontWeightMedium],NSForegroundColorAttributeName:[UIColor colorWithWhite:1 alpha:0.6]}]; NSMutableAttributedString *attStr = [[NSMutableAttributedString alloc] initWithString:(self.type == IncomeRecord_Diamond) ? YMLocalizedString(@"XPExchangeDiamondsView6") : YMLocalizedString(@"XPExchangeDiamondsView7")
attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:16 weight:UIFontWeightMedium],
NSForegroundColorAttributeName:[UIColor colorWithWhite:1 alpha:0.6]}];
_numberView.attributedPlaceholder = attStr; _numberView.attributedPlaceholder = attStr;
_numberView.font = kFontMedium(15); _numberView.font = kFontMedium(15);
_numberView.textColor = [UIColor whiteColor]; _numberView.textColor = [UIColor whiteColor];
// _numberView.textAlignment = NSTextAlignmentRight;
[_numberView addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged]; [_numberView addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
if (self.type == IncomeRecord_Gold) {
_numberView.userInteractionEnabled = NO;
}
} }
return _numberView; return _numberView;
} }

View File

@@ -259,7 +259,7 @@ typedef enum : NSUInteger {
return 90; return 90;
break; break;
case Medal: case Medal:
return 70; return 140;
break; break;
case Gifts: case Gifts:
return [XPMineGiftsTableViewCell cellHeight:self.isGiftsSectionExpand return [XPMineGiftsTableViewCell cellHeight:self.isGiftsSectionExpand

View File

@@ -797,6 +797,7 @@
#pragma mark - Load Data from API #pragma mark - Load Data from API
- (void)setupData { - (void)setupData {
[self showLoading];
[self loadUserInfo]; [self loadUserInfo];
[self loadWalletInfo]; [self loadWalletInfo];
} }
@@ -815,6 +816,12 @@
[self loadVIPCenterInfo]; [self loadVIPCenterInfo];
[self updatePurchaseArea]; [self updatePurchaseArea];
} else {
if (msg.length > 0) {
[self showErrorToast:msg];
} else {
[self hideHUD];
}
} }
} uid:uid]; } uid:uid];
} }
@@ -862,6 +869,14 @@
[self configIdentificationCards]; [self configIdentificationCards];
[self configExclusivePrivilegesArea]; [self configExclusivePrivilegesArea];
[self updatePurchaseArea]; [self updatePurchaseArea];
[self hideHUD];
} else {
if (msg.length > 0) {
[self showErrorToast:msg];
} else {
[self hideHUD];
}
} }
}]; }];
} }
@@ -915,7 +930,7 @@
#pragma mark - TYCyclePagerView Delegate & DataSource #pragma mark - TYCyclePagerView Delegate & DataSource
- (NSInteger)numberOfItemsInPagerView:(TYCyclePagerView *)pageView { - (NSInteger)numberOfItemsInPagerView:(TYCyclePagerView *)pageView {
return 9; return self.vipModel.vipInfos.count;//9;
} }
- (TYCyclePagerViewLayout *)layoutForPagerView:(TYCyclePagerView *)pageView { - (TYCyclePagerViewLayout *)layoutForPagerView:(TYCyclePagerView *)pageView {
@@ -1046,7 +1061,6 @@
_vipCardCyclePager.collectionView.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight; _vipCardCyclePager.collectionView.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
_vipCardCyclePager.backgroundColor = [UIColor clearColor]; _vipCardCyclePager.backgroundColor = [UIColor clearColor];
_vipCardCyclePager.backgroundView = nil; _vipCardCyclePager.backgroundView = nil;
_vipCardCyclePager.layer.borderWidth = 1;
_vipCardCyclePager.isInfiniteLoop = NO; _vipCardCyclePager.isInfiniteLoop = NO;
_vipCardCyclePager.autoScrollInterval = -1; _vipCardCyclePager.autoScrollInterval = -1;
_vipCardCyclePager.dataSource = self; _vipCardCyclePager.dataSource = self;

View File

@@ -355,7 +355,7 @@ return view;\
[self.namePlateView addSubview:self.nameplateImageView]; [self.namePlateView addSubview:self.nameplateImageView];
[self.namePlateView addSubview:self.nameplateLabel]; [self.namePlateView addSubview:self.nameplateLabel];
[self.nameplateImageView mas_makeConstraints:^(MASConstraintMaker *make) { [self.nameplateImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(30); make.height.mas_equalTo(20);
make.top.mas_equalTo(0); make.top.mas_equalTo(0);
make.width.mas_equalTo(80); make.width.mas_equalTo(80);
}]; }];
@@ -389,7 +389,7 @@ return view;\
make.width.mas_equalTo(54); make.width.mas_equalTo(54);
}]; }];
[self.namePlateView mas_makeConstraints:^(MASConstraintMaker *make) { [self.namePlateView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(30); make.height.mas_equalTo(20);
make.width.mas_equalTo(80); make.width.mas_equalTo(80);
}]; }];
} }

View File

@@ -67,6 +67,7 @@
#import "XPLittleGameRoomOpenView.h" #import "XPLittleGameRoomOpenView.h"
#import "PISwitchingEnvironmentVC.h" #import "PISwitchingEnvironmentVC.h"
#import "XPGameOrdersListViewController.h" #import "XPGameOrdersListViewController.h"
#import "VIPCenterViewController.h"
UIKIT_EXTERN NSString *kRequestTicket; UIKIT_EXTERN NSString *kRequestTicket;
@@ -297,8 +298,10 @@ UIKIT_EXTERN NSString *kRequestTicket;
break; break;
case XPMineItemType_Noble_Center: case XPMineItemType_Noble_Center:
{ {
XPNobleCenterViewController *nobleCenterVC = [[XPNobleCenterViewController alloc] init]; VIPCenterViewController *vc = [[VIPCenterViewController alloc] init];
[self.navigationController pushViewController:nobleCenterVC animated:YES]; [self.navigationController pushViewController:vc animated:YES];
// XPNobleCenterViewController *nobleCenterVC = [[XPNobleCenterViewController alloc] init];
// [self.navigationController pushViewController:nobleCenterVC animated:YES];
} }
break; break;
case XPMineItemType_FansTeam: { case XPMineItemType_FansTeam: {

View File

@@ -47,9 +47,9 @@
UIImageView *headDress_1 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"home_rank_Headdress_first"]]; UIImageView *headDress_1 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"home_rank_Headdress_first"]];
UIImageView *headDress_2 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"home_rank_Headdress_second"]]; UIImageView *headDress_2 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"home_rank_Headdress_second"]];
UIImageView *headDress_3 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"home_rank_Headdress_second"]]; UIImageView *headDress_3 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"home_rank_Headdress_second"]];
headDress_1.contentMode = UIViewContentModeScaleAspectFit; headDress_1.contentMode = UIViewContentModeScaleAspectFill;
headDress_2.contentMode = UIViewContentModeScaleAspectFit; headDress_2.contentMode = UIViewContentModeScaleAspectFill;
headDress_3.contentMode = UIViewContentModeScaleAspectFit; headDress_3.contentMode = UIViewContentModeScaleAspectFill;
[self.contentView addSubview:headDress_3]; [self.contentView addSubview:headDress_3];
[self.contentView addSubview:headDress_2]; [self.contentView addSubview:headDress_2];
@@ -58,22 +58,22 @@
[headDress_1 mas_makeConstraints:^(MASConstraintMaker *make) { [headDress_1 mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.contentView).offset(2); make.centerX.mas_equalTo(self.contentView).offset(2);
make.top.mas_equalTo(self.contentView).offset(3); make.top.mas_equalTo(self.contentView).offset(3);
make.width.mas_equalTo(62); make.width.mas_equalTo(kGetScaleWidth(62));
make.height.mas_equalTo(62); make.height.mas_equalTo(kGetScaleWidth(62));
}]; }];
[headDress_2 mas_makeConstraints:^(MASConstraintMaker *make) { [headDress_2 mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self.contentView).offset(-5); make.bottom.mas_equalTo(self.contentView).offset(-5);
make.leading.mas_equalTo(self.contentView).offset(3); make.leading.mas_equalTo(self.contentView).offset(3);
make.width.mas_equalTo(55); make.width.mas_equalTo(kGetScaleWidth(55));
make.height.mas_equalTo(55); make.height.mas_equalTo(kGetScaleWidth(55));
}]; }];
[headDress_3 mas_makeConstraints:^(MASConstraintMaker *make) { [headDress_3 mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self.contentView).offset(-5); make.bottom.mas_equalTo(self.contentView).offset(-5);
make.trailing.mas_equalTo(self.contentView).offset(-3); make.trailing.mas_equalTo(self.contentView).offset(-3);
make.width.mas_equalTo(55); make.width.mas_equalTo(kGetScaleWidth(55));
make.height.mas_equalTo(55); make.height.mas_equalTo(kGetScaleWidth(55));
}]; }];
[self.contentView insertSubview:self.avatar_1 belowSubview:headDress_1]; [self.contentView insertSubview:self.avatar_1 belowSubview:headDress_1];
@@ -83,19 +83,19 @@
[self.avatar_1 mas_makeConstraints:^(MASConstraintMaker *make) { [self.avatar_1 mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.contentView).offset(13); make.top.mas_equalTo(self.contentView).offset(13);
make.centerX.mas_equalTo(headDress_1); make.centerX.mas_equalTo(headDress_1);
make.width.height.mas_equalTo(38); make.width.height.mas_equalTo(kGetScaleWidth(38));
}]; }];
[self.avatar_2 mas_makeConstraints:^(MASConstraintMaker *make) { [self.avatar_2 mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(headDress_2).offset(-9); make.bottom.mas_equalTo(headDress_2).offset(-9);
make.centerX.mas_equalTo(headDress_2); make.centerX.mas_equalTo(headDress_2);
make.width.height.mas_equalTo(38); make.width.height.mas_equalTo(kGetScaleWidth(38));
}]; }];
[self.avatar_3 mas_makeConstraints:^(MASConstraintMaker *make) { [self.avatar_3 mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(headDress_3).offset(-9); make.bottom.mas_equalTo(headDress_3).offset(-9);
make.centerX.mas_equalTo(headDress_3); make.centerX.mas_equalTo(headDress_3);
make.width.height.mas_equalTo(38); make.width.height.mas_equalTo(kGetScaleWidth(38));
}]; }];
} }
@@ -168,7 +168,7 @@
} else { } else {
_bgImageView.layer.cornerRadius = kGetScaleWidth(12); _bgImageView.layer.cornerRadius = kGetScaleWidth(12);
@kWeakify(self); @kWeakify(self);
[_bgImageView loadImageWithUrl: _itemModel.icon completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) { [_bgImageView loadImageWithUrl:_itemModel.icon completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) {
@kStrongify(self); @kStrongify(self);
self.bgImageView.layer.cornerRadius = kGetScaleWidth(0); self.bgImageView.layer.cornerRadius = kGetScaleWidth(0);
}]; }];

View File

@@ -14,8 +14,6 @@
#import "Api+Gift.h" #import "Api+Gift.h"
#import "XPGiftStorage.h" #import "XPGiftStorage.h"
#import "VIPCenterViewController.h"
@interface XPHomePagingViewController () <UIPageViewControllerDelegate, UIPageViewControllerDataSource> @interface XPHomePagingViewController () <UIPageViewControllerDelegate, UIPageViewControllerDataSource>
@property (nonatomic, strong) UIView *topControlView; @property (nonatomic, strong) UIView *topControlView;
@@ -173,12 +171,6 @@
} }
- (void)didTapSearchButton { - (void)didTapSearchButton {
#if DEBUG
VIPCenterViewController *vc = [[VIPCenterViewController alloc] init];
[self.navigationController pushViewController:vc animated:YES];
return;
#endif
XPRoomSearchContainerViewController * searchVC = [[XPRoomSearchContainerViewController alloc] init]; XPRoomSearchContainerViewController * searchVC = [[XPRoomSearchContainerViewController alloc] init];
searchVC.modalPresentationStyle = UIModalPresentationFullScreen; searchVC.modalPresentationStyle = UIModalPresentationFullScreen;
[self.navigationController presentViewController:searchVC [self.navigationController presentViewController:searchVC

View File

@@ -43,7 +43,8 @@
#import "XPMineUserInfoViewController.h" #import "XPMineUserInfoViewController.h"
#import "SessionViewController.h" #import "SessionViewController.h"
#import <QGVAPWrapView.h>
#import "XPRoomGiftAnimationParser.h"
@interface XPUserCardViewController ()<UICollectionViewDelegate, UICollectionViewDataSource,XPUserCardProtocol> @interface XPUserCardViewController ()<UICollectionViewDelegate, UICollectionViewDataSource,XPUserCardProtocol>
///view ///view
@@ -58,6 +59,8 @@
@property (nonatomic,strong) UIView * userInfoView; @property (nonatomic,strong) UIView * userInfoView;
///VIP ///VIP
@property (nonatomic, strong) NetImageView *nobleImageView; @property (nonatomic, strong) NetImageView *nobleImageView;
@property (nonatomic, strong) VAPView *vapView;
@property (nonatomic, strong) XPRoomGiftAnimationParser *vapParser;
/// ///
@property (strong, nonatomic) UIVisualEffectView *effectView; @property (strong, nonatomic) UIVisualEffectView *effectView;
/// ///
@@ -153,7 +156,8 @@
[self.backView addSubview:self.stackView]; [self.backView addSubview:self.stackView];
[self.view addSubview:self.nobleImageView]; [self.view addSubview:self.nobleImageView];
[self.view addSubview:self.vapView];
[self.stackView addArrangedSubview:self.userInfoView]; [self.stackView addArrangedSubview:self.userInfoView];
[self.stackView addArrangedSubview:self.skillCardView]; [self.stackView addArrangedSubview:self.skillCardView];
[self.stackView addArrangedSubview:self.collectionView]; [self.stackView addArrangedSubview:self.collectionView];
@@ -220,6 +224,9 @@
make.trailing.mas_equalTo(self.backView).offset(nobleMargin*0.5); make.trailing.mas_equalTo(self.backView).offset(nobleMargin*0.5);
make.leading.mas_equalTo(self.backView).mas_offset(-nobleMargin*0.5); make.leading.mas_equalTo(self.backView).mas_offset(-nobleMargin*0.5);
}]; }];
[self.vapView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.nobleImageView);
}];
[self.skillCardView mas_makeConstraints:^(MASConstraintMaker *make) { [self.skillCardView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(self.userInfoView); make.width.mas_equalTo(self.userInfoView);
make.height.mas_equalTo(0); make.height.mas_equalTo(0);
@@ -239,7 +246,8 @@
}]; }];
///view ///view
[self.backImageView mas_makeConstraints:^(MASConstraintMaker *make) { [self.backImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.userInfoView); make.top.leading.right.mas_equalTo(self.userInfoView);
make.height.mas_equalTo(110);
}]; }];
[self.effectView mas_makeConstraints:^(MASConstraintMaker *make) { [self.effectView mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -520,16 +528,40 @@
- (void)onGetUserInfoSuccess:(UserInfoModel *)userInfo { - (void)onGetUserInfoSuccess:(UserInfoModel *)userInfo {
self.targetUserInfo = userInfo; self.targetUserInfo = userInfo;
self.avatarImageView.imageUrl = userInfo.avatar; self.avatarImageView.imageUrl = userInfo.avatar;
self.backImageView.imageUrl = userInfo.avatar;
self.nobleImageView.imageUrl = userInfo.userInfoCardPic; self.nobleImageView.imageUrl = userInfo.userInfoCardPic;
if (userInfo.userVipInfoVO.vipLevel>0 && userInfo.userVipInfoVO.userCardBG.length > 0) {
self.backImageView.imageUrl = [userInfo.userVipInfoVO.userCardBG stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
self.effectView.hidden = YES;
self.backImageView.clipsToBounds = NO;
[self.backImageView mas_updateConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(180);
}];
} else {
self.backImageView.layer.masksToBounds = YES;
self.backImageView.layer.cornerRadius = 25;
self.backImageView.imageUrl = userInfo.avatar;
}
NSString *resourcePath = [userInfo.userInfoCardPic stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
if (resourcePath.length > 0) {
NSString *encodingUrl = [resourcePath stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet characterSetWithCharactersInString:@"`#%^{}\"[]|\\<> "].invertedSet];
@kWeakify(self);
[self.vapParser parseWithURL:encodingUrl completionBlock:^(NSString * _Nullable videoUrl) {
@kStrongify(self);
if (videoUrl.length) {
[self.vapView setMute:YES];
[self.vapView playHWDMP4:videoUrl repeatCount:-1 delegate:nil];
}
} failureBlock:^(NSError * _Nullable error) {
}];
}
self.nobleIconImageView.imageUrl = userInfo.userVipInfoVO.vipIcon; self.nobleIconImageView.imageUrl = userInfo.userVipInfoVO.vipIcon;
if (userInfo.userVipInfoVO && userInfo.userVipInfoVO.vipIcon) {//VIPicon if (userInfo.userVipInfoVO && userInfo.userVipInfoVO.vipIcon) {//VIPicon
[self.nobleIconImageView mas_updateConstraints:^(MASConstraintMaker *make) { [self.nobleIconImageView mas_updateConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(30); make.width.mas_equalTo(30);
}]; }];
// [self.nickLabel mas_updateConstraints:^(MASConstraintMaker *make) {
// make.leading.mas_equalTo(self.nobleIconImageView.mas_trailing).mas_offset(2);
// }];
} }
NSString * nick = userInfo.nick; NSString * nick = userInfo.nick;
// if (nick.length > 20) { // if (nick.length > 20) {
@@ -598,7 +630,6 @@
make.height.mas_equalTo(30); make.height.mas_equalTo(30);
}]; }];
} }
self.skillCardView.dataArray = userInfo.absCardPics; self.skillCardView.dataArray = userInfo.absCardPics;
} }
@@ -1222,8 +1253,6 @@
if (!_backImageView) { if (!_backImageView) {
_backImageView = [[NetImageView alloc] init]; _backImageView = [[NetImageView alloc] init];
_backImageView.userInteractionEnabled = YES; _backImageView.userInteractionEnabled = YES;
_backImageView.layer.masksToBounds = YES;
_backImageView.layer.cornerRadius = 25;
_backImageView.contentMode = UIViewContentModeScaleAspectFill; _backImageView.contentMode = UIViewContentModeScaleAspectFill;
_backImageView.image = [UIImageConstant defaultAvatarPlaceholder]; _backImageView.image = [UIImageConstant defaultAvatarPlaceholder];
} }
@@ -1500,4 +1529,20 @@
return _pickHeartButton; return _pickHeartButton;
} }
- (VAPView *)vapView {
if (!_vapView) {
_vapView = [[VAPView alloc] init];
_vapView.contentMode = UIViewContentModeScaleAspectFill;
}
return _vapView;
}
- (XPRoomGiftAnimationParser *)vapParser {
if (!_vapParser) {
_vapParser = [[XPRoomGiftAnimationParser alloc] init];
_vapView.userInteractionEnabled = NO;
}
return _vapParser;
}
@end @end

View File

@@ -28,6 +28,8 @@ NS_ASSUME_NONNULL_BEGIN
///隐身访问主页 ///隐身访问主页
@property (nonatomic,assign) BOOL lookHomepageHide; @property (nonatomic,assign) BOOL lookHomepageHide;
@property (nonatomic, copy) NSString *userCardBG;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -3200,6 +3200,7 @@ ineHeadView12" = "الحمل";
"XPExchangeDiamondsView2" = "عدد الألماس غير كافٍ"; "XPExchangeDiamondsView2" = "عدد الألماس غير كافٍ";
"XPIncomeRecordGoldDetailsVC0" = "تفاصيل الألماس"; "XPIncomeRecordGoldDetailsVC0" = "تفاصيل الألماس";
"XPExchangeDiamondsView6"="يرجى إدخال …"; "XPExchangeDiamondsView6"="يرجى إدخال …";
"XPExchangeDiamondsView7"="الرجاء إدخال عدد الماسات...";
///XPNobleCenterMyNobleView.m ///XPNobleCenterMyNobleView.m
"XPNobleCenterMyNobleView0" = "المستوى الحالي"; "XPNobleCenterMyNobleView0" = "المستوى الحالي";
"XPNobleCenterMyNobleView1" = "لقد تم الوصول إلى أعلى مستوى VIP قابل للإستخدام"; "XPNobleCenterMyNobleView1" = "لقد تم الوصول إلى أعلى مستوى VIP قابل للإستخدام";

View File

@@ -2992,6 +2992,7 @@
"XPExchangeDiamondsView4"="The number of Coins for exchange cannot exceed %ld"; "XPExchangeDiamondsView4"="The number of Coins for exchange cannot exceed %ld";
"XPExchangeDiamondsView5"="Exchange successful"; "XPExchangeDiamondsView5"="Exchange successful";
"XPExchangeDiamondsView6"="Please enter..."; "XPExchangeDiamondsView6"="Please enter...";
"XPExchangeDiamondsView7"="Please enter the number of diamonds...";
"XPIncomeRecordCoinsDetailsView0"="No data available"; "XPIncomeRecordCoinsDetailsView0"="No data available";
"XPIncomeRecordCoinsDetailsView1"="Total Coins flow in the current room: %@ diamonds"; "XPIncomeRecordCoinsDetailsView1"="Total Coins flow in the current room: %@ diamonds";

View File

@@ -2634,6 +2634,7 @@
"XPExchangeDiamondsView4"="兑换金币数不能超过%ld钻"; "XPExchangeDiamondsView4"="兑换金币数不能超过%ld钻";
"XPExchangeDiamondsView5"="兑换成功"; "XPExchangeDiamondsView5"="兑换成功";
"XPExchangeDiamondsView6"="請輸入..."; "XPExchangeDiamondsView6"="請輸入...";
"XPExchangeDiamondsView7"="請輸入鑽石數量...";
"XPIncomeRecordGoldDetailsView0"="暂没有数据"; "XPIncomeRecordGoldDetailsView0"="暂没有数据";
"XPIncomeRecordGoldDetailsView1"="当前房间总计金币流水:%@金币"; "XPIncomeRecordGoldDetailsView1"="当前房间总计金币流水:%@金币";

View File

@@ -2627,6 +2627,7 @@
"XPExchangeDiamondsView4"="兌換金幣數不能超過%ld鉆"; "XPExchangeDiamondsView4"="兌換金幣數不能超過%ld鉆";
"XPExchangeDiamondsView5"="兌換成功"; "XPExchangeDiamondsView5"="兌換成功";
"XPExchangeDiamondsView6"="請輸入..."; "XPExchangeDiamondsView6"="請輸入...";
"XPExchangeDiamondsView7"="請輸入鑽石數量...";
"XPIncomeRecordGoldDetailsView0"="暫沒有數據"; "XPIncomeRecordGoldDetailsView0"="暫沒有數據";
"XPIncomeRecordGoldDetailsView1"="當前房間總計金幣流水:%@金幣"; "XPIncomeRecordGoldDetailsView1"="當前房間總計金幣流水:%@金幣";