代码 & UI 小优化

This commit is contained in:
eggmanQQQ
2024-10-29 17:10:56 +08:00
parent 1f6b060898
commit 0e00f4df11
23 changed files with 80 additions and 90 deletions

View File

@@ -208,6 +208,7 @@ static CGFloat const kBtnHeight = 38.f;
if (!_titleLabel) {
_titleLabel = [[UILabel alloc] init];
_titleLabel.textAlignment = NSTextAlignmentCenter;
_titleLabel.numberOfLines = 0;
}
return _titleLabel ;
}

View File

@@ -293,7 +293,7 @@
[Api phoneSmsCode:[self createHttpCompletion:^(id _Nonnull data) {
@kStrongify(self);
[[self getView] phoneSmsCodeSuccess];
}] mobile:desPhone type:[NSString stringWithFormat:@"%lu", (unsigned long)type] phoneAreaCode:phoneAreaCode];
} showLoading:YES errorToast:YES] mobile:desPhone type:[NSString stringWithFormat:@"%lu", (unsigned long)type] phoneAreaCode:phoneAreaCode];
}
/// 使

View File

@@ -36,7 +36,13 @@
//
NSData *data = [[NSData alloc] initWithContentsOfFile:path];
// JSON
NSDictionary *codeData = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
NSError *error = nil;
NSDictionary *codeData = [NSJSONSerialization JSONObjectWithData:data
options:NSJSONReadingMutableLeaves
error:&error];
if (error) {
NSLog(@"JSON Parsing Error: %@", error.localizedDescription);
}
NSArray *codeList = [LoginAreaModel modelsWithArray:codeData[@"RECORDS"]];
[self getLocalPlistWithList:codeList];
}

View File

@@ -162,12 +162,12 @@
make.height.mas_equalTo(kGetScaleWidth(48));
make.width.mas_equalTo(kGetScaleWidth(303));
}];
}
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
[self.view endEditing:YES];
}
- (void)racBind {
@weakify(self);
RAC(self.loginBtn, enabled) = [[RACSignal combineLatest:@[self.phoneInputView.inputTextField.rac_textSignal, self.codeInputView.inputTextField.rac_textSignal,self.accountView.inputTextField.rac_textSignal,self.accountPwdView.inputTextField.rac_textSignal] reduce:^id _Nonnull(NSString *phone, NSString* smsCode,NSString *account,NSString *accountPwd){
@@ -179,7 +179,6 @@
}] takeUntil:self.rac_willDeallocSignal];
}
///
- (void)loginBtnClicked {
[XNDJTDDLoadingTool showOnlyView:self.view];
@@ -189,8 +188,7 @@
[self.presenter loginWithPhone:phone password:password];
return;
}
NSString *phone = self.phoneInputView.inputTextField.text;
NSString *smsCode = self.codeInputView.inputTextField.text;
NSString * phoneStr = [NSString stringWithFormat:@"%@%@",self.pi_phoneAreaCode, phone];
@@ -348,7 +346,6 @@
return _loginBtn;
}
- (UIImageView *)bgImageView{
if(!_bgImageView){
_bgImageView = [[UIImageView alloc]init];
@@ -371,8 +368,6 @@
_chooseTypeView = [UIImageView new];
_chooseTypeView.userInteractionEnabled = YES;
[_chooseTypeView setImage:kImage(@"login_choose_phone_bg")];
}
return _chooseTypeView;
}

View File

@@ -179,7 +179,9 @@
_titleView.contentEdgeInsetRight = 120;
_titleView.titles = self.titles;
_titleView.cellSpacing = 20;
_titleView.customWidth = KScreenWidth - 40;
if (isMSTR() || isMSEN()) {
_titleView.customLeading = 40;
}
_titleView.listContainer = (id<JXCategoryViewListContainer>)self.pagingView.listContainerView;
[_titleView addSubview:self.allCleanBtn];

View File

@@ -19,7 +19,7 @@ NS_ASSUME_NONNULL_BEGIN
/// @param password 支付密码
/// @param phone 手机号
/// @param veriftCode 验证码
- (void)setPayPassword:(NSString *)password phone:(NSString *)phone veriftCode:(NSString *)veriftCode;
//- (void)setPayPassword:(NSString *)password phone:(NSString *)phone veriftCode:(NSString *)veriftCode;
/// 设置支付密码
/// @param password 支付密码

