143 lines
5.2 KiB
Mathematica
143 lines
5.2 KiB
Mathematica
|
|
//
|
||
|
|
// QXBuyNobilitySuccessViewController.m
|
||
|
|
// QXLive
|
||
|
|
//
|
||
|
|
// Created by 启星 on 2025/11/10.
|
||
|
|
//
|
||
|
|
|
||
|
|
#import "QXBuyNobilitySuccessViewController.h"
|
||
|
|
#import "QXNobilityBuyDesCell.h"
|
||
|
|
|
||
|
|
@interface QXBuyNobilitySuccessViewController ()<UITableViewDelegate,UITableViewDataSource>
|
||
|
|
@property (nonatomic,strong)UITableView *tableView;
|
||
|
|
@property (nonatomic,strong)UIView *headerView;
|
||
|
|
@property (nonatomic,strong)UIImageView *resultImageView;
|
||
|
|
@property (nonatomic,strong)UILabel *resultLabel;
|
||
|
|
@property (nonatomic,strong)UILabel *titleLabel;
|
||
|
|
@property (nonatomic,strong)UIImageView *nobilityImageView;
|
||
|
|
@end
|
||
|
|
|
||
|
|
@implementation QXBuyNobilitySuccessViewController
|
||
|
|
|
||
|
|
- (void)viewDidLoad {
|
||
|
|
[super viewDidLoad];
|
||
|
|
// Do any additional setup after loading the view.
|
||
|
|
}
|
||
|
|
-(void)viewWillAppear:(BOOL)animated{
|
||
|
|
[super viewWillAppear:animated];
|
||
|
|
[self.navigationController setNavigationBarHidden:NO animated:YES];
|
||
|
|
}
|
||
|
|
-(void)viewWillDisappear:(BOOL)animated{
|
||
|
|
[super viewWillDisappear:animated];
|
||
|
|
}
|
||
|
|
|
||
|
|
-(void)initSubViews{
|
||
|
|
self.titleLabel.text = [NSString stringWithFormat:@"恭喜您已经成功开通%@爵位",self.model.nobility_name];
|
||
|
|
[self.nobilityImageView sd_setImageWithURL:[NSURL URLWithString:self.model.nobility_image]];
|
||
|
|
self.tableView.tableHeaderView = self.headerView;
|
||
|
|
[self.view addSubview:self.tableView];
|
||
|
|
}
|
||
|
|
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||
|
|
return self.model.power_list.count;
|
||
|
|
}
|
||
|
|
|
||
|
|
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||
|
|
QXNobilityBuyDesCell *cell = [QXNobilityBuyDesCell cellWithTableView:tableView];
|
||
|
|
QXNobilityGetPricePowerList *md = self.model.power_list[indexPath.row];
|
||
|
|
cell.titleLabel.text = md.content;
|
||
|
|
return cell;
|
||
|
|
}
|
||
|
|
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||
|
|
return 36;
|
||
|
|
}
|
||
|
|
|
||
|
|
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
|
||
|
|
UIView *header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 42)];
|
||
|
|
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(16, 12, SCREEN_WIDTH-32, 30)];
|
||
|
|
label.font = [UIFont boldSystemFontOfSize:16];
|
||
|
|
label.text = @"骑士特权";
|
||
|
|
label.textColor = RGB16A(0x000000, 0.85);
|
||
|
|
[header addSubview:label];
|
||
|
|
return header;
|
||
|
|
}
|
||
|
|
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
|
||
|
|
return 42;
|
||
|
|
}
|
||
|
|
|
||
|
|
-(UITableView *)tableView{
|
||
|
|
if (!_tableView) {
|
||
|
|
self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, NavContentHeight, SCREEN_WIDTH, SCREEN_HEIGHT-NavContentHeight) style:UITableViewStyleGrouped];
|
||
|
|
self.tableView.backgroundColor = [UIColor clearColor];
|
||
|
|
self.tableView.delegate = self;
|
||
|
|
self.tableView.dataSource = self;
|
||
|
|
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||
|
|
}
|
||
|
|
return _tableView;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
-(UIView *)headerView{
|
||
|
|
if (!_headerView) {
|
||
|
|
_headerView = [[UIView alloc] initWithFrame:CGRectMake(0, NavContentHeight, SCREEN_WIDTH, 280)];
|
||
|
|
[_headerView addSubview:self.resultImageView];
|
||
|
|
[_headerView addSubview:self.resultLabel];
|
||
|
|
[_headerView addSubview:self.titleLabel];
|
||
|
|
[_headerView addSubview:self.nobilityImageView];
|
||
|
|
|
||
|
|
[self.resultImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||
|
|
make.width.mas_equalTo(68);
|
||
|
|
make.height.mas_equalTo(60);
|
||
|
|
make.top.mas_equalTo(25);
|
||
|
|
make.centerX.equalTo(_headerView);
|
||
|
|
}];
|
||
|
|
[self.resultLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||
|
|
make.height.mas_equalTo(22);
|
||
|
|
make.centerX.equalTo(_headerView);
|
||
|
|
make.top.equalTo(self.resultImageView.mas_bottom).offset(7);
|
||
|
|
}];
|
||
|
|
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||
|
|
make.height.mas_equalTo(20);
|
||
|
|
make.centerX.equalTo(_headerView);
|
||
|
|
make.top.equalTo(self.resultLabel.mas_bottom).offset(7);
|
||
|
|
}];
|
||
|
|
[self.nobilityImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||
|
|
make.width.mas_equalTo(104);
|
||
|
|
make.height.mas_equalTo(104);
|
||
|
|
make.top.equalTo(self.titleLabel.mas_bottom).offset(36);
|
||
|
|
make.centerX.equalTo(_headerView);
|
||
|
|
}];
|
||
|
|
}
|
||
|
|
return _headerView;
|
||
|
|
}
|
||
|
|
|
||
|
|
-(UIImageView *)resultImageView{
|
||
|
|
if (!_resultImageView) {
|
||
|
|
_resultImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"nobility_pay_result_successs"]];
|
||
|
|
}
|
||
|
|
return _resultImageView;
|
||
|
|
}
|
||
|
|
-(UILabel *)resultLabel{
|
||
|
|
if (!_resultLabel) {
|
||
|
|
_resultLabel = [[UILabel alloc] init];
|
||
|
|
_resultLabel.textColor = RGB16(0x333333);
|
||
|
|
_resultLabel.font = [UIFont boldSystemFontOfSize:20];
|
||
|
|
_resultLabel.text = @"支付成功";
|
||
|
|
}
|
||
|
|
return _resultLabel;
|
||
|
|
}
|
||
|
|
-(UILabel *)titleLabel{
|
||
|
|
if (!_titleLabel) {
|
||
|
|
_titleLabel = [[UILabel alloc] init];
|
||
|
|
_titleLabel.textColor = RGB16A(0x000000,0.65);
|
||
|
|
_titleLabel.font = [UIFont systemFontOfSize:14];
|
||
|
|
}
|
||
|
|
return _titleLabel;
|
||
|
|
}
|
||
|
|
-(UIImageView *)nobilityImageView{
|
||
|
|
if (!_nobilityImageView) {
|
||
|
|
_nobilityImageView = [[UIImageView alloc] init];
|
||
|
|
}
|
||
|
|
return _nobilityImageView;
|
||
|
|
}
|
||
|
|
@end
|