CartCheckTableV.m 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. //
  2. // CartCheckTableV.m
  3. // Asteria
  4. //
  5. // Created by 王猛 on 2024/2/17.
  6. //
  7. #import "CartCheckTableV.h"
  8. @implementation CartCheckTableV
  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:[MyCartGrandTotalCellData class]]){
  21. MyCartGrandTotalCell *cell = [MyCartGrandTotalCell cellWithTableView:tableView CellClass:[MyCartGrandTotalCell class]];
  22. [cell configData:(MyCartGrandTotalCellData *)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:[MyCartCouponCellData class]]){
  30. MyCartCouponCell *cell = [MyCartCouponCell cellWithTableView:tableView CellClass:[MyCartCouponCell class]];
  31. [cell configData:(MyCartCouponCellData *)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:[ASCheckoutPointData class]]){
  39. ASCheckoutPointApplyCell *cell = [ASCheckoutPointApplyCell cellWithTableView:tableView CellClass:[ASCheckoutPointApplyCell class]];
  40. [cell configData:(ASCheckoutPointData *)objectM];
  41. @weakify(self)
  42. cell.currencyparameterClose = ^(NSInteger type, id Data) {
  43. @strongify(self)
  44. [self generaltriggermethodType:type data:Data];
  45. };
  46. return cell;
  47. }else if([objectM isKindOfClass:[ASCheckoutAddressData class]]){//地址
  48. ASCheckoutAddressCell *cell = [ASCheckoutAddressCell cellWithTableView:tableView CellClass:[ASCheckoutAddressCell class]];
  49. [cell configData:(ASCheckoutAddressData *)objectM];
  50. // @weakify(self)
  51. // cell.currencyparameterClose = ^(NSInteger type, id Data) {
  52. // @strongify(self)
  53. // [self generaltriggermethodType:type data:Data];
  54. // };
  55. return cell;
  56. }else if([objectM isKindOfClass:[ASCheckoutPaymentModel class]]){
  57. ASCheckoutPaymentCell *cell = [ASCheckoutPaymentCell cellWithTableView:tableView CellClass:[ASCheckoutPaymentCell class]];
  58. [cell configData:(ASCheckoutPaymentModel *)objectM];
  59. @weakify(self)
  60. cell.currencyparameterClose = ^(NSInteger type, id Data) {
  61. @strongify(self)
  62. [self generaltriggermethodType:type data:Data];
  63. };
  64. return cell;
  65. }else if([objectM isKindOfClass:[MyCartPayTypeCellData class]]){
  66. MyCartPayTypeCell *cell = [MyCartPayTypeCell cellWithTableView:tableView CellClass:[MyCartPayTypeCell class]];
  67. [cell configData:(MyCartPayTypeCellData *)objectM];
  68. return cell;
  69. }
  70. return nil;
  71. }
  72. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
  73. NSObject *objectM = self.infodata[indexPath.row];
  74. if([objectM isKindOfClass:[CartTotalsItemsM class]] && self.isFlod){
  75. return 0;
  76. }
  77. return UITableViewAutomaticDimension;
  78. }
  79. - (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath{
  80. return 200;
  81. }
  82. @end