MyCarlTableV.m 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. }else if([objectM isKindOfClass:[MyCartPayTypeCellData class]]){
  39. MyCartPayTypeCell *cell = [MyCartPayTypeCell cellWithTableView:tableView CellClass:[MyCartPayTypeCell class]];
  40. [cell configData:(MyCartPayTypeCellData *)objectM];
  41. return cell;
  42. }
  43. return nil;
  44. }
  45. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
  46. return UITableViewAutomaticDimension;
  47. }
  48. - (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath{
  49. return 200;
  50. }
  51. @end