View File

@@ -25,7 +25,7 @@
NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)];
[Api phoneSmsCode:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] phoneSmsCodeSuccess];
}] mobile:desPhone type:typeStr phoneAreaCode:phoneAreaCode];
} showLoading:YES errorToast:YES] mobile:desPhone type:typeStr phoneAreaCode:phoneAreaCode];
}
///

View File

@@ -15,8 +15,6 @@
///model
#import "XPIncomeRecordModel.h"
#import "XPExchangeDiamondsModel.h"
#import "XPBindExtractInfoModel.h"
#import "XPWithdrawAccountModel.h"
#import "XPIncomeRecordGoldDetailsModel.h"
@implementation XPIncomeRecordPresent
- (id<XPIncomeRecordProtocol>)getView {
@@ -31,13 +29,10 @@
} showLoading:NO errorToast:NO]];
}
-(void)requestRecordIncome{
[Api requestRecordIncome:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
XPIncomeRecordModel *model = [XPIncomeRecordModel modelWithDictionary:data.data];
[[self getView]getRecordIncomeSuccess:model];
} showLoading:YES]];
}
-(void)getExchangeDiamondInformation{
@kWeakify(self);

View File

@@ -135,10 +135,6 @@ TZImagePickerControllerDelegate>
}];
}];
#if DEBUG
self.userInfo.userVipInfoVO.uploadGifAvatar = YES;
#endif
if (self.userInfo.userVipInfoVO.uploadGifAvatar) {
TTActionSheetConfig *gifLibraryConfig = [TTActionSheetConfig normalTitle:YMLocalizedString(@"UserInfoEdit_1.0.17_0") clickAction:^{
[YYUtility checkAssetsLibrayAvailable:^{

View File

@@ -124,7 +124,7 @@ HWDMP4PlayDelegate>
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self.presenter getUserInfoWithUid:@(self.uid).stringValue];
[self initHttpRequest];
if([XPSkillCardPlayerManager shareInstance].isInRoom == YES && [XPSkillCardPlayerManager shareInstance].isInRoomFirstRecharge == NO){
[XPSkillCardPlayerManager shareInstance].isInRoomFirstRecharge = YES;
@@ -137,6 +137,12 @@ HWDMP4PlayDelegate>
self.playVapCount = 0;
[self initSubViews];
[self initSubViewConstraints];
///访
NSString *uid = [NSString stringWithFormat:@"%ld", self.uid];
if (![uid isEqualToString:[[AccountInfoStorage instance] getUid]]) {
[self.presenter visitUser:uid];
}
}
- (void)viewDidLayoutSubviews {
@@ -174,12 +180,8 @@ HWDMP4PlayDelegate>
- (void)initHttpRequest {
NSString *uid = [NSString stringWithFormat:@"%ld", self.uid];
// [self.presenter getUserInfoWithUid:uid];
[self.presenter getUserInfoWithUid:uid];
[self.presenter getUserAttentionState:uid];
///访
if (![uid isEqualToString:[[AccountInfoStorage instance] getUid]]) {
[self.presenter visitUser:uid];
}
}
#pragma mark -

View File

@@ -788,12 +788,12 @@ UICollectionViewDataSource>
[model.vipAuthInfos enumerateObjectsUsingBlock:^(NobleAuthInfo * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
if (obj.authType == 1 || obj.authType == 2 || obj.authType == 5 || obj.authType == 8 || obj.authType == 11 || obj.authType == 12) {
[tempArray_1 addObject:obj];
} else if (obj.authType != 16) {
} else {
[tempArray_2 addObject:obj];
}
}];
self.vipIdentificationInfoArray = tempArray_1.copy;
self.vipExclusivePrivilegesInfoArray = tempArray_2.copy;
self.vipExclusivePrivilegesInfoArray = model.vipAuthInfos.copy;
if (self.userVIPInfo) {
self.currentVIPInfo = [self.vipModel.vipInfos xpSafeObjectAtIndex:self.userVIPInfo.vipLevel - 1];
@@ -994,10 +994,14 @@ UICollectionViewDataSource>
return UIEdgeInsetsMake(10, 0, 10, 0);
break;
case 1:
return UIEdgeInsetsMake(0, 16, 0, 16);
if (iPhoneXSeries) {
return UIEdgeInsetsMake(0, 16, 0, 16);
} else {
return UIEdgeInsetsMake(0, 6, 0, 6);
}
break;
case 2:
return UIEdgeInsetsMake(10, 0, 10, 0);
return UIEdgeInsetsMake(14, 0, 6, 0);
break;
case 3:
return UIEdgeInsetsMake(0, 40, 100, 40);

View File

@@ -97,7 +97,7 @@
[UIView animateWithDuration:0.25 animations:^{
bannerView.center = CGPointMake(superView.center.x, height/2 + topSpace);
} completion:^(BOOL finished) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[UIView animateWithDuration:0.25 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
bannerView.frame = CGRectMake(-KScreenWidth, topSpace, width, height);
} completion:^(BOOL finished) {

View File

@@ -975,6 +975,7 @@ return view;\
if (!_reviewIcon) {
_reviewIcon = [[UIImageView alloc] init];
_reviewIcon.image = [UIImage getLanguageImage:@"mine_album_reviewing"];
_reviewIcon.contentMode = UIViewContentModeScaleAspectFit;
_reviewIcon.hidden = YES;
}
return _reviewIcon;

View File

@@ -54,7 +54,7 @@
[UIView animateWithDuration:0.25 animations:^{
bannerView.center = CGPointMake(superView.center.x, height/2 + 80);
} completion:^(BOOL finished) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[UIView animateWithDuration:0.25 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
bannerView.frame = CGRectMake(-KScreenWidth, 80, width, height);
} completion:^(BOOL finished) {

View File

@@ -26,14 +26,13 @@
@kStrongify(self);
self.icon.imageUrl = boomModel.pic;
CGFloat progress = boomModel.speed * 1.0 / 100.0;
if (progress == 0) {
self.progress.hidden = YES;
} else {
self.progress.hidden = NO;
[UIView animateWithDuration:0.3 animations:^{
[self.progress mas_updateConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(kGetScaleWidth(32) * progress);
make.width.mas_equalTo(46 * progress);
}];
[self layoutIfNeeded];
}];
@@ -45,24 +44,25 @@
if (self = [super init]) {
[self addSubview:self.icon];
[self.icon mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.mas_equalTo(self);
make.size.mas_equalTo(CGSizeMake(kGetScaleWidth(40), kGetScaleWidth(40)));
make.centerX.mas_equalTo(self);
make.bottom.mas_equalTo(-10);
make.size.mas_equalTo(CGSizeMake(55,55));
}];
[self addSubview:self.progressBG];
[self.progressBG mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self.icon).offset(3);
make.leading.mas_equalTo(self.icon).offset(3);
make.trailing.mas_equalTo(self.icon).offset(-3);
make.height.mas_equalTo(7);
make.bottom.mas_equalTo(self).offset(-3);
make.centerX.mas_equalTo(self);
make.width.mas_equalTo(47);
make.height.mas_equalTo(8);
}];
[self addSubview:self.progress];
[self.progressBG addSubview:self.progress];
[self.progress mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.progressBG);
make.leading.mas_equalTo(self.icon).offset(4.5);
make.leading.mas_equalTo(self.progress).offset(0.5);
make.width.mas_equalTo(0);
make.height.mas_equalTo(5);
make.height.mas_equalTo(7);
}];
}
return self;
@@ -80,7 +80,7 @@
- (UIImageView *)progress {
if (!_progress) {
UIImage *progressImage = [kImage(@"room_boom_entry_progress_bar") resizableImageWithCapInsets:UIEdgeInsetsMake(0, 10, 0, 3) resizingMode:UIImageResizingModeTile];
UIImage *progressImage = [kImage(@"room_boom_entry_progress_bar") resizableImageWithCapInsets:UIEdgeInsetsMake(0, 6, 0, 6) resizingMode:UIImageResizingModeStretch];
_progress = [[UIImageView alloc] initWithImage:progressImage];
_progress.userInteractionEnabled = YES;
_progress.hidden = NO;

View File

@@ -166,6 +166,7 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
CGFloat scrollItemWidth = KScreenHeight > 667 ? 65 : 55 * kScreenHeightScale;
CGSize itemSize = CGSizeMake(scrollItemWidth , scrollItemWidth);
CGSize itemSize_game_rocket = CGSizeMake(55 , 55);
[self.pi_cycleScrollView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(itemSize);
}];
@@ -181,12 +182,12 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
[self.gambleMenuButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(0);
make.size.mas_equalTo(itemSize);
make.size.mas_equalTo(itemSize_game_rocket);
}];
[self.boomView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(0);
make.size.mas_equalTo(itemSize);
make.size.mas_equalTo(itemSize_game_rocket);
}];
[self.configEntranceMenuButton mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -787,9 +788,9 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
if (!_stackView) {
_stackView = [[UIStackView alloc] init];
_stackView.axis = UILayoutConstraintAxisVertical;
_stackView.distribution = UIStackViewDistributionFill;
_stackView.distribution = UIStackViewDistributionFillProportionally;
_stackView.alignment = UIStackViewAlignmentCenter;
_stackView.spacing = 0;
_stackView.spacing = 14;
}
return _stackView;
}
@@ -831,7 +832,7 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
b.imageView.contentMode = UIViewContentModeScaleAspectFit;
b.contentHorizontalAlignment = UIControlContentHorizontalAlignmentFill;
b.contentVerticalAlignment = UIControlContentVerticalAlignmentFill;
b.imageEdgeInsets = UIEdgeInsetsMake(10, 10, 10, 10);
// b.imageEdgeInsets = UIEdgeInsetsMake(10, 10, 10, 10);
b.hidden = YES;
_gambleMenuButton = b;
}
@@ -846,7 +847,7 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
b.imageView.contentMode = UIViewContentModeScaleAspectFit;
b.contentHorizontalAlignment = UIControlContentHorizontalAlignmentFill;
b.contentVerticalAlignment = UIControlContentVerticalAlignmentFill;
b.imageEdgeInsets = UIEdgeInsetsMake(10, 10, 10, 10);
// b.imageEdgeInsets = UIEdgeInsetsMake(10, 10, 10, 10);
b.hidden = YES;
_configEntranceMenuButton = b;
}

View File

@@ -49,7 +49,7 @@
[UIView animateWithDuration:0.25 animations:^{
bannerView.center = CGPointMake(superView.center.x, height/2 + 80);
} completion:^(BOOL finished) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[UIView animateWithDuration:0.25 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
bannerView.frame = CGRectMake(-KScreenWidth, 80, width, height);
} completion:^(BOOL finished) {
@@ -200,9 +200,9 @@
[self.bgImageView loadImageWithUrl:model.resourceContent completion:^(UIImage * _Nullable image, NSURL * _Nonnull url) {
@kStrongify(self);
if (image) {
[self loadLocalSVGA];
} else {
self.bgImageView.image = image;
} else {
[self loadLocalSVGA];
}
}];
}

View File

@@ -87,7 +87,7 @@ exitCurrentRoom:(void(^)(void))exit {
[UIView animateWithDuration:0.25 animations:^{
bannerView.center = CGPointMake(superView.center.x, height/2 + 80);
} completion:^(BOOL finished) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[UIView animateWithDuration:0.25 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
bannerView.frame = CGRectMake(-KScreenWidth, 80, width, height);
} completion:^(BOOL finished) {

View File

@@ -131,7 +131,7 @@
- (UIImageView *)bgImageView{
if(!_bgImageView){
_bgImageView = [UIImageView new];
_bgImageView.image = kImage(@"room_candy_tree_buy_love__bg");
_bgImageView.image = [UIImage getLanguageImage:@"room_candy_tree_buy_love__bg"];//kImage(@"room_candy_tree_buy_love__bg");
_bgImageView.userInteractionEnabled = YES;
}
return _bgImageView;

View File

@@ -277,7 +277,7 @@
- (UIImageView *)bgImageView{
if(!_bgImageView){
_bgImageView = [UIImageView new];
_bgImageView.image = kImage(@"room_candy_tree_confirm_buy_bg");
_bgImageView.image = [UIImage getLanguageImage:@"room_candy_tree_confirm_buy_bg"];//kImage(@"room_candy_tree_confirm_buy_bg");
_bgImageView.userInteractionEnabled = YES;
}
return _bgImageView;
@@ -334,7 +334,8 @@
- (UIButton *)buyBtn{
if(!_buyBtn){
_buyBtn = [UIButton new];
[_buyBtn setBackgroundImage:kImage(@"room_candy_tree_buy_love_but_btn") forState:UIControlStateNormal];
[_buyBtn setBackgroundImage:[UIImage getLanguageImage:@"room_candy_tree_buy_love_but_btn"]//kImage(@"room_candy_tree_buy_love_but_btn")
forState:UIControlStateNormal];
// [_buyBtn setTitle:YMLocalizedString(@"PITreasureFairyBuyElfShardView1") forState:UIControlStateNormal];
// [_buyBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
// _buyBtn.titleLabel.font = kFontMedium(14);

View File

@@ -51,8 +51,6 @@
///
@property (nonatomic,strong) UIImageView *moreImageView;
///
@property (strong, nonatomic) SVGAParser *parser;
///
@@ -62,8 +60,6 @@
@property(nonatomic,strong) UIImageView *lampView;
///
@property (nonatomic,strong) SVGAImageView *candyTreeOpenView;
@@ -93,7 +89,6 @@
- (void)dealloc {
[[NIMSDK sharedSDK].systemNotificationManager removeDelegate:self];
}
- (instancetype)initWithDelegate:(id<RoomHostDelegate>)delegate {
@@ -117,35 +112,32 @@
[self initSubViewConstraints];
[self.presenter getCandyTreeInfo];
[self.presenter getLoveSettingInfo];
}
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
[self.view endEditing:YES];
}
#pragma mark -XPCandyRankContainerViewDelegate
- (void)didClickHeadHandle:(NSInteger)uid{
[TTPopup dismiss];
XPMineUserInfoViewController * userInfoVC = [[XPMineUserInfoViewController alloc] init];
userInfoVC.uid = uid;
[self.hostDelegate.getCurrentNav pushViewController:userInfoVC animated:YES];
}
#pragma mark - XPCandyTreeProtocol
- (void)getCandyTreeInfoSuccess:(CandyTreeInfoModel *)info {
[self hideHUD];
self.candyInfo = info;
}
-(void)getLoveSettingInfoSuccess:(PICandyTreeSetModel *)setModel{
self.setModel = setModel;
self.buyView.num = self.setModel.ticketNum;
}
- (void)buyLoveTicketSuccessWithNum:(NSString *)num{
- (void)buyLoveTicketSuccessWithNum:(NSString *)num{
NSString *time = [NSDate getNowTimeTimestamp];
NSString *curTime = [NSDate timestampSwitchTime:[time integerValue] andFormatter:@"yyyy-MM-dd"];
NSDictionary *timeDic = [[NSUserDefaults standardUserDefaults]valueForKey:@"kBuyLoveNumSuccessNoPrompt"];
@@ -248,10 +240,8 @@
}
#pragma mark - Private Method
- (void)initSubViews {
self.view.backgroundColor = [UIColor clearColor];
[self.view addSubview:self.backView];
[self.view addSubview:self.bgImageView];
@@ -272,20 +262,16 @@
[self.bgImageView addSubview:self.animationView];
[self.bgImageView addSubview:self.buyView];
@kWeakify(self);
[self.parser parseWithNamed:@"pi_happy_egg_smash" inBundle:[NSBundle mainBundle] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) {
@kStrongify(self);
self.candyTreeOpenView.loops = 1;
self.candyTreeOpenView.clearsAfterStop = NO;
self.candyTreeOpenView.videoItem = videoItem;
} failureBlock:^(NSError * _Nonnull error) {
}];
@kWeakify(self);
[self.parser parseWithNamed:@"pi_happy_egg_smash" inBundle:[NSBundle mainBundle] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) {
@kStrongify(self);
self.candyTreeOpenView.loops = 1;
self.candyTreeOpenView.clearsAfterStop = NO;
self.candyTreeOpenView.videoItem = videoItem;
} failureBlock:^(NSError * _Nonnull error) {
}];
}
- (void)initSubViewConstraints {

View File

@@ -103,7 +103,8 @@
}];
[self.allMicroButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(60, 28));
make.height.mas_equalTo(28);
make.width.mas_greaterThanOrEqualTo(60);
}];
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {

View File

@@ -50,7 +50,6 @@
XPRoomSettingItemModel *avatarItem = [[XPRoomSettingItemModel alloc] init];
avatarItem.title = YMLocalizedString(@"RoomSetting_1.0.17_0");
avatarItem.subTitle = roomInfo.roomTag;
avatarItem.avatar = roomInfo.avatar;
avatarItem.type = RoomSettingItemType_Avatar;