소스 검색

feat:商品详情优惠券UI

“wangdongchao” 1 년 전
부모
커밋
1e1b804fcc

+ 6 - 0
Asteria.xcodeproj/project.pbxproj

@@ -221,6 +221,7 @@
 		8810F5962BFB291300346FD4 /* ASGoodsCouponCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8810F5952BFB291300346FD4 /* ASGoodsCouponCell.m */; };
 		8810F5992BFB2B2400346FD4 /* ASGoodsGuaranteeInfoCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8810F5982BFB2B2400346FD4 /* ASGoodsGuaranteeInfoCell.m */; };
 		8810F59C2BFB3A4500346FD4 /* ASGoodsIntrouduceWebView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8810F59B2BFB3A4500346FD4 /* ASGoodsIntrouduceWebView.m */; };
+		8810F59F2BFC7D7600346FD4 /* ASGoodsReviewHeadCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8810F59E2BFC7D7600346FD4 /* ASGoodsReviewHeadCell.m */; };
 		8C24ECE114420CDEE7B9B22B /* Pods_Asteria.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 54DCE8001991D89B696E7D44 /* Pods_Asteria.framework */; };
 		9A1247942A1B082300126226 /* Fuction_Tool.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A1247932A1B082300126226 /* Fuction_Tool.m */; };
 		9A1247972A1B0A2800126226 /* AS_ForgotC.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A1247962A1B0A2800126226 /* AS_ForgotC.m */; };
@@ -784,6 +785,8 @@
 		8810F5982BFB2B2400346FD4 /* ASGoodsGuaranteeInfoCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASGoodsGuaranteeInfoCell.m; sourceTree = "<group>"; };
 		8810F59A2BFB3A4500346FD4 /* ASGoodsIntrouduceWebView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASGoodsIntrouduceWebView.h; sourceTree = "<group>"; };
 		8810F59B2BFB3A4500346FD4 /* ASGoodsIntrouduceWebView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASGoodsIntrouduceWebView.m; sourceTree = "<group>"; };
+		8810F59D2BFC7D7600346FD4 /* ASGoodsReviewHeadCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASGoodsReviewHeadCell.h; sourceTree = "<group>"; };
+		8810F59E2BFC7D7600346FD4 /* ASGoodsReviewHeadCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASGoodsReviewHeadCell.m; sourceTree = "<group>"; };
 		9A1247922A1B082300126226 /* Fuction_Tool.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Fuction_Tool.h; sourceTree = "<group>"; };
 		9A1247932A1B082300126226 /* Fuction_Tool.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Fuction_Tool.m; sourceTree = "<group>"; };
 		9A1247952A1B0A2800126226 /* AS_ForgotC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AS_ForgotC.h; sourceTree = "<group>"; };
@@ -2486,6 +2489,8 @@
 				8810F58E2BF83D0400346FD4 /* ASGoodsDetailsSizeSelView.m */,
 				8810F5972BFB2B2400346FD4 /* ASGoodsGuaranteeInfoCell.h */,
 				8810F5982BFB2B2400346FD4 /* ASGoodsGuaranteeInfoCell.m */,
+				8810F59D2BFC7D7600346FD4 /* ASGoodsReviewHeadCell.h */,
+				8810F59E2BFC7D7600346FD4 /* ASGoodsReviewHeadCell.m */,
 			);
 			path = V;
 			sourceTree = "<group>";
@@ -3112,6 +3117,7 @@
 				81717C9C2A3BF1F100648139 /* ASHomeAlertViewController.m in Sources */,
 				8810F5092BEB159600346FD4 /* ASCheckoutTopView.m in Sources */,
 				8810F5612BF5EBF400346FD4 /* ASOrderListCell.m in Sources */,
+				8810F59F2BFC7D7600346FD4 /* ASGoodsReviewHeadCell.m in Sources */,
 				9AD345FC2A08D60F005CA070 /* ZFPlayerLogManager.m in Sources */,
 				8193D5C82BEA299F00B9AB11 /* ASAddressListViewController.m in Sources */,
 				9A78E0142B6389FC00CA4E32 /* Cart_MyCartC.m in Sources */,

+ 28 - 1
Asteria/Fuction/Cart/Cart_CheckoutC.m

