| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211 | 
							- //
 
- //  ASGoodsDetailsTableView.m
 
- //  Asteria
 
- //
 
- //  Created by xingyu on 2024/5/17.
 
- //
 
- #import "ASGoodsDetailsTableView.h"
 
- //#import "GoodsReviewsListM.h"
 
- #import "ASGoodsBannerCell.h"
 
- #import "ASGoodsDetailsSizeCell.h"
 
- #import "ASGoodsCouponCell.h"
 
- #import "ASGoodsTitlePriceCell.h"
 
- #import "ASGoodsGuaranteeInfoCell.h"
 
- #import "ASGoodsReviewHeadCell.h"
 
- #import "GoodsReviewsCell.h"
 
- #import "ASGoodsReviewFootCell.h"
 
- #import "KWMineMoreProductsCell.h"
 
- #import "KWMineMoreProductModel.h"
 
- #import <GKPhotoBrowser/GKPhotoBrowser.h>
 
- @interface ASGoodsDetailsTableView()
 
- @property (nonatomic, assign) BOOL couponSelect;
 
- @end
 
- @implementation ASGoodsDetailsTableView
 
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
 
-     
 
-     
 
-     NSObject *dataM = self.infodata[indexPath.row];
 
-     
 
-     NSObject *objectM = nil;
 
-     NSString *typeStr = @"";
 
-     if ([dataM isKindOfClass:[NSDictionary class]]) {
 
-         NSDictionary *dataDic = (NSDictionary *)dataM;
 
-         objectM = [dataDic objectForKey:@"data"];
 
-         typeStr = [dataDic objectForKey:@"type"];
 
-     } else if ([dataM isKindOfClass:[GoodsReviewsListM class]]) {
 
-         objectM = dataM;
 
-     }
 
