// // CartCheckTableV.m // Asteria // // Created by 王猛 on 2024/2/17. // #import "CartCheckTableV.h" @implementation CartCheckTableV - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ NSObject *objectM = self.infodata[indexPath.row]; if([objectM isKindOfClass:[CartTotalsItemsM class]]){ ASCheckoutGoodsItemCell *cell = [ASCheckoutGoodsItemCell cellWithTableView:tableView CellClass:[ASCheckoutGoodsItemCell class]]; cell.clipsToBounds = YES; [cell configData:(CartTotalsItemsM *)objectM]; @weakify(self) cell.currencyparameterClose = ^(NSInteger type, id Data) { @strongify(self) [self generaltriggermethodType:type data:Data]; }; return cell; }else if([objectM isKindOfClass:[MyCartGrandTotalCellData class]]){ MyCartGrandTotalCell *cell = [MyCartGrandTotalCell cellWithTableView:tableView CellClass:[MyCartGrandTotalCell class]]; [cell configData:(MyCartGrandTotalCellData *)objectM]; @weakify(self) cell.currencyparameterClose = ^(NSInteger type, id Data) { @strongify(self) [self generaltriggermethodType:type data:Data]; }; return cell; }else if([objectM isKindOfClass:[MyCartCouponCellData class]]){ MyCartCouponCell *cell = [MyCartCouponCell cellWithTableView:tableView CellClass:[MyCartCouponCell class]]; [cell configData:(MyCartCouponCellData *)objectM]; @weakify(self) cell.currencyparameterClose = ^(NSInteger type, id Data) { @strongify(self) [self generaltriggermethodType:type data:Data]; }; return cell; }else if([objectM isKindOfClass:[ASCheckoutPointData class]]){ ASCheckoutPointApplyCell *cell = [ASCheckoutPointApplyCell cellWithTableView:tableView CellClass:[ASCheckoutPointApplyCell class]]; [cell configData:(ASCheckoutPointData *)objectM]; @weakify(self) cell.currencyparameterClose = ^(NSInteger type, id Data) { @strongify(self) [self generaltriggermethodType:type data:Data]; }; return cell; }else if([objectM isKindOfClass:[ASCheckoutAddressData class]]){//地址 ASCheckoutAddressCell *cell = [ASCheckoutAddressCell cellWithTableView:tableView CellClass:[ASCheckoutAddressCell class]]; [cell configData:(ASCheckoutAddressData *)objectM]; // @weakify(self) // cell.currencyparameterClose = ^(NSInteger type, id Data) { // @strongify(self) // [self generaltriggermethodType:type data:Data]; // }; return cell; }else if([objectM isKindOfClass:[ASCheckoutShipMethodData class]]){ ASCheckoutShipMethodCell *cell = [ASCheckoutShipMethodCell cellWithTableView:tableView CellClass:[ASCheckoutShipMethodCell class]]; [cell configData:(ASCheckoutShipMethodData *)objectM]; @weakify(self) cell.currencyparameterClose = ^(NSInteger type, id Data) { @strongify(self) [self generaltriggermethodType:type data:Data]; }; return cell; }else if([objectM isKindOfClass:[ASCheckoutPaymentModel class]]){ ASCheckoutPaymentCell *cell = [ASCheckoutPaymentCell cellWithTableView:tableView CellClass:[ASCheckoutPaymentCell class]]; [cell configData:(ASCheckoutPaymentModel *)objectM]; @weakify(self) cell.currencyparameterClose = ^(NSInteger type, id Data) { @strongify(self) [self generaltriggermethodType:type data:Data]; }; return cell; }else if([objectM isKindOfClass:[MyCartPayTypeCellData class]]){ MyCartPayTypeCell *cell = [MyCartPayTypeCell cellWithTableView:tableView CellClass:[MyCartPayTypeCell class]]; [cell configData:(MyCartPayTypeCellData *)objectM]; return cell; }else if([objectM isKindOfClass:[ASCheckoutCommentData class]]){ ASCheckoutCommentCell *cell = [ASCheckoutCommentCell cellWithTableView:tableView CellClass:[ASCheckoutCommentCell class]]; // [cell configData:(ASCheckoutCommentData *)objectM]; @weakify(self) cell.currencyparameterClose = ^(NSInteger type, id Data) { @strongify(self) [self generaltriggermethodType:type data:Data]; }; return cell; } return nil; } - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { NSObject *objectM = self.infodata[indexPath.row]; if([objectM isKindOfClass:[CartTotalsItemsM class]] && self.isFlod){ return 0.0001; } return UITableViewAutomaticDimension; } - (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath{ return 200; } @end