@@ -132,6 +132,10 @@
                 }
             }
             [self requestSetShipMethodByAddress];
+        } else if ([data isKindOfClass:[MyCartGrandTotalCellData class]]){
+//            MyCartGrandTotalCellData *totalData = (MyCartGrandTotalCellData *)data;
+            //丢件险
+            [self requestLostExtraFee:num];
         }
     };
     
@@ -235,7 +239,8 @@
                || [mark isEqualToString:Chectout_PUT_usePoints]
                || [mark isEqualToString:Chectout_DEL_cancelusePoints]
                || [mark isEqualToString:Chectout_setShipMethod]
-               || [mark isEqualToString:Chectout_giftAddCart]){
+               || [mark isEqualToString:Chectout_giftAddCart]
+               || [mark isEqualToString:Chectout_lost_extrafee]){
         if(sucessOrFail){
             if ([mark isEqualToString:Chectout_giftAddCart]) {
                 self.index --;
@@ -543,8 +548,30 @@
         self.giftShowCount = 2;
         [self.VM ry_formDataRequestPostApi:Chectout_giftAddCart param:param];
     }
+}
+
+//丢件险
+- (void)requestLostExtraFee:(BOOL)isOpen {
+    NSDictionary *address = @{@"countryId":AS_String_valid(self.addressCellM.addressModel.country_id) ? AS_String_NotNull(self.addressCellM.addressModel.country_id) : @"US",
+                              @"region":AS_String_NotNull(self.addressCellM.addressModel.region.region),
+                              @"postcode":AS_String_NotNull(self.addressCellM.addressModel.postcode),
+                              @"city":AS_String_NotNull(self.addressCellM.addressModel.city)};
+    NSDictionary *addressInformation = @{@"address":address,
+                                         @"shipping_method_code":AS_String_valid(self.shipmethodCellM.shipMethodModel.method_code) ? self.shipmethodCellM.shipMethodModel.method_code : @"bestway",
+                                         @"shipping_carrier_code":AS_String_valid(self.shipmethodCellM.shipMethodModel.carrier_code) ? self.shipmethodCellM.shipMethodModel.carrier_code : @"tablerate"};
     
+    NSMutableDictionary *params = [[NSMutableDictionary alloc] initWithCapacity:1];
+    if(isOpen ==0){ //取消丢件险
+        NSDictionary *information = @{@"fee_id":@(1), @"options_ids":@[]};
+        [params addEntriesFromDictionary:@{@"information":information}];
+    }else if(isOpen == 1){//打开丢件险
+        NSDictionary *information = @{@"fee_id":@(1), @"options_ids":@[@"1"]};
+        [params addEntriesFromDictionary:@{@"information":information}];
+    }
+    [params setValue:addressInformation forKey:@"addressInformation"];
     
+    [MBProgressHUD showHUDAddedTo:self.view animated:YES];
+    [self.VM ry_requestPostApi:Chectout_lost_extrafee param:params];
 }
 
 #pragma mark --- 懒加载 ---

+ 34 - 2
Asteria/Fuction/Cart/Cart_MyCartC.m

@@ -95,14 +95,21 @@
                 default:
                     break;
             }
-        }else if ([data isKindOfClass:[MyCartCouponCellData class]]){
+        } else if ([data isKindOfClass:[MyCartCouponCellData class]]){
             MyCartCouponCellData *couponM = (MyCartCouponCellData *)data;
             if(num ==0){ //使用优惠券
                 [self reqNet_PUT_cartsMineCoupons:couponM.coupon_code];
             }else if(num == 1){//删除优惠券
                 [self reqNet_DEL_cartsMineCoupons];
             }
+        } else if ([data isKindOfClass:[MyCartGrandTotalCellData class]]){
+            MyCartGrandTotalCellData *totalData = (MyCartGrandTotalCellData *)data;
+            
+            [self requestLostExtraFee:num];
         }
+        
+        
+        
     };
 }
 - (void)ucm_bindvmmodel{
@@ -146,6 +153,30 @@
     [self.VM ry_requestDeleteApi:DEL_cartsMineCoupons paramStr:@""];
 }
 
