// // QXRechargeViewcController.m // QXLive // // Created by 启星 on 2025/5/16. // #import "QXRechargeViewcController.h" #import "QXRechargeView.h" #import "QXWalletTopView.h" #import "QXPayTypeModel.h" #import "QXMineNetwork.h" @interface QXRechargeViewcController () @property (nonatomic,strong)QXWalletTopView *topView; @property (nonatomic,strong)QXRechargeView *rechargeView; @end @implementation QXRechargeViewcController - (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]; [self getPrice]; [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(rechargeSuccess) name:noticeAlipayResult object:nil]; } -(void)setNavgationItems{ [super setNavgationItems]; self.navigationItem.title = QXText(@"充值"); } -(void)rechargeSuccess{ [self getPrice]; } - (void)initSubViews{ [self.view addSubview:self.topView]; [self.view addSubview:self.rechargeView]; [self.topView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(16); make.right.mas_equalTo(-16); make.top.mas_equalTo(NavContentHeight+12); make.height.mas_equalTo(ScaleWidth(112)); }]; [self.rechargeView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(0); make.right.mas_equalTo(0); make.top.equalTo(self.topView.mas_bottom).offset(12); make.bottom.mas_equalTo(-10); }]; } -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ [self.view endEditing:YES]; } -(void)getPrice{ MJWeakSelf [QXMineNetwork getWalletInfoSuccessBlock:^(NSString * _Nonnull coin, NSString * _Nonnull earnings, NSString * _Nonnull title, NSString * _Nonnull url) { weakSelf.topView.coin = coin; } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { }]; } -(QXWalletTopView *)topView{ if (!_topView) { _topView = [[QXWalletTopView alloc] init]; } return _topView; } -(QXRechargeView *)rechargeView{ if (!_rechargeView) { _rechargeView = [[QXRechargeView alloc] initWithFrame:CGRectMake(0, ScaleWidth(112)+12, SCREEN_WIDTH, SCREEN_HEIGHT-ScaleWidth(112)-12-NavContentHeight-12)]; } return _rechargeView; } -(void)dealloc{ [[NSNotificationCenter defaultCenter] removeObserver:self]; } @end