ASVipCouponsViewController.m 2.9 KB

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