JXSkPayVC.m 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. //
  2. // JXSkPayVC.m
  3. // shiku_im
  4. //
  5. // Created by p on 2019/5/16.
  6. // Copyright © 2019年 Reese. All rights reserved.
  7. //
  8. #import "JXSkPayVC.h"
  9. @interface JXSkPayVC ()
  10. @property (nonatomic, strong) UIView *contentView;
  11. @end
  12. @implementation JXSkPayVC
  13. - (void)viewDidLoad {
  14. [super viewDidLoad];
  15. self.view.backgroundColor = [UIColor colorWithWhite:.5 alpha:.5];
  16. _contentView = [[UIView alloc] initWithFrame:CGRectMake(0, 300, JX_SCREEN_WIDTH, JX_SCREEN_HEIGHT - 300)];
  17. _contentView.backgroundColor = [UIColor whiteColor];
  18. [self.view addSubview:_contentView];
  19. UIButton *cancelBtn = [[UIButton alloc] initWithFrame:CGRectMake(10, 10, 20, 20)];
  20. [cancelBtn setImage:[UIImage imageNamed:@"pay_cha"] forState:UIControlStateNormal];
  21. [cancelBtn addTarget:self action:@selector(cancelBtnAction) forControlEvents:UIControlEventTouchUpInside];
  22. [_contentView addSubview:cancelBtn];
  23. UILabel *title = [[UILabel alloc] initWithFrame:CGRectMake(0, 10, JX_SCREEN_WIDTH, 20)];
  24. title.font = [UIFont systemFontOfSize:16.0];
  25. title.textAlignment = NSTextAlignmentCenter;
  26. title.text = Localized(@"JX_ConfirmPayment");
  27. [_contentView addSubview:title];
  28. UILabel *RMBLab = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(title.frame)+40, JX_SCREEN_WIDTH, 50)];
  29. RMBLab.textAlignment = NSTextAlignmentCenter;
  30. RMBLab.font = SYSFONT(46);
  31. RMBLab.text = [NSString stringWithFormat:@"¥%.2f",[[self.payDic objectForKey:@"money"] doubleValue]];
  32. [_contentView addSubview:RMBLab];
  33. UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(15, CGRectGetMaxY(RMBLab.frame) + 40, 200, 30)];
  34. label.textColor = [UIColor lightGrayColor];
  35. label.text = Localized(@"JX_OrderInfo");
  36. [_contentView addSubview:label];
  37. label = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(RMBLab.frame) + 25, JX_SCREEN_WIDTH - 15, 30)];
  38. label.textAlignment = NSTextAlignmentRight;
  39. label.textColor = [UIColor lightGrayColor];
  40. label.text = [self.payDic objectForKey:@"desc"];
  41. [_contentView addSubview:label];
  42. UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(15, CGRectGetMaxY(label.frame) + 20, JX_SCREEN_WIDTH - 15, .5)];
  43. lineView.backgroundColor = [UIColor lightGrayColor];
  44. [_contentView addSubview:lineView];
  45. label = [[UILabel alloc] initWithFrame:CGRectMake(15, CGRectGetMaxY(lineView.frame) + 20, 200, 30)];
  46. label.textColor = [UIColor lightGrayColor];
  47. label.text = Localized(@"JX_PayType");
  48. [_contentView addSubview:label];
  49. label = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(lineView.frame) + 10, JX_SCREEN_WIDTH - 15, 30)];
  50. label.textAlignment = NSTextAlignmentRight;
  51. label.textColor = [UIColor lightGrayColor];
  52. label.text = Localized(@"JX_PayBalance");
  53. [_contentView addSubview:label];
  54. lineView = [[UIView alloc] initWithFrame:CGRectMake(15, CGRectGetMaxY(label.frame) + 20, JX_SCREEN_WIDTH - 15, .5)];
  55. lineView.backgroundColor = [UIColor lightGrayColor];
  56. [_contentView addSubview:lineView];
  57. UIButton *btn = [UIFactory createCommonButton:Localized(@"JX_SKPayConfirm") target:self action:@selector(onPay)];
  58. [btn setBackgroundImage:nil forState:UIControlStateHighlighted];
  59. btn.custom_acceptEventInterval = 1.f;
  60. btn.frame = CGRectMake(INSETS,_contentView.frame.size.height - 100, WIDTH, 50);
  61. [btn setBackgroundImage:nil forState:UIControlStateNormal];
  62. btn.backgroundColor = THEMECOLOR;
  63. [_contentView addSubview:btn];
  64. }
  65. - (void)onPay {
  66. if ([self.delegate respondsToSelector:@selector(skPayVC:payBtnAction:)]) {
  67. [self.delegate skPayVC:self payBtnAction:self.payDic];
  68. }
  69. [self cancelBtnAction];
  70. }
  71. - (void)cancelBtnAction {
  72. [self dismissViewControllerAnimated:YES completion:nil];
  73. }
  74. /*
  75. #pragma mark - Navigation
  76. // In a storyboard-based application, you will often want to do a little preparation before navigation
  77. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  78. // Get the new view controller using [segue destinationViewController].
  79. // Pass the selected object to the new view controller.
  80. }
  81. */
  82. @end