Преглед на файлове

feat:购物车、商品详情UI优化

“wangdongchao” преди 1 година
родител
ревизия
4b6a2400b0

+ 6 - 0
Asteria.xcodeproj/project.pbxproj

@@ -222,6 +222,7 @@
 		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 */; };
+		8810F5A22BFF448C00346FD4 /* ASMyCartNoDataView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8810F5A12BFF448C00346FD4 /* ASMyCartNoDataView.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 */; };
@@ -787,6 +788,8 @@
 		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>"; };
+		8810F5A02BFF448C00346FD4 /* ASMyCartNoDataView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASMyCartNoDataView.h; sourceTree = "<group>"; };
+		8810F5A12BFF448C00346FD4 /* ASMyCartNoDataView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASMyCartNoDataView.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>"; };
@@ -2586,6 +2589,8 @@
 				9A2415BD2B678A1000A6E903 /* QtyCountV.m */,
 				9AEFA7DC2B649F3F00AE1974 /* MyCarlTableV.h */,
 				9AEFA7DD2B649F3F00AE1974 /* MyCarlTableV.m */,
+				8810F5A02BFF448C00346FD4 /* ASMyCartNoDataView.h */,
+				8810F5A12BFF448C00346FD4 /* ASMyCartNoDataView.m */,
 			);
 			path = V;
 			sourceTree = "<group>";
@@ -3104,6 +3109,7 @@
 				9AD364C62A05E73E00452C7A /* AS_GoodsDetailsC.m in Sources */,
 				8120211E2B15F2B30026B8B5 /* ASVipUrlTempModel.m in Sources */,
 				8193D5CE2BEA2B8E00B9AB11 /* ASAddressViewModel.m in Sources */,
+				8810F5A22BFF448C00346FD4 /* ASMyCartNoDataView.m in Sources */,
 				9A35203A2B479BAA00D097CB /* YJLAttributesLabel.m in Sources */,
 				816020102A2EE55F00E4A8F1 /* ASCategaryListCell.m in Sources */,
 				8810F55E2BF5EBF400346FD4 /* ASOrderDetailsInfoCell.m in Sources */,

+ 2 - 0
Asteria/ASUI/SimpleBase/ASBaseViewController.h

@@ -48,6 +48,8 @@ NS_ASSUME_NONNULL_BEGIN
 -(void)goto_WKM_GoodsDetailsC:(NSString *)entity_id;
 -(void)action_GoodsSizeC:(NSString *)entity_id;
 
+- (void)backAction;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 6 - 0
Asteria/Fuction/Cart/Cart.xcassets/Cart/Contents.json

@@ -0,0 +1,6 @@
+{
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 22 - 0
Asteria/Fuction/Cart/Cart.xcassets/Cart/cart_no_data.imageset/Contents.json

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

BIN
Asteria/Fuction/Cart/Cart.xcassets/Cart/cart_no_data.imageset/cart_no_data@2x.png


BIN
Asteria/Fuction/Cart/Cart.xcassets/Cart/cart_no_data.imageset/cart_no_data@3x.png


+ 75 - 11
Asteria/Fuction/Cart/Cart_CheckoutC.m

@@ -21,6 +21,8 @@
 
 #import "ASAddGiftGoodsView.h"
 
+#import "ASPaypalManager.h"
+
 
 @interface Cart_CheckoutC ()<RY_baseVMprotocol>
 
@@ -272,7 +274,17 @@
             self.addGiftView.hidden = NO;
             [self.addGiftView setGiftData:model.add_gooodsImgUrl];
         }
+    } else if ([mark isEqualToString:Chectout_Verify_PayToken]) {
+        //校验支付token结果返回
+        if(sucessOrFail){
+            NSDictionary *payReturnDic = (NSDictionary *)data;
+            [self paymentResultStatus:[payReturnDic objectForKey:@"id"]];
+        }else{
+            [self.view makeToast:(NSString *)data duration:2 position:CSToastPositionCenter];
+        }
     }
