GoodsDetailsPayV.m 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //
  2. // GoodsDetailsPayV.m
  3. // Asteria
  4. //
  5. // Created by 王猛 on 2023/12/27.
  6. //
  7. #import "GoodsDetailsPayV.h"
  8. #import "AlertMyCartDeleteV.h"
  9. @implementation GoodsDetailsPayV
  10. - (void)tt_setupViews{
  11. [self addSubview:self.titleLab];
  12. self.titleLab.frame = CGRectMake(10, 10, self.mj_w-20, 20);
  13. NSArray *imgAry = @[@"goods_pay_paypal",@"goods_pay_afterpay"];
  14. for (int i = 0; i<imgAry.count; i++) {
  15. NSString *imgstr = imgAry[i];
  16. UIButton *payBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  17. [payBtn setImage:[UIImage imageNamed:imgstr] forState:UIControlStateNormal];
  18. payBtn.tag = GoodsInfoPayTypeTag+i;
  19. [self addSubview:payBtn];
  20. [payBtn addTarget:self action:@selector(pay_payBtnType:) forControlEvents:UIControlEventTouchUpInside];
  21. payBtn.frame = CGRectMake(10+(10+76)*i, CGRectGetMaxY(self.titleLab.frame) + 10, 76, 24);
  22. }
  23. }
  24. -(void)pay_payBtnType:(UIButton *)btn{
  25. NSArray *alertvImgAry = @[@"goods_alertv_paypal",@"goods_alertv_afterpay"];
  26. NSArray *closeImgAry = @[@"base_close_white",@"base_close_black"];
  27. AlertMyCartDeleteV *payAlertV = [[AlertMyCartDeleteV alloc]initWithPaytypeAlertV:[UIImage imageNamed:alertvImgAry[btn.tag-GoodsInfoPayTypeTag]] closeBtnImg:[UIImage imageNamed:closeImgAry[btn.tag-GoodsInfoPayTypeTag]]];
  28. [payAlertV alertv_show];
  29. }
  30. - (QMUILabel *)titleLab{
  31. if(!_titleLab){
  32. _titleLab = [[QMUILabel alloc]init];
  33. _titleLab.font = [UIFont fontWithName:Rob_Regular size:12];
  34. _titleLab.textColor = [UIColor colorWithHexString:@"#0D1623"];
  35. }
  36. return _titleLab;
  37. }
  38. @end