-     if ([typeStr isEqualToString:@"banner"]) {
 
-         ASGoodsBannerCell *cell = [ASGoodsBannerCell cellWithTableView:tableView CellClass:[ASGoodsBannerCell class]];
 
-         
 
-         [cell configData:(GoodsInformationM *)objectM];
 
-         
 
-         return  cell;
 
-     } else if ([typeStr isEqualToString:@"titlePrice"]) {
 
-         ASGoodsTitlePriceCell *cell = [ASGoodsTitlePriceCell cellWithTableView:tableView CellClass:[ASGoodsTitlePriceCell class]];
 
-         
 
-         [cell configData:(GoodsInformationM *)objectM];
 
-         
 
-         @weakify(self)
 
-         cell.currencyparameterClose = ^(NSInteger type, id Data) {
 
-             @strongify(self)
 
-             [self generaltriggermethodType:type data:Data];
 
-         };
 
-         
 
-         return  cell;
 
-     } else if ([typeStr isEqualToString:@"coupon"]) {
 
-         
 
-         NSArray *couponArr = (NSArray *)objectM;
 
-         
 
-         ASGoodsCouponCell *cell = [ASGoodsCouponCell cellWithTableView:tableView CellClass:[ASGoodsCouponCell class]];
 
-         
 
-         [cell configData:couponArr isSelect:self.couponSelect];
 
-         
 
-         @weakify(self)
 
-         cell.currencyparameterClose = ^(NSInteger type, id Data) {
 
-             @strongify(self)
 
-             self.couponSelect = type;
 
-             [self reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationNone];
 
-         };
 
-         
 
-         return  cell;
 
-     } else if ([typeStr isEqualToString:@"size"]) {
 
-         ASGoodsDetailsSizeCell *cell = [ASGoodsDetailsSizeCell cellWithTableView:tableView CellClass:[ASGoodsDetailsSizeCell class]];
 
-         
 
-         @weakify(self)
 
-         cell.currencyparameterClose = ^(NSInteger type, id Data) {
 
-             @strongify(self)
 
-             [self generaltriggermethodType:type data:Data];
 
-         };
 
-         
 
-         
 
-         [cell configData:(GoodsInformationM *)objectM];
 
-         
 
-         return  cell;
 
-     } else if ([typeStr isEqualToString:@"guarantee"]) {
 
-         ASGoodsGuaranteeInfoCell *cell = [ASGoodsGuaranteeInfoCell cellWithTableView:tableView CellClass:[ASGoodsGuaranteeInfoCell class]];
 
-         
 
-         [cell configData:(GoodsInformationM *)objectM];
 
-         
 
-         @weakify(self)
 
-         cell.currencyparameterClose = ^(NSInteger type, id Data) {
 
-             @strongify(self)
 
-             [self generaltriggermethodType:type data:Data];
 
-         };
 
-         
 
-         return  cell;
 
-     } else if ([typeStr isEqualToString:@"reviewHead"]) {
 
-         ASGoodsReviewHeadCell *cell = [ASGoodsReviewHeadCell cellWithTableView:tableView CellClass:[ASGoodsReviewHeadCell class]];
 
-         cell.clipsToBounds = YES;
 
-         [cell configData:(GoodsInformationM *)objectM];
 
-         
 
-         @weakify(self)
 
-         cell.currencyparameterClose = ^(NSInteger type, id Data) {
 
-             @strongify(self)
 
-             [self generaltriggermethodType:type data:Data];
 
-         };
 
-         
 
-         return  cell;
 
-     } else if ([objectM isKindOfClass:[GoodsReviewsListM class]]) {
 
- //        GoodsReviewsListM *objectM =  self.infodata[indexPath.row];
 
-         GoodsReviewsCell *cell = [GoodsReviewsCell cellWithTableView:tableView CellClass:[GoodsReviewsCell class]];
 
-         cell.clipsToBounds = YES;
 
-         [cell configData:objectM];
 
-         @weakify(self)
 
-         cell.currencyparameterClose = ^(NSInteger type, id Data) {
 
-             @strongify(self) //图片选择器展示
 
-             
 
-             NSArray *imageArr = (NSArray *)Data;
 
-             NSMutableArray *photos = [[NSMutableArray alloc]init];
 
-             for (NSString *imgUrl in imageArr) {
 
-                 GKPhoto *photo = [GKPhoto new];
 
-                 photo.placeholderImage = UIImageDefaultImg_SD;
 
-                 photo.url = [NSURL URLWithString:imgUrl];
 
-                 [photos addObject:photo];
 
-             }
 
-             GKPhotoBrowser *photoBrowser = [GKPhotoBrowser photoBrowserWithPhotos:photos currentIndex:type];
 
-             photoBrowser.failureText = @"Net Error";
 
-             photoBrowser.showStyle = GKPhotoBrowserShowStyleNone;
 
-             [photoBrowser showFromVC:[Current_normalTool topViewController]];
 
-             
 
-         };
 
-         return cell;
 
-     } else if ([typeStr isEqualToString:@"reviewFoot"]) {
 
-         //        GoodsReviewsListM *objectM =  self.infodata[indexPath.row];
 
-         ASGoodsReviewFootCell *cell = [ASGoodsReviewFootCell cellWithTableView:tableView CellClass:[ASGoodsReviewFootCell class]];
 
-         cell.clipsToBounds = YES;
 
-         @weakify(self)
 
-         cell.currencyparameterClose = ^(NSInteger type, id Data) {
 
-             @strongify(self)
 
-             [self generaltriggermethodType:type data:Data];
 
-         };
 
-         return cell;
 
-     } else if ([typeStr isEqualToString:@"customer"]) {
 
-         NSArray *typeArr =  (NSArray *)objectM;
 
- //        KWMineMoreProductsCell *cell = [tableView dequeueReusableCellWithIdentifier:@"KWMineMoreProductsCell" forIndexPath:indexPath];
 
-         KWMineMoreProductsCell *cell = [[KWMineMoreProductsCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"KWMineMoreProductsCell"];
 
-         
 
-         cell.topSpace = 20;
 
- //        KWMineMoreProductModel * model = [KWMineMoreProductModel demoData];
 
- //        [cell setData: model];
 
-         
 
-         [cell setTypeArray:typeArr];
 
-         
 
-         K_WEAK_SELF;
 
-         cell.productBlock = ^(ASProductBaseModel * _Nonnull model) {
 
-             K_STRONG_SELF;
 
-             [self generaltriggermethodType:101 data:model];
 
-         };
 
-         
 
-         cell.addCartBlock = ^(ASProductBaseModel * _Nonnull model) {
 
-             K_STRONG_SELF;
 
-             [self generaltriggermethodType:102 data:model];
 
-         };
 
-         
 
-         
 
-         return cell;
 
-     }
 
-     
 
-     
 
-     
 
-     return  nil;
 
-     
 
- }
 
- - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
 
-     
 
-     NSObject *dataM = self.infodata[indexPath.row];
 
-     
 
-     NSObject *objectM = nil;
 
-     NSString *typeStr = @"";
 
-     if ([dataM isKindOfClass:[NSDictionary class]]) {
 
-         NSDictionary *dataDic = (NSDictionary *)dataM;
 
-         objectM = [dataDic objectForKey:@"data"];
 
-         typeStr = [dataDic objectForKey:@"type"];
 
-     } else if ([dataM isKindOfClass:[GoodsReviewsListM class]]) {
 
-         objectM = dataM;
 
-     }
 
-     
 
-     if (([typeStr isEqualToString:@"reviewHead"] || [objectM isKindOfClass:[GoodsReviewsListM class]] || [typeStr isEqualToString:@"reviewFoot"] || [typeStr isEqualToString:@"customer"]) && !self.isReview) {
 
-         return 0;
 
-     }
 
-     
 
-     return UITableViewAutomaticDimension;
 
- }
 
- - (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath{
 
-     return 200;
 
- }
 
- @end
 
 
  |