+    
+    
 }
 
 - (void)updateData{
@@ -470,23 +482,75 @@
     [MBProgressHUD showHUDAddedTo:self.view animated:YES];
     [self.VM ry_requestDeleteApi:Chectout_DEL_cancelusePoints paramStr:@""];
 }
+
+//根据支付返回的token去服务端校验
+- (void)requestVerifyPayToken:(NSString *)payToken {
+    [MBProgressHUD showHUDAddedTo:self.view animated:YES];
+    [self.VM ry_requestGetApi:Chectout_Verify_PayToken param:@{@"token":payToken}];
+}
+
 //下单
 -(void)requestSureOrder{
     
+    [self.view makeToast:@"支付失败/取消支付" duration:0.5 position:CSToastPositionCenter];
+    K_WEAK_SELF;
+    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+        K_STRONG_SELF;
+        //支付失败
+        [self paymentResultStatus:@""];
+    });
+    
+    
+    return;
+    
     NSString *paymentCode = self.paymentModel.code;
     
+//    K_WEAK_SELF;
+    [[ASPaypalManager sharedInstance] checkoutPayWithMethodType:paymentCode completion:^(NSUInteger isSucess, id  _Nonnull payData) {
+        K_STRONG_SELF;
+        NSLog(@"payData======%@", payData);
+        if (isSucess == 1) {
+            
+            [self.view makeToast:@"支付成功,正在为你下单" duration:0.5 position:CSToastPositionCenter];
+            
+            K_WEAK_SELF;
+            dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+                K_STRONG_SELF;
+                //支付失败
+                [self requestVerifyPayToken:[(NSDictionary *)payData objectForKey:@"token"]];
+            });
+            
+        } else {
+            
+            [self.view makeToast:@"支付失败/取消支付" duration:0.5 position:CSToastPositionCenter];
+            K_WEAK_SELF;
+            dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+                K_STRONG_SELF;
+                //支付失败
+                [self paymentResultStatus:@""];
+            });
+            
+        }
+    }];
+    
+    return;
+    
     if ([paymentCode isEqualToString:@"paypal_express"]) {//paypal
         
-        for (int i=0; i<self.totalCellM.total_segments.count; i++) {
-            NSDictionary *dic = self.totalCellM.total_segments[i];
-            NSString *code = MM_str(dic[@"code"]);
-            if ([code isEqualToString:@"grand_total"]){ //subBottomV
-                NSString *priceStr = [NSString stringWithFormat:@"%@",dic[@"value"]];
-//                [self PayPalWithAmount:priceStr currencyCode:ASCurrencyManager.shared.currentCur shortDescription:@"购买商品"];
-                return;
-
-            }
-        }
+        
+        
+        return;
+        
+//        for (int i=0; i<self.totalCellM.total_segments.count; i++) {
+//            NSDictionary *dic = self.totalCellM.total_segments[i];
+//            NSString *code = MM_str(dic[@"code"]);
+//            if ([code isEqualToString:@"grand_total"]){ //subBottomV
+//                NSString *priceStr = [NSString stringWithFormat:@"%@",dic[@"value"]];
+////                [self PayPalWithAmount:priceStr currencyCode:ASCurrencyManager.shared.currentCur shortDescription:@"购买商品"];
+//                return;
+//
+//            }
+//        }
         return;
     } else if ([paymentCode isEqualToString:@"stripe_payments"]) {//visa
         
@@ -500,7 +564,7 @@
     
     [MBProgressHUD showHUDAddedTo:self.view animated:YES];
     NSDictionary *param = @{@"method":paymentCode};
-    K_WEAK_SELF;
+//    K_WEAK_SELF;
     [ASNetTools.shared putWithPath:Chectout_PUT_sureOrder param:@{@"paymentMethod":param} success:^(id _Nonnull json) {
         K_STRONG_SELF;
         [MBProgressHUD hideHUDForView:self.view animated:YES];

+ 84 - 31
Asteria/Fuction/Cart/Cart_MyCartC.m

@@ -13,6 +13,7 @@
 #import "ASGoodsDetailsVM.h"
 
 #import "ASAddGiftGoodsView.h"
+#import "ASMyCartNoDataView.h"
 
 #import "ASGoodsDetailsViewController.h"
 
@@ -37,6 +38,9 @@
 @property (nonatomic, assign) int index;
 @property (nonatomic, assign) int giftShowCount;
 
+//空页面
+@property (nonatomic, strong) ASMyCartNoDataView *noDataView;
+
 @end
 
 @implementation Cart_MyCartC
@@ -52,6 +56,9 @@
 }
 - (void)initSubviews {
     [super initSubviews];
+    
+    self.view.backgroundColor = [UIColor colorWithHexString:@"#F8F8F8"];
+    
     [self.view addSubview:self.topBgV];
     [self.topBgV addSubview:self.top_totalLab];
     [self.topBgV addSubview:self.top_priceLab];
@@ -66,6 +73,8 @@
         make.centerY.equalTo(self.topBgV);
     }];
     
+    
+    
     IPhoneXHeigh
     [self setupTableV:[MyCarlTableV class] Frame:CGRectMake(0, CGRectGetMaxY(self.topBgV.frame), KScreenWidth, KScreenHeight-securityBottom_H - 65- CGRectGetMaxY(self.topBgV.frame)-self.postBtn.mj_h)];
     self.TableV.backgroundColor = [UIColor colorWithHexString:@"#F8F8F8"];
@@ -76,6 +85,10 @@
     self.addGiftParamArr = [[NSMutableArray alloc] initWithCapacity:1];
     self.index = 0;
     self.giftShowCount = 0;
+    
+    self.topBgV.hidden = YES;
+    self.postBtn.hidden = YES;
+    self.TableV.hidden = YES;
 }
 
 
