MyCarlTableV.m 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //
  2. // MyCarlTableV.m
  3. // Asteria
  4. //
  5. // Created by 王猛 on 2024/1/27.
  6. //
  7. #import "MyCarlTableV.h"
  8. @implementation MyCarlTableV
  9. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  10. NSObject *objectM = self.infodata[indexPath.row];
  11. if([objectM isKindOfClass:[CartTotalsItemsM class]]){
  12. MyCartItemCell *cell = [MyCartItemCell cellWithTableView:tableView CellClass:[MyCartItemCell class]];
  13. [cell configData:(CartTotalsItemsM *)objectM];
  14. @weakify(self)
  15. cell.currencyparameterClose = ^(NSInteger type, id Data) {
  16. @strongify(self)
  17. [self generaltriggermethodType:type data:Data];
  18. };
  19. return cell;
  20. }else if([objectM isKindOfClass:[MyCartCouponCellData class]]){
  21. MyCartCouponCell *cell = [MyCartCouponCell cellWithTableView:tableView CellClass:[MyCartCouponCell class]];
  22. [cell configData:(MyCartCouponCellData *)objectM];
  23. @weakify(self)
  24. cell.currencyparameterClose = ^(NSInteger type, id Data) {
  25. @strongify(self)
  26. [self generaltriggermethodType:type data:Data];
  27. };
  28. return cell;
  29. }else if([objectM isKindOfClass:[MyCartGrandTotalCellData class]]){
  30. MyCartGrandTotalCell *cell = [MyCartGrandTotalCell cellWithTableView:tableView CellClass:[MyCartGrandTotalCell class]];
  31. [cell configData:(MyCartGrandTotalCellData *)objectM];
  32. @weakify(self)
  33. cell.currencyparameterClose = ^(NSInteger type, id Data) {
  34. @strongify(self)
  35. [self generaltriggermethodType:type data:Data];
  36. };
  37. return cell;
  38. }
  39. return nil;
  40. }
  41. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
  42. return UITableViewAutomaticDimension;
  43. }
  44. - (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath{
  45. return 200;
  46. }
  47. @end