ASVipCouponsViewController.m 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. //
  2. // ASVipCouponsViewController.m
  3. // Asteria
  4. //
  5. // Created by iOS on 2023/7/1.
  6. //
  7. #import "ASVipCouponsViewController.h"
  8. #import "ASCouponListCell.h"
  9. #import "ASHomeAlertWindow.h"
  10. @interface ASVipCouponsViewController () <UITableViewDelegate,UITableViewDataSource>
  11. @property (nonatomic, strong) UIView *colorBgV;
  12. @property (nonatomic, strong) UITableView *tableV;
  13. @end
  14. @implementation ASVipCouponsViewController
  15. - (void)viewDidLoad {
  16. [super viewDidLoad];
  17. [self loadSubVs];
  18. [self configSubVs];
  19. }
  20. - (void)configSubVs {
  21. self.titleStr = @"VIP Exclusive Coupon";
  22. [self setNavRightSearch:^{
  23. }];
  24. self.statusBgV.backgroundColor = _E0FFF5;
  25. self.customNavBar.backgroundColor = _F0FFFA;
  26. }
  27. // MARK: - loadSubVs
  28. - (void)loadSubVs {
  29. [self.view addSubview:self.colorBgV];
  30. [self.view addSubview:self.tableV];
  31. [self.colorBgV mas_makeConstraints:^(MASConstraintMaker *make) {
  32. make.top.equalTo(self.customNavBar.mas_bottom);
  33. make.leading.trailing.bottom.equalTo(self.view);
  34. }];
  35. [self.tableV mas_makeConstraints:^(MASConstraintMaker *make) {
  36. make.top.equalTo(self.customNavBar.mas_bottom);
  37. make.leading.trailing.bottom.equalTo(self.view);
  38. }];
  39. dispatch_async(dispatch_get_main_queue(), ^{
  40. [UIView viewAddHorColorBg:self.colorBgV colorArr:@[
  41. (id)_E0FFF5.CGColor,
  42. (id)Col_FFF.CGColor
  43. ] startP:CGPointMake(0.5, 0.2) endP:CGPointMake(0.5, 1)];
  44. });
  45. }
  46. // MARK: - subVs
  47. - (UIView *)colorBgV {
  48. if (!_colorBgV) {
  49. UIView *v = [UIView baseV];
  50. v.backgroundColor = Col_FFF;
  51. _colorBgV = v;
  52. }
  53. return _colorBgV;
  54. }
  55. - (UITableView *)tableV {
  56. if (!_tableV) {
  57. UITableView *v = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
  58. [v baseSet];
  59. v.backgroundColor = UIColor.clearColor;
  60. v.delegate = self;
  61. v.dataSource = self;
  62. [v registerClass:[ASCouponListCell class] forCellReuseIdentifier:@"ASCouponListCell"];
  63. _tableV = v;
  64. }
  65. return _tableV;
  66. }
  67. // MARK: - UITableViewDelegate,UITableViewDataSource
  68. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  69. return 10;
  70. }
  71. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  72. ASCouponListCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ASCouponListCell" forIndexPath:indexPath];
  73. __weak typeof(self) weakSelf = self;
  74. [cell setCopyCallBack:^{
  75. [ASHomeAlertWindow alertMsg:@"Coupon Received Please Check In My Coupon"];
  76. }];
  77. [cell setVipCouponStyle];
  78. return cell;
  79. }
  80. @end