ASPayFailedViewController.m 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. //
  2. // ASPayFailedViewController.m
  3. // Asteria
  4. //
  5. // Created by xingyu on 2024/5/16.
  6. //
  7. #import "ASPayFailedViewController.h"
  8. #import "ASPayFinishHeadView.h"
  9. @interface ASPayFailedViewController ()
  10. @property (nonatomic, strong) UIScrollView *scrollView;
  11. @end
  12. @implementation ASPayFailedViewController
  13. - (void)viewDidLoad {
  14. [super viewDidLoad];
  15. self.statusBgV.backgroundColor = Col_FFF;
  16. self.customNavBar.backgroundColor = Col_FFF;
  17. _scrollView = [[UIScrollView alloc] init];
  18. [self.view addSubview:_scrollView];
  19. [_scrollView mas_makeConstraints:^(MASConstraintMaker *make) {
  20. make.top.equalTo(self.customNavBar.mas_bottom);
  21. make.leading.trailing.bottom.equalTo(self.view);
  22. }];
  23. ASPayFinishHeadView *payFailedView = [[ASPayFinishHeadView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, 100) status:0 desc:@""];
  24. [self.scrollView addSubview:payFailedView];
  25. K_WEAK_SELF;
  26. payFailedView.clickBlock = ^(int type) {
  27. K_STRONG_SELF;
  28. if (type == 1) {
  29. [self.navigationController popViewControllerAnimated:true];
  30. } else if (type == 2) {
  31. UIViewController *vc = [CTMediator.sharedInstance getWebViewVc:@{
  32. @"title":@"Faq",
  33. @"url":HelpFaqsWebUrl,
  34. }];
  35. [weakSelf.navigationController pushViewController:vc animated:true];
  36. } else if (type == 3) {
  37. UIViewController *vc = [CTMediator.sharedInstance getWebViewVc:@{
  38. @"title":@"Contact Us",
  39. @"url":ContactUsWebUrl,
  40. }];
  41. [weakSelf.navigationController pushViewController:vc animated:true];
  42. }
  43. };
  44. float viewHeight = [payFailedView getViewHeight];
  45. payFailedView.frame = CGRectMake(0, 0, KScreenWidth, viewHeight);
  46. self.scrollView.contentSize = CGSizeMake(KScreenWidth, viewHeight);
  47. }
  48. @end