@@ -103,7 +116,7 @@
                 [self reqNet_DEL_cartsMineCoupons];
             }
         } else if ([data isKindOfClass:[MyCartGrandTotalCellData class]]){
-            MyCartGrandTotalCellData *totalData = (MyCartGrandTotalCellData *)data;
+//            MyCartGrandTotalCellData *totalData = (MyCartGrandTotalCellData *)data;
             
             [self requestLostExtraFee:num];
         }
@@ -208,45 +221,75 @@
     [MBProgressHUD hideHUDForView:self.view animated:YES];
     if([mark isEqualToString:Cart_cartsMineTotals]){
         if(sucessOrFail){
-            CartTotalsM *model = [arry firstObject];
-            self.totalsM = model;
-            self.top_totalLab.text = [NSString stringWithFormat:@"%@ pcs | total",model.items_qty];
-            self.top_priceLab.text =[NSString stringWithFormat:@"%@%@",model.currency_symbol,model.subtotal];
-            [self.TableV.infodata removeAllObjects];
-            self.TableV.infodata = [NSMutableArray arrayWithArray:model.items];
             
-            self.couponCellM.couponAry =[NSMutableArray arrayWithArray: [ASNetTools shared].xxx_couponAry];
-            self.couponCellM.coupon_code = model.coupon_code;
-            self.couponCellM.discount_amount = model.discount_amount;
-            self.couponCellM.currency_symbol = model.currency_symbol;
-            [self.TableV.infodata addObject:self.couponCellM];
             
-            self.totalCellM.total_segments = [NSMutableArray arrayWithArray:model.total_segments];
-            self.totalCellM.currency_symbol = model.currency_symbol;
-            [self.TableV.infodata addObject:self.totalCellM];
             
-            MyCartPayTypeCellData *data = [[MyCartPayTypeCellData alloc]init];
-            data.final_prices_f = [model.subtotal floatValue];
-            data.currency_symbol = model.currency_symbol;
-            [self.TableV.infodata addObject:data];
             
-            //手动添加赠品功能
-            [self.addGiftParamArr removeAllObjects];
             
-            NSDictionary *freeData = (NSDictionary *)[[self.totalsM.extension_attributes objectForKey:@"free_data"] mj_JSONObject];
-            BOOL is_show = [[freeData objectForKey:@"is_show"] boolValue];
-            if (is_show && self.giftShowCount< 1) {//显示存在赠品
-                NSArray *productArr = [freeData objectForKey:@"products"];
-                if (productArr.count > 0) { //存在赠品
-                    for (int i = 0; i < productArr.count; i++) {
-                        NSDictionary *productDic = productArr[i];
-                        NSString *entity_id = productDic[@"entity_id"];
-                        [self reqNet_GoodsDetails_productGetProduct:entity_id];
+            CartTotalsM *model = [arry firstObject];
+            self.totalsM = model;
+            
+            if (AS_Array_valid(self.totalsM.items)) {
+                //空页面
+                self.noDataView.hidden = YES;
+                self.TableV.hidden = NO;
+                self.topBgV.hidden = NO;
+                self.postBtn.hidden = NO;
+                
+                self.top_totalLab.text = [NSString stringWithFormat:@"%@ pcs | total",model.items_qty];
+                self.top_priceLab.text =[NSString stringWithFormat:@"%@%@",model.currency_symbol,model.subtotal];
+                [self.TableV.infodata removeAllObjects];
+                self.TableV.infodata = [NSMutableArray arrayWithArray:model.items];
+                
+                self.couponCellM.couponAry =[NSMutableArray arrayWithArray: [ASNetTools shared].xxx_couponAry];
+                self.couponCellM.coupon_code = model.coupon_code;
+                self.couponCellM.discount_amount = model.discount_amount;
+                self.couponCellM.currency_symbol = model.currency_symbol;
+                [self.TableV.infodata addObject:self.couponCellM];
+                
+                self.totalCellM.total_segments = [NSMutableArray arrayWithArray:model.total_segments];
+                self.totalCellM.currency_symbol = model.currency_symbol;
+                [self.TableV.infodata addObject:self.totalCellM];
+                
+                MyCartPayTypeCellData *data = [[MyCartPayTypeCellData alloc]init];
+                data.final_prices_f = [model.subtotal floatValue];
+                data.currency_symbol = model.currency_symbol;
+                [self.TableV.infodata addObject:data];
+                
+                //手动添加赠品功能
+                [self.addGiftParamArr removeAllObjects];
+                
+                NSDictionary *freeData = (NSDictionary *)[[self.totalsM.extension_attributes objectForKey:@"free_data"] mj_JSONObject];
+                BOOL is_show = [[freeData objectForKey:@"is_show"] boolValue];
+                if (is_show && self.giftShowCount< 1) {//显示存在赠品
+                    NSArray *productArr = [freeData objectForKey:@"products"];
+                    if (productArr.count > 0) { //存在赠品
+                        for (int i = 0; i < productArr.count; i++) {
+                            NSDictionary *productDic = productArr[i];
+                            NSString *entity_id = productDic[@"entity_id"];
+                            [self reqNet_GoodsDetails_productGetProduct:entity_id];
+                        }
                     }
                 }
+                
+                [self.TableV reloadData];
+                
+                
+            } else {
+                //空页面
+                self.noDataView.hidden = NO;
+                self.TableV.hidden = YES;
+                self.topBgV.hidden = YES;
+                self.postBtn.hidden = YES;
             }
             
-            [self.TableV reloadData];
+        } else {
+            //空页面
+            self.noDataView.hidden = NO;
+            self.TableV.hidden = YES;
+            self.topBgV.hidden = YES;
+            self.postBtn.hidden = YES;
+            
         }
     }else if ([mark isEqualToString:Cart_cartsMineItems_Post]
               || [mark isEqualToString:DEL_cartsMineItems]
@@ -393,4 +436,14 @@
     return _addGiftView;
 }
 
+- (ASMyCartNoDataView *)noDataView {
+    if (!_noDataView) {
+        IPhoneXHeigh
+        _noDataView = [[ASMyCartNoDataView alloc] initWithFrame:CGRectMake(0, securitytop_Y, KScreenWidth, KScreenHeight - securitytop_Y - securityBottom_H)];
+        _noDataView.hidden = YES;
+        [self.view addSubview:_noDataView];
+    }
+    return _noDataView;
+}
+
 @end

+ 4 - 0
Asteria/Fuction/Cart/PayManager/ASPaypalManager.h

@@ -9,8 +9,12 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
+#define Chectout_Pay_Paypal_Url      BaseRequestrUrl(@"rewrite/paypal/getPaypalToken")
+
 @interface ASPaypalManager : NSObject
 
++ (instancetype)sharedInstance;
+
 
 - (void)checkoutPayWithMethodType:(NSString *)payType completion:(void (^ __nullable)(NSUInteger isSucess , id payData))completion;
 

+ 22 - 1
Asteria/Fuction/Cart/PayManager/ASPaypalManager.m

@@ -10,12 +10,33 @@
 
 @implementation ASPaypalManager
 
+static ASPaypalManager *_instance = nil;
++ (instancetype)sharedInstance {
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        _instance = [[ASPaypalManager alloc] init];
+    });
+    
+    return _instance;
+}
+
 
 - (void)checkoutPayWithMethodType:(NSString *)payType completion:(void (^ __nullable)(NSUInteger isSucess , id payData))completion {
+    
+    UIViewController *topVC = topViewController();
+    
     if ([payType isEqualToString:@"paypal_express"]) {//paypal
         K_WEAK_SELF;
-        [ASNetTools.shared postWithPath:postTakeExtraPoints param:@{@"type": @"123"} success:^(id _Nonnull json) {
+        [ASNetTools.shared getWithPath:Chectout_Pay_Paypal_Url param:@{} success:^(id _Nonnull json) {
+            K_STRONG_SELF;
+            
+            NSDictionary *dataDic = (NSDictionary *)json;
+            NSString *urlStr = AS_String_NotNull(dataDic[@"url"]);
+            dispatch_async(dispatch_get_main_queue(), ^{
+                [self tool_gotoWebPay:urlStr withVC:topVC completion:completion];
+            });
             
+            NSLog(@"=====%@", json);
         } faild:^(NSString * _Nonnull code, NSString * _Nonnull msg) {
             
         }];

+ 16 - 0
Asteria/Fuction/Cart/V/ASMyCartNoDataView.h

@@ -0,0 +1,16 @@
+//
+//  ASMyCartNoDataView.h
+//  Asteria
+//
+//  Created by xingyu on 2024/5/23.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface ASMyCartNoDataView : UIView
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 83 - 0
Asteria/Fuction/Cart/V/ASMyCartNoDataView.m

@@ -0,0 +1,83 @@
+//
+//  ASMyCartNoDataView.m
+//  Asteria
+//
+//  Created by xingyu on 2024/5/23.
+//
+
+#import "ASMyCartNoDataView.h"
+
+@interface ASMyCartNoDataView()
+
+@property (nonatomic, strong) UIView *emptyV;
+@property (nonatomic, strong) UIImageView *emptyImageView;
+
+@end
+
+@implementation ASMyCartNoDataView
+
+- (instancetype)initWithFrame:(CGRect)frame {
+    if (self = [super initWithFrame:frame]) {
+        
+        
+        [self addSubview:self.emptyV];
+        [self.emptyV mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.edges.mas_equalTo(0);
+        }];
+        
+        _emptyImageView = [[UIImageView alloc] init];
+        _emptyImageView.contentMode = UIViewContentModeScaleAspectFit;
+        _emptyImageView.image = [UIImage imageNamed:@"cart_no_data"];
+        [self.emptyV addSubview:_emptyImageView];
+        [_emptyImageView mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.centerX.equalTo(self.emptyV);
+            make.top.mas_equalTo(60);
+            make.width.height.mas_equalTo(KScreenWidth - 80);
+        }];
+        
+        K_WEAK_SELF;
+        dispatch_async(dispatch_get_main_queue(), ^{
+            K_STRONG_SELF;
+            [UIView viewAddHorColorBg:self.emptyV colorArr:@[
+                (id)_E0FFF5.CGColor,
+                (id)Col_FFF.CGColor
+            ] startP:CGPointMake(0.5, 0.25) endP:CGPointMake(0.5, 1)];
+            [self.emptyV bringSubviewToFront:self.emptyImageView];
+        });
+        
+        UIButton *clickBtn = [UIButton buttonWithType:UIButtonTypeCustom];
+        clickBtn.titleLabel.font = [UIFont fontWithName:Rob_Regular size:14];
+        [clickBtn setTitle:@"Contact Us" forState:UIControlStateNormal];
+        clickBtn.backgroundColor = Col_000;
+        [clickBtn addTarget:self action:@selector(_btnClick) forControlEvents:UIControlEventTouchUpInside];
+        TT_ViewRadius(clickBtn, 4);
+        [clickBtn setTitleColor:Col_FFF forState:UIControlStateNormal];
+        [self addSubview:clickBtn];
+        [clickBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.top.mas_equalTo(_emptyImageView.mas_bottom).offset(48);
+            make.height.mas_equalTo(45);
+            make.left.mas_equalTo(40);
+            make.right.mas_equalTo(-40);
+            
+        }];
+        
+    }
+    return self;
+}
+
+- (void)_btnClick {
+    
+}
+
+- (UIView *)emptyV {
+    if (!_emptyV) {
+        UIView *v = [UIView baseV];
+        v.backgroundColor = Col_FFF;
+        _emptyV = v;
+    }
+    return _emptyV;
+}
+
+
+
+@end

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

@@ -45,6 +45,9 @@
 //丢件险
 #define Chectout_lost_extrafee       @"rest/en/V1/amasty_extrafee/carts/mine/totals-information"
 
+//根据支付返回的token去服务端校验
+#define Chectout_Verify_PayToken     BaseRequestrUrl(@"rewrite/paypal/return")
+
 
 NS_ASSUME_NONNULL_BEGIN
 

+ 15 - 5
Asteria/Fuction/Goods/V/ASGoodsDetailsTableView.m

@@ -125,11 +125,21 @@
 }
 - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
     
-//    NSObject *objectM = self.infodata[indexPath.row];
-//    if([objectM isKindOfClass:[CartTotalsItemsM class]] && self.isFlod){
-//        return 0;
-//    }
-//    return 1;
+    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]]) && !self.isReview) {
+        return 0;
+    }
     
     return UITableViewAutomaticDimension;
 }