+//丢件险
+- (void)requestLostExtraFee:(BOOL)isOpen {
+    
+    NSDictionary *address = @{@"countryId":@"US",
+                              @"postcode":@"*"};
+    NSDictionary *addressInformation = @{@"address":address,
+                                         @"shipping_method_code":@"bestway",
+                                         @"shipping_carrier_code":@"tablerate"};
+    
+    NSMutableDictionary *params = [[NSMutableDictionary alloc] initWithCapacity:1];
+    if(isOpen ==0){ //取消丢件险
+        NSDictionary *information = @{@"fee_id":@(1), @"options_ids":@[]};
+        [params addEntriesFromDictionary:@{@"information":information}];
+    }else if(isOpen == 1){//打开丢件险
+        NSDictionary *information = @{@"fee_id":@(1), @"options_ids":@[@"1"]};
+        [params addEntriesFromDictionary:@{@"information":information}];
+    }
+    [params setValue:addressInformation forKey:@"addressInformation"];
+    
+    [MBProgressHUD showHUDAddedTo:self.view animated:YES];
+    [self.VM ry_requestPostApi:Chectout_lost_extrafee param:params];
+}
+
+
 //请求赠品商品详情
 -(void)reqNet_GoodsDetails_productGetProduct:(NSString *)enterId{
     NSMutableDictionary * params = [[NSMutableDictionary alloc] init];
@@ -220,7 +251,8 @@
     }else if ([mark isEqualToString:Cart_cartsMineItems_Post]
               || [mark isEqualToString:DEL_cartsMineItems]
               || [mark isEqualToString:PUT_cartsMineCoupons]
-              || [mark isEqualToString:Chectout_giftAddCart]){
+              || [mark isEqualToString:Chectout_giftAddCart]
+              || [mark isEqualToString:Chectout_lost_extrafee]){
         if(sucessOrFail){
             
             if ([mark isEqualToString:Chectout_giftAddCart]) {

+ 2 - 0
Asteria/Fuction/Cart/Cell/MyCartGrandTotalCell.h

@@ -16,6 +16,8 @@ NS_ASSUME_NONNULL_BEGIN
 @end
 @interface MyCartGrandTotalCell : TT_BaseCell
 
+@property (nonatomic, strong) MyCartGrandTotalCellData *totalData;
+
 @end
 
 

+ 17 - 5
Asteria/Fuction/Cart/Cell/MyCartGrandTotalCell.m

@@ -54,6 +54,7 @@
   
     [self.subLostV mas_makeConstraints:^(MASConstraintMaker *make) {
         make.height.mas_equalTo(60);
+        make.right.mas_equalTo(10);
     }];
     [self.subBottomV mas_makeConstraints:^(MASConstraintMaker *make) {
         make.height.mas_equalTo(60);
@@ -62,15 +63,24 @@
 
 - (void)configData:(id)Data{
     MyCartGrandTotalCellData *model = (MyCartGrandTotalCellData *)Data;
+    
+    self.totalData = model;
 ///当一个元素被 removeFromSuperview ,则 arrangedSubviews也会同步移除
     [self.stackSubTopV.arrangedSubviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
     for (int i=0; i<model.total_segments.count; i++) {
         NSDictionary *dic = model.total_segments[i];
         NSString *code = MM_str(dic[@"code"]);
         if([code isEqualToString:@"amasty_extrafee"]){ //subLostV
-            NSString *tips = [NSString stringWithFormat:@"%@%@%@",dic[@"title"],model.currency_symbol,dic[@"value"]];
+            
+            if ([dic[@"value"] qmui_CGFloatValue] > 0) {
+                NSString *tips = [NSString stringWithFormat:@"%@%@%@",dic[@"title"],model.currency_symbol,dic[@"value"]];
+                [self.subLostV xxx_configTips:tips isLost:YES];
+            } else {
+                [self.subLostV xxx_configTips:@"Extra Fee (insurance for lost)" isLost:NO];
+            }
+            
             //wm_todo 需要 获取丢件险状态 carts/mine/fees-information 
-            [self.subLostV xxx_configTips:tips isLost:[dic[@"value"] qmui_CGFloatValue] > 0 ? YES : NO];
+            
         }else if ([code isEqualToString:@"grand_total"]){ //subBottomV
             NSString *priceStr = [NSString stringWithFormat:@"%@%@",model.currency_symbol,dic[@"value"]];
             [self.subBottomV xxx_configTips:dic[@"title"] price:priceStr];
@@ -136,10 +146,12 @@
     if (!_subLostV) {
         _subLostV = [[SubLoastSelectItemV alloc] init];
         _subLostV.backgroundColor = [UIColor colorWithHexString:@"#FFFFFF"];
+        K_WEAK_SELF;
         _subLostV.ViewtapClose = ^(NSInteger num, id  _Nonnull data) {
-            NSLog(@"=====%ld=====%@", num, data);
-            
-            
+            K_STRONG_SELF;
+            if(self.currencyparameterClose){
+                self.currencyparameterClose(num, self.totalData);
+            }
         };
     }
     return _subLostV;

+ 1 - 1
Asteria/Fuction/Cart/Checkout/ASCheckoutShipMethodCell.m

@@ -152,7 +152,7 @@
 
 - (void)setShipItemData:(ASCheckoutShipMethodModel *)shipModel symbol:(NSString *)symbol {
     
-    _shipMethodLab.text = [NSString stringWithFormat:@"%@ %@", shipModel.method_title, shipModel.carrier_title];
+    _shipMethodLab.text = [NSString stringWithFormat:@"%@ %@", AS_String_NotNull(shipModel.method_title), AS_String_NotNull(shipModel.carrier_title)];
     _shipPriceLab.text = [NSString stringWithFormat:@"%@%@", symbol, shipModel.amount];
     
     _selectBtn.selected = shipModel.isSelect;

+ 4 - 0
Asteria/Fuction/Cart/VM/CartVM.h

@@ -42,6 +42,10 @@
 //赠品手动加车
 #define Chectout_giftAddCart         BaseRequestrUrl(@"addGiftProduct")
 
+//丢件险
+#define Chectout_lost_extrafee       @"rest/en/V1/amasty_extrafee/carts/mine/totals-information"
+
+
 NS_ASSUME_NONNULL_BEGIN
 
 @interface CartVM : RYBaseVM

+ 22 - 0
Asteria/Fuction/Goods/Assets/Goods.xcassets/goods_coupon_bg.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "goods_coupon_bg@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "goods_coupon_bg@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
Asteria/Fuction/Goods/Assets/Goods.xcassets/goods_coupon_bg.imageset/goods_coupon_bg@2x.png


BIN
Asteria/Fuction/Goods/Assets/Goods.xcassets/goods_coupon_bg.imageset/goods_coupon_bg@3x.png


+ 12 - 0
Asteria/Fuction/Goods/V/ASGoodsCouponCell.h

@@ -6,11 +6,23 @@
 //
 
 #import <WMBase/WMBase.h>
+#import "GoodsInformationM.h"
+
+@class ASGoodsCouponItemView;
 
 NS_ASSUME_NONNULL_BEGIN
 
 @interface ASGoodsCouponCell : TT_BaseCell
 
+- (void)configData:(id)Data isSelect:(BOOL)isSelect;
+
+@end
+
+
+@interface ASGoodsCouponItemView : UIView
+
+
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 151 - 0
Asteria/Fuction/Goods/V/ASGoodsCouponCell.m

@@ -7,8 +7,159 @@
 
 #import "ASGoodsCouponCell.h"
 
+@interface ASGoodsCouponCell()
+
+@property (nonatomic, strong) UIView *backView;
+@property (nonatomic, strong) UILabel *titleLab;
+@property (nonatomic, strong) UILabel *titleDescLab;
+@property (nonatomic, strong) UIButton *rTopBtn;
+
+@property (nonatomic, strong) UIView *couponView;
+
+@end
+
 @implementation ASGoodsCouponCell
 
+- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
+    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
+        _backView = [[UIView alloc] init];
+        TT_ViewRadius(_backView, 8);
+        _backView.backgroundColor = _113632;
+        [self.contentView addSubview:_backView];
+        [_backView mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.mas_equalTo(10);
+            make.top.mas_equalTo(10);
+            make.right.mas_equalTo(-10);
+//            make.height.mas_equalTo(45);
+            make.bottom.mas_equalTo(0);
+        }];
+        
+        _titleLab = [UILabel labelCreateWithText:@"COUPON" font:[UIFont fontWithName:Rob_Bold size:14] textColor:Col_FFF];
+        _titleDescLab.adjustsFontSizeToFitWidth = YES;
+        [_backView addSubview:_titleLab];
+        [_titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.mas_equalTo(10);
+            make.top.mas_equalTo(12);
+            make.height.mas_equalTo(20);
+            make.width.mas_equalTo(60);
+        }];
+        
+        _titleDescLab = [UILabel labelCreateWithText:@"All wigs 10% off   code:wkwig" font:[UIFont fontWithName:Rob_Regular size:12] textColor:Col_FFF];
+        _titleDescLab.adjustsFontSizeToFitWidth = YES;
+        [_backView addSubview:_titleDescLab];
+        [_titleDescLab mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.mas_equalTo(_titleLab.mas_right).offset(4);
+            make.centerY.mas_equalTo(_titleLab);
+            make.right.mas_equalTo(-40);
+        }];
+        
+        _rTopBtn = [[UIButton alloc]init];
+//        _rTopBtn.selected = NO;
+        [_rTopBtn addTarget:self action:@selector(_couponEvent:) forControlEvents:UIControlEventTouchUpInside];
+        [_rTopBtn setImage:[UIImage imageNamed:@"base_add_white"] forState:UIControlStateNormal];
+        [_rTopBtn setImage:[UIImage imageNamed:@"base_subtract_white"] forState:UIControlStateSelected];
+        [_backView addSubview:_rTopBtn];
+        [_rTopBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.centerY.equalTo(_titleLab);
+            make.right.mas_equalTo(0);
+            make.width.mas_equalTo(40);
+            make.height.mas_equalTo(30);
+        }];
+        
+        _couponView = [[UIView alloc] init];
+        _couponView.backgroundColor = [UIColor clearColor];
+        [_backView addSubview:_couponView];
+        [_couponView mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.right.bottom.mas_equalTo(0);
+            make.height.mas_equalTo(1);
+            make.top.mas_equalTo(_titleLab.mas_bottom).offset(12);
+            make.bottom.mas_equalTo(0);
+        }];
+    }
+    return self;
+}
+
+- (void)setupSubviewS {
+    
+    
+    
+}
+
+- (void)configData:(id)Data isSelect:(BOOL)isSelect{
+    GoodsInformationM *model = (GoodsInformationM *)Data;
+    
+    self.rTopBtn.selected = isSelect;
+    
+    if (self.rTopBtn.selected) {//展开
+        
+        
+        
+        NSArray *array = @[@"1", @"2",  @"3",  @"4",  @"5",  @"6"];
+        
+        float itemWidth = (KScreenWidth - 50)/2;
+        float itemX = 10;
+        float itemY = 10;
+        for (int i = 0; i < array.count; i++) {
+            ASGoodsCouponItemView *itemView = [[ASGoodsCouponItemView alloc] initWithFrame:CGRectMake(itemX, itemY, itemWidth, 100)];
+            [_couponView addSubview:itemView];
+            
+            if (i % 2 == 1) {
+                itemX = 10;
+                itemY = itemY + 100 + 10;
+            } else {
+                itemX = itemX + itemWidth + 10;
+            }
+            
+            
+        }
+        
+        if (array.count % 2 != 0) {
+            itemY = itemY + 100 + 10;
+        }
+        
+        [_couponView mas_updateConstraints:^(MASConstraintMaker *make) {
+            make.height.mas_equalTo(itemY);
+        }];
+        
+    } else {//收起
+        
+        [self.couponView mas_updateConstraints:^(MASConstraintMaker *make) {
+            make.height.mas_equalTo(1);
+        }];
+    }
+}
+
+- (void)_couponEvent:(UIButton *)button {
+//    button.selected = !button.selected;
+    self.rTopBtn.selected = !self.rTopBtn.selected;
+//    TT_ViewRadius(self.backView, 0);
+    if (self.currencyparameterClose) {
+        self.currencyparameterClose(self.rTopBtn.selected, nil);
+    }
+}
+
+@end
+
+@interface ASGoodsCouponItemView()
+
+@end
+
+
+@implementation ASGoodsCouponItemView
 
+- (instancetype)initWithFrame:(CGRect)frame {
+    if (self = [super initWithFrame:frame]) {
+        
+        UIImageView *bgImaegView = [[UIImageView alloc] init];
+        bgImaegView.image = [UIImage imageNamed:@"goods_coupon_bg"];
+        [self addSubview:bgImaegView];
+        [bgImaegView mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.edges.mas_equalTo(0);
+        }];
+        
+        
+    }
+    return self;
+}
 
 @end

+ 16 - 9
Asteria/Fuction/Goods/V/ASGoodsDetailsSizeSelView.m

@@ -15,7 +15,7 @@
 
 -(void)setTipStr:(NSString *)tipStr {
     _tipStr = tipStr;
-    CGFloat h = 84;
+    CGFloat h = 72;
     for (OptionsModel *m in self.optionArr) {
         if (m.isLongValue) {
             if (m.values.count > 0) {
@@ -43,7 +43,7 @@
 
 - (void)setOptionArr:(NSArray<OptionsModel *> *)optionArr {
     _optionArr = optionArr;
-    CGFloat h = 84;
+    CGFloat h = 72;
     for (OptionsModel *m in optionArr) {
         if (m.isLongValue) {
             if (m.values.count > 0) {
@@ -250,9 +250,10 @@
 
 - (void)setSelType:(BOOL)isSel isCat:(BOOL)isCat {
     self.colorBg.hidden = true;
+    TT_ViewRadius(self.bgV, 4);
     self.bgV.layer.borderWidth = 1;
-    self.bgV.backgroundColor = _F8F8F8;
-    self.bgV.layer.borderColor = isSel ? _32CFB0.CGColor : Col_FFF.CGColor;
+    self.bgV.backgroundColor = isSel ? _32CFB0 : Col_FFF;
+    self.bgV.layer.borderColor = isSel ? _32CFB0.CGColor : [UIColor colorWithHexString:@"#E6E6E6"].CGColor;
     self.selTipV.hidden = !isSel;
     self.titleLb.font = [UIFont fontWithName:(isSel ? Rob_Bold : Rob_Regular ) size:(isCat ? 12 : 14)];
 }
@@ -436,13 +437,13 @@
     [self.numLb mas_makeConstraints:^(MASConstraintMaker *make) {
         make.height.equalTo(@32);
         make.width.equalTo(@46);
-        make.left.equalTo(self.minusBt.mas_right).offset(1);
+        make.left.equalTo(self.minusBt.mas_right).offset(-1);
         make.centerY.equalTo(self.minusBt);
     }];
     
     [self.addBt mas_makeConstraints:^(MASConstraintMaker *make) {
         make.width.height.equalTo(@32);
-        make.left.equalTo(self.numLb.mas_right).offset(1);
+        make.left.equalTo(self.numLb.mas_right).offset(-1);
         make.centerY.equalTo(self.minusBt);
     }];
     
@@ -462,7 +463,10 @@
 - (UIButton *)addBt {
     if (!_addBt) {
         UIButton *bt = [UIButton buttonWithType:UIButtonTypeCustom];
-        [bt setImage:[UIImage imageNamed:@"goods_num_add"] forState:UIControlStateNormal];
+        [bt setTitle:@"+" forState:UIControlStateNormal];
+        [bt setTitleColor:Col_000 forState:UIControlStateNormal];
+        bt.titleLabel.font = [UIFont fontWithName:Rob_Bold size:14];
+//        [bt setImage:[UIImage imageNamed:@"goods_num_add"] forState:UIControlStateNormal];
         bt.layer.borderWidth = 1;
         bt.layer.borderColor = [UIColor colorWithHexString:@"#E6E6E6"].CGColor;
         [bt addTarget:self action:@selector(addBtAction:) forControlEvents:UIControlEventTouchUpInside];
@@ -476,7 +480,7 @@
         UILabel *lb = [UILabel baseLb];
         lb.textAlignment = NSTextAlignmentCenter;
         lb.textColor = Col_000;
-        lb.layer.borderColor = Col_000.CGColor;
+        lb.layer.borderColor = [UIColor colorWithHexString:@"#E6E6E6"].CGColor;
         lb.layer.borderWidth = 1;
         lb.text = @"1";
         lb.font = [UIFont fontWithName:Rob_Bold size:16];
@@ -488,7 +492,10 @@
 - (UIButton *)minusBt {
     if (!_minusBt) {
         UIButton *bt = [UIButton buttonWithType:UIButtonTypeCustom];
-        [bt setImage:[UIImage imageNamed:@"goods_num_minus"] forState:UIControlStateNormal];
+        [bt setTitle:@"-" forState:UIControlStateNormal];
+        [bt setTitleColor:Col_000 forState:UIControlStateNormal];
+        bt.titleLabel.font = [UIFont fontWithName:Rob_Bold size:14];
+//        [bt setImage:[UIImage imageNamed:@"goods_num_minus"] forState:UIControlStateNormal];
         bt.layer.borderWidth = 1;
         bt.layer.borderColor = [UIColor colorWithHexString:@"#E6E6E6"].CGColor;
         [bt addTarget:self action:@selector(minusBtAction:) forControlEvents:UIControlEventTouchUpInside];

+ 2 - 0
Asteria/Fuction/Goods/V/ASGoodsDetailsTableView.h

@@ -11,6 +11,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 @interface ASGoodsDetailsTableView : TT_BaseTableV
 
+@property (nonatomic, assign) BOOL isReview;//是否展示评论
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 34 - 0
Asteria/Fuction/Goods/V/ASGoodsDetailsTableView.m

@@ -9,8 +9,17 @@
 
 #import "ASGoodsBannerCell.h"
 #import "ASGoodsDetailsSizeCell.h"
+#import "ASGoodsCouponCell.h"
 #import "ASGoodsTitlePriceCell.h"
 #import "ASGoodsGuaranteeInfoCell.h"
+#import "ASGoodsReviewHeadCell.h"
+
+@interface ASGoodsDetailsTableView()
+
+@property (nonatomic, assign) BOOL couponSelect;
+
+@end
+
 
 @implementation ASGoodsDetailsTableView
 
@@ -37,6 +46,19 @@
             [self generaltriggermethodType:type data:Data];
         };
         
+        return  cell;
+    } else if ([typeStr isEqualToString:@"coupon"]) {
+        ASGoodsCouponCell *cell = [ASGoodsCouponCell cellWithTableView:tableView CellClass:[ASGoodsCouponCell class]];
+        
+        [cell configData:(GoodsInformationM *)objectM 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]];
@@ -61,6 +83,18 @@
             [self generaltriggermethodType:type data:Data];
         };
         
+        return  cell;
+    } else if ([typeStr isEqualToString:@"reviewHead"]) {
+        ASGoodsReviewHeadCell *cell = [ASGoodsReviewHeadCell cellWithTableView:tableView CellClass:[ASGoodsReviewHeadCell class]];
+        
+        [cell configData:(GoodsInformationM *)objectM];
+        
+        @weakify(self)
+        cell.currencyparameterClose = ^(NSInteger type, id Data) {
+            @strongify(self)
+            [self generaltriggermethodType:type data:Data];
+        };
+        
         return  cell;
     }
     

+ 17 - 0
Asteria/Fuction/Goods/V/ASGoodsReviewHeadCell.h

@@ -0,0 +1,17 @@
+//
+//  ASGoodsReviewHeadCell.h
+//  Asteria
+//
+//  Created by xingyu on 2024/5/21.
+//
+
+#import <WMBase/WMBase.h>
+#import "GoodsInformationM.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface ASGoodsReviewHeadCell : TT_BaseCell
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 57 - 0
Asteria/Fuction/Goods/V/ASGoodsReviewHeadCell.m

@@ -0,0 +1,57 @@
+//
+//  ASGoodsReviewHeadCell.m
+//  Asteria
+//
+//  Created by xingyu on 2024/5/21.
+//
+
+#import "ASGoodsReviewHeadCell.h"
+#import "ReviewsTableHearV.h"
+
+@interface ASGoodsReviewHeadCell()
+
+@property (nonatomic, strong) ReviewsTableHearV *tableHeadV;
+
+@end
+
+@implementation ASGoodsReviewHeadCell
+
+- (void)setupSubviewS {
+    
+    [self.contentView addSubview:self.tableHeadV];
+    [self.tableHeadV mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.top.mas_equalTo(0);
+        make.right.mas_equalTo(0);
+        make.height.mas_equalTo([ReviewsTableHearV xxx_viewHeight]);
+        make.bottom.mas_equalTo(-10);
+    }];
+    
+}
+
+- (void)configData:(id)Data{
+    GoodsInformationM *model = (GoodsInformationM *)Data;
+    
+    [self.tableHeadV tt_confignewdata:model];
+}
+
+- (ReviewsTableHearV *)tableHeadV {
+    if (!_tableHeadV) {
+        _tableHeadV = [[ReviewsTableHearV alloc] initWithFrame:CGRectFlatMake(0, 0, KScreenHeight, [ReviewsTableHearV xxx_viewHeight])];
+        _tableHeadV.backgroundColor = [UIColor colorWithHexString:@"#FFFFFF"];
+        @weakify(self)
+        _tableHeadV.ViewtapClose = ^(NSInteger num, id  _Nonnull data) {
+            @strongify(self)
+//            if(num == 0){
+//                GoodsReviewsWriteC *vc = [[GoodsReviewsWriteC alloc]init];
+//                vc.goodsM = self.goodsM;
+//                vc.topBgV = self.topBgV;
+//                vc.nav_title = [NSString stringWithFormat:@"REVIEWS (%@)",self.goodsM.review_nums];
+//                [self.navigationController pushViewController:vc animated:YES];
+//            }
+        };
+    }
+    return _tableHeadV;
+}
+
+
+@end

+ 30 - 6
Asteria/Fuction/Goods/VC/ASGoodsDetailsViewController.m

@@ -38,6 +38,9 @@
 //底部按钮点击类型
 @property (nonatomic, assign) NSInteger bottomClickType;
 
+//底部按钮点击类型
+@property (nonatomic, assign) BOOL isReview;
+
 @end
 
 @implementation ASGoodsDetailsViewController
@@ -62,6 +65,9 @@
     IPhoneXHeigh
     [self setupTableV:[ASGoodsDetailsTableView class] Frame:CGRectMake(0, securitytop_Y , KScreenWidth, KScreenHeight - securitytop_Y - securityBottom_H - 65)];
     self.TableV.backgroundColor = [UIColor colorWithHexString:@"#F8F8F8"];
+    self.TableV.estimatedRowHeight = 0;
+    self.TableV.estimatedSectionHeaderHeight = 0;
+    self.TableV.estimatedSectionFooterHeight = 0;
     
     K_WEAK_SELF;
     self.TableV.tapClose = ^(NSInteger num, id data) {
@@ -69,11 +75,15 @@
         if (num == 1) {//查看评论
             [self action_GoodsReviewsListC];
         } else if (num == 2) {//商品web详情
-            self.TableV.tableFooterView = self.footView;
+            self.isReview = NO;
+            [self updateGoodsDetailsData];
         } else if (num == 3) {//商品评论
-            self.TableV.tableFooterView = nil;
+            self.isReview = YES;
+            [self updateGoodsDetailsData];
         } else if (num == 100) {
             self.sizeParam = (NSDictionary *)data;
+        } else if (num == 1000) {
+            [self.TableV reloadData];
         }
     };
     
@@ -122,23 +132,37 @@
 
 - (void)updateGoodsDetailsData {
         
+    [self.TableV.infodata removeAllObjects];
     //商品图
     NSDictionary *banner = @{@"type":@"banner", @"data":self.model};
     [self.TableV.infodata addObject:banner];
     //商品名、价格
     NSDictionary *titlePrice = @{@"type":@"titlePrice", @"data":self.model};
     [self.TableV.infodata addObject:titlePrice];
+    //优惠券
+    NSDictionary *coupon = @{@"type":@"coupon", @"data":self.model};
+    [self.TableV.infodata addObject:coupon];
     //规格
     NSDictionary *goodsSize = @{@"type":@"size", @"data":self.model};
     [self.TableV.infodata addObject:goodsSize];
     //保障信息
     NSDictionary *guarantee = @{@"type":@"guarantee", @"data":self.model};
     [self.TableV.infodata addObject:guarantee];
-//    //介绍
-//    NSDictionary *webIntroduce = @{@"type":@"webIntroduce", @"data":self.model};
-//    [self.TableV.infodata addObject:webIntroduce];
     
-    [self loadWebString];
+    if (self.isReview) {
+        //评论头
+        NSDictionary *reviewHead = @{@"type":@"reviewHead", @"data":self.model};
+        [self.TableV.infodata addObject:reviewHead];
+        
+        
+        self.TableV.tableFooterView = nil;
+        
+    } else {
+        [self loadWebString];
+    }
+    
+    
+    
     
     
     [self.TableV reloadData];