Files
featherVoice/QXLive/Mine(音域)/Controller/设置/QXModifyMobileViewController.m
2025-12-22 10:16:05 +08:00

88 lines
3.5 KiB
Objective-C

//
// QXModifyMobileViewController.m
// QXLive
//
// Created by 启星 on 2025/12/19.
//
#import "QXModifyMobileViewController.h"
#import "QXBindMobileViewController.h"
@interface QXModifyMobileViewController ()
@property (nonatomic,strong)UIImageView *topImageView;
@property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)UILabel *mobileLabel;
@property (nonatomic,strong)UIButton *changeBtn;
@end
@implementation QXModifyMobileViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
-(void)setNavgationItems{
[super setNavgationItems];
self.navigationItem.title = @"更换手机号码";
}
-(void)initSubViews{
self.topImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"change_mobile_top"]];
[self.view addSubview:self.topImageView];
[self.topImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(ScaleWidth(150));
make.top.mas_equalTo(NavContentHeight);
make.centerX.equalTo(self.view);
}];
self.titleLabel = [[UILabel alloc] init];
self.titleLabel.textColor = RGB16(0x666666);
self.titleLabel.font = [UIFont systemFontOfSize:14];
self.titleLabel.text = @"更换手机号码以后,个人信息不变";
[self.view addSubview:self.titleLabel];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self.view);
make.top.equalTo(self.topImageView.mas_bottom).offset(8);
make.height.mas_equalTo(21);
}];
self.mobileLabel = [[UILabel alloc] init];
self.mobileLabel.textColor = RGB16(0x999999);
self.mobileLabel.font = [UIFont systemFontOfSize:12];
NSString *pMobile = [QXGlobal.shareGlobal.loginModel.mobile stringByReplacingCharactersInRange:NSMakeRange(3, 4) withString:@"****"];
NSString *mobile = [NSString stringWithFormat:@"当前手机号 %@",pMobile];
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:mobile];
[attr yy_setFont:[UIFont boldSystemFontOfSize:17] range:[mobile rangeOfString:pMobile]];
[attr yy_setColor:RGB16(0x333333) range:[mobile rangeOfString:pMobile]];
self.mobileLabel.attributedText = attr;
[self.view addSubview:self.mobileLabel];
[self.mobileLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self.view);
make.top.equalTo(self.titleLabel.mas_bottom).offset(8);
make.height.mas_equalTo(28);
}];
self.changeBtn = [[UIButton alloc] init];
[self.changeBtn setTitle:@"更换手机号码" forState:(UIControlStateNormal)];
[self.changeBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
[self.changeBtn addTarget:self action:@selector(changeAction) forControlEvents:(UIControlEventTouchUpInside)];
[self.changeBtn addRoundedCornersWithRadius:21];
self.changeBtn.titleLabel.font = [UIFont systemFontOfSize:14];
self.changeBtn.backgroundColor = QXConfig.themeColor;
[self.view addSubview:self.changeBtn];
[self.changeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self.view);
make.top.equalTo(self.mobileLabel.mas_bottom).offset(30);
make.height.mas_equalTo(42);
make.width.mas_equalTo(ScaleWidth(300));
}];
}
-(void)changeAction{
QXBindMobileViewController *vc = [[QXBindMobileViewController alloc] init];
vc.haveMobile = YES;
[self.navigationController pushViewController:vc animated:YES];
}
@end