+ 3 - 7
Asteria/Fuction/Goods/V/ASGoodsReviewHeadCell.m

@@ -41,13 +41,9 @@
         @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];
-//            }
+            if (self.currencyparameterClose) {
+                self.currencyparameterClose(4, nil);
+            }
         };
     }
     return _tableHeadV;

+ 39 - 19
Asteria/Fuction/Goods/VC/ASGoodsDetailsViewController.m

@@ -8,6 +8,7 @@
 #import "ASGoodsDetailsViewController.h"
 #import "AS_GoodsReviewsListC.h"
 #import "Cart_CheckoutC.h"
+#import "GoodsReviewsWriteC.h"
 
 #import "ASGoodsDetailsVM.h"
 #import "ASGoodsDetailsTableView.h"
@@ -80,10 +81,22 @@
             [self action_GoodsReviewsListC];
         } else if (num == 2) {//商品web详情
             self.isReview = NO;
-            [self updateGoodsDetailsData];
-        } else if (num == 3) {//商品评论
+            self.TableV.isReview = NO;
+            self.TableV.tableFooterView = self.footView;
+            [self.TableV reloadData];
+//            [self updateGoodsDetailsData];
+        } else if (num == 3) {//商品评论列表
             self.isReview = YES;
-            [self updateGoodsDetailsData];
+            self.TableV.isReview = YES;
+            self.TableV.tableFooterView = nil;
+            [self.TableV reloadData];
+//            [self updateGoodsDetailsData];
+        } else if (num == 4) {//写商品评论
+            GoodsReviewsWriteC *vc = [[GoodsReviewsWriteC alloc]init];
+            vc.goodsM = self.model;
+//            vc.topBgV = self.topBgV;
+            vc.nav_title = [NSString stringWithFormat:@"REVIEWS (%@)",self.model.review_nums];
+            [self.navigationController pushViewController:vc animated:YES];
         } else if (num == 100) {
             self.sizeParam = (NSDictionary *)data;
         } else if (num == 1000) {
@@ -131,9 +144,11 @@
             self.model = model;
             self.title = model.name;
             
-            [self loadWebString];
             [self updateGoodsDetailsData];
-        } else if([mark isEqualToString:Size_rewriteCartAddProducts]) {            
+            
+            [self loadWebString];
+            
+        } else if([mark isEqualToString:Size_rewriteCartAddProducts]) {
             
             [self.view makeToast:@"Success" duration:2 position:CSToastPositionCenter title:nil image:nil style:nil completion:^(BOOL didTap) {
                 if (self.bottomClickType == 1) {
@@ -156,7 +171,7 @@
 
 - (void)updateGoodsDetailsData {
         
-    [self.TableV.infodata removeAllObjects];
+//    [self.TableV.infodata removeAllObjects];
     //商品图
     NSDictionary *banner = @{@"type":@"banner", @"data":self.model};
     [self.TableV.infodata addObject:banner];
@@ -173,19 +188,22 @@
     NSDictionary *guarantee = @{@"type":@"guarantee", @"data":self.model};
     [self.TableV.infodata addObject:guarantee];
     
-    if (self.isReview) {
-        //评论头
-        NSDictionary *reviewHead = @{@"type":@"reviewHead", @"data":self.model};
-        [self.TableV.infodata addObject:reviewHead];
-        
-        //评论数据
-        [self.TableV.infodata addObjectsFromArray:self.reviewDataArray];
-        
-        self.TableV.tableFooterView = nil;
-        
-    } else {
-        self.TableV.tableFooterView = _footView;
-    }
+    //评论头
+    NSDictionary *reviewHead = @{@"type":@"reviewHead", @"data":self.model};
+    [self.TableV.infodata addObject:reviewHead];
+    
+    //评论数据
+    [self.TableV.infodata addObjectsFromArray:self.reviewDataArray];
+    
+//    if (self.isReview) {
+//        
+//        
+//        self.TableV.tableFooterView = nil;
+//        
+//    } else {
+//        self.TableV.tableFooterView = _footView;
+//    }
+    
     
     [self.TableV reloadData];
 }
@@ -206,6 +224,8 @@
         self.footView.frame = CGRectMake(0, 0, KScreenWidth, webHeight);
         [self.TableV reloadData];
     };
+    
+    self.TableV.tableFooterView = _footView;
 }
 
 #pragma mark ---- Touch Event ----

+ 8 - 0
Asteria/Fuction/UserCenter/Orders/Controller/ASOrderDetailsViewController.m

@@ -126,6 +126,14 @@
     
 }
 
+- (void)backAction {
+    if (self.isPay) {
+        [self.navigationController popToRootViewControllerAnimated:YES];
+    } else {
+        [self.navigationController popViewControllerAnimated:YES];
+    }
+}
+
 // MARK: - subvs
 - (UITableView *)tableView {
     if (!_tableView) {