CartCheckTableV.m 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. ASCheckoutGoodsItemCell *cell = [ASCheckoutGoodsItemCell cellWithTableView:tableView CellClass:[ASCheckoutGoodsItemCell class]];
  13. cell.clipsToBounds = YES;
  14. [cell configData:(CartTotalsItemsM *)objectM];
  15. @weakify(self)
  16. cell.currencyparameterClose = ^(NSInteger type, id Data) {
  17. @strongify(self)
  18. [self generaltriggermethodType:type data:Data];
  19. };
  20. return cell;
  21. }else if([objectM isKindOfClass:[MyCartGrandTotalCellData class]]){
  22. MyCartGrandTotalCell *cell = [MyCartGrandTotalCell cellWithTableView:tableView CellClass:[MyCartGrandTotalCell class]];
  23. [cell configData:(MyCartGrandTotalCellData *)objectM];
  24. @weakify(self)
  25. cell.currencyparameterClose = ^(NSInteger type, id Data) {
  26. @strongify(self)
  27. [self generaltriggermethodType:type data:Data];
  28. };
  29. return cell;
  30. }else if([objectM isKindOfClass:[MyCartCouponCellData class]]){
  31. MyCartCouponCell *cell = [MyCartCouponCell cellWithTableView:tableView CellClass:[MyCartCouponCell class]];
  32. [cell configData:(MyCartCouponCellData *)objectM];
  33. @weakify(self)
  34. cell.currencyparameterClose = ^(NSInteger type, id Data) {
  35. @strongify(self)
  36. [self generaltriggermethodType:type data:Data];
  37. };
  38. return cell;
  39. }else if([objectM isKindOfClass:[ASCheckoutPointData class]]){
  40. ASCheckoutPointApplyCell *cell = [ASCheckoutPointApplyCell cellWithTableView:tableView CellClass:[ASCheckoutPointApplyCell class]];
  41. [cell configData:(ASCheckoutPointData *)objectM];
  42. @weakify(self)
  43. cell.currencyparameterClose = ^(NSInteger type, id Data) {
  44. @strongify(self)
  45. [self generaltriggermethodType:type data:Data];
  46. };
  47. return cell;
  48. }else if([objectM isKindOfClass:[ASCheckoutAddressData class]]){//地址
  49. ASCheckoutAddressCell *cell = [ASCheckoutAddressCell cellWithTableView:tableView CellClass:[ASCheckoutAddressCell class]];
  50. [cell configData:(ASCheckoutAddressData *)objectM];
  51. // @weakify(self)
  52. // cell.currencyparameterClose = ^(NSInteger type, id Data) {
  53. // @strongify(self)
  54. // [self generaltriggermethodType:type data:Data];
  55. // };
  56. return cell;
  57. }else if([objectM isKindOfClass:[ASCheckoutShipMethodData class]]){
  58. ASCheckoutShipMethodCell *cell = [ASCheckoutShipMethodCell cellWithTableView:tableView CellClass:[ASCheckoutShipMethodCell class]];
  59. [cell configData:(ASCheckoutShipMethodData *)objectM];
  60. @weakify(self)
  61. cell.currencyparameterClose = ^(NSInteger type, id Data) {
  62. @strongify(self)
  63. [self generaltriggermethodType:type data:Data];
  64. };
  65. return cell;
  66. }else if([objectM isKindOfClass:[ASCheckoutPaymentModel class]]){
  67. ASCheckoutPaymentCell *cell = [ASCheckoutPaymentCell cellWithTableView:tableView CellClass:[ASCheckoutPaymentCell class]];
  68. [cell configData:(ASCheckoutPaymentModel *)objectM];
  69. @weakify(self)
  70. cell.currencyparameterClose = ^(NSInteger type, id Data) {
  71. @strongify(self)
  72. [self generaltriggermethodType:type data:Data];
  73. };
  74. return cell;
  75. }else if([objectM isKindOfClass:[MyCartPayTypeCellData class]]){
  76. MyCartPayTypeCell *cell = [MyCartPayTypeCell cellWithTableView:tableView CellClass:[MyCartPayTypeCell class]];
  77. [cell configData:(MyCartPayTypeCellData *)objectM];
  78. return cell;
  79. }else if([objectM isKindOfClass:[ASCheckoutCommentData class]]){
  80. ASCheckoutCommentCell *cell = [ASCheckoutCommentCell cellWithTableView:tableView CellClass:[ASCheckoutCommentCell class]];
  81. // [cell configData:(ASCheckoutCommentData *)objectM];
  82. @weakify(self)
  83. cell.currencyparameterClose = ^(NSInteger type, id Data) {
  84. @strongify(self)
  85. [self generaltriggermethodType:type data:Data];
  86. };
  87. return cell;
  88. }
  89. return nil;
  90. }
  91. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
  92. NSObject *objectM = self.infodata[indexPath.row];
  93. if([objectM isKindOfClass:[CartTotalsItemsM class]] && self.isFlod){
  94. return 0.0001;
  95. }
  96. return UITableViewAutomaticDimension;
  97. }
  98. - (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath{
  99. return 200;
  100. }
  101. @end