CartCheckTableV.m 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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 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:[ASCheckoutShipMethodData class]]){
  57. ASCheckoutShipMethodCell *cell = [ASCheckoutShipMethodCell cellWithTableView:tableView CellClass:[ASCheckoutShipMethodCell class]];
  58. [cell configData:(ASCheckoutShipMethodData *)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:[ASCheckoutPaymentModel class]]){
  66. ASCheckoutPaymentCell *cell = [ASCheckoutPaymentCell cellWithTableView:tableView CellClass:[ASCheckoutPaymentCell class]];
  67. [cell configData:(ASCheckoutPaymentModel *)objectM];
  68. @weakify(self)
  69. cell.currencyparameterClose = ^(NSInteger type, id Data) {
  70. @strongify(self)
  71. [self generaltriggermethodType:type data:Data];
  72. };
  73. return cell;
  74. }else if([objectM isKindOfClass:[MyCartPayTypeCellData class]]){
  75. MyCartPayTypeCell *cell = [MyCartPayTypeCell cellWithTableView:tableView CellClass:[MyCartPayTypeCell class]];
  76. [cell configData:(MyCartPayTypeCellData *)objectM];
  77. return cell;
  78. }else if([objectM isKindOfClass:[ASCheckoutCommentData class]]){
  79. ASCheckoutCommentCell *cell = [ASCheckoutCommentCell cellWithTableView:tableView CellClass:[ASCheckoutCommentCell class]];
  80. // [cell configData:(ASCheckoutCommentData *)objectM];
  81. @weakify(self)
  82. cell.currencyparameterClose = ^(NSInteger type, id Data) {
  83. @strongify(self)
  84. [self generaltriggermethodType:type data:Data];
  85. };
  86. return cell;
  87. }
  88. return nil;
  89. }
  90. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
  91. NSObject *objectM = self.infodata[indexPath.row];
  92. if([objectM isKindOfClass:[CartTotalsItemsM class]] && self.isFlod){
  93. return 0;
  94. }
  95. return UITableViewAutomaticDimension;
  96. }
  97. - (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath{
  98. return 200;
  99. }
  100. @end