CartCheckTableV.m 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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:[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. }else if([objectM isKindOfClass:[ASCheckoutCommentData class]]){
  70. ASCheckoutCommentCell *cell = [ASCheckoutCommentCell cellWithTableView:tableView CellClass:[ASCheckoutCommentCell class]];
  71. // [cell configData:(ASCheckoutCommentData *)objectM];
  72. @weakify(self)
  73. cell.currencyparameterClose = ^(NSInteger type, id Data) {
  74. @strongify(self)
  75. [self generaltriggermethodType:type data:Data];
  76. };
  77. return cell;
  78. }
  79. return nil;
  80. }
  81. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
  82. NSObject *objectM = self.infodata[indexPath.row];
  83. if([objectM isKindOfClass:[CartTotalsItemsM class]] && self.isFlod){
  84. return 0;
  85. }
  86. return UITableViewAutomaticDimension;
  87. }
  88. - (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath{
  89. return 200;
  90. }
  91. @end